644644 dprob = DiscreteProblem (jsys, u0, tspan, p)
645645 jprob = JumpProblem (jsys, dprob, Direct (); kwargs... )
646646 sol = solve (jprob, SSAStepper (); tstops = tstops)
647- @show sol
648647 @test (sol (1.000000000001 )[1 ] - sol (0.99999999999 )[1 ]) == 1
649648 paramtotest === nothing || (@test sol. ps[paramtotest] == 1.0 )
650649 @test sol (40.0 )[1 ] == 0
@@ -1153,7 +1152,7 @@ end
11531152 f = ModelingToolkit. FunctionalAffect (
11541153 f = (i, u, p, c) -> seen = true , sts = [], pars = [], discretes = [])
11551154 cb1 = ModelingToolkit. SymbolicContinuousCallback (
1156- [x ~ 0 ], Equation[] , initialize = [x ~ 1.5 ], finalize = f)
1155+ [x ~ 0 ], nothing , initialize = [x ~ 1.5 ], finalize = f)
11571156 @mtkbuild sys = ODESystem (D (x) ~ - 1 , t, [x], []; continuous_events = [cb1])
11581157 prob = ODEProblem (sys, [x => 1.0 ], (0.0 , 2 ), [])
11591158 sol = solve (prob, Tsit5 (); dtmax = 0.01 )
@@ -1166,15 +1165,15 @@ end
11661165 f = ModelingToolkit. FunctionalAffect (
11671166 f = (i, u, p, c) -> seen = true , sts = [], pars = [], discretes = [])
11681167 cb1 = ModelingToolkit. SymbolicContinuousCallback (
1169- [x ~ 0 ], Equation[] , initialize = [x ~ 1.5 ], finalize = f)
1168+ [x ~ 0 ], nothing , initialize = [x ~ 1.5 ], finalize = f)
11701169 inited = false
11711170 finaled = false
11721171 a = ModelingToolkit. FunctionalAffect (
11731172 f = (i, u, p, c) -> inited = true , sts = [], pars = [], discretes = [])
11741173 b = ModelingToolkit. FunctionalAffect (
11751174 f = (i, u, p, c) -> finaled = true , sts = [], pars = [], discretes = [])
11761175 cb2 = ModelingToolkit. SymbolicContinuousCallback (
1177- [x ~ 0.1 ], Equation[] , initialize = a, finalize = b)
1176+ [x ~ 0.1 ], nothing , initialize = a, finalize = b)
11781177 @mtkbuild sys = ODESystem (D (x) ~ - 1 , t, [x], []; continuous_events = [cb1, cb2])
11791178 prob = ODEProblem (sys, [x => 1.0 ], (0.0 , 2 ), [])
11801179 sol = solve (prob, Tsit5 ())
@@ -1238,7 +1237,7 @@ end
12381237 @variables x (t) [irreducible = true ] y (t) [irreducible = true ]
12391238 eqs = [x ~ y, D (x) ~ - 1 ]
12401239 cb = [x ~ 0.0 ] => [x ~ 0 , y ~ 1 ]
1241- @test_throws ErrorException @mtkbuild pend = ODESystem (eqs, t; continuous_events = [cb])
1240+ @test_throws Exception @mtkbuild pend = ODESystem (eqs, t; continuous_events = [cb])
12421241
12431242 cb = [x ~ 0.0 ] => [y ~ 1 ]
12441243 @mtkbuild pend = ODESystem (eqs, t; continuous_events = [cb])
0 commit comments