Numerical Analysis/Truncation Errors

From testwiki
Jump to navigation Jump to search

This page is about Truncation error of ODE methods.

Definition

Truncation errors are defined as the errors that result from using an approximation in place of an exact mathematical procedure.

There are two ways to measure the errors:

  1. Local Truncation Error (LTE): the error, τ, introduced by the approximation method at each step.
  2. Global Truncation Error (GTE): the error, e, is the absolute difference between the correct value and the approximate value.

Assume that our methods take the form:

Let yn+1 and yn be approximation values.
Then
Template:Center topyn+1=yn+hA(tn,yn,h,f), whereTemplate:Center bottom
h is the time step, equal to tn+1tn, and
A is an increment function and is some algorithm for approximating the average slope yn+1ynh.

Three important examples of A are:

  • Euler’s method: A(tn,yn,h,f)=f(tn,yn).
  • Modified Euler's method: A(tn,yn,h,f)=12(A1+A2), where
A1=f(yn,yn), andA2=f(tn+h,yn+hA1).
  • Runge-Kutta method: A(tn,yn,h,f)=16(A1+2A2+2A3+A4), where
A1=f(tn,yn),A2=f(tn+12h,yn+12hA1),A3=f(tn+12h,yn+12hA2), andA4=f(tn+h,yn+hA3).

Why do we care about truncation errors?

In the case of one-step methods, the local truncation error provides us a measure to determine how the solution to the differential equation fails to solve the difference equation. The local truncation error for multistep methods is similar to that of one-step methods.

A one-step method with local truncation error τn(h) at the nth step:

  • This method is consistent with the differential equation it approximates if
limh0max1nN|τn(h)|=0.

Note that here we assume that the approximation values are exactly equal to the true solution at every step.

  • The method is convergent with respect to the differential equation it approximates if
limh0max1nN|yny(tn)|=0,

where yn denotes the approximation obtained from the method at the nth step, and y(tn) the exact value of the solution of the differential equation.

How do we avoid truncation errors?

The truncation error generally increases as the step size increases, while the roundoff error decreases as the step size increases.

Relationship Between Local Truncation Error and Global Truncation Error

The global truncation error (GTE) is one order lower than the local truncation error (LTE).
That is,

if τn(h)=O(hp+1), then en(h)=O(hp).

Proof

We assume that perfect knowledge of the true solution at the initial time step.
Let y~(t) be the exact solution of

{y=f(t,y), andy(tn)=yn.

The truncation error at step n+1 is defined as τn+1(h)=y~(tn+1)yn+1. Also, the global errors are defined as

e0(h)=0en+1(h)=y(tn+1)yn+1=[y(tn+1)y~(tn+1)]+[y~(tn+1)yn+1].

According to the w:Triangle inequality, we obtain that Template:NumBlk The second term on the right-hand side of (Template:EquationNote) is the truncation error τn+1(h). Here we assume Template:NumBlk Thus, Template:NumBlk The first term on the right-hand side of (Template:EquationNote) is the difference between two exact solutions.

Both y(t) and y~(t) satisfy y=f(t,y) so

{y(t)=f(t,y), andy~(t)=f(t,y~).

By subtracting one equation from the other, we can get that

y(t)y~(t)=f(t,y)f(t,y~)so|y(t)y~(t)|=|f(t,y)f(t,y~)|.

Since f is w:Lipschitz continuous, then

|y(t)y~(t)|L|y(t)y~(t)|, where t>tn.

By w:Gronwall's inequality,

|y(t)y~(t)||y(tn)y~(tn)|exp(tntLds)=eL(ttn)|y(tn)y~(tn)|,

where t[tn,tn+1].

Setting t=tn+1, we have that Template:NumBlk

Plugging equation (Template:EquationNote) and (Template:EquationNote) into (Template:EquationNote), we can get that Template:NumBlk

Note that equation (Template:EquationNote) is a recursive inequality valid for all values of n.

Next, we are trying to use it to estimate |eN(h)|, where we assume Nh=T.

Let α=eLh. Dividing both sides of (Template:EquationNote) by αn+1, we get that

|en+1(h)|αn+1en(h)αn+Chp+11αn+1.

Summing over n = 0,1, 2,…, N-1,

|e1(h)|α1e0(h)α0+Chp+11α1,
|e2(h)|α2e1(h)α1+Chp+11α2,

and

|eN(h)|αNeN1(h)αN1+Chp+11αN.

Then we obtain

|eN(h)|αNe0(h)α0+Chp+1(1α1+1α2++1αN)=e0(h)α0+Chp+1[1αN(1+α+α2++αN1)]=e0(h)α0+Chp+1[1αN(αN1α1)].

Since e0(h)=0, we have

|eN(h)|Chp+1[1αN(αN1α1)]Chp+1(αN1α1),since αN>1.

Using the inequality ex1x, we get

α1=eLh1LhandαN1=eLNh1=eLT1.

Therefore, we can obtain that

|eN(h)|Chp+1(eLT1Lh)=C(eLT1L)hp.

That is, Template:NumBlk

From equation (Template:EquationNote) and (Template:EquationNote),

τn+1(h)=O(hp+1)and
|eN(h)|=O(hp),

so we can conclude that the global truncation error is one order lower than the local truncation error.

Graph

In this graph, c=a+ba2. The red line is the true value, the green line is the first step, and the blue line is the second step.

AB is the local truncation error at step 1, τ1=e1, equal to CD.
DE is separation because after the first step we are on the wrong solution of the ODE.
EF is τ2.

Thus, CF is the global truncation error at step 2, e2.

We can see from this,

en+1=en+h[A(tn),y(tn),h,f)A(tn,yn,h,f)]+τn+1.

Then,

e2=e1+h[A(t1),y(t1),h,f)A(t1,y1,h,f)]+τ2.
e2=AB+DE+CF.

Exercise

Find the order of the 2-steps Adams-Bashforth method. You need to show the order of truncation error.

References

  1. Burden, R. L., & Faires, J. (2011). Numerical analysis ninth edition. Brooks/Cole, Cengage Learning.
  2. Materials from MATH 3600 Lecture 28 http://www.math.ohiou.edu/courses/math3600/lecture28.pdf.
  3. http://www.math.uiuc.edu/~ekirr/page/teaching/math385/handout2.pdf.
  4. http://users.soe.ucsc.edu/~hongwang/AMS147/Notes/Lecture09.pdf.
  5. http://livetoad.org/Courses/Documents/03e0/Notes/truncation_error.pdf.