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=hf(xi,yi)

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

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

k4=hf(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) = 100.50.510 = 2

Step 1: 0=0x0=0

(0202)=0k1=0.5(y03x0​​−x0y0)=0.5(20​−02)=0 (0.752.1250.252.25)=0.03529k2=0.5((y0+0.250.5)3(x0+0.25)​−(x0+0.25)(y0+0.25))=0.5(2.1250.75​−0.252.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(y13x1​​−x1y1)=0.5(1.6310.75​−0.51.631)=0.2319

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

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

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

y2=1.631+61(0.2319+20.1062+20.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.