Numerical ODEs · Definition
Local and global error
Before you start you need to know
When approximating a differential equation step by step, each step introduces a small mistake. Measuring how these mistakes accumulate tells you whether a method is reliable.
Definition
The local error is the difference between the exact ODE solution over one step and the method's approximation starting from the exact value.
If Euler's method has local error of order \(O(h^2)\), the global error is usually of order \(O(h)\), one power less, because the local error accumulates over about \(1/h\) steps. This relation is the basis of convergence analysis.
Consider \(y'=y\), \(y(0)=1\), with \(h=0.1\). After the first Euler step we get \(y_1=1.1\), while \(y(0.1)=e^{0.1}\approx1.10517\), so the local error is about \(0.00517\).
A typical mistake is confusing local with global error and assuming that a method with small local error must have an equally small global error. The global error also depends on the stability of the method.
Think about it
Why can a method with a small local error still have a large global error?
Because local errors accumulate and propagate at each step, and the method's stability can amplify them.
Exercises 10
- What does the local error measure in a numerical ODE method?
- What does the global error measure in a numerical ODE method?
- If a method's local error is \(O(h^2)\), what order does the global error typically have?
- With Euler's method, what is the local error when computing \(y_{n+1}\) from \(y(t_n)\)?
- What best describes how local errors build up into the global error?
- For \(y'=y\), \(y(0)=1\), and \(h=0.1\), what is approximately the local error of the first Euler step?
- If halving h roughly halves the global error of Euler's method, what is the order of the global error?
- If the local error of one step is \(C h^3\), roughly how many steps accumulate over the interval \([0,1]\)?
- A method has local error \(O(h^2)\). If h goes from 0.1 to 0.05, how does the global error change approximately if its global order is \(O(h)\)?
- For \(y'=-2y\), \(y(0)=1\) and \(h=0.1\), the first Euler step gives \(y_1=0.8\). If the local error of that step is \(0.0187\), what is the approximate relative local error with respect to \(y(0.1)=e^{-0.2}\approx0.81873\)?
References
- Richard L. Burden, J. Douglas Faires, Annette M. Burden, Numerical Analysis, 10th edition, Cengage Learning, 2016.
- Lloyd N. Trefethen, David Bau III, Numerical Linear Algebra, 1st edition, SIAM, 1997.