1 /* ode-initval/test_odeiv.c
3 * Copyright (C) 2004 Tuomo Keskitalo
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 /* Some functions and tests based on test.c by G. Jungman.
28 #include <gsl/gsl_test.h>
29 #include <gsl/gsl_errno.h>
30 #include <gsl/gsl_math.h>
31 #include <gsl/gsl_matrix.h>
32 #include <gsl/gsl_linalg.h>
33 #include <gsl/gsl_ieee_utils.h>
34 #include <gsl/gsl_odeiv.h>
35 #include "odeiv_util.h"
37 /* Maximum number of ODE equations */
40 /* RHS for f=2. Solution y = 2 * t + t0 */
43 rhs_linear (double t, const double y[], double f[], void *params)
51 jac_linear (double t, const double y[], double *dfdy, double dfdt[],
60 gsl_odeiv_system rhs_func_lin = {
67 /* RHS for f=y. Equals y=exp(t) with initial value y(0)=1.0 */
70 rhs_exp (double t, const double y[], double f[], void *params)
78 jac_exp (double t, const double y[], double *dfdy, double dfdt[],
87 gsl_odeiv_system rhs_func_exp = {
94 /* RHS for f0 = -y1, f1 = y0
95 equals y = [cos(t), sin(t)] with initial values [1, 0]
99 rhs_sin (double t, const double y[], double f[], void *params)
108 jac_sin (double t, const double y[], double *dfdy, double dfdt[],
122 gsl_odeiv_system rhs_func_sin = {
129 /* Sine/cosine with random failures */
132 rhs_xsin (double t, const double y[], double f[], void *params)
138 if (n > 40 && n < 65) {
151 jac_xsin (double t, const double y[], double *dfdy, double dfdt[],
158 if (n > 50 && n < 55) {
180 gsl_odeiv_system rhs_func_xsin = {
188 /* RHS for classic stiff example
189 dy0 / dt = 998 * y0 + 1998 * y1 y0(0) = 1.0
190 dy1 / dt = -999 * y0 - 1999 * y1 y1(0) = 0.0
193 y0 = 2 * exp(-t) - exp(-1000 * t)
194 y1 = - exp(-t) + exp(-1000 * t)
198 rhs_stiff (double t, const double y[], double f[], void *params)
200 f[0] = 998.0 * y[0] + 1998.0 * y[1];
201 f[1] = -999.0 * y[0] - 1999.0 * y[1];
207 jac_stiff (double t, const double y[], double *dfdy, double dfdt[],
221 gsl_odeiv_system rhs_func_stiff = {
228 /* van Der Pol oscillator:
230 f1 = -y0 + mu * y1 * (1 - y0^2) y1(0) = 0.0
234 rhs_vanderpol (double t, const double y[], double f[], void *params)
236 const double mu = 10.0;
239 f[1] = -y[0] + mu * y[1] * (1.0 - y[0]*y[0]);
245 jac_vanderpol (double t, const double y[], double *dfdy, double dfdt[],
248 const double mu = 10.0;
252 dfdy[2] = -2.0 * mu * y[0] * y[1] - 1.0;
253 dfdy[3] = mu * (1.0 - y[0] * y[0]);
261 gsl_odeiv_system rhs_func_vanderpol = {
268 /* The Oregonator - chemical Belusov-Zhabotinskii reaction
269 y0(0) = 1.0, y1(0) = 2.0, y2(0) = 3.0
273 rhs_oregonator (double t, const double y[], double f[], void *params)
275 const double c1=77.27;
276 const double c2=8.375e-6;
277 const double c3=0.161;
279 f[0] = c1 * (y[1] + y[0] * (1 - c2 * y[0] - y[1]));
280 f[1] = 1/c1 * (y[2] - y[1] * (1 + y[0]));
281 f[2] = c3 * (y[0] - y[2]);
287 jac_oregonator (double t, const double y[], double *dfdy, double dfdt[],
290 const double c1=77.27;
291 const double c2=8.375e-6;
292 const double c3=0.161;
294 dfdy[0] = c1 * (1 - 2 * c2 * y[0] - y[1]);
295 dfdy[1] = c1 * (1 - y[0]);
298 dfdy[3] = 1/c1 * (-y[1]);
299 dfdy[4] = 1/c1 * (-1 - y[0]);
313 gsl_odeiv_system rhs_func_oregonator = {
320 /* Volterra-Lotka predator-prey model
322 f0 = (a - b * y1) * y0 y0(0) = 3.0
323 f1 = (-c + d * y0) * y1 y1(0) = 1.0
327 rhs_vl (double t, const double y[], double f[], void *params)
329 const double a = 1.0;
330 const double b = 1.0;
331 const double c = 1.0;
332 const double d = 1.0;
334 f[0] = (a - b * y[1]) * y[0];
335 f[1] = (-c + d * y[0]) * y[1];
341 jac_vl (double t, const double y[], double *dfdy, double dfdt[],
344 const double a = 1.0;
345 const double b = 1.0;
346 const double c = 1.0;
347 const double d = 1.0;
349 dfdy[0] = a - b * y[1];
352 dfdy[3] = -c + d * y[0];
360 gsl_odeiv_system rhs_func_vl = {
367 /* Stiff trigonometric example
369 f0 = -50 * (y0 - cos(t)) y0(0) = 0.0
373 rhs_stifftrig (double t, const double y[], double f[], void *params)
375 f[0] = -50 * (y[0] - cos(t));
381 jac_stifftrig (double t, const double y[], double *dfdy, double dfdt[],
386 dfdt[0] = -50 * sin(t);
391 gsl_odeiv_system rhs_func_stifftrig = {
398 /* E5 - a stiff badly scaled chemical problem by Enright, Hull &
399 Lindberg (1975): Comparing numerical methods for stiff systems of
400 ODEs. BIT, vol. 15, pp. 10-48.
402 f0 = -a * y0 - b * y0 * y2 y0(0) = 1.76e-3
403 f1 = a * y0 - m * c * y1 * y2 y1(0) = 0.0
404 f2 = a * y0 - b * y0 * y2 - m * c * y1 * y2 + c * y3 y2(0) = 0.0
405 f3 = b * y0 * y2 - c * y3 y3(0) = 0.0
409 rhs_e5 (double t, const double y[], double f[], void *params)
411 const double a = 7.89e-10;
412 const double b = 1.1e7;
413 const double c = 1.13e3;
414 const double m = 1.0e6;
416 f[0] = -a * y[0] - b * y[0] * y[2];
417 f[1] = a * y[0] - m * c * y[1] * y[2];
418 f[3] = b * y[0] * y[2] - c * y[3];
425 jac_e5 (double t, const double y[], double *dfdy, double dfdt[],
428 const double a = 7.89e-10;
429 const double b = 1.1e7;
430 const double c = 1.13e3;
431 const double m = 1.0e6;
433 dfdy[0] = -a - b * y[2];
439 dfdy[5] = -m * c * y[2];
440 dfdy[6] = -m * c * y[1];
443 dfdy[8] = a - b * y[2];
444 dfdy[9] = -m * c * y[2];
445 dfdy[10] = -b * y[0] - m * c * y[1];
461 gsl_odeiv_system rhs_func_e5 = {
469 test_odeiv_stepper (const gsl_odeiv_step_type *T, const gsl_odeiv_system *sys,
470 const double h, const double t, const char desc[],
471 const double ystart[], const double yfin[],
474 /* tests stepper T with one fixed length step advance of system sys
475 and compares with given values yfin
478 double y[MAXEQ] = {0.0};
479 double yerr[MAXEQ] = {0.0};
480 size_t ne = sys->dimension;
483 gsl_odeiv_step *step = gsl_odeiv_step_alloc (T, ne);
485 DBL_MEMCPY (y, ystart, MAXEQ);
488 int s = gsl_odeiv_step_apply (step, t, h, y, yerr, 0, 0, sys);
489 if (s != GSL_SUCCESS)
491 gsl_test(s, "test_odeiv_stepper: %s step_apply returned %d", desc, s);
495 for (i = 0; i < ne; i++)
497 gsl_test_rel (y[i], yfin[i], relerr,
499 gsl_odeiv_step_name (step), desc,i);
502 gsl_odeiv_step_free (step);
506 test_stepper (const gsl_odeiv_step_type *T)
508 /* Tests stepper T with a step of selected systems */
510 double y[MAXEQ] = {0.0};
511 double yfin[MAXEQ] = {0.0};
516 /* Required tolerance */
523 yfin[0] = y[0] + 2 * h;
524 test_odeiv_stepper (T, &rhs_func_lin, h, 0.0, "linear",
525 y, yfin, err_target);
531 yfin[0] = exp(2.7 + h);
532 test_odeiv_stepper (T, &rhs_func_exp, h, 2.7, "exponential",
533 y, yfin, err_target);
539 yfin[0] = cos(1.2 + h);
540 yfin[1] = sin(1.2 + h);
541 test_odeiv_stepper (T, &rhs_func_sin, h, 1.2, "cosine-sine",
542 y, yfin, err_target);
551 const double e1 = exp (-h);
552 const double e2 = exp (-1000.0 * h);
553 yfin[0] = 2.0 * e1 - e2;
557 test_odeiv_stepper (T, &rhs_func_stiff, h, 0.0, "classic_stiff",
558 y, yfin, err_target);
562 test_evolve_system (const gsl_odeiv_step_type * T,
563 const gsl_odeiv_system * sys,
564 double t0, double t1, double hstart,
565 double y[], double yfin[],
566 double err_target, const char *desc)
568 /* Tests system sys with stepper T. Step length is controlled by
569 error estimation from the stepper.
578 /* Tolerance factor in testing errors */
579 const double factor = 10;
581 gsl_odeiv_step * step = gsl_odeiv_step_alloc (T, sys->dimension);
583 gsl_odeiv_control *c =
584 gsl_odeiv_control_standard_new (err_target, err_target, 1.0, 0.0);
586 gsl_odeiv_evolve *e = gsl_odeiv_evolve_alloc (sys->dimension);
590 int s = gsl_odeiv_evolve_apply (e, c, step, sys, &t, t1, &h, y);
592 if (s != GSL_SUCCESS && sys != &rhs_func_xsin)
594 gsl_test(s, "%s evolve_apply returned %d",
595 gsl_odeiv_step_name (step), s);
601 gsl_test(GSL_EFAILED,
602 "%s evolve_apply reached maxiter",
603 gsl_odeiv_step_name (step));
610 /* err_target is target error of one step. Test if stepper has made
611 larger error than (tolerance factor times) the number of steps
612 times the err_target */
614 for (i = 0; i < sys->dimension; i++)
616 gsl_test_abs (y[i], yfin[i], factor * e->count * err_target,
618 gsl_odeiv_step_name (step), desc, i);
621 gsl_odeiv_evolve_free (e);
622 gsl_odeiv_control_free (c);
623 gsl_odeiv_step_free (step);
627 sys_driver (const gsl_odeiv_step_type * T,
628 const gsl_odeiv_system * sys,
629 double t0, double t1, double hstart,
630 double y[], double epsabs, double epsrel,
633 /* This function evolves a system sys with stepper T from t0 to t1.
634 Step length is varied via error control with possibly different
635 absolute and relative error tolerances.
644 gsl_odeiv_step * step = gsl_odeiv_step_alloc (T, sys->dimension);
646 gsl_odeiv_control *c =
647 gsl_odeiv_control_standard_new (epsabs, epsrel, 1.0, 0.0);
648 gsl_odeiv_evolve *e = gsl_odeiv_evolve_alloc (sys->dimension);
652 s = gsl_odeiv_evolve_apply (e, c, step, sys, &t, t1, &h, y);
654 if (s != GSL_SUCCESS)
656 gsl_test(s, "sys_driver: %s evolve_apply returned %d",
657 gsl_odeiv_step_name (step), s);
663 gsl_test(GSL_EMAXITER,
664 "sys_driver: %s evolve_apply reached maxiter at t=%g",
665 gsl_odeiv_step_name (step), t);
673 gsl_test(s, "%s %s [%g,%g], %d steps completed",
674 gsl_odeiv_step_name (step), desc, t0, t1, steps);
676 gsl_odeiv_evolve_free (e);
677 gsl_odeiv_control_free (c);
678 gsl_odeiv_step_free (step);
684 test_compare_vanderpol (void)
686 /* Compares output of van Der Pol oscillator with several steppers */
688 /* system dimension */
691 const gsl_odeiv_step_type *steppers[20];
692 const gsl_odeiv_step_type **T;
694 /* Required error tolerance for each stepper. */
695 double err_target[20];
697 /* number of ODE solvers */
698 const size_t ns = 11;
700 /* initial values for each ode-solver */
702 double *yp = &y[0][0];
707 /* Parameters for the problem and stepper */
708 const double start = 0.0;
709 const double end = 100.0;
710 const double epsabs = 1e-8;
711 const double epsrel = 1e-8;
712 const double initstepsize = 1e-5;
716 steppers[0] = gsl_odeiv_step_rk2;
717 err_target[0] = 1e-6;
718 steppers[1] = gsl_odeiv_step_rk4;
719 err_target[1] = 1e-6;
720 steppers[2] = gsl_odeiv_step_rkf45;
721 err_target[2] = 1e-6;
722 steppers[3] = gsl_odeiv_step_rkck;
723 err_target[3] = 1e-6;
724 steppers[4] = gsl_odeiv_step_rk8pd;
725 err_target[4] = 1e-6;
726 steppers[5] = gsl_odeiv_step_rk2imp;
727 err_target[5] = 1e-5;
728 steppers[6] = gsl_odeiv_step_rk2simp;
729 err_target[6] = 1e-5;
730 steppers[7] = gsl_odeiv_step_rk4imp;
731 err_target[7] = 1e-6;
732 steppers[8] = gsl_odeiv_step_bsimp;
733 err_target[8] = 1e-7;
734 steppers[9] = gsl_odeiv_step_gear1;
735 err_target[9] = 1e-2;
736 steppers[10] = gsl_odeiv_step_gear2;
737 err_target[10] = 1e-6;
742 for (i = 0; i < ns; i++)
748 /* Call each solver for the problem */
754 int s = sys_driver (*T, &rhs_func_vanderpol,
755 start, end, initstepsize, &yp[i],
756 epsabs, epsrel, "vanderpol");
757 if (s != GSL_SUCCESS)
767 if (status != GSL_SUCCESS)
772 /* Compare results */
776 for (i = 0; i < ns; i++)
777 for (j = i+1; j < ns; j++)
778 for (k = 0; k < sd; k++)
780 const double val1 = yp[sd * i + k];
781 const double val2 = yp[sd * j + k];
782 gsl_test_abs (val1, val2,
783 ( GSL_MAX(err_target[i], err_target[j]) ),
785 T[i]->name, T[j]->name);
791 test_compare_oregonator (void)
793 /* Compares output of the Oregonator with several steppers */
795 /* system dimension */
798 const gsl_odeiv_step_type *steppers[20];
799 const gsl_odeiv_step_type **T;
801 /* Required error tolerance for each stepper. */
802 double err_target[20];
804 /* number of ODE solvers */
807 /* initial values for each ode-solver */
809 double *yp = &y[0][0];
814 /* Parameters for the problem and stepper */
815 const double start = 0.0;
816 const double end = 360.0;
817 const double epsabs = 1e-8;
818 const double epsrel = 1e-8;
819 const double initstepsize = 1e-5;
823 steppers[0] = gsl_odeiv_step_rk2simp;
824 err_target[0] = 1e-6;
825 steppers[1] = gsl_odeiv_step_bsimp;
826 err_target[1] = 1e-6;
831 for (i = 0; i < ns; i++)
838 /* Call each solver for the problem */
844 int s = sys_driver (*T, &rhs_func_oregonator,
845 start, end, initstepsize, &yp[i],
846 epsabs, epsrel, "oregonator");
848 if (s != GSL_SUCCESS)
858 if (status != GSL_SUCCESS)
863 /* Compare results */
867 for (i = 0; i < ns; i++)
868 for (j = i+1; j < ns; j++)
869 for (k = 0; k < sd; k++)
871 const double val1 = yp[sd * i + k];
872 const double val2 = yp[sd * j + k];
873 gsl_test_rel (val1, val2,
874 ( GSL_MAX(err_target[i], err_target[j]) ),
876 T[i]->name, T[j]->name);
882 test_evolve_linear (const gsl_odeiv_step_type * T, double h, double err)
889 test_evolve_system (T, &rhs_func_lin, 0.0, 4.0, h, y, yfin, err,
894 test_evolve_exp (const gsl_odeiv_step_type * T, double h, double err)
901 test_evolve_system (T, &rhs_func_exp, 0.0, 2.0, h, y, yfin, err,
906 test_evolve_sin (const gsl_odeiv_step_type * T, double h, double err)
915 test_evolve_system (T, &rhs_func_sin, 0.0, 2.0, h, y, yfin, err,
920 test_evolve_xsin (const gsl_odeiv_step_type * T, double h, double err)
929 test_evolve_system (T, &rhs_func_xsin, 0.0, 2.0, h, y, yfin, err,
930 "sine[0,2] w/errors");
935 test_evolve_stiff1 (const gsl_odeiv_step_type * T, double h, double err)
944 double e1 = exp (-arg);
945 double e2 = exp (-1000.0 * arg);
946 yfin[0] = 2.0 * e1 - e2;
949 test_evolve_system (T, &rhs_func_stiff, 0.0, 1.0, h, y, yfin, err,
954 test_evolve_stiff5 (const gsl_odeiv_step_type * T, double h, double err)
963 double e1 = exp (-arg);
964 double e2 = exp (-1000.0 * arg);
965 yfin[0] = 2.0 * e1 - e2;
968 test_evolve_system (T, &rhs_func_stiff, 0.0, 5.0, h, y, yfin, err,
972 /* Test cases from Frank Reininghaus <frank78ac@googlemail.com> */
974 int rhs_stepfn (double t, const double * y, double * dydt, void * params) {
983 void test_stepfn (void) {
984 /* infinite loop for epsabs = 1e-18, but not for 1e-17 */
985 double epsabs = 1e-18;
986 double epsrel = 1e-6;
988 const gsl_odeiv_step_type * T = gsl_odeiv_step_rk2;
989 gsl_odeiv_step * s = gsl_odeiv_step_alloc (T, 1);
990 gsl_odeiv_control * c = gsl_odeiv_control_y_new (epsabs, epsrel);
991 gsl_odeiv_evolve * e = gsl_odeiv_evolve_alloc (1);
992 gsl_odeiv_system sys = {rhs_stepfn, 0, 1, 0};
1000 while (t < 2.0 && i < 1000000) {
1001 status = gsl_odeiv_evolve_apply (e, c, s, &sys, &t, 2, &h, &y);
1003 printf("i=%d status=%d t=%g h=%g y=%g\n", i, status, t, h, y);
1005 if (status != GSL_SUCCESS)
1011 gsl_test_abs(t, 2.0, 1e-16, "evolve step function, t (stepfn/rk2)");
1012 gsl_test_rel(y, 1.0, epsrel, "evolve step function, y (stepfn/rk2)");
1014 gsl_odeiv_evolve_free (e);
1015 gsl_odeiv_control_free (c);
1016 gsl_odeiv_step_free (s);
1019 int rhs_stepfn2 (double t, const double * y, double * dydt, void * params) {
1028 void test_stepfn2 (void) {
1029 /* infinite loop for epsabs = 1e-25, but not for 1e-24 */
1030 double epsabs = 1e-25;
1031 double epsrel = 1e-6;
1033 const gsl_odeiv_step_type * T = gsl_odeiv_step_rk2;
1034 gsl_odeiv_step * s = gsl_odeiv_step_alloc (T, 1);
1035 gsl_odeiv_control * c = gsl_odeiv_control_y_new (epsabs, epsrel);
1036 gsl_odeiv_evolve * e = gsl_odeiv_evolve_alloc (1);
1037 gsl_odeiv_system sys = {rhs_stepfn2, 0, 1, 0};
1046 while (t < 1.0 && i < 10000) {
1047 status = gsl_odeiv_evolve_apply (e, c, s, &sys, &t, 1.0, &h, &y);
1049 printf("i=%d status=%d t=%g h=%g y=%g\n", i, status, t, h, y);
1051 if (status != GSL_SUCCESS)
1057 gsl_test_abs(t, 1.0, 1e-16, "evolve big step function, t (stepfn2/rk2)");
1058 gsl_test_rel(y, 1e300, epsrel, "evolve big step function, y (stepfn2/rk2)");
1060 gsl_odeiv_evolve_free (e);
1061 gsl_odeiv_control_free (c);
1062 gsl_odeiv_step_free (s);
1065 int rhs_stepfn3 (double t, const double * y, double * dydt, void * params) {
1067 static int calls = 0;
1076 return (calls < 100000) ? GSL_SUCCESS : -999;
1080 void test_stepfn3 (void) {
1081 /* infinite loop for epsabs = 1e-26, but not for 1e-25 */
1082 double epsabs = 1e-26;
1083 double epsrel = 1e-6;
1085 const gsl_odeiv_step_type * T = gsl_odeiv_step_rkf45;
1086 gsl_odeiv_step * s = gsl_odeiv_step_alloc (T, 1);
1087 gsl_odeiv_control * c = gsl_odeiv_control_y_new (epsabs, epsrel);
1088 gsl_odeiv_evolve * e = gsl_odeiv_evolve_alloc (1);
1089 gsl_odeiv_system sys = {rhs_stepfn3, 0, 1, 0};
1098 while (t < 1.0 && i < 10000) {
1099 status = gsl_odeiv_evolve_apply (e, c, s, &sys, &t, 1.0, &h, &y);
1101 printf("i=%d status=%d t=%g h=%g y=%g\n", i, status, t, h, y);
1103 if (status != GSL_SUCCESS)
1109 gsl_test_abs(t, 1.0, 1e-16, "evolve big step function, t (stepfn3/rkf45)");
1110 gsl_test_rel(y, 1e300, epsrel, "evolve big step function, y (stepfn3/rkf45)");
1112 gsl_odeiv_evolve_free (e);
1113 gsl_odeiv_control_free (c);
1114 gsl_odeiv_step_free (s);
1117 int rhs_cos (double t, const double * y, double * dydt, void * params) {
1122 int jac_cos (double t, const double y[], double *dfdy, double dfdt[],
1131 /* Test evolution in negative direction */
1134 test_evolve_negative_h (const gsl_odeiv_step_type * T, double h, double err)
1136 /* Tolerance factor in testing errors */
1137 const double factor = 10;
1139 gsl_odeiv_step * step = gsl_odeiv_step_alloc (T, 1);
1140 gsl_odeiv_control * c = gsl_odeiv_control_standard_new (err, err, 1.0, 0.0);
1141 gsl_odeiv_evolve * e = gsl_odeiv_evolve_alloc (1);
1142 gsl_odeiv_system sys = {rhs_cos, jac_cos, 1, 0};
1148 double yfin = sin (t1);
1150 /* Make initial h negative */
1154 int status = gsl_odeiv_evolve_apply (e, c, step, &sys, &t, t1, &h, &y);
1156 if (status != GSL_SUCCESS)
1158 gsl_test(status, "%s evolve_apply returned %d for negative h",
1159 gsl_odeiv_step_name (step), status);
1164 gsl_test_abs (y, yfin, factor * e->count * err,
1165 "evolution with negative h (using %s)",
1166 gsl_odeiv_step_name (step));
1168 gsl_odeiv_evolve_free (e);
1169 gsl_odeiv_control_free (c);
1170 gsl_odeiv_step_free (step);
1180 const gsl_odeiv_step_type *type;
1185 p[0].type = gsl_odeiv_step_rk2;
1187 p[1].type = gsl_odeiv_step_rk4;
1189 p[2].type = gsl_odeiv_step_rkf45;
1191 p[3].type = gsl_odeiv_step_rkck;
1193 p[4].type = gsl_odeiv_step_rk8pd;
1195 p[5].type = gsl_odeiv_step_rk2imp;
1197 p[6].type = gsl_odeiv_step_rk2simp;
1199 p[7].type = gsl_odeiv_step_rk4imp;
1201 p[8].type = gsl_odeiv_step_bsimp;
1203 p[9].type = gsl_odeiv_step_gear1;
1205 p[10].type = gsl_odeiv_step_gear2;
1209 gsl_ieee_env_setup ();
1211 for (i = 0; p[i].type != 0; i++)
1213 test_stepper(p[i].type);
1216 for (i = 0; p[i].type != 0; i++)
1218 test_evolve_linear (p[i].type, p[i].h, 1e-10);
1219 test_evolve_exp (p[i].type, p[i].h, 1e-6);
1220 test_evolve_sin (p[i].type, p[i].h, 1e-8);
1221 test_evolve_xsin (p[i].type, p[i].h, 1e-8);
1222 test_evolve_stiff1 (p[i].type, p[i].h, 1e-7);
1223 test_evolve_stiff5 (p[i].type, p[i].h, 1e-7);
1224 test_evolve_negative_h (p[i].type, p[i].h, 1e-7);
1227 test_compare_vanderpol();
1228 test_compare_oregonator();
1234 exit (gsl_test_summary ());