Let f(x,y):dy/dx=x+y2
Part I: h=0.1x0=0 and y+0=1
By Runge kutta method of 4th order.
K1=hf(x0,y0)=0.1×f(0,1)=0.1×(0+12)=0.1K2=hf(x0+2h,y0+2k1=0.1f(0+20.1,21+0.1)0.1×(20.1+(22.1)2)=0.1×(0.05+(1.05)2)=0.1153
K3=hf(x0+2h,y0+2k2)=0.1×f(0+20.1,1+20.1153)=0.1×[20.1+(22.1153)2]=0.1169K4=hf(x0+h,y0+k3)=0.1×f(0+0.1,1+0.1169)=0.1[0.1+(1.1169)2]=0.1347
∴K=61(K1+2K2+2K3+K4)=61(0.1+0.1153×2+0.1169×2+0.1347)=0.1165
∴y=y0+k=1+0.1165=1.1165
∴ The correct value of y when x=0.1 is 1.1165
Part 2:
h=0.1,x=0.1&y1=1.1165k1=hf(x1,y1)=0.1f(0.1,1.1105)=0.1[0.1+(1.1165)2]=0.1347K2=hf(x1+2h,y1+2k1)=0.1×f(0.1+20.1,1.1165+20.1347)=0.1[0.15+(1.1838)2]0.1551K3=hf(x1+2h,y1+2k2)=0.1×f(0.1+20.1,1.1165+20.1551)=0.1×[0.15+(1.1941)2]=0.1576K4=hf(x1+h1,y1+k3)=0.1f(0.1+0.1,1.1165+0.1576)=0.1[0.2+(1.2741)2]=0.1823
K=61(k1+2k2+2k3+k4)=61(0.1347+2×0.1551+2×0.1576+0.1823)=0.1751∴y=y1+k=1.1165+0.1571=1.2736
K=61(k1+2k2+2k3+k4)=61(0.1347+2×0.1551+2×0.1576+0.1=0.1751
∴y=y1+k=1.1165+0.1571=1.2736
∴ The correct value of y when x=0.2 is 1.2736
Comments