Difference Between Euler and Improved Euler Methods for Ordinary Differential Equations: A Comparative Study

Difference Between Euler and Improved Euler Methods for Ordinary Differential Equations: A Comparative Study

In the field of numerical analysis, the Euler method and the Improved Euler method (also known as Heun's method) are commonly used to approximate solutions to ordinary differential equations (ODEs). Understanding the differences between these two methods is crucial for selecting the most appropriate technique for a given problem. This article provides a detailed comparison using a simple first-order ODE as an example.

Example Problem

Consider the first-order ODE:

frac;{dy}{dt} y, with the initial condition:

y(0) 1.

This ODE has the exact solution:

y(t) e^t.

Step-by-Step Comparison

Euler Method

The basic Euler method approximates the solution using the formula:

y_{n 1} y_n h cdot ft(y_n)

where h is the step size and f(y) y in our case. Let's choose a step size h 0.1 and compute the first few steps:

Step 0

t_0 0 y_0 1

Step 1

y_1 y_0 h cdot ft(y_0) 1 0.1 cdot 1 1.1

Step 2

t_1 0.1 y_2 y_1 h cdot ft(y_1) 1.1 0.1 cdot 1.1 1.21

Step 3

t_2 0.2 y_3 y_2 h cdot ft(y_2) 1.21 0.1 cdot 1.21 1.331

Continuing this process, you would get approximations for y(t) at different time steps.

Improved Euler Method (Heun's Method)

The Improved Euler method modifies the basic Euler approach by using an average of the slopes at the beginning and the end of the interval. The formula is:

y_{n 1} y_n frac{h}{2} left(ft(y_n) ft(y_n h cdot ft(y_n))right)

Using the same step size h 0.1:

Step 0

t_0 0 y_0 1

Step 1

Calculate the slope at the beginning: f(y_0) 1 Predict the next value: y_{text{predict}} y_0 h cdot f(y_0) 1 0.1 cdot 1 1.1 Calculate the slope at the predicted point: f(y_{text{predict}}) 1.1 Update using the average of the slopes: y_1 y_0 frac{0.1}{2} left(1 1.1right) 1 0.05 cdot 2.1 1.105

Step 2

t_1 0.1 y_1 1.105 Calculate the slope at y_1: f(y_1) 1.105 Predict the next value: y_{text{predict}} 1.105 0.1 cdot 1.105 1.2155 Calculate the slope at the predicted point: f(y_{text{predict}}) 1.2155 Update: y_2 y_1 frac{0.1}{2} left(1.105 1.2155right) 1.105 0.05 cdot 2.3205 1.1105 0.116025 1.221525

Continuing this process, you would obtain more accurate approximations for

y(t).

Summary of Differences

Accuracy: The Improved Euler method generally provides better accuracy than the basic Euler method because it takes into account the slope at both the beginning and the end of the interval.

Error: The Euler method has a local truncation error of O(h^2) and a global error of O(h), while the Improved Euler method has a local truncation error of O(h^3) and a global error of O(h^2).

Calculation Complexity: The Improved Euler method requires an additional function evaluation at each step, making it slightly more complex but yielding better results.

Using these methods on the same problem allows you to see how the Improved Euler method converges more closely to the exact solution, especially over larger intervals or with larger step sizes.