#include "stuff.h" /* Given values for variables y[0..M-1] at x, this function implements */ /* a fourth order RK scheme to advance them to yout[0..M-1] over */ /* a step size dx. */ /* Need to supply a function f which computes the RHS of the /* equations dy_i/dx=f_i(x,y) and returns the dy[M] vector i=0..M-1 #define M 2 void rk4(double y[], double yout[], double x, double dx){ double k1[M],k2[M],k3[M],k4[M]; double yt[M],dy[M]; int i; f(x,y,dy); for(i=0;i