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

class for a general switched discrete linear system or linearized discrete system More...

#include <SwitchedDiscreteLinearSystem.h>

Inheritance diagram for ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >:
ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > ct::core::DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALAR >

Public Types

typedef Switched< LinearSystemPtrSwitchedLinearSystems
 
typedef DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALARBase
 
typedef Base::time_t time_t
 
typedef Base::state_vector_t state_vector_t
 
typedef Base::control_vector_t control_vector_t
 
typedef StateMatrix< STATE_DIM, SCALARstate_matrix_t
 state Jacobian type More...
 
typedef StateControlMatrix< STATE_DIM, CONTROL_DIM, SCALARstate_control_matrix_t
 input Jacobian type More...
 
- Public Types inherited from ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >
typedef Base::time_t time_t
 
typedef Base::state_vector_t state_vector_t
 
typedef Base::control_vector_t control_vector_t
 
typedef StateMatrix< STATE_DIM, SCALARstate_matrix_t
 state Jacobian type More...
 
typedef StateControlMatrix< STATE_DIM, CONTROL_DIM, SCALARstate_control_matrix_t
 input Jacobian type More...
 
- Public Types inherited from ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >
typedef DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALARBase
 
typedef Base::state_vector_t state_vector_t
 
typedef Base::control_vector_t control_vector_t
 
typedef Base::time_t time_t
 
- Public Types inherited from ct::core::DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALAR >
typedef int time_t
 the type of the time variable More...
 
typedef StateVector< STATE_DIM, SCALARstate_vector_t
 
typedef ControlVector< CONTROL_DIM, SCALARcontrol_vector_t
 

Public Member Functions

 SwitchedDiscreteLinearSystem (const SwitchedLinearSystems &switchedLinearSystems, const DiscreteModeSequence &discreteModeSequence, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 default constructor More...
 
 SwitchedDiscreteLinearSystem (const SwitchedDiscreteLinearSystem &arg)
 copy constructor More...
 
virtual ~SwitchedDiscreteLinearSystem ()
 destructor More...
 
virtual SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > * clone () const override
 deep cloning More...
 
virtual void propagateControlledDynamics (const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext) override
 compute the system dynamics More...
 
virtual void getAandB (const state_vector_t &x, const control_vector_t &u, const state_vector_t &x_next, const int n, size_t subSteps, state_matrix_t &A, state_control_matrix_t &B) override
 retrieve discrete-time linear system matrices A and B for mode i, active at time n. More...
 
- Public Member Functions inherited from ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >
 DiscreteLinearSystem (const ct::core::SYSTEM_TYPE &type=ct::core::SYSTEM_TYPE::GENERAL)
 default constructor More...
 
virtual ~DiscreteLinearSystem ()
 destructor More...
 
void getAandB (const state_vector_t &x, const control_vector_t &u, const int n, state_matrix_t &A, state_control_matrix_t &B)
 
- Public Member Functions inherited from ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >
 DiscreteControlledSystem (const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 default constructor More...
 
 DiscreteControlledSystem (std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> controller, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 constructor More...
 
 DiscreteControlledSystem (const ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > &arg)
 copy constructor More...
 
virtual ~DiscreteControlledSystem ()=default
 destructor More...
 
void setController (const std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> &controller)
 set a new controller More...
 
void getController (std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> &controller) const
 get the controller instance More...
 
std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > > getController ()
 get the controller instace More...
 
virtual void propagateDynamics (const state_vector_t &state, const time_t n, state_vector_t &stateNext) override
 propagates the system dynamics forward by one step More...
 
- Public Member Functions inherited from ct::core::DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALAR >
 DiscreteSystem (const SYSTEM_TYPE &type=GENERAL)
 constructor More...
 
virtual ~DiscreteSystem ()
 desctructor More...
 
virtual void propagateDynamics (const StateVector< STATE_DIM, SCALAR > &state, const time_t n, StateVector< STATE_DIM, SCALAR > &stateNext)=0
 propagates the system dynamics forward by one step More...
 
SYSTEM_TYPE getType () const
 get the type of system More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr< DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > > LinearSystemPtr
 
- Public Attributes inherited from ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALARBase
 
- Public Attributes inherited from ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr< DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > > Ptr
 

Protected Attributes

SwitchedLinearSystems switchedLinearSystems_
 Switched linear system container. More...
 
DiscreteModeSequence discreteModeSequence_
 the prespecified mode sequence More...
 
- Protected Attributes inherited from ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >
std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR > > controller_
 the controller instance More...
 
- Protected Attributes inherited from ct::core::DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALAR >
SYSTEM_TYPE type_
 type of system More...
 

Detailed Description

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
class ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >

class for a general switched discrete linear system or linearized discrete system

Defines the interface for a switched discrete linear system

Template Parameters
STATE_DIMsize of state vector
CONTROL_DIMsize of input vector

Member Typedef Documentation

◆ SwitchedLinearSystems

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Switched<LinearSystemPtr> ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::SwitchedLinearSystems

◆ Base

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DiscreteControlledSystem<STATE_DIM, CONTROL_DIM, SCALAR> ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::Base

◆ time_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::time_t ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::time_t

◆ state_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::state_vector_t ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_t

◆ control_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::control_vector_t ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_t

◆ state_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef StateMatrix<STATE_DIM, SCALAR> ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::state_matrix_t

state Jacobian type

◆ state_control_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef StateControlMatrix<STATE_DIM, CONTROL_DIM, SCALAR> ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::state_control_matrix_t

input Jacobian type

Constructor & Destructor Documentation

◆ SwitchedDiscreteLinearSystem() [1/2]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::SwitchedDiscreteLinearSystem ( const SwitchedLinearSystems switchedLinearSystems,
const DiscreteModeSequence discreteModeSequence,
const SYSTEM_TYPE type = SYSTEM_TYPE::GENERAL 
)
inline

default constructor

Parameters
typesystem type

Referenced by ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::clone().

◆ SwitchedDiscreteLinearSystem() [2/2]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::SwitchedDiscreteLinearSystem ( const SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > &  arg)
inline

◆ ~SwitchedDiscreteLinearSystem()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::~SwitchedDiscreteLinearSystem ( )
inlinevirtual

destructor

Member Function Documentation

◆ clone()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual SwitchedDiscreteLinearSystem<STATE_DIM, CONTROL_DIM, SCALAR>* ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::clone ( ) const
inlineoverridevirtual

◆ propagateControlledDynamics()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual void ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::propagateControlledDynamics ( const state_vector_t state,
const time_t  n,
const control_vector_t control,
state_vector_t stateNext 
)
inlineoverridevirtual

◆ getAandB()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual void ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::getAandB ( const state_vector_t x,
const control_vector_t u,
const state_vector_t x_next,
const int  n,
size_t  subSteps,
state_matrix_t A,
state_control_matrix_t B 
)
inlineoverridevirtual

retrieve discrete-time linear system matrices A and B for mode i, active at time n.

This computes matrices A and B such that

\[ x_{n+1} = A_{i}x_n + B_{i}u_n \]

Note that the inputs x_next and subSteps are potentially being ignored for 'true' discrete system models but are relevant for sensitivity calculations if the underlying system is continuous.

Parameters
xthe state setpoint at n
uthe control setpoint at n
nthe time setpoint
x_nextthe state at n+1
subStepsnumber of substeps to use in sensitivity calculation
Athe resulting linear system matrix A
Bthe resulting linear system matrix B

Implements ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >.

References ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::discreteModeSequence_, ct::core::PhaseSequence< Phase, Time >::getPhaseFromTime(), and ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::switchedLinearSystems_.

Referenced by TEST().

Member Data Documentation

◆ LinearSystemPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr<DiscreteLinearSystem<STATE_DIM, CONTROL_DIM, SCALAR> > ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::LinearSystemPtr

Referenced by TEST().

◆ switchedLinearSystems_

◆ discreteModeSequence_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
DiscreteModeSequence ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >::discreteModeSequence_
protected

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