You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
all(s1 == s2 for (s1, s2) inzip(get_systems(sys1), get_systems(sys2)))
290
290
end
291
291
@@ -771,7 +771,6 @@ function DiffEqBase.SDEProblem{iip, specialize}(
771
771
end
772
772
773
773
function DiffEqBase.SDEProblem(sys::ODESystem, args...; kwargs...)
774
-
775
774
ifany(ModelingToolkit.isbrownian, unknowns(sys))
776
775
error("SDESystem constructed by defining Brownian variables with @brownian must be simplified by calling `structural_simplify` before a SDEProblem can be constructed.")
Copy file name to clipboardExpand all lines: test/sdesystem.jl
+8-7Lines changed: 8 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -882,10 +882,10 @@ end
882
882
0.1* z]
883
883
884
884
@named sys =ODESystem(eqs, tt, [x, y, z], [σ, ρ, β])
885
-
885
+
886
886
@named de =SDESystem(eqs, noiseeqs, tt, [x, y, z], [σ, ρ, β], tspan = (0.0, 10.0))
887
887
de =complete(de)
888
-
888
+
889
889
f =SDEFunctionExpr(de)
890
890
@test f isa Expr
891
891
@@ -915,7 +915,7 @@ end
915
915
@variablesX(t)
916
916
@parameters p d
917
917
@brownian a
918
-
seq =D(X) ~ p - d*X + a
918
+
seq =D(X) ~ p - d*X + a
919
919
@mtkbuild ssys1 =System([seq], t; name =:ssys)
920
920
@mtkbuild ssys2 =System([seq], t; name =:ssys)
921
921
@test ssys1 == ssys2 # true
@@ -925,15 +925,15 @@ end
925
925
926
926
@mtkbuild ssys1 =System([seq], t; name =:ssys, continuous_events)
927
927
@mtkbuild ssys2 =System([seq], t; name =:ssys)
928
-
@test ssys1 !== ssys2
928
+
@test ssys1 !== ssys2
929
929
930
930
@mtkbuild ssys1 =System([seq], t; name =:ssys, discrete_events)
931
931
@mtkbuild ssys2 =System([seq], t; name =:ssys)
932
932
@test ssys1 !== ssys2
933
933
934
934
@mtkbuild ssys1 =System([seq], t; name =:ssys, continuous_events)
935
935
@mtkbuild ssys2 =System([seq], t; name =:ssys, discrete_events)
936
-
@test ssys1 !== ssys2
936
+
@test ssys1 !== ssys2
937
937
end
938
938
939
939
@testset"Error when constructing SDESystem without `structural_simplify`"begin
@@ -950,7 +950,8 @@ end
950
950
u0map = [x =>1.0, y =>0.0, z =>0.0]
951
951
parammap = [σ =>10.0, β =>26.0, ρ =>2.33]
952
952
953
-
@test_throwsErrorException("SDESystem constructed by defining Brownian variables with @brownian must be simplified by calling `structural_simplify` before a SDEProblem can be constructed.") SDEProblem(de, u0map, (0.0, 100.0), parammap)
953
+
@test_throwsErrorException("SDESystem constructed by defining Brownian variables with @brownian must be simplified by calling `structural_simplify` before a SDEProblem can be constructed.") SDEProblem(
954
+
de, u0map, (0.0, 100.0), parammap)
954
955
de =structural_simplify(de)
955
956
@testSDEProblem(de, u0map, (0.0, 100.0), parammap) isa SDEProblem
0 commit comments