Download Lecture 2: Discrete Versus Continuous Models

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Fundamental theorem of algebra wikipedia , lookup

Transcript
1
Lecture 3: Analysis of Discretization Error
Introduction.
Initial value problems have the form
ut = f(t,u) and u(0) given.
(1)
The simplest cases can be solved by separation of variable, but in general they do not
have to have closed form solutions. Therefore, one is forced to consider various
approximation methods. In this lecture continue to consider the Euler finite difference
method, and we will give an analysis of the discretization error. This will require the
extended mean value theorem. We shall see that the error made by this approximation is
proportional to h..
Model.
The continuous model of Newton's empirical law of cooling states that
the rate of change of the temperature is proportional to the difference in the surrounding
temperature and the temperature of the liquid.
ut = c(usur – u).
If c = 0, then there is perfect insulation, and the liquid temperature must remain at its
initial value. For large c the liquid's temperature will rapidly approach the surrounding
temperature.
Euler’s method involves the approximation of ut by the finite difference
(uk+1 - uk)/h
where h = T/K, uk is an approximation of u(kh) and f is evaluated at (kh,uk). If T is not
finite, then h will be fixed and k may range over all of the positive integers. The
differential equation (1) can be replaced
(uk+1 - uk)/h = f(kh,uk).
(2)
The scheme given by (2) is call Euler's method and it is a discrete model of heat
transfer.
In the previous lecture we observed that as the time step decreases the solution
from the discrete model approached the solution from the continuous model. This was
depicted in both graphical and table form. Here we will give a careful mathematical
analysis, which can be applied to a larger class of initial value problems. The main
mathematical tool is the mean value theorem and some of it variations.
2
Mean Value Theorems. In order to give an explanation of the discretization error
we must review the mean value theorem and some of its variations. The mean value
theorem, like the intermediate value theorem, will appear to be clearly true once one
draws the picture associated with it. However, it is a very powerful tool, which can help
us control the size of numerical errors in approximating hard integrals and differential
equations.
f(x)
f '(c) = (f(b) - f(a))/(b - a)
a
b
c
Figure:
x
Function Mean Value
Drawing the picture does make some assumptions. For example, consider the
function given by f(x) = 1 - |x|. Here there is a "corner" in the graph at x = 0, that is, f(x)
does not have a derivative at x = 0. Moreover, there is no mean value x = c as depicted in
the above figure!
Mean Value Theorem.
Let f:[a,b] → R be continuous on [a,b]. If f has a derivative
at each point of (a,b), then there is a c in (a,b) such that
f '(c) = (f(b) - f(a))/(b - a).
(3)
Proof. It suffices to prove the case where f(a) = 0 = f(b) because we can replace f(x) by
f(x) - [((f(b) - f(a))/(b - a))(x-a) + f(a)].
This special case is known as Rolle's theorem. Furthermore, in order to keep the details
at a minimum, we will assume that the derivative is continuous on [a,b].
3
Suppose f '(x) is not zero for all x in [a,b]. There are three possible cases. First,
f '(x) > 0 and as f(a) = 0, f(b) must be positive which is a contradiction. Second, f '(x) <
0 also gives a contradiction. Third, f '(x) must change sign. Here we apply the
intermediate value theorem to the derivative function, f '(x). So, there must be a c in
(a,b) such that f '(c) = 0.
Often the conclusion is written, with b = x and c some point between a and x, as
f(x) = f(a) + f'(c)(x-a).
(4)
Another variation on the mean value theorem is to apply it directly to integrals. The
following figure indicates that there is a particular rectangle with height f(c) which has
the same area as under the curve of f(x). The choice of c will depend on f as well as a
and b.
f(x)
area under f(x)
= f(c) (b - a)
a
Figure:
c
b
Integral Mean Value
Integral Form of Mean Value Theorem. Let f and w be continuous on [a,b], and let w
> 0 on (a,b). Then there is some c between a and b such that
b
∫ f (t)w(t)dt =
a
b
f (c)∫ w(t)dt.
(5)
a
The second form of the mean value theorem's conclusion is
f(x) = f(a) + f '(c) (x - a)
for some c between a and x, provided f '(x) is continuous on [a,b]. The extended mean
value theorem will conclude that
f(x) = f(a) + f '(a) (x - a) + f ''(c)(x - a)2 /2
for some c between a and x, provided f ''(x) is continuous on [a,b].
The extended mean value conclusion follows in a natural way from integration by
parts and the integral form of the mean value theorem:
4
x
f (x) = f (a) + ∫ f ' (t)dt
a
x
= f (a) + [ f ' (t)(t − x)| tt ==ax − ∫ f '' (t)(t − x)dt ]
a
x
= f (a) + [ f ' (a)(x − a) + f ' ' (c)∫ (x − t)dt ]
a
= f (a) + f ' (a)(x − a) + f '' (c)
Extended Mean Value Theorem.
(x − a)2
.
2
If f:[a,b]→ R has two continuous derivatives on
[a,b], then there is a c between a and x such
f(x) = f(a) + f '(a) (x - a) + f ''(c)(x - a)2 /2
Here x is in (a,b) and c will depend on the choice of x.
(6)
Analysis of the Discretiztion Error.
Discretization error = Edk = uk - u(kh) where
uk is from Euler's algorithm (2) with no roundoff error and
u(kh) is from the exact continuum solution (1).
Now we will give the discretization error analysis. The relevant terms for the
error analysis are
ut (kh) = c(usur - u(kh)),
uk+1 = uk + hc(usur - uk) and
Use the extended mean value theorem along with (7), and also use (8).
Edk +1 = uk+1 - u((k+1)h)
(7)
(8)
= [uk + hc(usur - uk)] - [u(kh) + c(usur - u(kh))h + utt (ck+1 )h2 /2]
= a Edk + bk+1h2/2
where a = 1 – ch > 0 and bk+1 = -utt(ck+1).
Let |a| = 1 - ch = r and |bk+1| < M2 = M. Use a "telescoping" argument and the partial
sums of the geometric series (1 + r + r2 +...+ rk = (rk+1 - 1)/(r - 1) ) to get
| Edk +1 | < r| Edk | + Mh2/2
< r(r| Edk −1 | + Mh2/2) + Mh2/2
#
5
< rk+1| Ed0 | + (rk+1 - 1)/(r - 1) Mh2/2.
0
d
Assume E
(9)
= 0 and r = 1 – ch > 0 with h = T/K to obtain
| Edk +1 | < 0 + [(1 – ch)k+1 -1]/(-ch) Mh2/2
< 1/(ch) Mh2/2
= M/(2c) h.
(10)
Euler Error Theorem.
Consider Euler's algorithm (8) for the initial value problem (7), which has a
unique solution with two continuous derivatives. If Ed0 = 0, h = T/K, max|utt| < M for t
in [0,T], then
| Edk +1 | < M/(2c) h.
Remark. The theorem can be generalized to initial value problems of the form (1) where
additional assumptions on f(t,u) must be made. In many cases the exact solution may not
be known, but the numerical method can be used to approximate the solution. The error
approximations imply that the numerical solution is “close” to the unknown exact
solution.
Homework.
1.
2.
Fill in the steps leading to (9).
In order to prove (10) we assumed T was finite. Suppose a = 1 – ch > 0
and for all t the second derivative of the solution is bounded by M. Show
for all k
| Edk +1 | < 1/(ch) Mh2/2.
3.
Prove the integral form of the mean value theorem by using the mean
value theorem with f(x) replaced by
x
x
a
a
F(x) = ∫ f (t)w(t )dt − K ∫ w(t )dt and K defined by F(b) = 0.