-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Knot-vectors? #71
Comments
If I recall correctly the knot-vector message comes sometimes from the 1D interpolation when generating the (functional) OCP solution from the discretized problem solution. I did not find the cause when looking at the time steps vector that looked fine, but the problem vanished in the CTDirect test suite when updating to Julia 1.9 or more. I'll retest this. |
Ok @jbcaillau , the solution generation fails here because the optimization did not converge, and finished with a negative tf. The time steps grid is therefore nonincreasing... I added a failsafe here to prevent the error: tf = max(tf, t0+eps). On a side note, the optimization fails because the constraint tf>=0 causes Ipopt to get stuck at tf=0. Putting a strictly positive lower bound (eg 0.1) is enough to get the convergence. We may want to warn about this as it is a very common 'mistake' (in Bocop the lower bound was set automatically to 1e-3). I could try to detect a 0 lower bound for tf ? |
PR?
Well done. Indeed, back to normal with @def ocp begin
tf ∈ R, variable
t ∈ [ 0, tf ], time
x ∈ R², state
u ∈ R, control
tf ≥ 1e-3
-1 ≤ u(t) ≤ 1
q = x₁
v = x₂
q(0) == 1
v(0) == 2
q(tf) == 0
v(tf) == 0
0 ≤ q(t) ≤ 5
-2 ≤ v(t) ≤ 3
(u^2)(t) ≤ 100
ẋ(t) == [ v(t), u(t) ]
tf → min
end |
@PierreMartinon @gergaud Error when solving the problem
NB. The constraint
(u^2)(t) ≤ 100
is for testing purpose onlyThe text was updated successfully, but these errors were encountered: