Mathematics Source Library
C & ASM


Gragg - Bulirsch-Stoer Method

Gragg-Bulirsch-Stoer Method

The Bulirsch-Stoer method is an adaptive method which uses Gragg's modified midpoint method to estimate the solution of an initial value problem for various step sizes. The estimates are fit to a "diagonal" rational function as a function of the step size and the limit as the step size tends to zero is taken as the final estimate. This technique can be extremely useful especially in the neighborhood of poles or other singularities.

Function List

  • int Gragg_Bulirsch_Stoer( double (*f)(double, double), double y[ ], double x0, double h, double *h_next, double epsilon )

    This function uses the GBS method to return the estimate of the solution of the initial value problem, y' = f(x,y); y = y[0] when x = x0, at x0 + h. Upon returning h_next contains the estimated step size so that the final answer is within epsilon of the actual solution at x = x0 + h, this value of h_next can be used as the initial step size h in the subsequent call to this function. On input, y[0] is the value of y(x) at x = x0 and on output y[1] is the value of y(x) at x = x0 + h. This function returns a 0 if a solution was found, -1 if the method failed to converge, and -2 if an attempt was made to divide by zero.

C Source Code

  • The file, bulirsch_stoer.c, contains the version of Gragg_Bulirsch_Stoer( ) written in C.