Go to the first, previous, next, last section, table of contents.

Stepping Functions

The lowest level components are the stepping functions which advance a solution from time @math{t} to @math{t+h} for a fixed step-size @math{h} and estimate the resulting local error.

Function: gsl_odeiv_step * gsl_odeiv_step_alloc (const gsl_odeiv_step_type * T, size_t dim)
This function returns a pointer to a newly allocated instance of a stepping function of type T for a system of dim dimensions.

Function: int gsl_odeiv_step_reset (gsl_odeiv_step * s)
This function resets the stepping function s. It should be used whenever the next use of s will not be a continuation of a previous step.

Function: void gsl_odeiv_step_free (gsl_odeiv_step * s)
This function frees all the memory associated with the stepping function s.

Function: const char * gsl_odeiv_step_name (const gsl_odeiv_step * s)
This function returns a pointer to the name of the stepping function. For example,

printf("step method is '%s'\n",
        gsl_odeiv_step_name (s));

would print something like step method is 'rk4'.

Function: unsigned int gsl_odeiv_step_order (const gsl_odeiv_step * s)
This function returns the order of the stepping function on the previous step. This order can vary if the stepping function itself is adaptive.

Function: int gsl_odeiv_step_apply (gsl_odeiv_step * s, double t, double h, double y[], double yerr[], const double dydt_in[], double dydt_out[], const gsl_odeiv_system * dydt)
This function applies the stepping function s to the system of equations defined by dydt, using the step size h to advance the system from time t and state y to time t+h. The new state of the system is stored in y on output, with an estimate of the absolute error in each component stored in yerr. If the argument dydt_in is not null it should point an array containing the derivatives for the system at time t on input. This is optional as the derivatives will be computed internally if they are not provided, but allows the reuse of existing derivative information. On output the new derivatives of the system at time t+h will be stored in dydt_out if it is not null.

The following algorithms are available,

Step Type: gsl_odeiv_step_rk2
Embedded 2nd order Runge-Kutta with 3rd order error estimate.

Step Type: gsl_odeiv_step_rk4
4th order (classical) Runge-Kutta.

Step Type: gsl_odeiv_step_rkf45
Embedded 4th order Runge-Kutta-Fehlberg method with 5th order error estimate. This method is a good general-purpose integrator.

Step Type: gsl_odeiv_step_rkck
Embedded 4th order Runge-Kutta Cash-Karp method with 5th order error estimate.

Step Type: gsl_odeiv_step_rk8pd
Embedded 8th order Runge-Kutta Prince-Dormand method with 9th order error estimate.

Step Type: gsl_odeiv_step_rk2imp
Implicit 2nd order Runge-Kutta at Gaussian points

Step Type: gsl_odeiv_step_rk4imp
Implicit 4th order Runge-Kutta at Gaussian points

Step Type: gsl_odeiv_step_bsimp
Implicit Bulirsch-Stoer method of Bader and Deuflhard.

Step Type: gsl_odeiv_step_gear1
M=1 implicit Gear method

Step Type: gsl_odeiv_step_gear2
M=2 implicit Gear method


Go to the first, previous, next, last section, table of contents.