The GATE Grind

GATE 2021 CH – Question 11

Engineering Mathematics · Numerical Methods: Algebraic equations, integration, ODEs and finite-difference methods · 1 mark · Multiple choice

An ordinary differential equation (ODE), $dy/dx=2y$, with an initial condition $y(0)=1$, has the analytical solution $y=e^{2x}$. Using Runge-Kutta second order method, numerically integrate the ODE to calculate $y$ at $x=0.5$ using a step size of $h=0.5$. If the relative percentage error is defined as $\varepsilon=\left|\frac{y_{analytical}-y_{numerical}}{y_{analytical}}\right|\times100$, then the value of $\varepsilon$ at $x=0.5$ is _____

  1. 0.06
  2. 0.8
  3. 4.0
  4. 8.0

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (D) 8.0

Explanation

For a second-order Runge–Kutta step on $y\prime=2y$, the amplification factor is $1+2h+(2h)^2/2$. With $h=0.5$ and $y_0=1$, $y_1=1+1+0.5=2.5$.

The exact value is $e^{2(0.5)}=e=2.7182818$. Thus
$$\varepsilon=\frac{2.7182818-2.5}{2.7182818}\times100=8.0301\%.$$

The nearest listed value is **8.0 (D)**. Midpoint and Heun RK2 give the same result for this linear equation.