@@ -2,7 +2,6 @@ using ModelingToolkit, OrdinaryDiffEq, StochasticDiffEq, JumpProcesses, Test
22using  SciMLStructures:  canonicalize, Discrete
33using  ModelingToolkit:  SymbolicContinuousCallback,
44                       SymbolicContinuousCallbacks, NULL_AFFECT,
5-                        get_callback,
65                       t_nounits as t,
76                       D_nounits as D
87using  StableRNGs
@@ -11,6 +10,10 @@ using SymbolicIndexingInterface
1110using  Setfield
1211rng =  StableRNG (12345 )
1312
13+ function  get_callback (prob)
14+     prob. kwargs[:callback ]
15+ end 
16+ 
1417@variables  x (t) =  0 
1518
1619eqs =  [D (x) ~  1 ]
@@ -747,8 +750,7 @@ let rng = rng
747750    function  testsol (jsys, u0, p, tspan; tstops =  Float64[], paramtotest =  nothing ,
748751            N =  40000 , kwargs... )
749752        jsys =  complete (jsys)
750-         dprob =  DiscreteProblem (jsys, u0, tspan, p)
751-         jprob =  JumpProblem (jsys, dprob, Direct (); kwargs... )
753+         jprob =  JumpProblem (jsys, u0, tspan, p; aggregator =  Direct (), kwargs... )
752754        sol =  solve (jprob, SSAStepper (); tstops =  tstops)
753755        @test  (sol (1.000000000001 )[1 ] -  sol (0.99999999999 )[1 ]) ==  1 
754756        paramtotest ===  nothing  ||  (@test  sol. ps[paramtotest] ==  1.0 )
@@ -1415,7 +1417,7 @@ end
14151417    @named  wd1 =  weird1 (0.021 )
14161418    @named  wd2 =  weird2 (0.021 )
14171419
1418-     sys1 =  structural_simplify (System ([], t; name =  :parent ,
1420+     sys1 =  structural_simplify (System (Equation [], t; name =  :parent ,
14191421        discrete_events =  [0.01  =>  ModelingToolkit. ImperativeAffect (
14201422            modified =  (; θs =  reduce (vcat, [[wd1. θ]])), ctx =  [1 ]) do  m, o, c, i
14211423            @set!  m. θs[1 ] =  c[] +=  1 
0 commit comments