An ordinary differential equation (ODE), \( \dfrac{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_{\text{analytical}} - y_{\text{numerical}}}{y_{\text{analytical}}} \right| \times 100, \] then the value of \(\varepsilon\) at \(x = 0.5\) is \(\underline{\hspace{2cm}}\).
Step 1: Analytical solution.
\[
y(x) = e^{2x}.
\]
At \(x = 0.5\):
\[
y_{\text{analytical}} = e^{1} = 2.71828.
\]
Step 2: Apply RK-2 method (midpoint form).
The RK-2 method uses:
\[
k_1 = f(x_0,y_0)
\]
\[
k_2 = f(x_0 + h/2, y_0 + h k_1/2)
\]
\[
y_{1} = y_0 + h\, k_2
\]
Given:
\[
f(x,y)=2y, y_0 = 1, h = 0.5.
\]
Compute \(k_1\):
\[
k_1 = 2y_0 = 2(1)=2.
\]
Compute \(k_2\):
\[
y_0 + \frac{h k_1}{2} = 1 + \frac{0.5 \times 2}{2} = 1 + 0.5 = 1.5.
\]
\[
k_2 = 2(1.5)=3.
\]
Now compute numerical value:
\[
y_{1} = y_0 + h k_2 = 1 + 0.5 \times 3 = 2.5.
\]
Step 3: Compute percentage error.
\[
\varepsilon = \left| \frac{y_{\text{analytical}} - y_{\text{numerical}}}{y_{\text{analytical}}} \right| \times 100
\]
\[
\varepsilon = \left| \frac{2.71828 - 2.5}{2.71828} \right| \times 100
\]
\[
= \left| \frac{0.21828}{2.71828} \right| \times 100
= 0.08025 \times 100
\approx 8.0
\]
Step 4: Conclusion.
The relative percentage error is approximately \(8%\).