-
-
Notifications
You must be signed in to change notification settings - Fork 232
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I am using ifelse
in an ODE like this:
using ModelingToolkit, OrdinaryDiffEq
using ModelingToolkit: t_nounits as t, D_nounits as D
@variables x(t) # position
eqs = [D(D(x)) ~ ifelse(x < 5, 1, 0)] # accelerate for first 5 meters
ics = [x ~ 0, D(x) ~ 0]
@named sys = ODESystem(eqs, t; initialization_eqs = ics)
ssys = mtkcompile(sys)
prob = ODEProblem(ssys, [], (0.0, 10.0))
sol = solve(prob, Tsit5())
The call to mtkcompile(sys)
warns
┌ Warning: Internal error: Variable x(t) was marked as being in Differential(t)(Differential(t)(x(t))) ~ ifelse(x(t) < 5, 1, 0), but was actually zero
└ @ ModelingToolkit.StructuralTransformations ~/.julia/packages/ModelingToolkit/OViQH/src/structural_transformation/utils.jl:292
What does this mean? Should I worry about it?
The solution looks fine to me. Apologies if I am overlooking something trivial!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working