(i) Rung-Kutta method of second orde
y′=x2y+x3=dxdy
h=0.2
y(0)=1,y0=1,x0=0
f(x,y)=x2y+x3,u1=u0+h=0+0.2⟹u1=0.2
Applying Runge-Kutta order 2,
k1=hf(x0,y0)
=0.2f(0,1)=0.2(02+03)=0
k2=hf(x0+h,y0+k1)=hf(0.2,1)
=0.2(0.22⋅1+0.23)=0.0096
∴y1=y(0.2)=y0+21(k1+k2)
=1+21(0+0.0096)=1.0048
Now; x1=0.2,y1=1.0048,h=0.2
∴u2=u1+h=0.2+0.2=0.4
f(x,y)=x2y+x3
Applying R-K method order 2
k1=hf(x1,y1)=0.2f(0.2,1.0048)
=0.2((0.2)2⋅1.0048+(0.2)3)=0.0096
k2=hf(x1+h,y1+k)
=hf(0.4,1.0144)
=(0.2)((0.4)2⋅1.0144+(1.0144)3)=0.2412
y2=y(0.4)=y1+21(k1+k2)
=1.0048+21(0.0096+0.2412)
=1.1302
(ii) f(x,y)=x2y+x3
h=0.2
y(0)=1,y0=1,x0=0
Applying Runge-Kutta method of fourth order,
k1=hf(x0,y0)=0.2f(0,1)
=0.2(0+0)=0
k2=hf(x0+2h,y0+2k)=hf(0.1,1)
=0.2(0.12⋅1+(0.1)3)=0.0022
k3=hf(x0+2h,y0+2k1)=hf(0.1,1.0011)
=0.2((0.1)2⋅(1.0011)+(0.1)3)=0.0022
k4=hf(x0+h,y0+k3)=hf(0.2,1.0022)
=(0.2)((0.2)2⋅(1.0022)+(0.2)3)=0.0096
k=61(k1+2k2+2k3+k4)=0.0031
∴y1=y(0.2)=y0+k=1+0.0031=1.0031
Now x1=0.2,y1=1.0031,h=0.2
f(x,y)=x2y+x3
x2=x1+h=0.2+0.2=0.4
By applying R-K method of order 4,
k1=hf(x1,y1)=0.2f(0.2,1.0031)
=(0.2)((0.2)2⋅(1.0031)+(0.2)3)
=0.0096
k2=hf(x1+2h,y1+2k1)=hf(0.3,1.0079)
=(0.2)((0.3)2⋅(1.0079)+(0.3)3)=0.0235
k3=hf(x1+2h,y1+2k2)=hf(0.3,1.0148)
=(0.2)((0.3)2⋅(1.0148)+(0.3)3)=0.0237
k4=hf(x1+h,y1+k3)=hf(0.4,1.0268)
=(0.2)((0.4)2⋅(1.0268)+(0.4)3)=0.0456
k=61(k1+2k2+2k3+k4)
=0.0249
∴y2=y(0.4)=y1+k
=1.0031+0.0249
=1.028
Comments