PLUTO
4.4-patch2
|
Ordinary differential equation solvers. More...
#include "pluto.h"
Functions | |
void | ODE_Solve (double *y0, int nvar, double xbeg, double xend, double dx, void(*rhs)(double, double *, double *), int method) |
void ODE_Solve | ( | double * | y0, |
int | nvar, | ||
double | xbeg, | ||
double | xend, | ||
double | dx, | ||
void(*)(double, double *, double *) | rhs, | ||
int | method | ||
) |
Main driver for the numerical integration of a system of standard ordinary differential equations (ODEs) of the type
where x is the independent variable and y[] is a vector of unknowns.
[in,out] | y0 | on input, y0 is an array containing the initial condition at x=xbeg; on output it is replaced by the value of the function at x=xend |
[in] | nvar | an integer number specifying the number of variable (i.e. the dimension of y0[]) |
[in] | xbeg | the initial integration point |
[in] | xend | the final integration point |
[in] | dx | the initial (suggested) step size |
[in] | rhs | a pointer to a function of the form rhs(x,*y,*f) giving the right hand side ![]() |
[in] | method | an integer specifying the integration algorithm. Possible choices are ODE_RK2 (fixed step size, 2nd order Runge-Kutta), ODE_RK4 (fixed step size, 4th order Runge-Kutta), ODE_CK45 (adaptive step size, 5th order Cash-Karp algorithm). |