All Exams Test series for 1 year @ ₹349 only
Question

Using Runge-Kutta method of fourth order, an approximate value of $y$ at $x=0.2$, given that $\frac{dy}{dx} = \frac{y^{2}-x^{2}}{y^{2}+x^{2}}$ and $y(0)=1$ is :

The correct answer is
1.196

Runge-Kutta 4th Order Method: ODE Approximation

This solution demonstrates calculating an approximate ODE value using the Runge-Kutta method of fourth order (RK4).

Problem Statement

Find the approximate value of $y$ at $x=0.2$ for the differential equation:

\frac{dy}{dx} = \frac{y^{2}-x^{2}}{y^{2}+x^{2}}

Given the initial condition $y(0)=1$. The step size is $h = 0.2 - 0 = 0.2$.

RK4 Formulas

The RK4 formulas are:

  • $y_{n+1} = y_n + \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)$
  • $k_1 = h \cdot f(x_n, y_n)$
  • $k_2 = h \cdot f\left(x_n + \frac{h}{2}, y_n + \frac{k_1}{2}\right)$
  • $k_3 = h \cdot f\left(x_n + \frac{h}{2}, y_n + \frac{k_2}{2}\right)$
  • $k_4 = h \cdot f(x_n + h, y_n + k_3)$

Where $f(x, y) = \frac{y^{2}-x^{2}}{y^{2}+x^{2}}$. Here, $x_0 = 0$ and $y_0 = 1$.

RK4 Calculation Steps

  1. Calculate $k_1$:

    $k_1 = 0.2 \cdot f(0, 1) = 0.2 \cdot \frac{1^{2}-0^{2}}{1^{2}+0^{2}} = 0.2 \cdot 1 = 0.2$

  2. Calculate $k_2$:

    $k_2 = 0.2 \cdot f(0 + \frac{0.2}{2}, 1 + \frac{0.2}{2}) = 0.2 \cdot f(0.1, 1.1)$

    $k_2 = 0.2 \cdot \frac{(1.1)^{2}-(0.1)^{2}}{(1.1)^{2}+(0.1)^{2}} = 0.2 \cdot \frac{1.20}{1.22} \approx 0.1967$

  3. Calculate $k_3$:

    $k_3 = 0.2 \cdot f(0 + \frac{0.2}{2}, 1 + \frac{0.1967}{2}) = 0.2 \cdot f(0.1, 1.09835)$

    $k_3 \approx 0.2 \cdot \frac{(1.09835)^{2}-(0.1)^{2}}{(1.09835)^{2}+(0.1)^{2}} \approx 0.1967$

  4. Calculate $k_4$:

    $k_4 = 0.2 \cdot f(0 + 0.2, 1 + 0.1967) = 0.2 \cdot f(0.2, 1.1967)$

    $k_4 \approx 0.2 \cdot \frac{(1.1967)^{2}-(0.2)^{2}}{(1.1967)^{2}+(0.2)^{2}} \approx 0.1891$

  5. Calculate $y(0.2)$:

    $y(0.2) \approx y_0 + \frac{1}{6}(k_1 + 2k_2 + 2k_3 + k_4)$

    $y(0.2) \approx 1 + \frac{1}{6}(0.2 + 2(0.1967) + 2(0.1967) + 0.1891)$

    $y(0.2) \approx 1 + \frac{1}{6}(1.1760) \approx 1.1960$

Final Result

The approximate value of $y$ at $x=0.2$ using the RK4 method is 1.196.

Was this answer helpful?

Important Questions from Miscellaneous

  1. Which of the following scheduler/schedulers is/are also called CPU scheduler ?
    (A). Short Term Scheduler
    (B). Long Term Scheduler
    (C). Medium Term Scheduler
    (D). Asymmetric Scheduler
    Choose the correct answer from the options given below:
  2. A situation where two or more processes are blocked, waiting for resources held by each other is called:
  3. External fragmentation occurs ________.
  4. Which disk scheduling algorithm looks for the track closest to the current head position?
  5. Which CPU scheduling algorithm prefers the process with the shortest burst time?
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App