- 3.0.2 core module.
ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR > Class Template Referenceabstract

The base class for the implementation of a symplectic system. In a symplectic system, the position and the velocity update can be separated. During integration, the velocity gets update first and the position update uses the updated velocity. More...

#include <SymplecticSystem.h>

Inheritance diagram for ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >:
ct::core::ControlledSystem< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR > ct::core::System< STATE_DIM, SCALAR >

Public Types

typedef Base::time_t time_t
 
- Public Types inherited from ct::core::ControlledSystem< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR >
typedef std::shared_ptr< ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR > > Ptr
 
typedef Base::time_t time_t
 
- Public Types inherited from ct::core::System< STATE_DIM, SCALAR >
typedef SCALAR time_t
 the type of the time variable More...
 

Public Member Functions

 SymplecticSystem (const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 Constructor. More...
 
 SymplecticSystem (std::shared_ptr< ct::core::Controller< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR >> controller, const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 Constructor. More...
 
 SymplecticSystem (const SymplecticSystem &arg)
 Copy constructor. More...
 
virtual ~SymplecticSystem ()
 Destructor. More...
 
virtual SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR > * clone () const override=0
 Creates a new instance of the object with same properties than original. More...
 
virtual bool isSymplectic () const override
 Determines if the system is in symplectic form. More...
 
virtual void computeControlledDynamics (const StateVector< POS_DIM+VEL_DIM, SCALAR > &state, const time_t &t, const ControlVector< CONTROL_DIM, SCALAR > &control, StateVector< POS_DIM+VEL_DIM, SCALAR > &derivative) override
 
void computePdot (const StateVector< POS_DIM+VEL_DIM, SCALAR > &x, const StateVector< VEL_DIM, SCALAR > &v, StateVector< POS_DIM, SCALAR > &pDot)
 Computes the derivative of the position. More...
 
void computeVdot (const StateVector< POS_DIM+VEL_DIM, SCALAR > &x, const StateVector< POS_DIM, SCALAR > &p, StateVector< VEL_DIM, SCALAR > &vDot)
 Computes the derivative of the velocity. More...
 
virtual void computePdot (const StateVector< POS_DIM+VEL_DIM, SCALAR > &x, const StateVector< VEL_DIM, SCALAR > &v, const ControlVector< CONTROL_DIM, SCALAR > &control, StateVector< POS_DIM, SCALAR > &pDot)=0
 Computes the derivative of the position. More...
 
virtual void computeVdot (const StateVector< POS_DIM+VEL_DIM, SCALAR > &x, const StateVector< POS_DIM, SCALAR > &p, const ControlVector< CONTROL_DIM, SCALAR > &control, StateVector< VEL_DIM, SCALAR > &vDot)=0
 Computes the derivative of the velocity. More...
 
- Public Member Functions inherited from ct::core::ControlledSystem< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR >
 ControlledSystem (const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 default constructor More...
 
 ControlledSystem (std::shared_ptr< ct::core::Controller< STATE_DIM, CONTROL_DIM, SCALAR >> 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, SCALAR >> &controller)
 set a new controller More...
 
void getController (std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, SCALAR >> &controller) const
 get the controller instance More...
 
std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, SCALAR > > getController ()
 get the controller instace More...
 
virtual void computeDynamics (const StateVector< STATE_DIM, SCALAR > &state, const time_t &t, StateVector< STATE_DIM, SCALAR > &derivative) override
 compute the dynamics of the system More...
 
virtual void computeControlledDynamics (const StateVector< STATE_DIM, SCALAR > &state, const time_t &t, const ControlVector< CONTROL_DIM, SCALAR > &control, StateVector< STATE_DIM, SCALAR > &derivative)=0
 
ControlVector< CONTROL_DIM, SCALARgetLastControlAction ()
 
- Public Member Functions inherited from ct::core::System< STATE_DIM, SCALAR >
 System (const SYSTEM_TYPE &type=SYSTEM_TYPE::GENERAL)
 default constructor More...
 
 System (const System &other)
 copy constructor More...
 
virtual ~System ()
 destructor More...
 
SYSTEM_TYPE getType () const
 get the type of system More...
 

Public Attributes

EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ControlledSystem< POS_DIM+VEL_DIM, CONTROL_DIM, SCALARBase
 
- Public Attributes inherited from ct::core::ControlledSystem< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef System< STATE_DIM, SCALARBase
 
- Public Attributes inherited from ct::core::System< STATE_DIM, SCALAR >
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef SCALAR S
 the scalar type More...
 

Additional Inherited Members

- Protected Attributes inherited from ct::core::ControlledSystem< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR >
std::shared_ptr< Controller< STATE_DIM, CONTROL_DIM, SCALAR > > controller_
 the controller instance More...
 
ControlVector< CONTROL_DIM, SCALARcontrolAction_
 
- Protected Attributes inherited from ct::core::System< STATE_DIM, SCALAR >
SYSTEM_TYPE type_
 type of system More...
 

Detailed Description

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
class ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >

The base class for the implementation of a symplectic system. In a symplectic system, the position and the velocity update can be separated. During integration, the velocity gets update first and the position update uses the updated velocity.

Template Parameters
POS_DIMThe position dimension
VEL_DIMThe velocity dimension
CONTROL_DIMThe control dimension
SCALARThe scalar type

Member Typedef Documentation

◆ time_t

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
typedef Base::time_t ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::time_t

Constructor & Destructor Documentation

◆ SymplecticSystem() [1/3]

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

Constructor.

Parameters
[in]typeThe type of the system

◆ SymplecticSystem() [2/3]

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::SymplecticSystem ( std::shared_ptr< ct::core::Controller< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR >>  controller,
const SYSTEM_TYPE type = SYSTEM_TYPE::GENERAL 
)
inline

Constructor.

Parameters
[in]controllerThe controller used when integrating the system
[in]typeThe type of the system

◆ SymplecticSystem() [3/3]

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::SymplecticSystem ( const SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR > &  arg)
inline

Copy constructor.

Parameters
[in]argThe argument

◆ ~SymplecticSystem()

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::~SymplecticSystem ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ clone()

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual SymplecticSystem<POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR>* ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::clone ( ) const
overridepure virtual

Creates a new instance of the object with same properties than original.

Returns
Copy of this object.

Implements ct::core::ControlledSystem< POS_DIM+VEL_DIM, CONTROL_DIM, SCALAR >.

Implemented in ct::core::tpl::TestSymplecticSystem< SCALAR >.

Referenced by ct::core::SymplecticSystem< 1, 1, 1, SCALAR >::~SymplecticSystem().

◆ isSymplectic()

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual bool ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::isSymplectic ( ) const
inlineoverridevirtual

Determines if the system is in symplectic form.

Returns
True if symplectic, False otherwise.

Reimplemented from ct::core::System< STATE_DIM, SCALAR >.

◆ computeControlledDynamics()

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual void ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::computeControlledDynamics ( const StateVector< POS_DIM+VEL_DIM, SCALAR > &  state,
const time_t t,
const ControlVector< CONTROL_DIM, SCALAR > &  control,
StateVector< POS_DIM+VEL_DIM, SCALAR > &  derivative 
)
inlineoverridevirtual

◆ computePdot() [1/2]

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
void ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::computePdot ( const StateVector< POS_DIM+VEL_DIM, SCALAR > &  x,
const StateVector< VEL_DIM, SCALAR > &  v,
StateVector< POS_DIM, SCALAR > &  pDot 
)
inline

Computes the derivative of the position.

Parameters
[in]xThe full state vector
[in]vThe updated velocity
[out]pDotThe derivative of the position

Referenced by ct::core::SymplecticSystem< 1, 1, 1, SCALAR >::computeControlledDynamics(), ct::core::SymplecticSystem< 1, 1, 1, SCALAR >::computePdot(), and ct::core::SymplecticSystem< 1, 1, 1, SCALAR >::computeVdot().

◆ computeVdot() [1/2]

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
void ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::computeVdot ( const StateVector< POS_DIM+VEL_DIM, SCALAR > &  x,
const StateVector< POS_DIM, SCALAR > &  p,
StateVector< VEL_DIM, SCALAR > &  vDot 
)
inline

Computes the derivative of the velocity.

Parameters
[in]xThe full state vector
[in]pThe position
[out]vDotThe derivative of the velocity

Referenced by ct::core::SymplecticSystem< 1, 1, 1, SCALAR >::computeControlledDynamics(), and ct::core::SymplecticSystem< 1, 1, 1, SCALAR >::computeVdot().

◆ computePdot() [2/2]

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual void ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::computePdot ( const StateVector< POS_DIM+VEL_DIM, SCALAR > &  x,
const StateVector< VEL_DIM, SCALAR > &  v,
const ControlVector< CONTROL_DIM, SCALAR > &  control,
StateVector< POS_DIM, SCALAR > &  pDot 
)
pure virtual

Computes the derivative of the position.

Parameters
[in]xThe full state vector
[in]vThe updated velocity
[in]controlThe control input
[out]pDotThe derivative of the position

Implemented in ct::core::tpl::TestSymplecticSystem< SCALAR >.

◆ computeVdot() [2/2]

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
virtual void ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::computeVdot ( const StateVector< POS_DIM+VEL_DIM, SCALAR > &  x,
const StateVector< POS_DIM, SCALAR > &  p,
const ControlVector< CONTROL_DIM, SCALAR > &  control,
StateVector< VEL_DIM, SCALAR > &  vDot 
)
pure virtual

Computes the derivative of the velocity.

Parameters
[in]xThe full state vector
[in]pThe position
[in]controlThe control input
[out]vDotThe derivative of the velocity

Implemented in ct::core::tpl::TestSymplecticSystem< SCALAR >.

Member Data Documentation

◆ Base

template<size_t POS_DIM, size_t VEL_DIM, size_t CONTROL_DIM, typename SCALAR = double>
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ControlledSystem<POS_DIM + VEL_DIM, CONTROL_DIM, SCALAR> ct::core::SymplecticSystem< POS_DIM, VEL_DIM, CONTROL_DIM, SCALAR >::Base

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