#include #include // max problem dimension: #define MAX_DIM 2 #include "integrate.c" #include "analytic_jacob.c" #include "result.c" int main (void) { FILE *result_file; int i; int dim = 2; // current problem dimension // times defining the observation windows: double t [] = {0.0, 1.0e-5, 1.0e-4, 1.0e-3, 1.0e-2, 1.0e-1, 1.0, 1.0e+1, 1.0e+2, 1.0e+3, 1.0e+4, 1.0e+5, 1.0e+6, 1.0e+7, 1.0e+8, 1.0e+9 }; // tunable parameters: double h_min = 0.001, h_max = 1.0e20, tol_rel = 0.01, tol_abs = 0.0001; // initial point: double x_ [2] = { 0.0, 1.0 }; if ((result_file = fopen ("a.dat","w")) == NULL) return 0; for (i = 1; i < sizeof (t) / sizeof (t [0]); i++) { // integration of sample problem using... // ...an analytically computed jacobian matrix if (!IntegrationStep (AnalyticJacob, dim, t [i-1], t [i] - t [i-1], h_min, h_max, tol_rel, tol_abs, x_, result_file)) (void) printf ("ERROR\n"); (void) printf ("%20.5f %10.7f %10.7f\n", t [i], x_[0], x_[1]); } (void) fclose (result_file); return 1; } // end main