- 3.0.2 core module.
ct::core::LTISystem< STATE_DIM, CONTROL_DIM > Class Template Reference

Linear time-invariant system. More...

#include <LTISystem.h>

Inheritance diagram for ct::core::LTISystem< STATE_DIM, CONTROL_DIM >:
ct::core::LinearSystem< STATE_DIM, CONTROL_DIM > ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, double > ct::core::System< STATE_DIM, double >

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW LTISystem (const Eigen::Matrix< double, STATE_DIM, STATE_DIM > &A, const Eigen::Matrix< double, STATE_DIM, CONTROL_DIM > &B, const Eigen::Matrix< double, STATE_DIM, STATE_DIM > &C=Eigen::Matrix< double, STATE_DIM, STATE_DIM >::Identity(), const Eigen::Matrix< double, STATE_DIM, CONTROL_DIM > D=Eigen::Matrix< double, STATE_DIM, CONTROL_DIM >::Zero())
 Constructs a linear time invariant system. More...
 
 LTISystem (const LTISystem &arg)
 copy constructor More...
 
LTISystem< STATE_DIM, CONTROL_DIM > * clone () const override
 deep clone More...
 
virtual ~LTISystem ()
 
virtual const Eigen::Matrix< double, STATE_DIM, STATE_DIM > & getDerivativeState (const StateVector< STATE_DIM > &x, const ControlVector< CONTROL_DIM > &u, const double t=0.0) override
 get A matrix More...
 
virtual const Eigen::Matrix< double, STATE_DIM, CONTROL_DIM > & getDerivativeControl (const StateVector< STATE_DIM > &x, const ControlVector< CONTROL_DIM > &u, const double t=0.0) override
 get B matrix More...
 
Eigen::Matrix< double, STATE_DIM, STATE_DIM > & A ()
 get A matrix More...
 
Eigen::Matrix< double, STATE_DIM, CONTROL_DIM > & B ()
 get B matrix More...
 
Eigen::Matrix< double, STATE_DIM, STATE_DIM > & C ()
 get C matrix More...
 
Eigen::Matrix< double, STATE_DIM, CONTROL_DIM > & D ()
 get D matrix More...
 
void computeControlledDynamics (const Eigen::Matrix< double, STATE_DIM, 1 > &state, const Time &t, const Eigen::Matrix< double, CONTROL_DIM, 1 > &control, Eigen::Matrix< double, STATE_DIM, 1 > &derivative)
 computes the system dynamics More...
 
void computeOutput (const Eigen::Matrix< double, STATE_DIM, 1 > &state, const Time &t, const Eigen::Matrix< double, CONTROL_DIM, 1 > &control, Eigen::Matrix< double, STATE_DIM, 1 > &output)
 computes the system output (measurement) More...
 
void computeControllabilityMatrix (Eigen::Matrix< double, STATE_DIM, STATE_DIM *CONTROL_DIM > &CO)
 computes the controllability matrix More...
 
bool isControllable ()
 checks if system is fully controllable More...
 
void computeObservabilityMatrix (Eigen::Matrix< double, STATE_DIM, STATE_DIM *STATE_DIM > &O)
 computes the observability matrix More...
 
bool isObservable ()
 checks if system is fully observable More...
 
- Public Member Functions inherited from ct::core::LinearSystem< STATE_DIM, CONTROL_DIM >
 LinearSystem (const ct::core::SYSTEM_TYPE &type=ct::core::SYSTEM_TYPE::GENERAL)
 default constructor More...
 
virtual ~LinearSystem ()
 destructor More...
 
virtual void computeControlledDynamics (const state_vector_t &state, const time_t &t, const control_vector_t &control, state_vector_t &derivative) override
 compute the system dynamics More...
 
virtual const state_matrix_tgetDerivativeState (const state_vector_t &x, const control_vector_t &u, const time_t t=time_t(0.0))=0
 get the A matrix of a linear system More...
 
virtual const state_control_matrix_tgetDerivativeControl (const state_vector_t &x, const control_vector_t &u, const time_t t=time_t(0.0))=0
 get the B matrix of a linear system More...
 
virtual void getDerivatives (state_matrix_t &A, state_control_matrix_t &B, const state_vector_t &x, const control_vector_t &u, const time_t t=time_t(0.0))
 Get both linear system matrices A and B in one call. More...
 
- Public Member Functions inherited from ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, double >
 ControlledSystem (const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 default constructor More...
 
 ControlledSystem (std::shared_ptr< ct::core::Controller< STATE_DIM, CONTROL_DIM, double >> controller, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 constructor More...
 
 ControlledSystem (const ControlledSystem &arg)
 copy constructor More...
 
virtual ~ControlledSystem ()
 destructor More...
 
void setController (const std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, double >> &controller)
 set a new controller More...
 
void getController (std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, double >> &controller) const
 get the controller instance More...
 
std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, double > > getController ()
 get the controller instace More...
 
virtual void computeDynamics (const StateVector< STATE_DIM, double > &state, const time_t &t, StateVector< STATE_DIM, double > &derivative) override
 compute the dynamics of the system More...
 
ControlVector< CONTROL_DIM, double > getLastControlAction ()
 
- Public Member Functions inherited from ct::core::System< STATE_DIM, double >
 System (const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 default constructor More...
 
 System (const System &other)
 copy constructor More...
 
virtual ~System ()
 destructor More...
 
virtual void computeDynamics (const StateVector< STATE_DIM, double > &state, const time_t &t, StateVector< STATE_DIM, double > &derivative)=0
 computes the system dynamics More...
 
SYSTEM_TYPE getType () const
 get the type of system More...
 
virtual bool isSymplectic () const
 Determines if the system is in symplectic form. More...
 

Additional Inherited Members

- Public Types inherited from ct::core::LinearSystem< STATE_DIM, CONTROL_DIM >
typedef Base::time_t time_t
 
typedef StateVector< STATE_DIM, double > state_vector_t
 state vector type More...
 
typedef ControlVector< CONTROL_DIM, double > control_vector_t
 input vector type More...
 
typedef StateMatrix< STATE_DIM, double > state_matrix_t
 state Jacobian type More...
 
typedef StateControlMatrix< STATE_DIM, CONTROL_DIM, double > state_control_matrix_t
 input Jacobian type More...
 
- Public Types inherited from ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, double >
typedef std::shared_ptr< ControlledSystem< STATE_DIM, CONTROL_DIM, double > > Ptr
 
typedef Base::time_t time_t
 
- Public Types inherited from ct::core::System< STATE_DIM, double >
typedef double time_t
 the type of the time variable More...
 
- Public Attributes inherited from ct::core::LinearSystem< STATE_DIM, CONTROL_DIM >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ControlledSystem< STATE_DIM, CONTROL_DIM, double > Base
 
- Public Attributes inherited from ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, double >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef System< STATE_DIM, double > Base
 
- Public Attributes inherited from ct::core::System< STATE_DIM, double >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef double S
 the scalar type More...
 
- Protected Attributes inherited from ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, double >
std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, double > > controller_
 the controller instance More...
 
ControlVector< CONTROL_DIM, double > controlAction_
 
- Protected Attributes inherited from ct::core::System< STATE_DIM, double >
SYSTEM_TYPE type_
 type of system More...
 

Detailed Description

template<size_t STATE_DIM, size_t CONTROL_DIM>
class ct::core::LTISystem< STATE_DIM, CONTROL_DIM >

Linear time-invariant system.

This defines a general linear time-invariant system of the form

\[ \begin{aligned} \dot{x} &= Ax + Bu \\ y &= Cx + Du \end{aligned} \]

Template Parameters
STATE_DIMsize of state vector
CONTROL_DIMsize of control vector

Constructor & Destructor Documentation

◆ LTISystem() [1/2]

template<size_t STATE_DIM, size_t CONTROL_DIM>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::LTISystem ( const Eigen::Matrix< double, STATE_DIM, STATE_DIM > &  A,
const Eigen::Matrix< double, STATE_DIM, CONTROL_DIM > &  B,
const Eigen::Matrix< double, STATE_DIM, STATE_DIM > &  C = Eigen::Matrix<double, STATE_DIM, STATE_DIM>::Identity(),
const Eigen::Matrix< double, STATE_DIM, CONTROL_DIM >  D = Eigen::Matrix<double, STATE_DIM, CONTROL_DIM>::Zero() 
)
inline

Constructs a linear time invariant system.

Parameters
AA matrix
BB matrix
CC matrix
DD matrix
Returns
instance of the LTI system

◆ LTISystem() [2/2]

template<size_t STATE_DIM, size_t CONTROL_DIM>
ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::LTISystem ( const LTISystem< STATE_DIM, CONTROL_DIM > &  arg)
inline

copy constructor

◆ ~LTISystem()

template<size_t STATE_DIM, size_t CONTROL_DIM>
virtual ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::~LTISystem ( )
inlinevirtual

Member Function Documentation

◆ clone()

template<size_t STATE_DIM, size_t CONTROL_DIM>
LTISystem<STATE_DIM, CONTROL_DIM>* ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::clone ( ) const
inlineoverridevirtual

◆ getDerivativeState()

template<size_t STATE_DIM, size_t CONTROL_DIM>
virtual const Eigen::Matrix<double, STATE_DIM, STATE_DIM>& ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::getDerivativeState ( const StateVector< STATE_DIM > &  x,
const ControlVector< CONTROL_DIM > &  u,
const double  t = 0.0 
)
inlineoverridevirtual

get A matrix

◆ getDerivativeControl()

template<size_t STATE_DIM, size_t CONTROL_DIM>
virtual const Eigen::Matrix<double, STATE_DIM, CONTROL_DIM>& ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::getDerivativeControl ( const StateVector< STATE_DIM > &  x,
const ControlVector< CONTROL_DIM > &  u,
const double  t = 0.0 
)
inlineoverridevirtual

get B matrix

◆ A()

template<size_t STATE_DIM, size_t CONTROL_DIM>
Eigen::Matrix<double, STATE_DIM, STATE_DIM>& ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::A ( )
inline

get A matrix

◆ B()

template<size_t STATE_DIM, size_t CONTROL_DIM>
Eigen::Matrix<double, STATE_DIM, CONTROL_DIM>& ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::B ( )
inline

get B matrix

◆ C()

template<size_t STATE_DIM, size_t CONTROL_DIM>
Eigen::Matrix<double, STATE_DIM, STATE_DIM>& ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::C ( )
inline

get C matrix

◆ D()

template<size_t STATE_DIM, size_t CONTROL_DIM>
Eigen::Matrix<double, STATE_DIM, CONTROL_DIM>& ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::D ( )
inline

get D matrix

◆ computeControlledDynamics()

template<size_t STATE_DIM, size_t CONTROL_DIM>
void ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::computeControlledDynamics ( const Eigen::Matrix< double, STATE_DIM, 1 > &  state,
const Time t,
const Eigen::Matrix< double, CONTROL_DIM, 1 > &  control,
Eigen::Matrix< double, STATE_DIM, 1 > &  derivative 
)
inline

computes the system dynamics

Computes $ \dot{x} = Ax + Bu $

Parameters
statecurrent state x
ttime (gets ignored)
controlcontrol input
derivativestate derivative

◆ computeOutput()

template<size_t STATE_DIM, size_t CONTROL_DIM>
void ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::computeOutput ( const Eigen::Matrix< double, STATE_DIM, 1 > &  state,
const Time t,
const Eigen::Matrix< double, CONTROL_DIM, 1 > &  control,
Eigen::Matrix< double, STATE_DIM, 1 > &  output 
)
inline

computes the system output (measurement)

Computes $ y = Cx + Du $

Parameters
statecurrent state x
ttime (gets ignored)
controlcontrol input
outputsystem output (measurement)

◆ computeControllabilityMatrix()

template<size_t STATE_DIM, size_t CONTROL_DIM>
void ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::computeControllabilityMatrix ( Eigen::Matrix< double, STATE_DIM, STATE_DIM *CONTROL_DIM > &  CO)
inline

computes the controllability matrix

Computes the controllability matrix to assess controllability. See isControllable() for the full test.

Todo:
Move to LinearSystem
Parameters
COcontrollability matrix

References i.

Referenced by ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::isControllable().

◆ isControllable()

template<size_t STATE_DIM, size_t CONTROL_DIM>
bool ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::isControllable ( )
inline

checks if system is fully controllable

Todo:
Move to LinearSystem
Returns
true if fully controllable, false if only partially or non-controllable

References ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::computeControllabilityMatrix().

◆ computeObservabilityMatrix()

template<size_t STATE_DIM, size_t CONTROL_DIM>
void ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::computeObservabilityMatrix ( Eigen::Matrix< double, STATE_DIM, STATE_DIM *STATE_DIM > &  O)
inline

computes the observability matrix

Todo:
Move to LinearSystem

Computes the observability matrix to assess observability. See isObservable() for the full test.

Parameters
Oobservability matrix

References i.

Referenced by ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::isObservable().

◆ isObservable()

template<size_t STATE_DIM, size_t CONTROL_DIM>
bool ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::isObservable ( )
inline

checks if system is fully observable

Todo:
Move to LinearSystem
Returns
true if fully observable, false if only partially or non-observable

References ct::core::LTISystem< STATE_DIM, CONTROL_DIM >::computeObservabilityMatrix().


The documentation for this class was generated from the following file: