Closed
Description
using ModelingToolkit: t_nounits as t, D_nounits as D
@variables Y(t)
# give `p` a guess and a default, which tells initialization you want to
# solve for it
@parameters d p = Y [guess = 1.0]
eqs = [D(Y) ~ p - d*Y]
@mtkbuild osys = ODESystem(eqs, t)
u0 = [Y => 1.0]
p = [d => 0.2]
oprob = ODEProblem(osys, u0, (0.0, 1.0), p)
oprob[osys.Y] # correct
oprob.ps[osys.p] # should be 1.0
Already reported, but just for keeping track of it. A guess is provided for p
. However, its values is entirely wrong. If no guess is provided the correct value is found.