Skip to content

Commit 07acf83

Browse files
committed
test ps and u0 given to problem construction are favored
1 parent e517b6b commit 07acf83

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/reactionsystem.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,17 @@ nlsys = convert(NonlinearSystem,rs)
5252
ModelingToolkit.get_defaults(nlsys) ==
5353
defs
5454

55+
u0map = [A=>5.] # was 0.5
56+
pmap = [k[1]=>5.] # was 1.
57+
prob = ODEProblem(rs, u0map, (0,10.), pmap)
58+
@test prob.p[1] == 5.
59+
@test prob.u0[1] == 5.
60+
u0 = [10., 11., 12., 13.]
61+
ps = [float(x) for x in 100:119]
62+
prob = ODEProblem(rs, u0, (0,10.), ps)
63+
@test prob.p == ps
64+
@test prob.u0 == u0
65+
5566
# hard coded ODE rhs
5667
function oderhs(u,k,t)
5768
A = u[1]; B = u[2]; C = u[3]; D = u[4];

0 commit comments

Comments
 (0)