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

A general, switched non-linear discrete dynamic system with a control input. More...

#include <SwitchedDiscreteControlledSystem.h>

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

Public Types

typedef std::shared_ptr< DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > > SystemPtr
 
typedef Switched< SystemPtrSwitchedSystems
 
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::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

 SwitchedDiscreteControlledSystem (const SwitchedSystems &switchedSystems, const DiscreteModeSequence &discreteModeSequence, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 default constructor More...
 
 SwitchedDiscreteControlledSystem (const SwitchedSystems &switchedSystems, const DiscreteModeSequence &discreteModeSequence, std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> controller, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 constructor More...
 
 SwitchedDiscreteControlledSystem (const SwitchedDiscreteControlledSystem &arg)
 copy constructor More...
 
virtual ~SwitchedDiscreteControlledSystem ()
 destructor More...
 
virtual SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > * clone () const override
 deep copy More...
 
virtual void propagateControlledDynamics (const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext) override
 propagates the controlled system dynamics forward by one step More...
 
- 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< SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > > Ptr
 
- 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

SwitchedSystems switchedSystems_
 switched 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::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >

A general, switched non-linear discrete dynamic system with a control input.

This describes a general, switched non-linear discrete dynamic system of the following form

\[ x_{n+1} = f_{i}(x_n,u_n,n) \]

where $ x_{n} $ is the state, $ u_{n} $ the control input and $ n $ the time index. $ f_{i} $ refers to the dynamics in a specific mode. Modes are prespecified as a function of time.

For implementing your own SwitchedDiscreteControlledSystem, provide a vector of Discrete systems and a prespecified mode sequence.

We generally assume that the Controller is a state and time index dependent function $ u_n = g(x_n,n) $ which allows any ControlledSystem to be re-written as a System of the form

\[ x_{n+1} = f(x_n,u_n(x_n,n),n) = g(x_n,n) \]

which can be forward propagated directly.

Template Parameters
STATE_DIMdimension of state vector
CONTROL_DIMdimension of input vector
SCALARscalar type

Member Typedef Documentation

◆ SystemPtr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef std::shared_ptr<DiscreteControlledSystem<STATE_DIM, CONTROL_DIM, SCALAR> > ct::core::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::SystemPtr

◆ SwitchedSystems

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Switched<SystemPtr> ct::core::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::SwitchedSystems

◆ Base

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

◆ state_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::state_vector_t ct::core::SwitchedDiscreteControlledSystem< 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::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_t

◆ time_t

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

Constructor & Destructor Documentation

◆ SwitchedDiscreteControlledSystem() [1/3]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::core::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::SwitchedDiscreteControlledSystem ( const SwitchedSystems switchedSystems,
const DiscreteModeSequence discreteModeSequence,
const SYSTEM_TYPE type = SYSTEM_TYPE::GENERAL 
)
inline

default constructor

Parameters
typesystem type

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

◆ SwitchedDiscreteControlledSystem() [2/3]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::core::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::SwitchedDiscreteControlledSystem ( const SwitchedSystems switchedSystems,
const DiscreteModeSequence discreteModeSequence,
std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >>  controller,
const SYSTEM_TYPE type = SYSTEM_TYPE::GENERAL 
)
inline

constructor

Parameters
controllercontroller
typesystem type

◆ SwitchedDiscreteControlledSystem() [3/3]

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

◆ ~SwitchedDiscreteControlledSystem()

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

destructor

Member Function Documentation

◆ clone()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual SwitchedDiscreteControlledSystem<STATE_DIM, CONTROL_DIM, SCALAR>* ct::core::SwitchedDiscreteControlledSystem< 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::SwitchedDiscreteControlledSystem< 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

propagates the controlled system dynamics forward by one step

evaluates $ x_{n+1} = f(x_n, u_n, n) $ at a given state, control, index, and mode

Parameters
statestart state to propagate from
controlthe control input to apply. This is a constant control input applied to the continuous-time dynamics
ntime index to propagate the dynamics at
stateNextthe resulting propagated state

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

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

Member Data Documentation

◆ Ptr

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef std::shared_ptr<SwitchedDiscreteControlledSystem<STATE_DIM, CONTROL_DIM, SCALAR> > ct::core::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::Ptr

◆ switchedSystems_

◆ discreteModeSequence_

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

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