Using simulatetraj, initial value problems can be solved numerically. In the backend, an adaptive numerical integration is performed using CVODES from the SUNDIALS suite.
Given initial state
| Symbol | Description | Dimensions |
|---|---|---|
| State vector | ||
| Control vector | ||
| Parameter vector | ||
| time |
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.
Internally, the differential equation is transformed from the time interval
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.
casadiscipynumpymatplotlib
Create a virtual environment and install the package using pip.
python -m venv sim_envpip install simulatetrajRun the scripts from examples folder to verify the installation.
Install poetry and clone the repository.
git clone https://github.com/sandeep026/simulatetraj.gitInstall the packages using poetry
poetry install --with docs, devPoetry will either use an existing environment or will create a new one.
Check the docs for examples and usage.