I can’t reproduce your issues, because I don’t know the arguments to your function. Take a read of: Please read: make it easier to help you
Some things that might help:
- use
fix(phi[1] init_phi)
instead of adding the initial value constraints. - Add sensible bounds on
phi
,theta
, andu
- Consider rewriting
phi
andtheta
as a@NLexpression
instead of a variable. (It seems your only real decision variable isu
.) For example, something like:phi = [@NLexpression(model, init_phi)] for i in 2:num_time_steps push!(phi, @NLexpression(model, phidot[i - 1] * h + phi[i - 1])) end