|
2 | 2 | $(TYPEDSIGNATURES) |
3 | 3 |
|
4 | 4 | Add a constraint to a dictionary of constraints. |
| 5 | +
|
| 6 | +## Arguments |
| 7 | +
|
| 8 | +- `ocp_constraints`: The dictionary of constraints to which the constraint will be added. |
| 9 | +- `type`: The type of the constraint. It can be :state, :control, :variable, :boundary or :path. |
| 10 | +- `n`: The dimension of the state. |
| 11 | +- `m`: The dimension of the control. |
| 12 | +- `q`: The dimension of the variable. |
| 13 | +- `rg`: The range of the constraint. It can be an integer or a range of integers. |
| 14 | +- `f`: The function that defines the constraint. It must return a vector of the same dimension as the constraint. |
| 15 | +- `lb`: The lower bound of the constraint. It can be a number or a vector. |
| 16 | +- `ub`: The upper bound of the constraint. It can be a number or a vector. |
| 17 | +- `label`: The label of the constraint. It must be unique in the dictionary of constraints. |
| 18 | +
|
| 19 | +## Requirements |
| 20 | +
|
| 21 | +- The constraint must not be set before. |
| 22 | +- The lower bound `lb` and the upper bound `ub` cannot be both nothing. |
| 23 | +- The lower bound `lb` and the upper bound `ub` must have the same length, if both provided. |
| 24 | +
|
| 25 | +If `rg` and `f` are not provided then, |
| 26 | +
|
| 27 | +- `type` must be :state, :control or :variable |
| 28 | +- `lb` and `ub` must be of dimension n, m or q respectively, when provided. |
| 29 | +
|
| 30 | +If `rg` is provided, then: |
| 31 | +
|
| 32 | +- `f` must not be provided. |
| 33 | +- `type` must be :state, :control or :variable. |
| 34 | +- `rg` must be a range of integers, and must be contained in 1:n, 1:m or 1:q respectively. |
| 35 | +
|
| 36 | +If `f` is provided, then: |
| 37 | +
|
| 38 | +- `rg` must not be provided. |
| 39 | +- `type` must be :boundary or :path. |
| 40 | +- `f` must be a function that returns a vector of the same dimension as the constraint. |
| 41 | +- `lb` and `ub` must be of the same dimension as the output of `f`, when provided. |
| 42 | +
|
5 | 43 | """ |
6 | 44 | function __constraint!( |
7 | 45 | ocp_constraints::ConstraintsDictType, |
|
124 | 162 | """ |
125 | 163 | $(TYPEDSIGNATURES) |
126 | 164 |
|
127 | | -Add a constraint to a pre-model. |
| 165 | +Add a constraint to a pre-model. See `[__constraint!](@ref)` for more details. |
128 | 166 | """ |
129 | 167 | function constraint!( |
130 | 168 | ocp::PreModel, |
|
0 commit comments