iDynTree::optimalcontrol::integrators::ImplicitTrapezoidal class

Base classes

class FixedStepIntegrator

Constructors, destructors, conversion operators

ImplicitTrapezoidal()
ImplicitTrapezoidal(const std::shared_ptr<iDynTree::optimalcontrol::DynamicalSystem> dynamicalSystem)
~ImplicitTrapezoidal() override

Public functions

auto evaluateCollocationConstraint(double time, const std::vector<VectorDynSize>& collocationPoints, const std::vector<VectorDynSize>& controlInputs, double dT, VectorDynSize& constraintValue) -> bool override
Evaluate the collocation constraint.
auto evaluateCollocationConstraintJacobian(double time, const std::vector<VectorDynSize>& collocationPoints, const std::vector<VectorDynSize>& controlInputs, double dT, std::vector<MatrixDynSize>& stateJacobianValues, std::vector<MatrixDynSize>& controlJacobianValues) -> bool override
auto getCollocationConstraintJacobianStateSparsity(std::vector<SparsityStructure>& stateJacobianSparsity) -> bool override
auto getCollocationConstraintJacobianControlSparsity(std::vector<SparsityStructure>& controlJacobianSparsity) -> bool override
auto evaluateCollocationConstraintSecondDerivatives(double time, const std::vector<VectorDynSize>& collocationPoints, const std::vector<VectorDynSize>& controlInputs, double dT, const VectorDynSize& lambda, CollocationHessianMap& stateSecondDerivative, CollocationHessianMap& controlSecondDerivative, CollocationHessianMap& stateControlSecondDerivative) -> bool override
auto getCollocationConstraintSecondDerivativeWRTStateSparsity(CollocationHessianSparsityMap& stateDerivativeSparsity) -> bool override
auto getCollocationConstraintSecondDerivativeWRTControlSparsity(CollocationHessianSparsityMap& controlDerivativeSparsity) -> bool override
auto getCollocationConstraintSecondDerivativeWRTStateControlSparsity(CollocationHessianSparsityMap& stateControlDerivativeSparsity) -> bool override

Private functions

auto allocateBuffers() -> bool override
auto oneStepIntegration(double t0, double dT, const VectorDynSize& x0, VectorDynSize& x) -> bool override

Function documentation

bool iDynTree::optimalcontrol::integrators::ImplicitTrapezoidal::evaluateCollocationConstraint(double time, const std::vector<VectorDynSize>& collocationPoints, const std::vector<VectorDynSize>& controlInputs, double dT, VectorDynSize& constraintValue) override

Evaluate the collocation constraint.

Parameters
time in Instant at which the collocation constraint is evaluated
collocationPoints in A vector containing $x_k$ and $x_{k+1}$ . Notice that $x_{k+1}$ corresponds to the state at instant (time + dT).
controlInputs in A vector containing $u_k$ and $u_{k+1}$ . Notice that $u_{k+1}$ is supposed to be applied at instant (time + dT).
dT in The time distance between $x_k$ and $x_{k+1}$ .
constraintValue out The result of $ \phi(x_k, x_{k+1}, u_k, u_{k+1}, t) - x_{k+1}$ .
Returns True if successfull, false otherwise (or if not implemented).

In some optimal control solvers, like the MultipleShootingSolver, we need to discretize the dynamical system associated to the optimal control problem. This function evaluates the discretization error according to specified integration method. The Integrator, when integrating a dynamical system, is performing the following discretization:

\[ x_{k+1} = \phi(x_k, x_{k+1}, u_k, u_{k+1}, t) \]

where $ x_{k+1}$ is the discretized output. For example, using forward euler, we would have

\[ x_{k+1} = x_k + f(t, x, u)\mathrm{d}T. \]

This function returns the result of $ \phi(x_k, x_{k+1}, u_k, u_{k+1}, t) - x_{k+1}$ .