Truncation, EULER’S METHOD

previous steps. The sum of the two is the total error. It is referred to as the global trunca- tion error. Insight into the magnitude and properties of the truncation error can be gained by de- riving Euler’s method directly from the Taylor series expansion. To do this, realize that the differential equation being integrated will be of the general form of Eq. 22.3, where d ydt = y ′ , and t and y are the independent and the dependent variables, respectively. If the solution—that is, the function describing the behavior of y—has continuous derivatives, it can be represented by a Taylor series expansion about a starting value t i , y i , as in [recall Eq. 4.13]: y i + 1 = y i + y ′ i h + y ′′ i 2 h 2 + · · · + y n i n h n + R n 22.6 where h = t i + 1 − t i and R n = the remainder term, defined as R n = y n+ 1 ξ n + 1 h n+ 1 22.7 where ξ lies somewhere in the interval from t i to t i + 1 . An alternative form can be devel- oped by substituting Eq. 22.3 into Eqs. 22.6 and 22.7 to yield y i + 1 = y i + f t i , y i h + f ′ t i , y i 2 h 2 + · · · + f n− 1 t i , y i n h n + Oh n+ 1 22.8 where Oh n+ 1 specifies that the local truncation error is proportional to the step size raised to the n + 1th power. By comparing Eqs. 22.5 and 22.8, it can be seen that Euler’s method corresponds to the Taylor series up to and including the term f t i , y i h. Additionally, the comparison indicates that a truncation error occurs because we approximate the true solution using a fi- nite number of terms from the Taylor series. We thus truncate, or leave out, a part of the true solution. For example, the truncation error in Euler’s method is attributable to the remain- ing terms in the Taylor series expansion that were not included in Eq. 22.5. Subtracting Eq. 22.5 from Eq. 22.8 yields E t = f ′ t i , y i 2 h 2 + · · · + Oh n+ 1 22.9 where E t = the true local truncation error. For sufficiently small h, the higher-order terms in Eq. 22.9 are usually negligible, and the result is often represented as E a = f ′ t i , y i 2 h 2 22.10 or E a = Oh 2 22.11 where E a = the approximate local truncation error. According to Eq. 22.11, we see that the local error is proportional to the square of the step size and the first derivative of the differential equation. It can also be demon- strated that the global truncation error is Oh—that is, it is proportional to the step size