Professional Documents
Culture Documents
(1) Problem Statement: Use Heun’s method to integrate y′ = 4e0.8x − 0.5y from x = 0
to x = 4 with a step size of 1. The initial condition at x = 0 is y = 2
(2) Solution Before solving the problem numerically, we can use calculus to determine the
following analytical solution:
4
e0.8x − e−0.5x + 2e−0.5x
y=
1.3
This formula can be used to generate the true solution values in Table.
First, the slope at (x0 , y0 ) is calculated as
y0′ = 4e0 − 0.5(2) = 3
This result is quite different from the actual average slope for the interval from 0 to 1.0, which
is equal to 4.1946, as calculated from the differential equations.
The numerical solution is obtained by using the predictor to obtain an estimate of y at 1.0:
y10 = 2 + 3(1) = 5
Iterations of Heun’s Method
1 15
xi ytrue yHeun |ϵt | yHeun |ϵt |
0 2 2 0 2 0
1 6.7011 6.1946 0.0818 6.1946 0.0268
2 16.3198 14.8439 0.0994 14.8439 0.0309
3 37.1992 33.6772 0.1046 33.6772 0.0317
4 83.3378 75.3390 0.1062 75.3390 0.0318
This report is due and the version of the problem set is 8/06/22.
LATEX template for this report is SEU-ML-Assign open source at tvj.one/ml-tex under the MIT License.
E-mail me@tvj.one for support.
2 Numerical analysis Report
Case: h = 0.25
Numerical analysis Report 5
Case: h = 0.125
(2) Check the following behavior decreasing the step size decreases
the error at a fasster rate for Heun’s mthod than for Euler’s method
Numerical analysis Report 7