- 3.0.2 optimal control module.
|
This class can integrate a controlled system and a costfunction. Furthermore, it provides first order derivatives with respect to initial state and control. More...
#include <SensitivityIntegratorCT.h>
Public Types | |
typedef ct::core::ControlVector< CONTROL_DIM, SCALAR > | control_vector |
typedef Eigen::Matrix< SCALAR, STATE_DIM, STATE_DIM > | state_matrix |
typedef Eigen::Matrix< SCALAR, CONTROL_DIM, CONTROL_DIM > | control_matrix |
typedef Eigen::Matrix< SCALAR, STATE_DIM, CONTROL_DIM > | state_control_matrix |
Public Member Functions | |
SensitivityIntegratorCT (const std::shared_ptr< ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >> &system, const ct::core::IntegrationType stepperType=ct::core::IntegrationType::EULERCT) | |
Constructor. More... | |
~SensitivityIntegratorCT ()=default | |
Destroys the object. More... | |
void | initializeDerived (const ct::core::IntegrationType stepperType) |
Initializes the steppers. More... | |
void | setLinearSystem (const std::shared_ptr< ct::core::LinearSystem< STATE_DIM, CONTROL_DIM, SCALAR >> &linearSystem) |
Prepares the integrator to provide first order sensitivity generation by setting a linearsystem, enabling state caching and settings up the function objects. More... | |
void | setControlledSystem (const std::shared_ptr< ct::core::ControlledSystem< STATE_DIM, CONTROL_DIM, SCALAR >> &controlledSystem) |
Changes the controlledsystem to be integrated. More... | |
void | setCostFunction (const std::shared_ptr< CostFunctionQuadratic< STATE_DIM, CONTROL_DIM, SCALAR >> costFun) |
Prepares the integrator to provide cost integration and first order cost derivatives. This is done by enabling sensitivity caching and setting up the function objects. More... | |
void | integrate (state_vector &state, const SCALAR startTime, const size_t numSteps, const SCALAR dt, ct::core::StateVectorArray< STATE_DIM, SCALAR > &stateTrajectory, ct::core::tpl::TimeArray< SCALAR > &timeTrajectory) |
Integrates the system starting from state and startTime for numSteps integration steps. Returns the full state and time trajectories. More... | |
void | integrate (state_vector &state, const SCALAR startTime, const size_t numSteps, const SCALAR dt) |
Integrates the system starting from state and startTime for numSteps integration steps. Returns only the final state and time. More... | |
void | integrateSensitivityDX0 (state_matrix &dX0, const SCALAR startTime, const size_t numSteps, const SCALAR dt) |
Integrates the sensitivity ODE of the integrator with respec to the initial state x0. More... | |
void | integrateSensitivityDU0 (state_control_matrix &dU0, const SCALAR startTime, const size_t numSteps, const SCALAR dt) |
Integrates the sensitivity ODE of the integrator with respec to the initial control input u0. More... | |
void | integrateSensitivityDUf (state_control_matrix &dUf, const SCALAR startTime, const size_t numSteps, const SCALAR dt) |
Integrates the sensitivity ODE of the integrator with respec to the final control input uf. More... | |
void | integrateCost (SCALAR &cost, const SCALAR startTime, const size_t numSteps, const SCALAR dt) |
Integrates the costfunction using the states and controls from the costintegration. More... | |
void | integrateCostSensitivityDX0 (state_vector &dX0, const SCALAR startTime, const size_t numSteps, const SCALAR dt) |
Integrates the sensitivity of the cost with respect to the initial state x0. More... | |
void | integrateCostSensitivityDU0 (control_vector &dU0, const SCALAR startTime, const size_t numSteps, const SCALAR dt) |
Integrates the sensitivity of the cost with respect to the initial control input u0. More... | |
void | integrateCostSensitivityDUf (control_vector &dUf, const SCALAR &startTime, const size_t numSteps, const SCALAR dt) |
Integrates the sensitivity of the cost with respect to the final control input uF. More... | |
void | linearize () |
Linearizes the system around the rollout from the state interation. More... | |
void | clearStates () |
Clears the cached states, controls and times. More... | |
void | clearSensitivities () |
Clears the cached sensitivities. More... | |
void | clearLinearization () |
Clears the linearized matrices. More... | |
Public Attributes | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ct::core::StateVector< STATE_DIM, SCALAR > | state_vector |
This class can integrate a controlled system and a costfunction. Furthermore, it provides first order derivatives with respect to initial state and control.
STATE_DIM | The state dimension |
CONTROL_DIM | The control dimension |
SCALAR | The scalar type |
typedef ct::core::ControlVector<CONTROL_DIM, SCALAR> ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::control_vector |
typedef Eigen::Matrix<SCALAR, STATE_DIM, STATE_DIM> ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::state_matrix |
typedef Eigen::Matrix<SCALAR, CONTROL_DIM, CONTROL_DIM> ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::control_matrix |
typedef Eigen::Matrix<SCALAR, STATE_DIM, CONTROL_DIM> ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::state_control_matrix |
|
inline |
Constructor.
[in] | system | The controlled system |
[in] | stepperType | The integration stepper type |
References ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::initializeDerived(), ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::setControlledSystem(), and ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::~SensitivityIntegratorCT().
|
default |
Destroys the object.
Referenced by ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::SensitivityIntegratorCT().
|
inline |
Initializes the steppers.
[in] | stepperType | The desired integration stepper type |
Referenced by ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::SensitivityIntegratorCT().
|
inline |
Prepares the integrator to provide first order sensitivity generation by setting a linearsystem, enabling state caching and settings up the function objects.
[in] | linearSystem | The linearized system |
References t.
|
inline |
Changes the controlledsystem to be integrated.
[in] | controlledSystem | The new controlled system |
Referenced by ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::SensitivityIntegratorCT().
|
inline |
Prepares the integrator to provide cost integration and first order cost derivatives. This is done by enabling sensitivity caching and setting up the function objects.
[in] | costFun | The new costfunction |
References t.
|
inline |
Integrates the system starting from state and startTime for numSteps integration steps. Returns the full state and time trajectories.
[in,out] | state | The initial state for integration |
[in] | startTime | The start time |
[in] | numSteps | The number steps |
[in] | dt | The integration timestep |
[out] | stateTrajectory | The output state trajectory |
[out] | timeTrajectory | The output time trajectory |
References ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::clearLinearization(), ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::clearStates(), dt, and i.
|
inline |
Integrates the system starting from state and startTime for numSteps integration steps. Returns only the final state and time.
References ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::clearLinearization(), ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::clearStates(), dt, and i.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Linearizes the system around the rollout from the state interation.
References i.
|
inline |
Clears the cached states, controls and times.
Referenced by ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::integrate().
|
inline |
Clears the cached sensitivities.
|
inline |
Clears the linearized matrices.
Referenced by ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::integrate().
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ct::core::StateVector<STATE_DIM, SCALAR> ct::optcon::SensitivityIntegratorCT< STATE_DIM, CONTROL_DIM, SCALAR >::state_vector |