- 3.0.2 core module.
ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > Class Template Referenceabstract

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

#include <DiscreteControlledSystem.h>

Inheritance diagram for ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >:
ct::core::DiscreteSystem< STATE_DIM, CONTROL_DIM, SCALAR > ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > ct::core::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > ct::core::SystemDiscretizer< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR > ct::core::DiscreteSystemLinearizer< STATE_DIM, CONTROL_DIM, SCALAR > ct::core::Sensitivity< STATE_DIM, CONTROL_DIM, SCALAR > ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR > ct::core::SensitivityApproximation< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR > ct::core::SensitivityIntegrator< STATE_DIM, CONTROL_DIM, P_DIM, V_DIM, SCALAR >

Public Types

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

 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...
 
virtual DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > * clone () const override=0
 deep copy 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...
 
virtual void propagateControlledDynamics (const state_vector_t &state, const time_t n, const control_vector_t &control, state_vector_t &stateNext)=0
 propagates the controlled 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< DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > > Ptr
 

Protected Attributes

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::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >

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

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

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

where $ x_{n} $ is the state, $ u_{n} $ the control input and $ n $ the time index.

For implementing your own ControlledSystem, derive from this class.

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

◆ Base

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef DiscreteSystem<STATE_DIM, CONTROL_DIM, SCALAR> ct::core::DiscreteControlledSystem< 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::DiscreteControlledSystem< 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::DiscreteControlledSystem< 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::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::time_t

Constructor & Destructor Documentation

◆ DiscreteControlledSystem() [1/3]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::DiscreteControlledSystem ( const SYSTEM_TYPE type = SYSTEM_TYPE::GENERAL)
inline

default constructor

Parameters
typesystem type

◆ DiscreteControlledSystem() [2/3]

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

constructor

Parameters
controllercontroller
typesystem type

◆ DiscreteControlledSystem() [3/3]

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

copy constructor

◆ ~DiscreteControlledSystem()

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

Member Function Documentation

◆ clone()

◆ setController()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
void ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::setController ( const std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> &  controller)
inline

set a new controller

Parameters
controllernew controller

◆ getController() [1/2]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
void ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::getController ( std::shared_ptr< DiscreteController< STATE_DIM, CONTROL_DIM, SCALAR >> &  controller) const
inline

get the controller instance

Todo:
remove this function (duplicate of getController() below)
Parameters
controllercontroller instance

◆ getController() [2/2]

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
std::shared_ptr<DiscreteController<STATE_DIM, CONTROL_DIM, SCALAR> > ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::getController ( )
inline

get the controller instace

Returns
controller instance

◆ propagateDynamics()

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

propagates the system dynamics forward by one step

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

Parameters
statestart state to propagate from
ntime index to propagate the dynamics at
stateNextthe resulting propagated state

◆ propagateControlledDynamics()

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

propagates the controlled system dynamics forward by one step

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

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

Implemented in ct::core::SwitchedDiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >, ct::core::SwitchedDiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >, ct::core::DiscreteLinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >, ct::core::DiscreteLinearSystem< 2, 1, float >, ct::core::DiscreteLinearSystem< 2, 1, double >, and ct::core::tpl::TestDiscreteNonlinearSystem< SCALAR >.

Referenced by ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, double >::propagateDynamics().

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<DiscreteControlledSystem<STATE_DIM, CONTROL_DIM, SCALAR> > ct::core::DiscreteControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >::Ptr

◆ controller_


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