next up previous contents
Next: Runge_Kutta4 Up: Miscellaneous Previous: Miscellaneous   Contents

Subsections

odeint

Syntax

void odeint(ReturnMatrix (*xdot)(Real time, const Matrix & xin),
            Matrix & xo, 
            Real to, 
            Real tf, 
            Real eps, 
            Real h1, 
            Real hmin,
            int & nok, 
            int & nbad,
            RowVector & tout, 
            Matrix & xout, 
            Real dtsav);

Description

This function performs the numerical integration of
$\displaystyle \dot{\mbox{\boldmath$ x $}}$ $\textstyle =$ $\displaystyle \mbox{\boldmath$ f $}(\mbox{\boldmath$ x $}(t),t)$ (2.76)

using an adaptive step size based on $4^{th}$ order Runge-Kutta scheme. It carries out the integration of xdot with the initial conditions given by xo, from time to to tf with accuracy eps saving the results at dtsav increments. After the function call, tout is set as
$\displaystyle \left[\begin{array}{cccc} t_0 & t_1 & \cdots & t_{nsteps} \end{array}\right]$     (2.77)

xout as
$\displaystyle \left[\begin{array}{cccc} \mbox{\boldmath$ x $}_0 & \mbox{\boldmath$ x $}_1 & \cdots & \mbox{\boldmath$ x $}_{nsteps} \end{array}\right]$     (2.78)

xo as $\mbox{\boldmath$ x $}_{nsteps}$, nok and nbad to the number of good and bad steps taken. The function odeint is adapted from [17].

Return Value

None (xo, tout and xout are modified on output)



Richard Gourdeau 2004-07-06