UNIHIVE

Study Hub UNIPORT MTH 492

MTH 492 · Numerical Methods

Initial value problems: Euler and one-step methods

Euler's method, the improved Euler method, local and global error, and why higher order helps.

Our notes

1 min read

The problem

An initial value problem (IVP): y′ = f(x, y), y(x₀) = y₀. We find approximations yₙ ≈ y(xₙ) at points xₙ = x₀ + nh, with step size h.

Euler's method

yₙ₊₁ = yₙ + h f(xₙ, yₙ): follow the tangent for one step.

  • Local truncation error (one step): O(h²).
  • Global error (after reaching a fixed x): O(h): halving h only halves the error.

The improved Euler (Heun) method

Predict with Euler, then average the slopes at both ends:

  1. k₁ = f(xₙ, yₙ)
  2. k₂ = f(xₙ + h, yₙ + h k₁)
  3. yₙ₊₁ = yₙ + (h/2)(k₁ + k₂)

Global error O(h²).

Worked example

y′ = x + y, y(0) = 1, h = 0.1. Exact solution y = 2eˣ − x − 1, so y(0.1) = 1.110342.

  • Euler: y₁ = 1 + 0.1(0 + 1) = 1.1 (error 0.0103)
  • Heun: k₁ = 1; k₂ = f(0.1, 1.1) = 1.2; y₁ = 1 + 0.05(2.2) = 1.11 (error 0.00034)

One step of Heun is thirty times more accurate here, for twice the work.

Order and cost

A method of order p has global error about C hᵖ. Halving h:

MethodOrderError falls by
Euler12
Heun24
RK4416

Stability of a method

Apply a method to the test equation y′ = λy (λ < 0, a decaying solution). Euler gives yₙ₊₁ = (1 + hλ)yₙ, so it only decays if |1 + hλ| < 1, that is h < 2/|λ|. If λ is large and negative (a stiff equation, common in chemical kinetics and circuits), explicit methods need tiny steps; implicit methods such as backward Euler, yₙ₊₁ = yₙ + h f(xₙ₊₁, yₙ₊₁), are stable for any h.

Exams usually ask

  • Apply Euler and Heun for two or three steps and compare with the exact solution.
  • State the orders of the methods and explain stiffness.

Common mistake

Using yₙ (not the predicted value) inside k₂ of Heun's method. The second slope is taken at the predicted point.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All MTH 492 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.