Exercise05_sol.pdf
Transcript of Exercise05_sol.pdf
-
- 1 -
AMS 147 Computational Methods and Applications
Exercise #5
1. Consider the total error of the first order numerical differentiation method in the IEEE double
precision system
ET h( ) =fl f x + h( )( ) fl f x( )( )
hNumerical value
obtained withfinite precision
f x( )Exactvalue
By selecting a proper step size h we can achieve the minimum total error.
What is the order of magnitude of the optimal step size?
What is the order of magnitude of the minimum total error?
Answer:
The optimal step size is about 10-8:
argminh
ET h( ) 108
The minimum total error is about 10-8:
minh
ET h( ) 108
2. Let T h( ) be the numerical approximation to I = f x( )dxa
b
obtained using the composite
trapezoidal rule with step size h. The error is defined as Error h( ) = T h( ) I .
Suppose (x) is infinitely differentiable. What is the order of Error(h)?
When the exact value I is unknown, we cannot calculate the error using
Error h( ) = T h( ) I . Write out how to use T h( ) and Th2
to estimate Error h( ) .
Answer:
Error h( ) = O h2( )
Error h( )T h( ) T
h
2
112
2
-
AMS 147 Computational Methods and Applications
- 2 -
3. Let T h( ) be the numerical approximation to I = f x( )dxa
b
obtained using the composite
Simpsons rule with step size h. The error is defined as Error h( ) = T h( ) I .
Suppose (x) is infinitely differentiable. What is the order of Error(h)?
When the exact value I is unknown, we cannot calculate the error using
Error h( ) = T h( ) I . Write out how to use T h( ) and Th2
to estimate Error h( ) .
Answer:
Error h( ) = O h4( )
Error h( )T h( ) T
h
2
112
4
4. Consider the Euler method for solving y = F y,t( ) .
Write out the Euler method.
Is the Euler method explicit or implicit?
What is the order of the local truncation error of the Euler method?
What is the order of the global error of the Euler method?
Answer:
yn+1 = yn + hF yn , tn( )
Euler method is explicit.
Local truncation error = O(h2).
Global error = O(h)
5. Consider the backward Euler method for solving y = F y,t( ) .
Write out the backward Euler method.
-
AMS 147 Computational Methods and Applications
- 3 -
Is the backward Euler method explicit or implicit?
What is the order of the local truncation error of the backward Euler method?
What is the order of the global error of the backward Euler method?
Answer:
yn+1 = yn + hF yn+1, tn+1( )
Backward Euler method is implicit.
Local truncation error = O(h2).
Global error = O(h)
6. Let y t( ) be the exact solution of y = F y,t( )
y 0( ) = y0
.
Let yn h( ) be the numerical approximation to y nh( ) obtained using the Euler method with
step size h. The error is Error h( ) = yn h( ) y nh( ) .
Since the Euler method is first order accurate, we have
yn h( ) y nh( ) = c1h + o h( )
y2nh
2
y nh( ) = c1
h
2+ o h( )
When the exact solution y nh( ) is unknown, we cannot calculate the error using
Error h( ) = yn h( ) y nh( ) . Write out how to use yn h( ) and y2nh2
to estimate Error h( ) .
Answer:
Error h( )yn h( ) y2n
h
2
112
7. Let y t( ) be the exact solution of y = F y,t( )
y 0( ) = y0
.
-
AMS 147 Computational Methods and Applications
- 4 -
Let yn h( ) be the numerical approximation to y j h( ) obtained using RK4 (the classical fourth
order Runge-Kutta method) with step size h. The error is Error h( ) = yn h( ) y nh( ) .
Since RK4 is fourth order accurate, we have
yn h( ) y nh( ) = c4h4
+ o h( )
y2nh
2y nh( ) = c4
h
2
4
+ o h( )
When the exact solution y nh( ) is unknown, we cannot calculate the error using
Error h( ) = yn h( ) y nh( ) . Write out how to use yn h( ) and y2nh2
to estimate Error h( ) .
Answer:
Error h( )yn h( ) y2n
h
2
112
4