/* nag_ode_bvp_fd_nonlin_fixedbc(d02gac) 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 y[], double f[], Nag_User *comm); #ifdef __cplusplus } #endif #define NEQ 3 #define MNP 40 int main(void) { double a, b; Integer i, j, k; double u[NEQ][2], x[MNP], y[NEQ][MNP]; Integer v[NEQ][2]; Integer np; double tol; static NagError fail; Integer neq, mnp; double beta; Nag_User comm; Vprintf("d02gac Example Program Results\n"); /* For communication with function fcn() * assign address of beta to comm.p. */ comm.p = (Pointer)β neq = NEQ; mnp = MNP; tol = 0.001; np = 26; a = 0.0; b = 10.0; beta = 0.0; for (i=0; ip; f[0] = y[1]; f[1] = y[2]; f[2] = -y[0] * y[2] - *beta * (1.0-y[1]*y[1]); }