Computer Oriented Numerical Methods (BCA) 3rd Sem Previous Year Solved Question Paper 2022

Practice Mode:
12.

Use the Runge-Kutta 4th order method with step size 0.5 to solve the initial value problem :

y′=y3x​−xy, y(0) =2 over the integral [0,1].

Explanation

The initial value problem using the 4th order Runge-Kutta method with a step size of 0.5, we'll perform iterations to approximate the values of y at discrete points within the interval [0, 1].

The differential equation is given as:

y′=y3x​−xy

with the initial condition 2y(0)=2.

We'll use the following formula to update the value of y at each step:

k1​=h⋅f(xi​,yi​)

k2​=h⋅f(xi​+2h​,yi​+2k1​​)

k3​=h⋅f(xi​+2h​,yi​+2k2​​)

k4​=h⋅f(xi​+h,yi​+k3​)

yi+1​=yi​+61​(k1​+2k2​+2k3​+k4​)

Let's calculate the values of y at each step within the interval [0, 1]:

  1. Initial condition: y0​=2

  2. ℎ=0.5h=0.5

  3. Number of steps (n) = 1−00.50.51−0​ = 2

Step 1: 0=0x0​=0

(02−0⋅2)=0k1​=0.5⋅(y0​3x0​​−x0​⋅y0​)=0.5⋅(20​−0⋅2)=0 (0.752.125−0.25⋅2.25)=−0.03529k2​=0.5⋅((y0​+0.25⋅0.5)3(x0​+0.25)​−(x0​+0.25)⋅(y0​+0.25))=0.5⋅(2.1250.75​−0.25⋅2.25)=−0.03529

((y0​+0.25⋅(−0.03529))3(x0​+0.25)​−(x0​+0.25)⋅(y0​+0.25⋅(−0.03529)))=−0.1512

k4​=0.5⋅((y0​+0.5⋅(−0.1512))3(x0​+0.5)​−(x0​+0.5)⋅(y0​+0.5⋅(−0.1512)))=−0.3795

31y1​=2+61​(0+2⋅(−0.03529)+2⋅(−0.1512)+(−0.3795))=1.631

Step 2: 5x1​=0.5

k1​=0.5⋅(y1​3x1​​−x1​⋅y1​)=0.5⋅(1.6310.75​−0.5⋅1.631)=0.2319

k2​=0.5⋅((y1​+0.25⋅0.2319)3(x1​+0.25)​−(x1​+0.25)⋅(y1​+0.25⋅0.2319))=0.1062

k3​=0.5⋅((y1​+0.25⋅0.1062)3(x1​+0.25)​−(x1​+0.25)⋅(y1​+0.25⋅0.1062))=0.04886

k4​=0.5⋅((y1​+0.5⋅0.04886)3(x1​+0.5)​−(x1​+0.5)⋅(y1​+0.5⋅0.04886))=0.1847

y2​=1.631+61​(0.2319+2⋅0.1062+2⋅0.04886+0.1847)=1.694

So, using the 4th order Runge-Kutta method with a step size of 0.5, the approximate solution for the initial value problem y′=y3x​−xy, (0)=2 over the interval [0, 1] is 1≈1.694y(1)≈1.694.