Given y′=y−x,y(0)=0.5,h=0.1,y(0.2)=?
Here, x0=0,y0=0.5,h=0.1,xn=0.2
y′=y−x∴f(x,y)=y−x
Modified Euler method
ym+1=ym+hf(xm+21h,ym+21hf(xm,ym))x0+21h=0+20.1=0.05y0+21hf(x0,y0)=0.5+20.1⋅0.5=0.525f(x0+21h,y0+21hf(x0,y0)=f(0.05,0.525)=0.475
y1=y0+hf(x0+21h,y0+21hf(x0,y0))=0.5+0.1⋅0.475=0.5475∴y(0.1)=0.5475
Again taking (x1,y1) in place of (x0,y0) and repeat the process
f(x1,y1)=f(0.1,0.5475)=0.4475x1+21h=0.1+20.1=0.15y1+21hf(x1,y1)=0.5475+20.1⋅0.4475=0.5699f(x1+21h,y1+21hf(x1,y1)=f(0.15,0.5699)=0.4199y2=y1+hf(x1+21h,y1+21hf(x1,y1))=0.5475+0.1⋅0.4199=0.5895∴y(0.2)=0.5895
Comments