- 3.0.2 optimal control module.
ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR > Class Template Referencefinal

System model adapted to CT. System model encapsulates the integrator, so it is able to propagate the system, but also computes derivatives w.r.t. both state and noise. When propagating the system, CTSystemModel does not use the specified control input, but uses the assigned system controller instead. More...

#include <CTSystemModel.h>

Inheritance diagram for ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >:
ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >

Public Types

using Base = SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >
 
using SensitivityApprox_t = ct::core::SensitivityApproximation< STATE_DIM, CONTROL_DIM, STATE_DIM/2, STATE_DIM/2, SCALAR >
 
using control_vector_t = ct::core::ControlVector< CONTROL_DIM, SCALAR >
 
using state_matrix_t = ct::core::StateMatrix< STATE_DIM, SCALAR >
 
using state_vector_t = ct::core::StateVector< STATE_DIM, SCALAR >
 
using Time_t = SCALAR
 
- Public Types inherited from ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >
using state_vector_t = ct::core::StateVector< STATE_DIM, SCALAR >
 
using state_matrix_t = ct::core::StateMatrix< STATE_DIM, SCALAR >
 
using control_vector_t = ct::core::ControlVector< CONTROL_DIM, SCALAR >
 
using Time_t = SCALAR
 

Public Member Functions

 CTSystemModel (std::shared_ptr< ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >> system, std::shared_ptr< SensitivityApprox_t > sensApprox, const state_matrix_t &dFdv, const ct::core::IntegrationType &intType=ct::core::IntegrationType::EULERCT)
 Constructor. Takes in the system with defined controller, and sens approximator for computing the derivatives. More...
 
state_vector_t computeDynamics (const state_vector_t &state, const control_vector_t &u, const Time_t dt, Time_t t) override
 Propagates the system giving the next state as output. Control input is generated by the system controller. More...
 
state_matrix_t computeDerivativeState (const state_vector_t &state, const control_vector_t &u, const Time_t dt, Time_t t) override
 Computes the derivative w.r.t state. Control input is generated by the system controller. More...
 
state_matrix_t computeDerivativeNoise (const state_vector_t &state, const control_vector_t &control, const Time_t dt, Time_t t) override
 Computes the derivative w.r.t noise. Control input is generated by the system controller. More...
 
- Public Member Functions inherited from ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >
virtual ~SystemModelBase ()=default
 Virtual destructor. More...
 

Protected Attributes

std::shared_ptr< ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > > system_
 The underlying CT system. More...
 
std::shared_ptr< ct::core::ConstantController< STATE_DIM, CONTROL_DIM, SCALAR > > constantController_
 each system gets re-assigned a constant controller for dynamics evaluation with known control inputs More...
 
std::shared_ptr< SensitivityApprox_tsensApprox_
 The sensitivity approximator. More...
 
state_matrix_t dFdv_
 Derivative w.r.t. noise. More...
 
ct::core::Integrator< STATE_DIM, SCALARintegrator_
 Integrator. More...
 

Detailed Description

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
class ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >

System model adapted to CT. System model encapsulates the integrator, so it is able to propagate the system, but also computes derivatives w.r.t. both state and noise. When propagating the system, CTSystemModel does not use the specified control input, but uses the assigned system controller instead.

Todo:
this needs to get unified with the system-interface from optcon
Template Parameters
STATE_DIM
CONTROL_DIM
Examples:
KalmanDisturbanceFiltering.cpp, and KalmanFiltering.cpp.

Member Typedef Documentation

◆ Base

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
using ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::Base = SystemModelBase<STATE_DIM, CONTROL_DIM, SCALAR>

◆ SensitivityApprox_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
using ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::SensitivityApprox_t = ct::core::SensitivityApproximation<STATE_DIM, CONTROL_DIM, STATE_DIM / 2, STATE_DIM / 2, SCALAR>

◆ control_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
using ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector_t = ct::core::ControlVector<CONTROL_DIM, SCALAR>

◆ state_matrix_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
using ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >::state_matrix_t = ct::core::StateMatrix<STATE_DIM, SCALAR>

◆ state_vector_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
using ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector_t = ct::core::StateVector<STATE_DIM, SCALAR>

◆ Time_t

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
using ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >::Time_t = SCALAR

Constructor & Destructor Documentation

◆ CTSystemModel()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::CTSystemModel ( std::shared_ptr< ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >>  system,
std::shared_ptr< SensitivityApprox_t sensApprox,
const state_matrix_t dFdv,
const ct::core::IntegrationType intType = ct::core::IntegrationType::EULERCT 
)

Constructor. Takes in the system with defined controller, and sens approximator for computing the derivatives.

References ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::constantController_, and ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::system_.

Member Function Documentation

◆ computeDynamics()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
auto ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::computeDynamics ( const state_vector_t state,
const control_vector_t u,
const Time_t  dt,
Time_t  t 
)
overridevirtual

Propagates the system giving the next state as output. Control input is generated by the system controller.

Implements ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >.

References ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::constantController_, dt, ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::integrator_, t, u, and x.

◆ computeDerivativeState()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
auto ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::computeDerivativeState ( const state_vector_t state,
const control_vector_t u,
const Time_t  dt,
Time_t  t 
)
overridevirtual

Computes the derivative w.r.t state. Control input is generated by the system controller.

Implements ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >.

References dt, ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::sensApprox_, t, and u.

◆ computeDerivativeNoise()

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR >
auto ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::computeDerivativeNoise ( const state_vector_t state,
const control_vector_t control,
const Time_t  dt,
Time_t  t 
)
overridevirtual

Computes the derivative w.r.t noise. Control input is generated by the system controller.

Implements ct::optcon::SystemModelBase< STATE_DIM, CONTROL_DIM, SCALAR >.

References ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::dFdv_.

Member Data Documentation

◆ system_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
std::shared_ptr<ct::core::ControlledSystem<STATE_DIM, CONTROL_DIM, SCALAR> > ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::system_
protected

◆ constantController_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
std::shared_ptr<ct::core::ConstantController<STATE_DIM, CONTROL_DIM, SCALAR> > ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::constantController_
protected

each system gets re-assigned a constant controller for dynamics evaluation with known control inputs

Referenced by ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::computeDynamics(), and ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::CTSystemModel().

◆ sensApprox_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
std::shared_ptr<SensitivityApprox_t> ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::sensApprox_
protected

◆ dFdv_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
state_matrix_t ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::dFdv_
protected

◆ integrator_

template<size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::core::Integrator<STATE_DIM, SCALAR> ct::optcon::CTSystemModel< STATE_DIM, CONTROL_DIM, SCALAR >::integrator_
protected

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