This tutorial explains how to use the ACADO integrators stand-alone for the simulation of Dynamic Systems. In the current release several Runge-Kutta and a BDF integrator are available. The BDF integrator can also be used for the simulation of differential algebraic systems. All integrators allow first and second order sensitivity generation based on internal numerical or on internal automatic differentiation.
We start by integrating a very simple test ODE of the form dx(t) / dt = -x(t) with t ∈ [0,1]. The explicit solution at the time t = 1 is given by x(1) = 1/e. Now, the standard way to integrate this differential equation with ACADO Toolkit reads as follows:
Compiling and running the above piece of code leads to the following output:
i.e. the Runge Kutta integrator needs 6 steps to obtain the result. The accuracy of the result depends of course on the tolerance options. How these options can be specified is explained below.
In order to obtain the result of the integration for example the following routine can be used:
Please note that the above tutorial code makes use of the ACADO matrix vector class, i.e. the result is stored in ACADO vector format. It is of course also possible to write the result into a simple " double* ". For this aim, the double pointer must be allocated with the correct dimension (here the dimension of the right-hand-side function f):
work in progress
Next example: Sensitivity Generation for Dynamic Systems