Complex Dynamics Constraints #278
Unanswered
tpresser570
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Can you please provide a minimum working example (i.e., the full script to reproduce this)? |
Beta Was this translation helpful? Give feedback.
2 replies
-
First off, welcome to the forum! With respect to the formulation a few observations:
To address the above concerns, I would recommend the following:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
transfer_example.txt
Hello,
I am trying to solve the optimal control problem for a spacecraft with thrust in a two-body problem. This should closely follow the hovercraft examples but the optimizer fails. My objective function is to minimize the energy (full script below):
@objective(model, Min, ∫(u[1]^2 + u[2]^2 + u[3]^2, t))
My variables are:
@variables(model, begin # state variables x[1:3], Infinite(t) v[1:3], Infinite(t) # control variables u[1:3], Infinite(t) end)
I provide two waypoints, the start and end positions
@constraint(model, [i = 1:3, j = eachindex(tw)], x[i](tw[j]) == xw[i, j])
as well as use the two body dynamics as the constraints on the derivative:
#compute radius ^ 3/2 @expression(model, expr, ((x[1]^2+x[2]^2+x[3]^2)^(3/2))) #ODE equations @constraint(model, [i = 1:3], ∂(x[i], t) == v[i]) @constraint(model, [i = 1:3], ∂(v[i], t) == -μ*x[i]/expr + u[i])
But this results in IPOPT with a 0 Jacobian.
Number of nonzeros in equality constraint Jacobian...: 384
Number of nonzeros in inequality constraint Jacobian.: 0
Number of nonzeros in Lagrangian Hessian.............: 210
The Jacobian for the equality constraints contains an invalid number
Has anyone encountered this problem before??
Beta Was this translation helpful? Give feedback.
All reactions