Skip to content

Commit 5ec6ea7

Browse files
committed
up
1 parent b22ca4c commit 5ec6ea7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

test/dsl/dsl_options.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ let
687687
end
688688

689689

690-
### Algebraic Equations ###
690+
### Hybrid CRN/Equations Models ###
691691

692692
# Checks creation of basic network.
693693
# Check indexing of output solution.
@@ -731,9 +731,9 @@ let
731731
ps = Dict([p => 1 + rand(rng), d => 1 + rand(rng), k => 1 + rand(rng)])
732732
oprob = ODEProblem(rn, u0, (0.0, 10000.0), ps; structural_simplify=true)
733733
sol = solve(oprob, Tsit5(); abstol=1e-9, reltol=1e-9)
734-
@test sol[S][end] ps[p]/ps[d]
735-
@test sol[X] .+ 5 sol[k] .*sol[S]
736-
@test 3*sol[Y] .+ sol[X] sol[S] .+ sol[X].*sol[d]
734+
@test sol[S][end] sol.ps[p]/sol.ps[d]
735+
@test sol[X] .+ 5 sol.ps[k] .*sol[S]
736+
@test 3*sol[Y] .+ sol[X] sol[S] .+ sol[X].*sol.ps[d]
737737
end
738738

739739
# Checks that block form is not required when only a single equation is used.
@@ -816,6 +816,7 @@ let
816816
end
817817
(p,d), 0 <--> S
818818
end
819+
@unpack X, Y, S, p, d, k = rn
819820

820821
# Checks that the internal structures have the correct lengths.
821822
@test length(species(rn)) == 1
@@ -841,8 +842,8 @@ let
841842
ps = Dict([p => 1 + rand(rng), d => 1 + rand(rng), k => 1 + rand(rng)])
842843
oprob = ODEProblem(rn, u0, (0.0, 10000.0), ps; structural_simplify=true)
843844
sol = solve(oprob, Tsit5(); abstol=1e-9, reltol=1e-9)
844-
@test sol[:S][end] sol[:p]/sol[:d]
845-
@test sol[:X] .+ 5 sol[:k] .*sol[:S]
845+
@test sol[:S][end] sol.ps[:p]/sol.ps[:d]
846+
@test sol[:X] .+ 5 sol.ps[:k] .*sol[:S]
846847
@test 5*sol[:Y][end] sol[:S][end] + sol[:X][end]
847848
end
848849

test/reactionsystem_structure/hybrid_equation_reaction_systems.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ end
407407

408408
# Checks that a hybrid SDE + algebraic equations works.
409409
# Checks that structural_simplify is required to simulate hybrid SDE + algebraic equations.
410-
@test_broken let # SDEs are currently broken with structural simplify.
410+
@test_broken let # SDEs are currently broken with structural simplify (https://github.com/SciML/ModelingToolkit.jl/issues/2614).
411411
# Creates hybrid reactions system.
412412
@parameters p d k1 k2
413413
@species X(t)

0 commit comments

Comments
 (0)