#include #include #include "dopri5.h" #define ndgl 1 #define nrdens 1 #define licont nrdens void func (unsigned n, double x, double *y, double *f) { f[0] = -y[0]; } void solout (long nr, double xold, double x, double* y, unsigned n, int* irtrn) { static double xout,y1; if (nr>1) printf ("step=%d x=%9.3e h=%9.3e\n",nr-1, xRead(),hRead()); } /* solout */ int main (void) { double y[ndgl]; unsigned icont[licont], i; int res, iout, itoler; double x, xend, atoler, rtoler; iout = 1; x = 0.0; y[0] = 1.0; xend = 1.0; itoler = 0; rtoler = 1.0E-7; atoler = rtoler; icont[0] = 0; res = dopri5 (ndgl, func, x, y, xend, &rtoler, &atoler, itoler, solout, iout, stdout, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, nrdens, NULL, licont); return 0; } /* main */