next up previous contents
Next: Errors Up: GRASP Routines: Waveforms from Previous: Function: integrate_function()   Contents

Function: integrateODE()

0 int integrateODE(float ystart[], int nvar, float *x1, float x2, float eps, float h1, float hmin, void (*derivs)(float x, float *y, float *dy))
Integrate a set of ordinary, coupled first order differential equations from $x_1$ to $x_2$. On return all the variables are set up, so that only a new value of $x_2$ has to be given to continue integration.
ystart: Input/Output. Contains the initial values for input and the calculated solution as output.
nvar: Input. The number of equations.
x1: Input/Output. The starting value. Becomes $x_2$ on return.
x2: Input. The final value.
eps: Input. The desired accuracy as discussed in chapter 16.2 of [1].
h1: Input. The initial step size.
hmin: Input. The smallest allowed step size.
derivs: Input. A function describing the ode's. derivs(x, y, dy) should set dy according to dy $= \frac{dy}{dx}= F(x,y)$.
Return value: Output. Returns $0$ if there was no error, and an error code otherwise. These codes are described in Section [*].
Author: Serge Droz, droz@physics.uoguelph.ca
Comments: You have to use Numerical Recipe notation, i.e. the first element in an array x is x[1] and not x[0]. See the program Lorenz for an example.


next up previous contents
Next: Errors Up: GRASP Routines: Waveforms from Previous: Function: integrate_function()   Contents
Bruce Allen 2000-11-19