|
231 | 231 | jtoj = eqeq_dependencies(jdeps, vdeps).fadjlist |
232 | 232 | @test jtoj == [[1, 2, 4], [1, 2, 4], [1, 2, 3, 4], [1, 2, 3, 4]] |
233 | 233 | end |
| 234 | + |
| 235 | +# Create JumpProblems for systems without parameters |
| 236 | +# Issue#2559 |
| 237 | +@parameters k |
| 238 | +@variables X(t) |
| 239 | +rate = k |
| 240 | +affect = [X ~ X - 1] |
| 241 | + |
| 242 | +crj = ConstantRateJump(1.0, [X ~ X - 1]) |
| 243 | +js1 = complete(JumpSystem([crj], t, [X], [k]; name = :js1)) |
| 244 | +js2 = complete(JumpSystem([crj], t, [X], []; name = :js2)) |
| 245 | + |
| 246 | +maj = MassActionJump(1.0, [X => 1], [X => -1]) |
| 247 | +js3 = complete(JumpSystem([maj], t, [X], [k]; name = :js2)) |
| 248 | +js4 = complete(JumpSystem([maj], t, [X], []; name = :js3)) |
| 249 | + |
| 250 | +u0 = [X => 10] |
| 251 | +tspan = (0.0, 1.0) |
| 252 | +ps = [k => 1.0] |
| 253 | + |
| 254 | +dp1 = DiscreteProblem(js1, u0, tspan, ps) |
| 255 | +dp2 = DiscreteProblem(js2, u0, tspan) |
| 256 | +dp3 = DiscreteProblem(js3, u0, tspan, ps) |
| 257 | +dp4 = DiscreteProblem(js4, u0, tspan) |
| 258 | + |
| 259 | +@test_nowarn jp1 = JumpProblem(js1, dp1, Direct()) |
| 260 | +@test_nowarn jp2 = JumpProblem(js2, dp2, Direct()) |
| 261 | +@test_nowarn jp3 = JumpProblem(js3, dp3, Direct()) |
| 262 | +@test_nowarn jp4 = JumpProblem(js4, dp4, Direct()) |
| 263 | + |
| 264 | +# Ensure `structural_simplify` (and `@mtkbuild`) works on JumpSystem (by doing nothing) |
| 265 | +# Issue#2558 |
| 266 | +@parameters k |
| 267 | +@variables X(t) |
| 268 | +rate = k |
| 269 | +affect = [X ~ X - 1] |
| 270 | + |
| 271 | +j1 = ConstantRateJump(k, [X ~ X - 1]) |
| 272 | +@test_nowarn @mtkbuild js1 = JumpSystem([j1], t, [X], [k]) |
0 commit comments