Skip to content

Commit 56c10a6

Browse files
isaacsasChrisRackauckas
authored andcommitted
complete converted sys and get u0 and p from oprob
1 parent 11c4068 commit 56c10a6

File tree

6 files changed

+139
-118
lines changed

6 files changed

+139
-118
lines changed

benchmarks/Bio/BCR.jmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ show(to)
3030
rn = complete(prnbng.rn)
3131
obs = [eq.lhs for eq in observed(rn)]
3232

33-
@timeit to "Create ODESys" osys = convert(ODESystem, rn)
33+
@timeit to "Create ODESys" osys = complete(convert(ODESystem, rn))
3434
show(to)
3535

3636
tspan = (0.,tf)
@@ -56,12 +56,12 @@ As compiling the ODE derivative functions has in the past taken longer than
5656
running a simulation, we first force compilation by evaluating these functions
5757
one time.
5858
```julia
59-
u = ModelingToolkit.varmap_to_vars(nothing, species(rn); defaults=ModelingToolkit.defaults(rn))
59+
u = oprob.u0
6060
du = copy(u)
61-
p = ModelingToolkit.varmap_to_vars(nothing, parameters(rn); defaults=ModelingToolkit.defaults(rn))
61+
p = oprob.p
6262
@timeit to "ODE rhs Eval1" oprob.f(du,u,p,0.)
63-
@timeit to "ODE rhs Eval2" oprob.f(du,u,p,0.)
64-
sparsejacprob.f(du,u,p,0.)
63+
@timeit to "ODE rhs spjac Eval1" sparsejacprob.f(du,u,p,0.)
64+
show(to)
6565
```
6666

6767
We also time the ODE rhs function with BenchmarkTools as it is more accurate

0 commit comments

Comments
 (0)