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
using ModelingToolkit, OrdinaryDiffEq
using ModelingToolkit: t_nounits as t, D_nounits as D
@parameters g
@variablesx(t) y(t) [state_priority =10] λ(t)
eqs = [D(D(x)) ~ λ * x
D(D(y)) ~ λ * y - g
x^2+ y^2~1]
@mtkbuild pend =ODESystem(eqs, t)
iprob = ModelingToolkit.InitializationProblem(pend, 0.0,
[x =>1, y =>0.0, D(y) =>2.0, λ =>1], [g =>1], guesses = [λ =>1])
using NonlinearSolve
sol =solve(iprob)
sol.resid[x] # indexing the residual
The text was updated successfully, but these errors were encountered:
As described here: https://discourse.julialang.org/t/indexing-a-residual-of-an-initializationproblem/123356?u=bart_van_de_lint
Symbolic indexing on the residual of a solution is not possible yet. This would be a good debugging tool. I would suggest this feature to work similarly to normal symbolic indexing. So instead of
sol[symbol]
it would work likesol.resid[symbol]
.Example:
The text was updated successfully, but these errors were encountered: