Control¶
openscvx.backend.control.Control
¶
Bases: Variable
A class representing the control variables in an optimal control problem.
The Control class extends Variable to handle control-specific properties and supports both true and augmented control dimensions. It provides methods for appending new control variables and accessing subsets of the control vector.
Attributes:
Name | Type | Description |
---|---|---|
name |
str
|
Name of the control variable. |
shape |
tuple
|
Shape of the control variable array. |
min |
ndarray
|
Minimum bounds for the control variables. Shape: (n_controls,). |
max |
ndarray
|
Maximum bounds for the control variables. Shape: (n_controls,). |
guess |
ndarray
|
Used to initialize SCP and contains the current SCP solution for the control trajectory. Shape: (n_nodes, n_controls). |
_true_dim |
int
|
True dimensionality of the control variables. |
_true_slice |
slice
|
Slice for accessing true control variables. |
_augmented_slice |
slice
|
Slice for accessing augmented control variables. |
Notes
Attributes prefixed with underscore (_) are for internal use only and should not be accessed directly.
Example
augmented
property
¶
Get the augmented control variables.
Returns:
Name | Type | Description |
---|---|---|
Control |
A new Control object containing only the augmented control variables |
true
property
¶
Get the true control variables (excluding augmented controls).
Returns:
Name | Type | Description |
---|---|---|
Control |
A new Control object containing only the true control variables |
_update_slices()
¶
Update the slice objects for true and augmented controls.
append(other=None, *, min=-np.inf, max=np.inf, guess=0.0, augmented=False)
¶
Append another control or create a new control variable.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
other
|
Control
|
Another Control object to append |
None
|
min
|
float
|
Minimum bound for new control. Defaults to -np.inf |
-inf
|
max
|
float
|
Maximum bound for new control. Defaults to np.inf |
inf
|
guess
|
float
|
Initial guess for new control. Defaults to 0.0 |
0.0
|
augmented
|
bool
|
Whether the new control is augmented. Defaults to False |
False
|