Page - 149 - in Programming for Computations β Python - A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
Image of the Page - 149 -
Text of the Page - 149 -
6.5 RateofConvergence 149
Clearly,when
h= bβa
n ,
(n sub-intervals of equal size h for an integration interval [a,b]), an alternative
expressionforE followsfrom
E=Khr, (6.22)
=K ( bβa
n )r
, (6.23)
=K(bβa)r (
1
n )r
, (6.24)
which,by introducinganotherconstantC=K(bβa)r, gives
E=Cnβr . (6.25)
Convergence Rate for the Trapezoidal and Midpoint Methods Using, for
example,thetrapezoidalmethod,wemaycarryoutsomeexperimentalrunswithour
test problem β«1
0 3t 2et 3
dt, doublingn foreach run:n=4,8,16.Thecorresponding
errors are then 12%, 3% and 0.78%, respectively. These numbers indicate that the
error is reducedbyroughlya factor4whendoublingn.Thus, it seems that theerror
converges to zero asnβ2, which suggests a convergence rate r = 2. In fact, it can
beshownmathematically that the trapezoidaland the midpointmethodbothhavea
convergencerate r=2, i.e., theyarebothsecond-ordermethods.Soon,wewill see
howthis fact (andmore)canbeexploited in the testingofcode.
Remarkonthe DefinitionofConvergenceRate
When we later address numerical solution methods for ordinary differential
equations (Chap.8), convergencerate is essentially defined like in (6.21),we
just switch (not required) the symbol h with Ξt (i.e., the spacing between
computedsolutionvalues).
However, with iterative methods for the solving of nonlinear algebraic
equations (Chap.7), convergence rate is defined differently. In that case, one
usually relates the error at an iteration to the error at the previous iteration,
and theconvergencerateappearsasa parameter in that relation.
Programming for Computations β Python
A Gentle Introduction to Numerical Simulations with Python 3.6, Volume Second Edition
- Title
- Programming for Computations β Python
- Subtitle
- A Gentle Introduction to Numerical Simulations with Python 3.6
- Volume
- Second Edition
- Authors
- Svein Linge
- Hans Petter Langtangen
- Publisher
- Springer Open
- Date
- 2020
- Language
- English
- License
- CC BY 4.0
- ISBN
- 978-3-319-32428-9
- Size
- 17.8 x 25.4 cm
- Pages
- 356
- Keywords
- Programmiersprache, Informatik, programming language, functional, imperative, object-oriented, reflective
- Category
- Informatik