Skip to content
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

[Dev] Constraint update #7

Open
jbcaillau opened this issue Dec 12, 2024 · 1 comment
Open

[Dev] Constraint update #7

jbcaillau opened this issue Dec 12, 2024 · 1 comment
Assignees

Comments

@jbcaillau
Copy link
Member

jbcaillau commented Dec 12, 2024

@ocots @PierreMartinon simplification proposal of setters (aka previous functional primitives) for constraints:

  • :initial and :final removed as subsumed by :boundary (everything already goes to functions, not ranges)
  • :state_fun, :control_fun, :mixed are now :path (all are path constraints, no need to refine)
  • so, the new simplified constraint types are
    • :boundary
    • :state_range, :control_range,
    • :path
    • :variable_range, :variable_fun
  • for the record, previous types returned by CTBase.constraint_type:
Return the type constraint among
`:initial`, `:final`, `:boundary`, `:control_range`, `:control_fun`,
`:state_range`, `:state_fun`, `:mixed`, `:variable_range`, `:variable_fun` (`:other` otherwise),
together with the appropriate value (range, updated expression...) Expressions like `u(t0)` where `u`
is the control and `t0` the initial time return `:other`.
  • NB. the fine grain knowledge on the constraint type (e.g. pure state / control vs. mixed) would still be useful for the sparsity structure of the derivatives
@PierreMartinon
Copy link
Member

PierreMartinon commented Dec 12, 2024

Ok, I like it !

A minor remark: merging the 3 kinds of path constraints potentially loses some information for the AD, however I don't think this is particularly significant. Also this will be improved when we provide the jacobian block structure.

Another more technical aspect was the fact that state and control variables may not be discretized on the same time grid, and so one could think of evaluating for instance the pure state constraints at the time steps and the pure control constraints at the time stages. It does seem a bit convoluted though, so I have no problems having a unified function for the path constraints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants