#include "chapter9.cpp"

typedef float runtype;
typedef std::vector<runtype> Array;

void main()
{
ofstream outfile1("taylor_sys1.txt");
	const int nsteps = 100;
	const runtype a = 0.0, b = 1.0;
	runtype x, y;

	x = 1.0;
	y = 0.0;

	outfile1 <<"   0  t = " << setw(10)<< a <<"  x =";
	outfile1 << setw(10)<< x << "  y =" << setw(10) << y<< endl;
	taysys1(outfile1,a,b,nsteps,x,y);
 
ofstream outfile2("taylor_sys2.txt");
	int n = 2;
	taysys2(outfile2, a, b, n, nsteps);
 
ofstream outfile3("rk4_sys1.txt");
	Array X(n+1, 0.0);
	runtype h;
  
	X[0] = 0.0; /* dummy */
	X[1] = 1.0;
	X[2] = 0.0;
	h = (b - a) / nsteps;
	rk4sys(outfile3, n, h, X, nsteps);

ofstream outfile4("amrk.txt");
	n = 5;

	X[0] = 1.0;
	X[1] = 2.0;
	X[2] = -4.0;
	X[3] = -2.0;
	X[4] = 7.0;
	X[5] = 6.0;
	h = (b - a)/nsteps;
	amrk(outfile4, n, h, X, nsteps);
}
