#include #include #include "DynamicalSystem.h" DynamicalSystem::DynamicalSystem(int n) { NVariable=n; Precision=1.e-4; Hmin=0.; Hestimate=1.e-1; // // private var // } //============================================================== void DynamicalSystem::nrerror(char * error_text) { cerr<<"Numerical Recipes run-time error : "< ERRCON ? SAFETY*h*exp(PGROW*log(errmax)) : 4.0*h); break; } h=SAFETY*h*exp(PSHRNK*log(errmax)); } for (i=0;i x1) ? fabs(h1) : -fabs(h1); *nok = (*nbad) = 0; for (i=0;i 0.0) h=x2-x; rkqc(y,dydx,&x,h,eps,yscal,&hdid,&hnext); if (hdid == h) ++(*nok); else ++(*nbad); if ((x-x2)*(x2-x1) >= 0.0) { for (i=0;i