-
-
Notifications
You must be signed in to change notification settings - Fork 231
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
@variables Y(t)
@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)
In the REPL:
julia> oprob[osys.Y]
1.0
julia> oprob.ps[osys.p]
0.0
This is because while the initialization is trivial:
julia> oprob.f.initialization_data.initializeprob
NonlinearProblem with uType Nothing. In-place: true
u0: nothing
julia> oprob.f.initialization_data.initializeprob.f.sys |> observed
2-element Vector{Equation}:
Y(t) ~ 1.0
p ~ Y(t)
MTK doesn't utilize this the way remake
does and solve the problem on the spot. We can fix this by simply calling remake(prob)
before returning.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working