Question #257973

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




1
Expert's answer
2021-10-29T03:00:21-0400

(i) Rung-Kutta method of second orde

y=x2y+x3=dydxy'=x^2y+x^3=\frac{dy}{dx}

h=0.2h=0.2

y(0)=1,y0=1,x0=0y(0)=1, y_0=1, x_0=0

f(x,y)=x2y+x3,u1=u0+h=0+0.2    u1=0.2f(x,y)=x^2y+x^3, u_1=u_0+h=0+0.2\implies u_1=0.2

Applying Runge-Kutta order 2,

k1=hf(x0,y0)k_1=hf(x_0,y_0)

=0.2f(0,1)=0.2(02+03)=0=0.2f(0,1)=0.2(0^2+0^3)=0

k2=hf(x0+h,y0+k1)=hf(0.2,1)k_2=hf(x_0+h,y_0+k_1)=hf(0.2,1)

=0.2(0.221+0.23)=0.0096=0.2(0.2^2\cdot1+0.2^3)=0.0096

y1=y(0.2)=y0+12(k1+k2)\therefore y_1=y(0.2)=y_0+\frac{1}{2}(k_1+k_2)

=1+12(0+0.0096)=1.0048=1+\frac{1}{2}(0+0.0096)=1.0048

Now; x1=0.2,y1=1.0048,h=0.2x_1=0.2, y_1=1.0048,h=0.2

u2=u1+h=0.2+0.2=0.4\therefore u_2=u_1+h=0.2+0.2=0.4

f(x,y)=x2y+x3f(x,y)=x^2y+x^3

Applying R-K method order 2

k1=hf(x1,y1)=0.2f(0.2,1.0048)k_1=hf(x_1,y_1)=0.2f(0.2,1.0048)

=0.2((0.2)21.0048+(0.2)3)=0.0096=0.2((0.2)^2\cdot1.0048+(0.2)^3)=0.0096

k2=hf(x1+h,y1+k)k_2=hf(x_1+h,y_1+k)

=hf(0.4,1.0144)=hf(0.4,1.0144)

=(0.2)((0.4)21.0144+(1.0144)3)=0.2412=(0.2)((0.4)^2\cdot1.0144+(1.0144)^3)=0.2412

y2=y(0.4)=y1+12(k1+k2)y_2=y(0.4)=y_1+\frac{1}{2}(k_1+k_2)

=1.0048+12(0.0096+0.2412)=1.0048+\frac{1}{2}(0.0096+0.2412)

=1.1302=1.1302

(ii) f(x,y)=x2y+x3f(x,y)=x^2y+x^3

h=0.2h=0.2

y(0)=1,y0=1,x0=0y(0)=1, y_0=1, x_0=0

Applying Runge-Kutta method of fourth order,

k1=hf(x0,y0)=0.2f(0,1)k_1=hf(x_0,y_0)=0.2f(0,1)

=0.2(0+0)=0=0.2(0+0)=0

k2=hf(x0+h2,y0+k2)=hf(0.1,1)k_2=hf(x_0+\frac{h}{2},y_0+\frac{k}{2})=hf(0.1,1)

=0.2(0.121+(0.1)3)=0.0022=0.2(0.1^2\cdot1+(0.1)^3)=0.0022

k3=hf(x0+h2,y0+k12)=hf(0.1,1.0011)k_3=hf(x_0+\frac{h}{2},y_0+\frac{k_1}{2})=hf(0.1,1.0011)

=0.2((0.1)2(1.0011)+(0.1)3)=0.0022=0.2((0.1)^2\cdot(1.0011)+(0.1)^3)=0.0022

k4=hf(x0+h,y0+k3)=hf(0.2,1.0022)k_4=hf(x_0+h,y_0+k_3)=hf(0.2,1.0022)

=(0.2)((0.2)2(1.0022)+(0.2)3)=0.0096=(0.2)((0.2)^2\cdot(1.0022)+(0.2)^3)=0.0096

k=16(k1+2k2+2k3+k4)=0.0031k=\frac{1}{6}(k_1+2k_2+2k_3+k_4)=0.0031

y1=y(0.2)=y0+k=1+0.0031=1.0031\therefore y_1=y(0.2)=y_0+k=1+0.0031=1.0031

Now x1=0.2,y1=1.0031,h=0.2x_1=0.2,y_1=1.0031,h=0.2

f(x,y)=x2y+x3f(x,y)=x^2y+x^3

x2=x1+h=0.2+0.2=0.4x_2=x_1+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)k_1=hf(x_1,y_1)=0.2f(0.2,1.0031)

=(0.2)((0.2)2(1.0031)+(0.2)3)=(0.2)((0.2)^2\cdot(1.0031)+(0.2)^3)

=0.0096

k2=hf(x1+h2,y1+k12)=hf(0.3,1.0079)k_2=hf(x_1+\frac{h}{2},y_1+\frac{k_1}{2})=hf(0.3,1.0079)

=(0.2)((0.3)2(1.0079)+(0.3)3)=0.0235=(0.2)((0.3)^2\cdot(1.0079)+(0.3)^3)=0.0235

k3=hf(x1+h2,y1+k22)=hf(0.3,1.0148)k_3=hf(x_1+\frac{h}{2},y_1+\frac{k_2}{2})=hf(0.3,1.0148)

=(0.2)((0.3)2(1.0148)+(0.3)3)=0.0237=(0.2)((0.3)^2\cdot(1.0148)+(0.3)^3)=0.0237

k4=hf(x1+h,y1+k3)=hf(0.4,1.0268)k_4=hf(x_1+h,y_1+k_3)=hf(0.4,1.0268)

=(0.2)((0.4)2(1.0268)+(0.4)3)=0.0456=(0.2)((0.4)^2\cdot(1.0268)+(0.4)^3)=0.0456

k=16(k1+2k2+2k3+k4)k=\frac{1}{6}(k_1+2k_2+2k_3+k_4)

=0.0249=0.0249

y2=y(0.4)=y1+k\therefore y_2=y(0.4)=y_1+k

=1.0031+0.0249=1.0031+0.0249

=1.028=1.028


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!
LATEST TUTORIALS
APPROVED BY CLIENTS