next up previous contents
Next: Integ_Trap Up: Miscellaneous Previous: odeint   Contents

Subsections

Runge_Kutta4

Syntax

void Runge_Kutta4(ReturnMatrix (*xdot)(Real time, const Matrix & xin),
                  const Matrix & xo, 
                  Real to, 
                  Real tf, 
                  int nsteps,
                  RowVector & tout, 
                  Matrix & xout);

Description

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

using a fixed step size $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 nsteps. After the function call, tout is set as
$\displaystyle \left[\begin{array}{cccc} t_0 & t_1 & \cdots & t_{nsteps} \end{array}\right]$     (2.80)

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

Return Value

None (tout and xout are modified on output)



Richard Gourdeau 2004-07-06