Given y′=x+y,y(0)=1,h=0.05,y(0.1)=?
Here, x0=0,y0=1,h=0.05,xn=0.1
y′=x+y∴f(x,y)=x+y
Modified Euler method
ym+1=ym+hf(xm+21h,ym+21hf(xm,ym))f(x0,y0)=f(0,1)=11x0+21h=0+20.05=0.0251y0+21hf(x0,y0)=1+20.05⋅1=1.025f(x0+21h,y0+21hf(x0,y0)=f(0.025,1.025)=1.05∴y(0.05)=1.0525
Again taking (x1,y1) in place of (x0,y0) and repeat the process
f(x1,y1)=f(0.05,1.0525)=1.1025x1+21h=0.05+20.05=0.075y1+21hf(x1,y1)=1.0525+20.05⋅1.1025=1.0801f(x1+21h,y1+21hf(x1,y1)=f(0.075,1.0801)=1.1551y2=y1+hf(x1+21h,y1+21hf(x1,y1))=1.0525+0.05⋅1.1551=1.1103∴y(0.1)=1.1103
Comments
Leave a comment