Numerical Methods for DEs - Examples & Applications

Conceptual Examples: Error Analysis

Global vs Local Truncation Error (Conceptual)

A student is using Euler's method to solve a differential equation from x=0x = 0 to x=10x = 10. They initially choose a step size of h=0.1h = 0.1. To improve accuracy, they decide to halve the step size to h=0.05h = 0.05.
What is the expected effect on the local truncation error per step, and what is the expected effect on the overall global truncation error at x=10x = 10?

Error Analysis Solution

0 of 2 Steps Completed
1

Comparing Methods by Order

For a certain application, a global error of no more than 10410^{-4} is acceptable. Using Euler's method, a step size of h=104h=10^{-4} is required. If the user switches to the 4th-order Runge-Kutta method (RK4), approximately what step size hh would yield the same acceptable global error?

Order Comparison Solution

0 of 2 Steps Completed
1

Euler's Method

Euler's Method Problem (Basic)

Given the initial value problem:
dydx=x+y,y(0)=1\frac{dy}{dx} = x + y, \quad y(0) = 1
Use Euler's method with a step size h=0.1h = 0.1 to approximate y(0.2)y(0.2).

Euler's Method Solution

0 of 3 Steps Completed
1

Euler's Method Problem (Non-linear)

Approximate y(1.2)y(1.2) for the IVP dydx=xy2\frac{dy}{dx} = xy^2, y(1)=2y(1) = 2 using Euler's Method with h=0.1h = 0.1.

Euler Non-linear Solution

0 of 2 Steps Completed
1

Improved Euler's Method (Heun's Method)

Improved Euler's Method Problem

Using the same IVP dydx=x+y,y(0)=1\frac{dy}{dx} = x + y, y(0) = 1, use Improved Euler's method with h=0.1h = 0.1 to approximate y(0.1)y(0.1).

Improved Euler's Method Solution

0 of 2 Steps Completed
1

Improved Euler's (Non-linear)

Approximate y(1.1)y(1.1) for dydx=xy2\frac{dy}{dx} = xy^2, y(1)=2y(1) = 2 using Improved Euler with h=0.1h = 0.1.

Improved Euler Non-linear Solution

0 of 2 Steps Completed
1

Runge-Kutta 4th Order Method (RK4)

Runge-Kutta (RK4) Problem

For the IVP dydx=x2y,y(0)=1\frac{dy}{dx} = x^2 - y, \quad y(0) = 1, find the first step using RK4 with h=0.1h=0.1.

RK4 Solution

0 of 5 Steps Completed
1

RK4 Problem (y-only function)

Approximate y(0.1)y(0.1) for dydx=2y\frac{dy}{dx} = 2y, y(0)=3y(0)=3 using RK4 with h=0.1h=0.1.

RK4 y-only Solution

0 of 2 Steps Completed
1