Solve the following Initial Value Problem using (i)R-K method of O(h2)
and (ii) R-K method of O(h4)
y' = x2y + x3 and y(0) = 1.
Find y(0.4) taking h = 0.2, where y' means dy/dx
(i) Rung-Kutta method of second orde
"y'=x^2y+x^3=\\frac{dy}{dx}"
"h=0.2"
"y(0)=1, y_0=1, x_0=0"
"f(x,y)=x^2y+x^3, u_1=u_0+h=0+0.2\\implies u_1=0.2"
Applying Runge-Kutta order 2,
"k_1=hf(x_0,y_0)"
"=0.2f(0,1)=0.2(0^2+0^3)=0"
"k_2=hf(x_0+h,y_0+k_1)=hf(0.2,1)"
"=0.2(0.2^2\\cdot1+0.2^3)=0.0096"
"\\therefore y_1=y(0.2)=y_0+\\frac{1}{2}(k_1+k_2)"
"=1+\\frac{1}{2}(0+0.0096)=1.0048"
Now; "x_1=0.2, y_1=1.0048,h=0.2"
"\\therefore u_2=u_1+h=0.2+0.2=0.4"
"f(x,y)=x^2y+x^3"
Applying R-K method order 2
"k_1=hf(x_1,y_1)=0.2f(0.2,1.0048)"
"=0.2((0.2)^2\\cdot1.0048+(0.2)^3)=0.0096"
"k_2=hf(x_1+h,y_1+k)"
"=hf(0.4,1.0144)"
"=(0.2)((0.4)^2\\cdot1.0144+(1.0144)^3)=0.2412"
"y_2=y(0.4)=y_1+\\frac{1}{2}(k_1+k_2)"
"=1.0048+\\frac{1}{2}(0.0096+0.2412)"
"=1.1302"
(ii) "f(x,y)=x^2y+x^3"
"h=0.2"
"y(0)=1, y_0=1, x_0=0"
Applying Runge-Kutta method of fourth order,
"k_1=hf(x_0,y_0)=0.2f(0,1)"
"=0.2(0+0)=0"
"k_2=hf(x_0+\\frac{h}{2},y_0+\\frac{k}{2})=hf(0.1,1)"
"=0.2(0.1^2\\cdot1+(0.1)^3)=0.0022"
"k_3=hf(x_0+\\frac{h}{2},y_0+\\frac{k_1}{2})=hf(0.1,1.0011)"
"=0.2((0.1)^2\\cdot(1.0011)+(0.1)^3)=0.0022"
"k_4=hf(x_0+h,y_0+k_3)=hf(0.2,1.0022)"
"=(0.2)((0.2)^2\\cdot(1.0022)+(0.2)^3)=0.0096"
"k=\\frac{1}{6}(k_1+2k_2+2k_3+k_4)=0.0031"
"\\therefore y_1=y(0.2)=y_0+k=1+0.0031=1.0031"
Now "x_1=0.2,y_1=1.0031,h=0.2"
"f(x,y)=x^2y+x^3"
"x_2=x_1+h=0.2+0.2=0.4"
By applying R-K method of order 4,
"k_1=hf(x_1,y_1)=0.2f(0.2,1.0031)"
"=(0.2)((0.2)^2\\cdot(1.0031)+(0.2)^3)"
=0.0096
"k_2=hf(x_1+\\frac{h}{2},y_1+\\frac{k_1}{2})=hf(0.3,1.0079)"
"=(0.2)((0.3)^2\\cdot(1.0079)+(0.3)^3)=0.0235"
"k_3=hf(x_1+\\frac{h}{2},y_1+\\frac{k_2}{2})=hf(0.3,1.0148)"
"=(0.2)((0.3)^2\\cdot(1.0148)+(0.3)^3)=0.0237"
"k_4=hf(x_1+h,y_1+k_3)=hf(0.4,1.0268)"
"=(0.2)((0.4)^2\\cdot(1.0268)+(0.4)^3)=0.0456"
"k=\\frac{1}{6}(k_1+2k_2+2k_3+k_4)"
"=0.0249"
"\\therefore y_2=y(0.4)=y_1+k"
"=1.0031+0.0249"
"=1.028"
Comments
Leave a comment