@@ -144,3 +144,32 @@ x₀ = 1.0 + 0.0im
144144prob = ODEProblem (f4, [x₀], Δt)
145145jumpProblem = JumpProblem (prob, Direct (), jump)
146146sol = solve (jumpProblem, Tsit5 ())
147+
148+ # test to check lack of dependency graphs is caught in Coevolve for systems with non-maj
149+ # jumps
150+ let
151+ maj_rate = [1.0 ]
152+ react_stoich_ = [Vector {Pair{Int, Int}} ()]
153+ net_stoich_ = [[1 => 1 ]]
154+ mass_action_jump_ = MassActionJump (maj_rate, react_stoich_, net_stoich_;
155+ scale_rates = false )
156+
157+ affect! = function (integrator)
158+ integrator. u[1 ] -= 1
159+ end
160+ cs_rate1 (u, p, t) = 0.2 * u[1 ]
161+ constant_rate_jump = ConstantRateJump (cs_rate1, affect!)
162+ jumpset_ = JumpSet ((), (constant_rate_jump,), nothing , mass_action_jump_)
163+
164+ u0 = [0 ]
165+ tspan = (0.0 , 30.0 )
166+ dprob_ = DiscreteProblem (u0, tspan)
167+ alg = Coevolve ()
168+ @test_throws ErrorException JumpProblem (dprob_, alg, jumpset_,
169+ save_positions = (false , false ))
170+
171+ vrj = VariableRateJump (cs_rate1, affect!; urate = ((u, p, t) -> 1.0 ),
172+ rateinterval = ((u, p, t) -> 1.0 ))
173+ @test_throws ErrorException JumpProblem (dprob_, alg, mass_action_jump_, vrj;
174+ save_positions = (false , false ))
175+ end
0 commit comments