-
-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Possibly related to: #4030. This one causes one of Catalyst's doc pages to error, preventing it from being built.
# Fetch packages.
using ModelingToolkitBase
using ModelingToolkitBase: t_nounits as t, D_nounits as D
# Make model.
@parameters pY pZ
@discretes pX(t)
@variables X(t) Y(t) Z(t)
eqs = [
D(X) ~ pX - X
D(Y) ~ -Y + pY*X
D(Z) ~ -Z + (pZ*X) / Y
]
discrete_events = ModelingToolkitBase.SymbolicDiscreteCallback([10.0] => [pX ~ 10*Pre(pX)]; discrete_parameters = [pX])
@mtkcompile sys = System(eqs, t; discrete_events)
# make ODE.
ps = [:pX => 0.1, :pY => 1.0, :pZ => 1.0]
u0 = [:X => 0.1, :Y => 0.1, :Z => 1.0]
oprob = ODEProblem(sys, [u0; ps], (0.0, 50.0))
# Try remake.
oprob_local = remake(oprob; p = [pX => 1.0]) # Fine
oprob_local = remake(oprob; p = [:pX => 1.0]) # ERROR: BoundsError: attempt to access Tuple{Int64, Int64} at index [3]Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working