|
akreon-control
Optimal and robust control and state estimation in C++26.
|
Forward declaration of PlantModel. More...
#include <plant_model.hpp>
Public Types | |
| using | StateSpace = linalg::remove_cvref_t< SS > |
| using | InputPortsT = linalg::remove_cvref_t< InputPorts > |
| using | OutputPortsT = linalg::remove_cvref_t< OutputPorts > |
| using | Model = PlantModel< StateSpace, InputPortsT, OutputPortsT > |
| using | T = plant_type_t< Model > |
Public Member Functions | |
| constexpr | PlantModel (const StateSpace &ss) |
| Copy a state-space model using the template-specified layouts. | |
| constexpr | PlantModel (const StateSpace &ss, const InputPortsT &, const OutputPortsT &) |
| Copy a model with layout arguments supplied for type deduction. | |
| constexpr auto | dynamics_matrix () const |
| Return A (StateDim x StateDim), without changing the time domain. | |
| constexpr auto | exogenous_matrix () const |
| Return B_w (StateDim x ExogenousDim), for disturbance/reference/noise inputs. | |
| constexpr auto | control_matrix () const |
| Return B_u (StateDim x ControlDim), for actuator inputs. | |
| constexpr auto | performance_matrix () const |
| Return C_z (PerformanceDim x StateDim), for regulated outputs. | |
| constexpr auto | measurement_matrix () const |
| Return C_y (MeasurementDim x StateDim), for measured outputs. | |
| template<PortRole OutRole, PortRole InRole> | |
| constexpr auto | feedthrough () const |
| Extract D blocks from the selected input role to output role. | |
Public Attributes | |
| SS | state_space |
| Owned full model; accessors reflect its current matrices. | |
Static Public Attributes | |
| static constexpr std::size_t | StateDim = plant_traits<Model>::StateDim |
| static constexpr std::size_t | InputDim = plant_traits<Model>::InputDim |
| static constexpr std::size_t | OutputDim = plant_traits<Model>::OutputDim |
Forward declaration of PlantModel.
State-space model with compile-time input and output port roles.
The underlying equations are xdot = A*x + B*v (continuous) or x[k+1] = A*x[k] + B*v[k] (discrete), with o = C*x + D*v. Input ports identify exogenous channels w and control channels u in v; output ports identify performance channels z and measurements y in o. The full matrices retain their original channel ordering.
Each Port<Role, Offset, Size> selects a contiguous, zero-based range: inputs select B/D columns and outputs select C/D rows. Ranges must be nonempty, in bounds, and nonoverlapping within each layout; these checks occur at compile time. Layouts need not cover every channel. Callers choose appropriate input/output roles and satisfy each synthesis formulation's additional assumptions; this wrapper does not check stabilizability, detectability, or physical units.
Accessors concatenate matching ports in layout declaration order, not ascending matrix offset. A missing role produces a zero-width input matrix or zero-height output matrix. All returned matrices are values, not views. Layouts are types and require no runtime storage; state_space owns a copy of the supplied model, including its time domain and optional D matrix.
For a model with inputs [w, u] and outputs [z, y], one channel each:
| SS | Continuous or discrete StateSpaceLike model. |
| InputPorts | PortLayout describing the full input axis. |
| OutputPorts | PortLayout describing the full output axis. |
Definition at line 56 of file plant_model.hpp.
| using control::PlantModel< SS, InputPorts, OutputPorts >::InputPortsT = linalg::remove_cvref_t<InputPorts> |
Definition at line 58 of file plant_model.hpp.
| using control::PlantModel< SS, InputPorts, OutputPorts >::Model = PlantModel<StateSpace, InputPortsT, OutputPortsT> |
Definition at line 60 of file plant_model.hpp.
| using control::PlantModel< SS, InputPorts, OutputPorts >::OutputPortsT = linalg::remove_cvref_t<OutputPorts> |
Definition at line 59 of file plant_model.hpp.
| using control::PlantModel< SS, InputPorts, OutputPorts >::StateSpace = linalg::remove_cvref_t<SS> |
Definition at line 57 of file plant_model.hpp.
| using control::PlantModel< SS, InputPorts, OutputPorts >::T = plant_type_t<Model> |
Definition at line 61 of file plant_model.hpp.
|
inlineexplicitconstexpr |
Copy a state-space model using the template-specified layouts.
| ss | Full model whose matrix ordering matches the port offsets. |
Definition at line 75 of file plant_model.hpp.
|
inlineconstexpr |
Copy a model with layout arguments supplied for type deduction.
| ss | Full state-space model. The layout arguments carry types only; no layout objects are stored. |
Definition at line 81 of file plant_model.hpp.
|
inlineconstexpr |
Return B_u (StateDim x ControlDim), for actuator inputs.
Definition at line 95 of file plant_model.hpp.
References control::is_continuous_v.
|
inlineconstexpr |
Return A (StateDim x StateDim), without changing the time domain.
Definition at line 86 of file plant_model.hpp.
References control::PlantModel< SS, InputPorts, OutputPorts >::state_space.
|
inlineconstexpr |
Return B_w (StateDim x ExogenousDim), for disturbance/reference/noise inputs.
Definition at line 90 of file plant_model.hpp.
References control::is_continuous_v.
|
inlineconstexpr |
Extract D blocks from the selected input role to output role.
| OutRole | Output role selecting rows in C/D. |
| InRole | Input role selecting columns in B/D. |
Definition at line 119 of file plant_model.hpp.
References control::is_continuous_v, and control::PlantModel< SS, InputPorts, OutputPorts >::state_space.
|
inlineconstexpr |
Return C_y (MeasurementDim x StateDim), for measured outputs.
Definition at line 105 of file plant_model.hpp.
References control::is_continuous_v.
|
inlineconstexpr |
Return C_z (PerformanceDim x StateDim), for regulated outputs.
Definition at line 100 of file plant_model.hpp.
References control::is_continuous_v.
|
staticconstexpr |
Definition at line 64 of file plant_model.hpp.
|
staticconstexpr |
Definition at line 65 of file plant_model.hpp.
| SS control::PlantModel< SS, InputPorts, OutputPorts >::state_space |
Owned full model; accessors reflect its current matrices.
Definition at line 129 of file plant_model.hpp.
Referenced by control::PlantModel< SS, InputPorts, OutputPorts >::dynamics_matrix(), and control::PlantModel< SS, InputPorts, OutputPorts >::feedthrough().
|
staticconstexpr |
Definition at line 63 of file plant_model.hpp.