/* nag_ode_ivp_rk_errass(d02pzc) Example Program * * Copyright 1992 Numerical Algorithms Group. * * Mark 3, 1992. * Mark 7 revised, 2001. * */ #include #include #include #include #include #include #ifdef __cplusplus extern "C" { #endif static void f(Integer neq, double t1, double y[], double yp[], Nag_User *comm); #ifdef __cplusplus } #endif #define NEQ 4 #define ZERO 0.0 #define ONE 1.0 #define THREE 3.0 #define ECC 0.7 int main(void) { double hstart, pi, tgot, tend,tol, tstart, twant; double errmax, terrmx; Integer neq, i; Nag_ErrorAssess errass; Nag_ODE_RK opt; Nag_User comm; Nag_RK_method method; static NagError fail; double thres[NEQ], ygot[NEQ], ypgot[NEQ], ystart[NEQ]; double ymax[NEQ], rmserr[NEQ]; Vprintf("d02pzc Example Program Results\n"); /* Set initial conditions and input for d02pvc */ neq = NEQ; pi = X01AAC; tstart = ZERO; ystart[0] = ONE - ECC; ystart[1] = ZERO; ystart[2] = ZERO; ystart[3] = sqrt((ONE+ECC)/(ONE-ECC)); tend = THREE*pi; for (i=0; i