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
Changing Initials with setsym_oop does not work when using initializealg = BrownFullBasicInit() when we have initial overrides.
Expected behavior
I would have expected this to work
Minimal Reproducible Example 👇
Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.
using ModelingToolkit, OrdinaryDiffEqDefault, OrdinaryDiffEqNonlinearSolve
using ModelingToolkit: t_nounits as t, D_nounits as D
using SymbolicIndexingInterface
@parameters g
@variablesx(t) [state_priority =10] y(t) λ(t)
eqs = [D(D(x)) ~ λ * x
D(D(y)) ~ λ * y - g
x^2+ y^2~1]
@mtkbuild pend =ODESystem(eqs, t)
prob =ODEProblem(pend, [x => (√2/2)], (0.0, 1.5), [g =>1], guesses = [λ =>1, y=>√2/2])
sol =solve(prob)
setter =setsym_oop(prob, [Initial(x)]);
(u0, p) =setter(prob, [0.8])
new_prob =remake(prob; u0, p, initializealg =BrownFullBasicInit())
new_sol =solve(new_prob)
new_sol[[x], 1] # √2/2 instead of 0.8
If I remove initializealg from the above remake call, then I get the expected answer of 0.8.
Environment (please complete the following information):
Describe the bug 🐞
Changing
Initial
s withsetsym_oop
does not work when usinginitializealg = BrownFullBasicInit()
when we have initial overrides.Expected behavior
I would have expected this to work
Minimal Reproducible Example 👇
Without MRE, we would only be able to help you to a limited extent, and attention to the issue would be limited. to know more about MRE refer to wikipedia and stackoverflow.
If I remove
initializealg
from the aboveremake
call, then I get the expected answer of 0.8.Environment (please complete the following information):
using Pkg; Pkg.status()
using Pkg; Pkg.status(; mode = PKGMODE_MANIFEST)
versioninfo()
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: