Base class for the state space representation of a linear time invariant system.
More...
|
| | StateSpace ()=default |
| |
| | StateSpace (const StateSpace &)=default |
| |
| StateSpace & | operator= (const StateSpace &)=default |
| |
| | StateSpace (const Eigen::Matrix< T, NStates, NStates > &A, const Eigen::Matrix< T, NStates, NInputs > &B, const Eigen::Matrix< T, NOutputs, NStates > &C, const Eigen::Matrix< T, NOutputs, NInputs > &D) |
| |
| std::tuple< Eigen::Vector< T, NStates >, Eigen::Vector< T, NOutputs > > | eval (const Eigen::Vector< T, NStates > &x, const Eigen::Vector< T, NInputs > &u) const |
| | calculates the new system states and outupts
|
| |
template<std::convertible_to< T > U>
requires (NInputs == 1 && NOutputs != 1) |
| std::tuple< Eigen::Vector< U, NStates >, Eigen::Vector< U, NOutputs > > | eval (const Eigen::Vector< U, NStates > &x, const U &u_scalar) const |
| | calculates the new system states and outupts for SISO (single input, single output) systems
|
| |
template<std::convertible_to< T > U>
requires (NInputs == 1 && NOutputs == 1) |
| std::tuple< Eigen::Vector< U, NStates >, U > | eval (const Eigen::Vector< U, NStates > &x, const U &u_scalar) const |
| | calculates the new system states and outupts for SISO (single input, single output) systems
|
| |
| const A_matrix_type & | A () const |
| |
| const B_matrix_type & | B () const |
| |
| const C_matrix_type & | C () const |
| |
| const D_matrix_type & | D () const |
| |
| A_matrix_type & | A () |
| |
| B_matrix_type & | B () |
| |
| C_matrix_type & | C () |
| |
| D_matrix_type & | D () |
| |
template<class T, int NStates, int NInputs, int NOutputs>
class controlpp::StateSpace< T, NStates, NInputs, NOutputs >
Base class for the state space representation of a linear time invariant system.
System describeing the matrices (A, B, C, D) of the following linear system:
\[
x = \mathbf{A} x + \mathbf{B} x
y = \mathbf{C} x + \mathbf{D} u
\]
Note that this class only stores the A, B, C, and D matrices and not the state x.
template<class T , int NStates, int NInputs, int NOutputs>
template<std::convertible_to< T > U>
requires (NInputs == 1 && NOutputs != 1)
| std::tuple< Eigen::Vector< U, NStates >, Eigen::Vector< U, NOutputs > > controlpp::StateSpace< T, NStates, NInputs, NOutputs >::eval |
( |
const Eigen::Vector< U, NStates > & |
x, |
|
|
const U & |
u_scalar |
|
) |
| const |
|
inline |
calculates the new system states and outupts for SISO (single input, single output) systems
Overload for SI systems that accepts scalar values as NInputs.
Usage Example:
float input = some_measurement();
auto [new_internal_states, new_output] = ss(NStates, input);
template<class T , int NStates, int NInputs, int NOutputs>
template<std::convertible_to< T > U>
requires (NInputs == 1 && NOutputs == 1)
| std::tuple< Eigen::Vector< U, NStates >, U > controlpp::StateSpace< T, NStates, NInputs, NOutputs >::eval |
( |
const Eigen::Vector< U, NStates > & |
x, |
|
|
const U & |
u_scalar |
|
) |
| const |
|
inline |
calculates the new system states and outupts for SISO (single input, single output) systems
Overload for SISO systems that accepts scalar values as NInputs.
Usage Example:
float input = some_measurement();
auto [new_internal_states, new_output] = ss(NStates, input);