Open ocots opened 1 year ago
Current state in CTDirect:
Small update: in the latest version only the adjoints are retrieved, other multipliers are skipped. Putting them back is easy since the previous code is still there.
While we're at it, it would be nice to add proper fields in OptimalControlSolution
for these multipliers (I used to dump them in info
).
@ocots, @jbcaillau I let you pick the names and add the fields, then I complete the parsing back ?
@PierreMartinon I guess we should stick to the current vocabulary (check constraint!
here):
Choose whatever name you want as long as you don't mix CamlCase_and_snake 🙃...
By the way we probably want to retrieve the different constraints as well (parsing is the same so there is no extra effort). So maybe something like this, to keep reasonably short names:
@PierreMartinon as pointed by @ocots there is still an interest in having labels for our constraints (abstract form) as one might want to retrieve the constraint associated with such a specific label:
@def ocp begin
t ∈ [ 0, 1 ], time
x ∈ R², state
u ∈ R, control
x(0) == [ -1, 0 ], (1)
x(1) == [ 0, 0 ]
ẋ(t) == [ x₂(t), u(t) ]
∫( 0.5u(t)^2 ) → min
end
Ok, in the solution parsing I can sort the different kinds of constraints and their associated multipliers, then interpolate the functions as we already do for the state and control (and costate) variables.
For the labels part, I guess it would be the same as retrieving a state/control by its name ?
By the way this will need a joint release of CTDirect / CTBase.
A user should have the possibility to get the dual variables of a constraint he has labeled, as in
JuMP
(cf. thedual
function). See also #131