x(n+1)=x(n)+(h/2)*[3*f(n)-f(n-1)] with f(n)=f(t(n),x(n))
Draw graphs of solutions: y'=-y, y(0)=1 or y''=-y y(0)=0;y'(0)=1 itp (y_1 take as a solution or compute by Heun method).y'=ay, y(0)=1, x_1=exp(ah) : a=1,-1.,1
for T=0.1,1,10,100. (using the method of halving the step i.e. compute e(T,h)/e(T,h/2) for e(t,h)=||x(T,h)-sol(T)||; x(t,h) approximation of the soultion sol(T) computed by the scheme using the step h) Take different x_1: e.g. x_1=exp(ah), x_1 computed by Heun or explicit Euler: x_1=x_0+h*f(t_0,x_0). Do you see any difference?y(n+1)=y(n)+ 0.5h*(f(n)+f(t(n+1),y(n)+hf(n))
and modified Eulera schemesy(n+1)=y(n)+ h*f(t(n)+0.5h,y(n)+0.5hf(n))
on the IVP:y'=-sin(y), y(0)=0, y'(0)=1.
x^{k+1}=x(n)+h*f(x^k,t^k+h) (if x^{k+1}=x^k then x^k=x_(n+1)) for x^0=x(n)+hf(n) (predictor ex. Euler)
- no of nonlinear iterations M should be a parameter - test for M=1,2,3 -It can be written with a stopping criteria like |x^{k+1}-x(n)-h*f(x^k,t^k+h)|<= h or <= x(n)*h or preset no of iterations e.g. one or two or three.x(n+1)=x(n)+(h/12)*(5*f(n+1)+8*f(n)-f(n-1)) with f(n)=f(t(n),x(n))
x(n+1)=x(n)+(h/12)*[23*f(n)-16*f(n-1)+5*f(n-2)] with f(n)=f(t(n),x(n))
x(1),x(2) may be computed by Heun scheme (order 2) - or substitute x(t0+h) x(t0+2h) with x(t) the solution of IVP.y'=ay y(0)=1; (penduulum equations) y''=-y (linear) or y''=-sin(y) with y(0)=1 y'(0)=0.
y(n+1)=x(n)+ 0.5h*(f(n)+f(t(n+1),x(n)+hf(n))
and then substitute y(n) into (replacing x(n+1) in the rhs of the trapezoid scheme i.e. we getx(n+1)=x(n)+0.5 h(f(n)+f(t(n+1),y(n+1)).
Then test the convergence order for y'=ay a=1,-1, y(0)=1 on [0,1] and [0,10] - starting with N=20.