Public Member Functions | |
StateSpace () | |
Default constructor. | |
StateSpace (TDStateMatrix *A, TDInputMatrix *B, TDOutputMatrix *C, TDOutputMatrix *D) | |
Construct a state space system with the given matrices. More... | |
template<typename DerivedA , typename DerivedB , typename DerivedC , typename DerivedD > | |
StateSpace (const Eigen::EigenBase< DerivedA > &A, const Eigen::EigenBase< DerivedB > &B, const Eigen::EigenBase< DerivedC > &C, const Eigen::EigenBase< DerivedD > &D) | |
StateSpace (const StateSpace &other) | |
Copy constructor. More... | |
const TDStateMatrix & | getA () const |
Gets the state matrix. More... | |
void | setA (TDStateMatrix *A) |
Sets the state matrix. More... | |
template<typename Derived > | |
void | setA (Eigen::EigenBase< Derived > *A) |
void | setA (const TDStateMatrix &A) |
Sets the state matrix. More... | |
template<typename Derived > | |
void | setA (const Eigen::EigenBase< Derived > &A) |
const TDInputMatrix & | getB () const |
Gets the input matrix. More... | |
void | setB (TDInputMatrix *B) |
Sets the input matrix. More... | |
template<typename Derived > | |
void | setB (Eigen::EigenBase< Derived > *B) |
void | setB (const TDInputMatrix &B) |
Sets the input matrix. More... | |
template<typename Derived > | |
void | setB (const Eigen::EigenBase< Derived > &B) |
const TDOutputMatrix & | getC () const |
Gets the output matrix. More... | |
void | setC (TDOutputMatrix *C) |
Sets the output matrix. More... | |
template<typename Derived > | |
void | setC (Eigen::EigenBase< Derived > *C) |
void | setC (const TDOutputMatrix &C) |
Sets the output matrix. More... | |
template<typename Derived > | |
void | setC (const Eigen::EigenBase< Derived > &C) |
const TDFeedforwardMatrix & | getD () const |
Gets the feedforward matrix. More... | |
void | setD (TDFeedforwardMatrix *D) |
Sets the feedforward matrix. More... | |
template<typename Derived > | |
void | setD (Eigen::EigenBase< Derived > *D) |
void | setD (const TDFeedforwardMatrix &D) |
Sets the feedforward matrix. More... | |
template<typename Derived > | |
void | setD (const Eigen::EigenBase< Derived > &D) |
void | copyMatrices (const StateSpace &other) |
Copies matrices from one state space object to the current instance. More... | |
void | setDiscreteParams (double dt) |
Sets the discrete time system parameters. More... | |
void | setDiscreteParams (double dt, bool discrete) |
Sets the discrete time system parameters. More... | |
bool | isDiscrete () const |
Returns a bool that tells if the system is discrete. More... | |
double | getSamplingPeriod () const |
Returns the sampling period. More... | |
void | setSamplingPeriod (double dt) |
Sets the sampling period. More... | |
stateDim () const | |
Returns the state dimension. More... | |
long | stateDimDynamic () const |
stateDim () const | |
long | stateDimStatic () const |
inputDim () const | |
Returns the input dimension. More... | |
long | inputDimDynamic () const |
inputDim () const | |
long | inputDimStatic () const |
outputDim () const | |
Returns the output dimension. More... | |
long | outputDimDynamic () const |
outputDim () const | |
long | outputDimStatic () const |
template<int TStateDim2, int TOutputDim2> | |
void | append (const StateSpace< TScalar, TStateDim2, TOutputDim, TOutputDim2 > &ss) |
Appends to state space systems. More... | |
bool | isStable (double tolerance=0) const |
Determines if the system is stable based on its eigenvalues. More... | |
template<typename T_TScalar = TScalar, const int T_TStateDim = TStateDim, const int T_TInputDim = TInputDim, const int T_TOutputDim = TOutputDim> | |
ls::systems::StateSpace< T_TScalar, LS_STATIC_UNLESS_DYNAMIC(T_TStateDim+T_TOutputDim), T_TInputDim, T_TOutputDim > | addIntegralAction (LS_IS_DYNAMIC_DEFAULT(T_TStateDim, T_TInputDim, T_TOutputDim)) const |
Returns a state space representation that adds integral action to the original system. More... | |
template<typename T_TScalar = TScalar, const int T_TStateDim = TStateDim, const int T_TInputDim = TInputDim, const int T_TOutputDim = TOutputDim> | |
ls::systems::StateSpace< T_TScalar, LS_STATIC_UNLESS_DYNAMIC(T_TStateDim+T_TOutputDim), T_TInputDim, T_TOutputDim > | addIntegralAction (LS_IS_STATIC_DEFAULT(T_TStateDim, T_TInputDim, T_TOutputDim)) const |
Returns a state space representation that adds integral action to the original system. More... | |
template<typename T_TScalar , const int T_TStateDim, const int T_TInputDim, const int T_TOutputDim> | |
ls::systems::StateSpace< T_TScalar, LS_STATIC_UNLESS_DYNAMIC(T_TStateDim+T_TOutputDim), T_TInputDim, T_TOutputDim > | addIntegralAction (LS_IS_DYNAMIC(T_TStateDim, T_TInputDim, T_TOutputDim)) const |
template<typename T_TScalar , const int T_TStateDim, const int T_TInputDim, const int T_TOutputDim> | |
ls::systems::StateSpace< T_TScalar, LS_STATIC_UNLESS_DYNAMIC(T_TStateDim+T_TOutputDim), T_TInputDim, T_TOutputDim > | addIntegralAction (LS_IS_STATIC(T_TStateDim, T_TInputDim, T_TOutputDim)) const |
Protected Attributes | |
TDStateMatrix * | A_ |
TDInputMatrix * | B_ |
TState matrix. | |
TDOutputMatrix * | C_ |
Input matrix. | |
TDFeedforwardMatrix * | D_ |
Output matrix. | |
double | dt_ |
Feedforward matrix. | |
bool | isDiscrete_ |
Sampling period. | |
ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::StateSpace | ( | TDStateMatrix * | A, |
TDInputMatrix * | B, | ||
TDOutputMatrix * | C, | ||
TDOutputMatrix * | D | ||
) |
Construct a state space system with the given matrices.
A | Pointer to state matrix. |
B | Pointer to input matrix. |
C | Pointer to output matrix. |
D | Pointer to feedforward matrix. |
ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::StateSpace | ( | const StateSpace< TScalar, TStateDim, TInputDim, TOutputDim > & | other | ) |
Copy constructor.
other | TState space object to copy. |
ls::systems::StateSpace<T_TScalar, LS_STATIC_UNLESS_DYNAMIC( T_TStateDim + T_TOutputDim), T_TInputDim, T_TOutputDim> ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::addIntegralAction | ( | LS_IS_DYNAMIC_DEFAULT(T_TStateDim, T_TInputDim, T_TOutputDim) | ) | const |
Returns a state space representation that adds integral action to the original system.
For details on the discrete time case, see [1].
T_TScalar | Copy of TScalar . |
T_TStateDim | Copy of TStateDim . |
T_TInputDim | Copy of TInputDim . |
T_TOutputDim | Copy of TOutputDim . |
ls::systems::StateSpace<T_TScalar, LS_STATIC_UNLESS_DYNAMIC( T_TStateDim + T_TOutputDim), T_TInputDim, T_TOutputDim> ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::addIntegralAction | ( | LS_IS_STATIC_DEFAULT(T_TStateDim, T_TInputDim, T_TOutputDim) | ) | const |
Returns a state space representation that adds integral action to the original system.
For details on the discrete time case, see [1].
T_TScalar | Copy of TScalar . |
T_TStateDim | Copy of TStateDim . |
T_TInputDim | Copy of TInputDim . |
T_TOutputDim | Copy of TOutputDim . |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::append | ( | const StateSpace< TScalar, TStateDim2, TOutputDim, TOutputDim2 > & | ss | ) |
Appends to state space systems.
If the discrete time parameters do not match the current system, the input system is altered to match the current system.
ss | TState space system to append. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::copyMatrices | ( | const StateSpace< TScalar, TStateDim, TInputDim, TOutputDim > & | other | ) |
Copies matrices from one state space object to the current instance.
ss | TState space object to copy matrices from. |
const ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::TDStateMatrix & ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::getA |
Gets the state matrix.
const ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::TDInputMatrix & ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::getB |
Gets the input matrix.
const ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::TDOutputMatrix & ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::getC |
Gets the output matrix.
const ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::TDFeedforwardMatrix & ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::getD |
Gets the feedforward matrix.
|
inline |
Returns the sampling period.
|
inline |
Returns the input dimension.
|
inline |
Returns a bool that tells if the system is discrete.
|
inline |
Determines if the system is stable based on its eigenvalues.
tolerance
sets the stability margin that is taken into account during computation.
tolerance | Eigenvalue tolerance. |
|
inline |
Returns the output dimension.
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setA | ( | const TDStateMatrix & | A | ) |
Sets the state matrix.
A | TState matrix. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setA | ( | TDStateMatrix * | A | ) |
Sets the state matrix.
A | Pointer to state matrix. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setB | ( | const TDInputMatrix & | B | ) |
Sets the input matrix.
B | Input matrix. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setB | ( | TDInputMatrix * | B | ) |
Sets the input matrix.
B | Pointer to input matrix. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setC | ( | const TDOutputMatrix & | C | ) |
Sets the output matrix.
C | Output matrix. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setC | ( | TDOutputMatrix * | C | ) |
Sets the output matrix.
C | Pointer to output matrix. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setD | ( | const TDFeedforwardMatrix & | D | ) |
Sets the feedforward matrix.
D | Pointer to feedforward matrix. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setD | ( | TDFeedforwardMatrix * | D | ) |
Sets the feedforward matrix.
D | Feedforward matrix. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setDiscreteParams | ( | double | dt | ) |
Sets the discrete time system parameters.
dt | Sampling period. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setDiscreteParams | ( | double | dt, |
bool | discrete | ||
) |
Sets the discrete time system parameters.
dt | Sampling period. |
discrete | If true, the system is treated as a discrete time system. |
void ls::systems::StateSpace< TScalar, TStateDim, TInputDim, TOutputDim >::setSamplingPeriod | ( | double | dt | ) |
Sets the sampling period.
dt | Sampling period. |
|
inline |
Returns the state dimension.