Topic 14.1: Euler's Method (Examples)

Contents Previous Chapter Start of Chapter No Previous Topic Introduction Notes Theory HOWTO Examples Engineering Error Questions Matlab Maple Next Topic Next Chapter

Example 1

Given the IVP y(1)(t) = 1 - t y(t) with y(0) = 1, approximate y(1) with one step.

First, let t0 = 0, y0 = 1, and h = 1. Therefore our approximation is y1 = y0 + h(1 - t0 y0) = 1 + 1 (1 - 0⋅1) = 2. The actual value is 1.331309118 and therefore the absolute error is approximately 0.669.

Example 2

Given the same IVP shown in Example 1, approximate y(0.5).

First, let t0 = 0, y0 = 1, and h = 0.5. Therefore our approximation is y1 = y0 + h(1 - t0 y0) = 1 + 0.5 (1 - 0⋅1) = 1.5. The actual value is 1.342841185 and therefore the error is 0.157, or approximately 1/4 the error in Example 1.

Example 3

Repeat Examples 1 and 2 but with with the initial value y(0.5) = 2.5 and approximating y(1.5) and y(1.0).

First, let t0 = 0.5, y0 = 2.5, and h = 1. Therefore our approximation is y1 = y0 + h(1 - t0 y0) = 2.5 + 1 (1 - 0.5 ⋅ 2.5) = 2.25. The actual value is 1.502483616 and therefore the absolute error is approximately 0.748.

Next, let t0 = 0.5, y0 = 2.5, and h = 0.5. Therefore our approximation is y1 = y0 + h(1 - t0 y0) = 2.5 + 0.5 (1 - 0.5 ⋅ 2.5) = 2.375. The actual value is 2.126611964 and therefore the absolute error is approximately 0.248.

In this case, the error is not exactly 1/4, but if we shrink the interval by half again, approximating y(0.75):

t0 = 0.5, y0 = 2.5, and h = 0.25. Therefore our approximation is y1 = y0 + h(1 - t0 y0) = 2.5 + 0.25 (1 - 0.5 ⋅ 2.5) = 2.4375. The actual value is 2.368609584 and therefore the absolute error is approximately 0.0689, which is closer to 1/4 the error found when approximating y(1).

If we tabulate the errors for various values of h, as is shown in Table 1, we note that as h gets smaller, the error drops by almost exactly 1/4 each time we divide h by two.

Table 1. Errors when approximating y(t0 + h) for decreasing values of h.

hApproximation
of y(0.5 + h)
Error
12.250.748
0.52.3750.248
0.252.43750.0689
0.1252.468750.0179
0.06252.4843750.00457
0.031252.49218750.00115
0.0156262.496093750.000289
0.00781252.4980468750.0000723

Copyright ©2005 by Douglas Wilhelm Harder. All rights reserved.