Replies: 1 comment 6 replies
-
Hi @afossa, I somehow missed this post, I am very sorry for the late reply. To better help you, could you please provide the complete script? From the above it is not clear how the infinite parameter is being defined. |
Beta Was this translation helpful? Give feedback.
6 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.
-
Hello,
I am using
InfiniteOpt
to solve optimal control problems in trajectory optimization. These type of problems frequently have complicated nonlinear expressions in both the dynamics and the constraints, and they rely a lot on operations like matrix-vector products, cross products, norms, etc.I was able to successfully solve an optimal transfer between the Earth and Mars, but I am looking for suggestions on how I can improve my implementation, specifically how to avoid recomputing quantities that appear in more than one constraint, such as the distance from the Sun. Should I add a variable for each of them, or is there a better way to achieve this?
I am also experimenting with different problem formulations, in particular I want to express the control variables for the three components of the thrust vector in either the inertial frame or in a rotating frame defined by the spacecraft position and velocity vectors. In the second case, I need to compute the rotation matrix from the rotating to the inertial frame, but I am getting an error that seems to be related to the normalization of the angular momentum vector (computed as the cross product between position and velocity):
So I modified the problem formulation to avoid it, however, the accuracy of the solution with the thrust expressed in rotating frame is much lower than that of the solution with the thrust expressed directly in inertial frame. My guess is that the rotation matrix, as I am computing it now, is not perfectly orthogonal. This is the working code I came up with:
Do you have any suggestion on how I can improve it, both in terms of accuracy and efficiency as discussed above?
The results I obtain in inertial frame are:
and in QSW frame:
finally, in TNW frame:
Attached is the full script and input data to reproduce these results. I am using the version of
InfiniteOpt
checked out from themaster
branch to use theconstant_over_collocation
method that enforces a piecewise-constant control.earth_mars_input.json
earth_mars_script.txt
Beta Was this translation helpful? Give feedback.
All reactions