Overdetermined system when using modelingtoolkitize

You can do this by setting the initial condition to nothing:

prob2 = ODEProblem(sys, [:u2 => nothing], tspan)

After which the problem solves without problems:

sol2 = solve(prob2) # yay!
plot(sol2, idxs = [:u1, :u2])

For reference, there is a page on the ModelingToolkit docs about system initialization that contains this specific problem.

2 Likes