Linear state-space model.
More...
#include <LinearModel.hpp>
|
| void | ExportMatlab (const std::string &path) const |
| | Export to MATLAB .m file.
|
| void | ExportNumPy (const std::string &path) const |
| | Export to Python/NumPy .py file.
|
| void | ExportJSON (const std::string &path) const |
| | Export to JSON file.
|
| int | ControllabilityRank () const |
| | Compute controllability matrix rank.
|
| int | ObservabilityRank () const |
| | Compute observability matrix rank.
|
| bool | IsStable () const |
| | Check if system is stable (all eigenvalues have negative real part).
|
| Eigen::VectorXcd | Eigenvalues () const |
| | Get eigenvalues of A matrix.
|
|
| Eigen::MatrixXd | A |
| | State matrix (n_states x n_states).
|
| Eigen::MatrixXd | B |
| | Input matrix (n_states x n_inputs).
|
| Eigen::MatrixXd | C |
| | Output matrix (n_outputs x n_states).
|
| Eigen::MatrixXd | D |
| | Feedthrough matrix (n_outputs x n_inputs).
|
| std::vector< std::string > | state_names |
| std::vector< std::string > | input_names |
| std::vector< std::string > | output_names |
| Eigen::VectorXd | x0 |
| | Operating point where linearization was performed.
|
| Eigen::VectorXd | u0 |
| double | t0 = 0.0 |
Linear state-space model.
Represents the linearized system: x_dot = A*x + B*u y = C*x + D*u
Where x is the state deviation from x0, u is input deviation from u0.
◆ ControllabilityRank()
| int icarus::staging::LinearModel::ControllabilityRank |
( |
| ) |
const |
|
inlinenodiscard |
Compute controllability matrix rank.
Controllability matrix: [B, AB, A^2B, ..., A^(n-1)B] System is controllable iff rank equals n_states.
- Returns
- Rank of controllability matrix, or 0 if no inputs (uncontrollable)
◆ Eigenvalues()
| Eigen::VectorXcd icarus::staging::LinearModel::Eigenvalues |
( |
| ) |
const |
|
inlinenodiscard |
Get eigenvalues of A matrix.
◆ ExportJSON()
| void icarus::staging::LinearModel::ExportJSON |
( |
const std::string & | path | ) |
const |
|
inline |
◆ ExportMatlab()
| void icarus::staging::LinearModel::ExportMatlab |
( |
const std::string & | path | ) |
const |
|
inline |
Export to MATLAB .m file.
Creates a MATLAB script that defines A, B, C, D matrices and constructs an ss() state-space object.
◆ ExportNumPy()
| void icarus::staging::LinearModel::ExportNumPy |
( |
const std::string & | path | ) |
const |
|
inline |
Export to Python/NumPy .py file.
◆ IsStable()
| bool icarus::staging::LinearModel::IsStable |
( |
| ) |
const |
|
inlinenodiscard |
Check if system is stable (all eigenvalues have negative real part).
◆ ObservabilityRank()
| int icarus::staging::LinearModel::ObservabilityRank |
( |
| ) |
const |
|
inlinenodiscard |
Compute observability matrix rank.
Observability matrix: [C; CA; CA^2; ...; CA^(n-1)] System is observable iff rank equals n_states.
- Returns
- Rank of observability matrix, or 0 if no outputs (unobservable)
| Eigen::MatrixXd icarus::staging::LinearModel::A |
State matrix (n_states x n_states).
| Eigen::MatrixXd icarus::staging::LinearModel::B |
Input matrix (n_states x n_inputs).
| Eigen::MatrixXd icarus::staging::LinearModel::C |
Output matrix (n_outputs x n_states).
| Eigen::MatrixXd icarus::staging::LinearModel::D |
Feedthrough matrix (n_outputs x n_inputs).
◆ input_names
| std::vector<std::string> icarus::staging::LinearModel::input_names |
◆ output_names
| std::vector<std::string> icarus::staging::LinearModel::output_names |
◆ state_names
| std::vector<std::string> icarus::staging::LinearModel::state_names |
◆ t0
| double icarus::staging::LinearModel::t0 = 0.0 |
◆ u0
| Eigen::VectorXd icarus::staging::LinearModel::u0 |
◆ x0
| Eigen::VectorXd icarus::staging::LinearModel::x0 |
Operating point where linearization was performed.
The documentation for this struct was generated from the following file: