/* nag_ode_bvp_fd_nonlin_gen(d02rac) Example Program * * Copyright 1992 Numerical Algorithms Group. * * Mark 3, 1992. * Mark 7 revised, 2001. * */ #include #include #include #include #ifdef __cplusplus extern "C" { #endif static void fcn(Integer neq, double x, double eps, double y[], double f[], Nag_User *comm); static void g(Integer neq, double eps, double ya[], double yb[], double bc[], Nag_User *comm); static void jaceps(Integer neq, double x, double eps, double y[], double f[], Nag_User *comm); static void jacgep(Integer neq, double eps, double ya[], double yb[], double bcep[], Nag_User *comm); static void jacobf(Integer neq, double x, double eps, double y[], double f[], Nag_User *comm); static void jacobg(Integer neq, double eps, double ya[], double yb[], double aj[], double bj[], Nag_User *comm); #ifdef __cplusplus } #endif #define NEQ 3 #define MNP 40 int main(void) { Integer i, j; double x[MNP], y[NEQ][MNP]; Integer np; double deleps; Integer numbeg, nummix; double abt[NEQ]; double tol; Integer neq, mnp; Nag_User comm; Vprintf("d02rac Example Program Results\n"); Vprintf("\nCalculation using analytic Jacobians\n\n"); neq = NEQ; mnp = MNP; tol = 1.0e-4; np = 17; numbeg = 2; nummix = 0; x[0] = 0.0; x[np-1] = 10.0; deleps = 0.1; d02rac(neq, &deleps, fcn, numbeg, nummix, g, Nag_DefInitMesh, mnp, &np, x, &y[0][0], tol, abt, jacobf, jacobg, jaceps, jacgep, &comm, NAGERR_DEFAULT); Vprintf("Solution on final mesh of %ld points \n", np); Vprintf(" X Y(1) Y(2) Y(3)\n"); for (j=0; j< np; ++j) { Vprintf(" %9.3f ", x[j]); for (i=0; i