You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this MWE we provide the values of Y and r to the ODEProblem. Since these are not part of the ODESystem, the user have probably done something wrong, and an error should be thrown.
using ModelingToolkit
using ModelingToolkit: t_nounits as t, D_nounits as D
@parameters p d r
@variablesX(t) Y(t)
eqs = [D(X) ~ p - d*X]
@mtkbuild osys =ODESystem(eqs, t)
u0 = [X =>1.0, Y =>1.0]
tspan = (0.0, 100.0)
ps = [p =>1.0, d =>1.0, r =>1.0]
prob =ODEProblem(osys, u0, tspan, ps) # works fine
The values are filtered away in the resulting problem, e.g.
prob[Y]
prob.ps[r]
both yields errors.
the same is the case for the other problem types as well.
The text was updated successfully, but these errors were encountered:
Actually, I should add that this is not as trivial as I first thought. E.g. if you have variables eliminated as observables from MTK, you might still want to provide values for these (e.g. if other parameters/variables have default values depending on these). Hence, there are situations where providing values for superfluous initial conditions might actually make sense.
In this MWE we provide the values of
Y
andr
to theODEProblem
. Since these are not part of theODESystem
, the user have probably done something wrong, and an error should be thrown.The values are filtered away in the resulting problem, e.g.
prob[Y] prob.ps[r]
both yields errors.
the same is the case for the other problem types as well.
The text was updated successfully, but these errors were encountered: