-
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
Adjoint (dynamics multipliers) parsing #184
Comments
@PierreMartinon in the current code below, compared to the previous tags, I don't see where you would skip the multipliers associated with constraints other than the dynamics (e.g. state constraints) in order to retrieve only the dynamics: """
$(TYPEDSIGNATURES)
Recover OCP costate from DOCP multipliers
"""
# +++todo: parse multipliers for the path and boundary constraints (use tuples)
function parse_DOCP_solution_dual(docp, multipliers)
# constraints, costate and constraints multipliers
N = docp.dim_NLP_steps
P = zeros(N, docp.dim_NLP_x)
if !isnothing(multipliers)
index = 1
for i in 1:N
# state equation multiplier for costate
P[i,:] = multipliers[index:index+docp.dim_NLP_x-1]
index = index + docp.dim_NLP_x
end
end
return P
end |
@jbcaillau |
J'arrive pas à update la version 0.9.6, j'ai tjrs la 0.9.4. Sinon je pourrais tester de suite |
👍🏽 @PierreMartinon vu pour la ligne ci-dessous, je teste Line 46 in d2321e2
|
@PierreMartinon CTDirect 0.9.6 now available. Latency? Anyway, seems much better 🙂 @ocots @alesiagr |
BINGO! @jbcaillau @PierreMartinon @ocots Merci 🙏🏼 |
Il faudra que je complete les tests pour le parsing de solution, verifier qu'on recupere bien ce qu'il faut. Actuellement on ne teste que l'objectif. |
Top si on peut corriger ce bug. Il faudra relancer les simulations avec Paul. |
Je ne sais pas si ça peut aider mais il y des choses sur l'adjoint dans le cas de contraintes d'états dans ce papier : https://inria.hal.science/hal-01367918 Il y a cette proposition page 15 et cette figure juste après |
Je sais pas si ça s'adressait à moi ton message mais merci @ocots :D |
Plutôt à @PierreMartinon et @jbcaillau mais tu peux regarder 😀 |
@PierreMartinon has corrected. Leaving the issue open so that we remember to add the relevant unitary test in CTDirect. |
@PierreMartinon still missing unit tests before closing, right? |
Yes. Ideally we would test the closeness of the interpolated trajectory and costate to a known functional solution (evaluate both on a given time grid then use isapprox) . Does anyone have a basic problem with simple expressions for x,u,p (preferably non-constant) ? |
@PierreMartinon is our basic example OK? (One of the adjoint is not constant.) |
There is a problem here : https://control-toolbox.org/OptimalControl.jl/stable/tutorial-double-integrator.html |
Ok, I'll take the double integrator ! |
Do you understand why? |
I'll have a look as soon as I can get CTBase 0.12 (there is usually some latency) |
It is ready. You can get it whenever you want. |
On the other hand, tests for state, control and costate added and OK for the double integrator |
It converged with |
New default in CTDirect is 250, so 250 probably |
NB. probably safer to use double integrator with |
@PierreMartinon As discussed: probable shift in
parse_DOCP_solution_dual
when retrieving the multipliers associated with the dynamics (= adjoints). Bug seem to be activated for problems with nonlinear constraints (= not mere boxes on slices of state / control). See for instance this variant of Goddard that, contrary to this one, has a such a nonlinear constraint: control-toolbox/BVP-DAE#1 (comment)Similar behaviour for these other projects that also have nonlinear (control or mixed) constraints:
@alesiagr https://github.com/mctao-inria/sail-therm
@PhysicDev https://github.com/PhysicDev/McTao_lunar_solar_sail
The text was updated successfully, but these errors were encountered: