90 likes | 195 Vues
Improvements of Euler’s Method Heun’s Method Used to improve the estimate of the slope by taking the average of two derivatives , one at initial point and another at end point (predictor – corrector) approach. Predictor Corrector. EX Use Heun’s Method to solve y’=4e^(0.8x)-0.5y
E N D
Improvements of Euler’s Method • Heun’s Method • Used to improve the estimate of the slope by taking the average of two derivatives , one at initial point and another at end point (predictor – corrector) approach. • Predictor • Corrector
EXUse Heun’s Method to solve y’=4e^(0.8x)-0.5y from x=0 to x=4 with h=1 Y=2 Solu Slope=(Xo,Yo)=Yo’=f(0,2)=0.4e^0-0.5(2)=4 – 1 =3 Y1=2+3(1) Y1=f(x1,y1)=4e^0.8x-0.5(5)=6.402 Y’=(3+6.402)/2=4.701 Y1=2+4.701(1)=6.701
Runge-Kutta Methods (RK) They achieve the accuracy of aTaylor series without requiring higher derivatives Increment function (slope over the interval) an constants kn f(xi,yi)
2nd-Order RK method Yi+1=yi + (a1k1+a2k2)h Where K1=f(xi,yi) K2=f(xi+p1h1yi+a1k1h)
a1+a2=1 …. equ1 a2p1 = ½ ….equ2 a2q11=1/2 ….equ3 4 unknowns : a1,a2,p1,q11 Assume a2 a1=1-a2 P1=q11=1/2a2
Cases of a2 ***a2=1/2 : Heun Method with a single corrector a1=1-a2=1-1/2=1/2 P1=q11=1/(2a2)=1/2(1/2)=1 Yi+1=Yi+(a1k1+a2k2)h Yi+1=Yi+(1/2k1+1/2k2)h Where k1=f(xi,yi) … slope at start of interval K2=f(xi+h,yi+k1h) … slope at end of interval
***a2=1 …. Midpoint method A1=1-a2=1-1=0 P1=q11=1/(2a2)=1/2(1)=1/2 Yi+1=Yi+k2h Where k1=f(xi,yi) K2=f(xi+1/2h,yi+1/2k1h)
*** a2=2/3 …. Ralston’s Method A1=1-a2=1-2/3=1/3 P1=q11=1/(2a2)=1/2(2/3)=3/4 Yi+1=Yi+(1/3ki+2/3k2)h Where k1=f(xi,yi) K2=f(xi+3/4h,yi+3/4k1h)