ConMan FileDownload NumericalODE2
ConMan FileDownload NumericalODE2
Anotida Madzvamuse
Department of Mathematics
Pevensey III, 5C15,
Brighton, BN1 9QH,
UK
Outline
2 Picard’s Theorem
3 One-step Methods
6 Runge-Kutta methods
Applications of ODEs
Applications of ODEs
y (x0 ) = y0 . (2)
Discretisation
Numerical Analysis
Picard’s theorem
Picard’s Theorem I
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
Picard’s Theorem II
Theorem (Picard’s Theorem)
Suppose that f (·, ·) is a continuous function of its arguments in a
region U of the (x, y ) plane which contains the rectangle
n o
R = (x, y ) : x0 ≤ x ≤ XM , |y − y0 | ≤ YM ,
The
n oessence of the proof is to consider the sequence of functions
∞
yn , defined recursively through what is known as the Picard
n=0
Iteration:
(
y0 (x) = y0 ,
Rx (4)
yn (x) = y0 + x0 f (ξ, yn−1 (ξ))dξ, n = 1, 2, · · · ,
n o∞
and show, using the conditions of the theorem, that yn
n=0
converges uniformly on the interval [x0 , XM ] to a function y
defined on [x0 , XM ] such that
Z x
yn (x) = y0 + f (ξ, yn−1 (ξ))dξ.
x0
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
m
!1
X 2
2
kvk = |vi | , v ∈ Rm
i=1
Proof.
Exercise
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
yn+1 ≈ yn + hf (xn , yn )
y (x0 ) = y0 .
(12)
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
1
The Trapezium Rule method: θ = 2
Example 1
Table 1
1
k xk yk for θ = 0 yk for θ = 2 yk for θ = 1
0 0 0 0 0
1 0.1 0 0.005 0.00999
2 0.2 0.01 0.01998 0.02990
3 0.3 0.02999 0.04486 0.05955
4 0.4 0.05990 0.07944 0.09857
Table: The values of the numerical solution at the mesh points.
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
Picard’s Iteration
Tabulating results
Tabulating y3 (x) on the interval [0, 0.4] with step size h = 0.1, we
get the exact solution at the mesh points shown in Table 2.
The exact solution is in good agreement with the results obtained
with θ = 12 : the error ≤ 5 × 10−5 . For θ = 0 and θ = 1 the
discrepancy between yk and y (xk ) is larger: error ≤ 3 × 10−2 .
k xk y (xk )
0 0 0
1 0.1 0.005
2 0.2 0.01998
3 0.3 0.04488
4 0.4 0.07949
Table: Values of the ”exact solution” at the mesh points.
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
θ=0
y (xn+1 ) − y (xn )
Tn = − f (xn , y (xn )), (16)
h
obtained by inserting the analytical solution y(x) into the
numerical method and dividing by the mesh size.
Indeed, it measures the extent to which the analytical solution
fails to satisfy the difference equation for Eulers method.
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
θ = 0 Continued
θ = 0 Continued
θ = 0 Continued
Orders of Convergence
for n = 0, · · · , N, y0 = given.
Frequently referred to as the Improved Explicit Euler’s
method.
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
Φ(xn , yn ; h) = f (xn , yn ),
en = y (xn ) − yn .
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
Truncation error
y (xn+1 ) − y (xn )
Tn = − Φ(xn , y (xn ); h. (22)
h
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
Theorem
Consider the general one-step method (22) where, in addition to
being a continuous function of its arguments, Φ is assumed to
satisfy a Lipschitz condition with respect to its second argument;
namely, there exists a positive constant LΦ such that, for
0 ≤ h ≤ h0 and for the same region R as in Picards theorem,
Proof
Proof.
Exercise
Example 2: Consider
0 −1
y = tan y ,
(25)
y (0) = y0 .
The aim of the exercise is to apply (24) to quantify the size of the
associated global error; thus, we need to find L and M2 . Here
f (x, y ) = tan−1 y , so by the Mean Value Theorem
∂f
|f (x, y ) − f (x, z)| = (x, η)(y − z)
∂y
where y < η < z.
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
Example 2 Cont’d
In our case
∂f
= |(1 + y 2 )−1 | ≤ 1,
∂y
and therefore L = 1. To find M2 we need to obtain a bound on
|y 00 | (without actually solving the initial value problem!). This is
easily achieved by differentiating both sides of the differential
equation with respect to x:
d dy
y 00 = (tan−1 y ) = (1 + y 2 )−1 = (1 + y 2 )−1 tan−1 y .
dx dx
Therefore |y 00 (x)| ≤ M2 = 12 π. Inserting the values of L and M2
into (18), have that
1
|en | ≤ e xn |e0 | + π (e xn − 1) h, n = 0, · · · , N.
4
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
1
|en | ≤ π(e xn − 1)h, n = 0, · · · , N.
4
Thus, given a tolerance TOL specified beforehand, we can ensure
that the error between the (unknown) analytical solution and its
numerical approximation does not exceed this tolerance by
choosing a positive step size h such that
4 XM −1
h≤ e −1 TOL.
π
For such h we shall have |y (xn ) − yn | = |en | ≤ TOL for each
n = 0, · · · , N, as required.
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
Consistency
Definition (Consistency)
The numerical method (21) is consistent with the differential
equation (1) if the truncation error defined by (22) is such that for
any > 0 there exists a positive h() for which |Tn | < for
0 < h < h() and any pair of points (xn , y (xn )), (xn+1 , y (xn+1 )) on
any solution curve in R.
NOTE:
Convergence Theorem
Theorem
Suppose that the solution of the initial value problem (1)-(2) lies
in R as does its approximation generated from (21) when h ≤ h0 .
Suppose also that the function Φ(·, ·; ·) is uniformly continuous on
R × [0, h0 ] and satisfies the consistency condition (26) and the
Lipschitz condition
Order of accuracy
for any pair of points (xn , y (xn )), (xn+1 , y (xn+1 )) on the solution
curve.
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
yn+1 = yn + hf (xn , yn ).
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
yn+1 = yn + h(c1 ks + c2 k2 ),
where
k1 = f (xn , yn ),
k2 = f (xn + a2 h, yn + b21 hk1 )
Consistency condition
Φ(xn , yn ; 0) ≡ f (x, y ).
we have
Order of accuracy
1 00 h i 1
hy − c2 h a2 fx + b21 fy f = 0 =⇒ a2 c2 = b21 c2 = .
2 2
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
Exercise
Let α be a non-zero real number and let xn = a + nh, n = 0, · · · , N, be a uniform mesh
on the interval [a, b] of step size h = b−a
N
. Consider the explicit one-step method for the
numerical solution of the initial value problem y 0 = f (x, y ), y (a) = y0 , which determines
approximations yn to the values y (xn ) from the recurrence relation
“ h h ”
yn+1 = yn + h(1 − α)f (xn , yn ) + hαf xn + , yn + f (xn , yn ) .
2α 2α
Show that this method is consistent and that its truncation error, Tn (h, α), can be
expressed as
h2
»„ « –
4 ∂f
Tn (h, α) = α − 1 y 000 (xn ) + y 00 (xn ) (xn , y (xn )) + O(h3 ).
8α 3 ∂y
This numerical method is applied to the initial value problem y 0 = −y p , y (0) = 1, where
p is a positive integer. Show that if p = 1 then Tn (h, α) = O(h2 ) for every non-zero real
number α. Show also that if p ≥ 2 then there exists a non-zero real number α0 such that
Tn (h, α0 ) = O(h3 ).
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
yn+1 = yn + h [c1 k1 + c2 k2 + c3 k3 ] ,
where
k1 = f (x, y ),
k2 = f (x + ha2 , y + hb21 k1 ),
k3 = f (x + ha3 , y + hb31 k1 + hb32 k2 ),
a2 = b21 , a3 = b31 + b32 .
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
1
k2 = f + ha2 (fx + k1 fy ) + h2 a22 (fxx + 2k1 fxy + k12 fyy ) + O(h3 )
2
1 2 2
= f + ha2 (f x + f fy ) + h a2 (fxx + 2f fxy + f 2 fyy ) + O(h3 )
2
2
1
= f + ha2 F1 + a22 F2 + O(h3 ),
h
where
F1 = fx + f fy and F2 = fxx + 2f fxy + f 2 fyy ,
Introduction and Preliminaries Picard’s Theorem One-step Methods Error analysis of the θ- method General explicit one-step met
and