simulatetraj documentation

Simulatetraj solves initial value problems of the form \(\dot{x}=f(x,u,t,p)\). The definition of the variables are provided in the table.

Symbol

Description

Dimensions

\(x(t)\)

State vector

\(\mathbb{R}^{n_x}\)

\(u(t)\)

Control vector

\(\mathbb{R}^{n_u}\)

\(p\)

Parameter vector

\(\mathbb{R}^{n_p}\)

\(t\)

time

\(\mathbb{R}^{1}\)

Backend Implementation

The simulatetraj function utilizes a CasADi integrator backend, supporting various numerical methods such as explicit RK4, IRK, and solvers from the CVODES suite. The framework supports symbolic objects, allowing for the construction of symbolic state trajectories that can be embedded into expression graphs for nonlinear optimization within CasADi.

Numerical Transformation and Efficiency

Internally, the differential equation is transformed from the time interval \([t_0, t_f]\) to a normalized domain \([0, 1]\) .

\[\begin{split}\dot{x}=f(t,x,u)\\ \dot{x}=(t_f-t_0) f(t_0+(t_f-t_0)\tau,x,u)\end{split}\]

This approach offers significant advantages.

  • Numerical Conditioning - It improves stability and facilitates parametric studies.

  • Resource Optimization - Most importantly, it allows the integrator object to be reused within the context of multiple shooting. This eliminates the overhead of repeated object creation, saving valuable computational time.

API:

Indices and tables