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)))
336
336
end
337
337
@@ -817,7 +817,6 @@ function DiffEqBase.SDEProblem{iip, specialize}(
817
817
end
818
818
819
819
function DiffEqBase.SDEProblem(sys::ODESystem, args...; kwargs...)
820
-
821
820
ifany(ModelingToolkit.isbrownian, unknowns(sys))
822
821
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
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -893,10 +893,10 @@ end
893
893
0.1* z]
894
894
895
895
@named sys =ODESystem(eqs, tt, [x, y, z], [σ, ρ, β])
896
-
896
+
897
897
@named de =SDESystem(eqs, noiseeqs, tt, [x, y, z], [σ, ρ, β], tspan = (0.0, 10.0))
898
898
de =complete(de)
899
-
899
+
900
900
f =SDEFunctionExpr(de)
901
901
@test f isa Expr
902
902
@@ -926,7 +926,7 @@ end
926
926
@variablesX(t)
927
927
@parameters p d
928
928
@brownian a
929
-
seq =D(X) ~ p - d*X + a
929
+
seq =D(X) ~ p - d*X + a
930
930
@mtkbuild ssys1 =System([seq], t; name =:ssys)
931
931
@mtkbuild ssys2 =System([seq], t; name =:ssys)
932
932
@test ssys1 == ssys2 # true
@@ -936,15 +936,15 @@ end
936
936
937
937
@mtkbuild ssys1 =System([seq], t; name =:ssys, continuous_events)
938
938
@mtkbuild ssys2 =System([seq], t; name =:ssys)
939
-
@test ssys1 !== ssys2
939
+
@test ssys1 !== ssys2
940
940
941
941
@mtkbuild ssys1 =System([seq], t; name =:ssys, discrete_events)
942
942
@mtkbuild ssys2 =System([seq], t; name =:ssys)
943
943
@test ssys1 !== ssys2
944
944
945
945
@mtkbuild ssys1 =System([seq], t; name =:ssys, continuous_events)
946
946
@mtkbuild ssys2 =System([seq], t; name =:ssys, discrete_events)
947
-
@test ssys1 !== ssys2
947
+
@test ssys1 !== ssys2
948
948
end
949
949
950
950
@testset"Error when constructing SDESystem without `structural_simplify`"begin
@@ -961,7 +961,8 @@ end
961
961
u0map = [x =>1.0, y =>0.0, z =>0.0]
962
962
parammap = [σ =>10.0, β =>26.0, ρ =>2.33]
963
963
964
-
@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)
964
+
@test_throwsErrorException("SDESystem constructed by defining Brownian variables with @brownian must be simplified by calling `structural_simplify` before a SDEProblem can be constructed.") SDEProblem(
965
+
de, u0map, (0.0, 100.0), parammap)
965
966
de =structural_simplify(de)
966
967
@testSDEProblem(de, u0map, (0.0, 100.0), parammap) isa SDEProblem
0 commit comments