springer978-3-642-61074... · 2017-08-23 · gisela engeln-miillges is professor of numerical...
TRANSCRIPT
NUMERICAL ALGORITHMS WITH C
Springer Berlin
Heidelberg New York Barcelona Budapest
Hong Kong London
Milan Paris
Santa Clara Singapore
Tokyo
Gisela Engeln-Miillges is Professor of Numerical Mathematics and Computer Science in the Department of Mechanical Engineering and Pro rector for Research and Development at the Fachhochschule Aachen. She advises engineers at academia and in industry on the application of numerical methods and has published numerous books.
Frank Uhlig is Professor of Mathematics at Auburn University. He has been awarded two Fulbright Grants and has organized several research conferences. His research activity and publications are in linear algebra, matrix theory, numerical analysis, geometry, Krein spaces, graph theory, mechanics, and inverse problems.
GISELA ENGELN-MULLGES FRANK UHLIG
Numerical Algorithms withC
With CD-ROM
With 46 Figures
{~~IP.' Springer
Gisela Engeln-Miillges Fachhochschule Aachen GoethestraBe 1 D-52064 Aachen, Germany
Frank Uhlig Auburn University Department of Mathematics 218 Parker Hall Auburn, AL 36849-5310, USA
Translated by Maria Schon and Frank Uhlig CD-ROM with ANSI C Programs by Albert Becker, Jiirgen Dietel and Uli Eggermann
Cataloging-in-Publication Data applied for Die Deutsche Bibliothek - CIP-Einheitsaufnahme Numerical algorithms with C/Gisela Engeln-Miillges; Frank Uhlig. 'fransl. by Maria Schon and Frank Uhlig. - Berlin; Heidelberg; New York, Barcelona; Budapest; Hong Kong; London; Milan; Paris; Santa Clara; Singapore; Tokyo: Springer.
NE: Engeln-Miillges, Gisela; Uhlig, Frank Buch. - 1996
ISBN-13: 978-3-642-64682-9 DOl: 10.1007/978-3-642-61074-5
e-ISBN-13: 978-3-642-61074-5
This work consists of a printed book and a CD-ROM packaged with the book, and is subject to copyright. All rights are reserved, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on micro-film or in any other way, and storage in data banks. Duplication of this publication or parts thereof is permitted only under the provisions of the German Copyright Law of September 9, 1965, in its current version, and permission for use must always be obtained from Springer-Verlag. Violations are liable for prosecution under the German Copyright Law. Springer-Verlag or the authors make no warranty of representation, either express or implied, with respect to this CD-ROM or book, including their quality, merchantability, or fitness for a particular purpose. In no event will Springer-Verlag or the authors be liable for direct, indirect, special, incidental, or consequential damages arising out of the use or inability to use the CD-ROM or book, even if Springer-Verlag or the authors have been advised of the possibility of such damages. © Springer-Verlag Berlin Heidelberg 1996 Softcover reprint of the hardcover 1 st edition 1996
The use of general descriptive names, trademarks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use. Cover Design: Kiinkel + Lopka Werbeagentur, nvesheim Typesetting: Camera ready by authors Printed on acid-free paper SPIN 10575405 33/3111 - 5 4 3 2
Preface
This book was begun about 20 years ago jointly by Gisela Engeln-Miillges and Fritz Reutter at the Technical University in Aachen (RWTH), Germany. Its first edition in 1974 was entitled "Formelsammlung zur Numerischen Mathematik mit FORTRAN-Programmen". It was based on courses in numerical analysis taught mainly to engineering students at the RWTH.
Professor Fritz Reutter (1911 - 1990) actively continued working on the text portion of this book until about 1978, and he served as a valued advisor until its third German edition in 1981. After 1983, his grave illness precluded him from developing this book further.
From the fourth to the seventh German editions (1984 - 1993), now entitled "Numerik-Algorithmen mit FORTRAN 77-Programmen", the book increased almost threefold in volume. This was due in part to the inclusion of new subject areas such as two-dimensional splines and numerical cubature, as well as to the presentation of new methods in the text and program portions of this book, such as Akima and Renner subsplines, Bezier and B-splines, and Runge-Kutta embedding formulas.
This book on "N mnerical Algorithms with e" is a translation of the seventh German edition (1993) with a few updates and changes of emphasis implemented by the new coauthor, Frank Uhlig of Auburn University. There are slight differences between this English edition and the current German edition, especially in chapters 1, 4, 7, 8 and 9.
Our book has a twofold purpose: for one it gives an informal introduction to the mathematical and computational principles of over 150 numerical algorithms, complete with many illustrations, as well as practical guidelines to their usage. Moreover a CD provides easy access to widely tested computer codes for these and other algorithms together with a battery of test programs and test examples and additional software. The wide range of quoted literature serves to broaden the treated subjects and is meant to help our users.
VI Preface
The book is not meant to be a textbook on 'Numerical Analysis': we include no single proof, hardly any examples and no problems. Our emphasis when writing this book lay in explaining the principles of various methods, and in describing efficient and proven algorithms for the standard methods of Numerical Analysis, as well as documenting and developing them. Moreover this book presents many not easily accessible and newly developed algorithms which prove to be of great merit in numerical computations.
The following topics are covered in 18 chapters:
- Computer representation of numbers, error and conditioning analysis, stability of algorithms.
- Methods to solve nonlinear and algebraic equations.
- Direct and iterative algorithms for solving linear systems of equations, both dense and sparse, structured and unstructured.
- Systems of nonlinear equations.
- Eigenvalues and eigenvectors of matrices.
- Linear and nonlinear approximation.
- Polynomial and rational approximation.
- Interpolating polynomial splines and cubic fitting splines for generating smooth curves.
- Two-dimensional splines, surface splines, Bezier splines, and B-splines.
- Akima and Renner subsplines.
- Numerical differentiation.
- Numerical integration.
- Numerical cubature.
- Initial and boundary value problems for ordinary differential equations.
Many algorithms in this book can only be found in the primary literature and are not available in programmed form elsewhere. Several algorithms were developed specifically for this book. These include: specific surely converging methods for solving nonlinear equations; methods for solving linear systems of equations with many specially structured system matrices as they appear naturally for splines e.g., in general or symmetric banded form with and without sparsity; Shepard interpolation; one- and multidimensional splines of several
Preface VII
types; Akima and Renner splines with and without rounding of corners and applications for finding arc length; numerical quadrature formulas of all stable orders, partially implemented adaptively; cubature for rectangular and triangular regions; stable adaptive initial value problem solvers and embedding methods up to order 9; effective methods of automatic step size control.
Our programs have proved their worth in the field. They have been widely applied and tested and are kept up to date continuously. We also keep developing and implementing new variants of existing methods. Clearly all of this cannot be detailed completely in the text portion. For more information on current developments and new additional software, we refer our users to our WWW sites below. To illustrate, our programs include versions of the FFT for node numbers not a power of two. Likewise surface splines for interpolation triples (Xi, Yi, Zi = f(Xi, Yi)) as described in the text part of the book have been augmented in the program section by surface splines for 4~tuples (Xi, Yi, Zi, fi) to interpolate functions w = f(x, y, z) as well.
All our programs supply the user with detailed error listings, should such be encountered. Many of our algorithms then propose alternate methods. The programs themselves are completely annotated. Our Numerical Library is used in industry, universities and research institutions. Over the last few years, we have issued more than 3000 individual site licenses and more than 50 campus licenses. To enhance this Numerical Library, we have developed additional software packages such as 2D /3D graphics programs, a symbolic language interpreter, and a program to plot implicit planar curves F(x, y) = 0 on a rectangle for example.
With the users of our previous German editions we have developed a steady and pleasant exchange of ideas over the years that has helped us stay up to date. We would be delighted if this exchange would continue with our users in English now. We shall welcome all comments and suggestions heartily.
We are indebted to many authors for their research work and to many programmers who have realized our programs. Especially we thank Andreas Beumers in Aachen, who has used his expertise to typeset this book in Jb.1EX and has produced the final printer's copy. Most of the drawings were done by Bjorn Terwege in PJ:CIEX in Aachen. The editing work on two continents would not have been possible without Rosie Torbert, Darryl Hankerson and Greg Harris at Auburn, and e-mail. An early English translation was started by Maria Schon of Aachen; Hans Neubarth, Doris Eggermann and Jorg Lindemann read the proofs. We thank Reinhard Wodicka for many useful hints and discussions and cooperation to the sections on B~splines and Akima and Renner subsplines. Finally we thank Springer Verlag in Heidelberg for supporting this book. Special mention here is due to H. Engesser for his support and help.
VIII Preface
Almost none of our work would have been possible to accomplish without the continuous help and encouragement from our friends and families.
February 1996
Information
Gisela Engeln-Miillges
Frank Uhlig
on campus and site licenses for the Numerical Library in the programming languages FORTRAN 77/90, Turbo Pascal, ANSI C, QuickBASIC, as well as on further software packages can be obtained by FAX or e-mail:
Prof. Dr. Gisela Engeln-Miillges Kesselstra13e 88
D-52076 Aachen-Lichtenbusch
FAX: +4924087812
e-mail: [email protected]
Frank Uhlig 706 Cary Dr.
Auburn, AL 36830 USA
FAX: (334) 8446555
e-mail: [email protected]
Further information together with current updates are to be found on the WWW at:
http://www.fh-aachen.de/home/engeln-muellges/num-alg.html or
http://www.auburn.edu/num-alg.html
Notations
=}
¢:}
.-!
<, < >, > a« b '" -"',-
{al, a2, ... }
{x I ... } E
~ C
c rt. IN
INo
l
Q IR
C
IR+,IR
(a, b)
[a, b] [a, b)
implies, logical implication
if and only if, iff
set equal to by definition
equality to be shown or obtained
less than, less than or equal to
greater than, or greater than or equal to
a is significantly smaller than b approximately
identity
proportional to
set with elements at, a2, ...
set of all x for which ... is true
element of
not an element of
contained in, a subset of
properly contained in, a proper subset of
not a subset of
set of positive integers 1, 2, 3, ...
set of nonnegative integers 0, 1, 2, ...
set of integers ... ,-2,-1,0,1,2, ...
set of rational numbers
set of real numbers
set of complex numbers
set of positive or negative real numbers, respectively
open interval from a to b, a < b
closed interval from a to b, a ~ b half open interval from a to b (open on the right), a < b
x
(a, b]
n!
(~) n
I1 ai i=l
n L ai i=l b
J a
e
lal
11·11
{ak}
lim ak k-+oo
Notations
half open interval from a to b (open on the left), a<b
n factorial, n! := 1 ·2·3· .. n for n E IN with O! := 1
n choose k, (~) := k!(:~k)! for k E IN o, k ~ n, n E IN
the product al . a2 . a3 ... an
the sum al + a2 + ... + an
definite integral from a to b
imaginary unit, i := A Euler constant, e = 2.718 281 828 459 045 235 36 ...
7r,7r = 3.141 59265358979323846 ...
{ a for a ~ 0 magnitude of a, lal:= -a for a < 0
norm of·
sequence of ak
limit of ak for k -+ 00
max {J(x) I x E [a, b]} maximum of the function f(x) for x E [a, b] min {IMill i = 1,2, ... ,m} minimum over IMil for i = 1,2, ... ,m (x, y) ordered pair
(Xl, X2,.··, X n ) n tupel
f:I-+IR X -+ f(x),x E D f', f", fill, f(4), ... , f(n)
C[a,b] cn[a, b]
IR n
A = O(hq )
sign (a)
x, y, z, .. .
A,B,C, .. .
o xxy
I AT
a real valued function f from I to IR
X is mapped to f(x) for xED first, second, third, fourth, ... , nth derivative of f set of continuous functions on [a, b] set of n fold continously differentiable function on [a, b]
n dimensional real space
IA/hql ~ C for h -+ O,C = canst
sign of a
vectors
matrices
zero vector
cross product of two vectors x and y
identity matrix
transpose matrix of A
Notations
A-1
det(A)
[ABC] w.l.o.g.
".wpose vee'm of x = ( :~ )
inverse matrix of a square matrix A
determinant of a square matrix A
see quote in the bibliography under [ABC] without loss of generality
XI
Contents
1 Computer Numbers, Error Analysis, Conditioning, Stability of Algorithms and Operations Count ................ 1
1.1 Definition of Errors ............................................. 1
1.2 Decimal Representation of Numbers ............................ 3 1.3 Sources of Errors ............................................... 6
1.3.1 Input Errors ................................................ 6 1.3.2 Procedural Errors ........................................... 7
1.3.3 Error Propagation and the Condition of a Problem .......... 7
1.3.4 The Computational Error and Numerical Stability of an Algorithm ........................................... 10
1.4 Operations Count, et cetera ................................... 11
2 Nonlinear Equations in One Variable ......................... 13
2.1 Introduction ................................................... 13 2.2 Definitions and Theorems on Roots ............................ 14 2.3 General Iteration Procedures .................................. 15
2.3.1 How to Construct an Iterative Process ..................... 15 2.3.2 Existence and Uniqueness of Solutions ..................... 16 2.3.3 Convergence and Error Estimates of Iterative Procedures ... 17 2.3.4 Practical Implementation .................................. 20
2.4 Order of Convergence of an Iterative Procedure ................ 22 2.4.1 Definitions and Theorems .................................. 22
2.4.2 Determining the Order of Convergence Experimentally ..... 24 2.5 Newton's Method ............................................. 25
2.5.1 Finding Simple Roots ...................................... 25 2.5.2 A Damped Version of Newton's Method .................... 27
2.5.3 Newton's Method for Multiple Zeros; a Modified Newton's Method ................................................... 27
XIV Contents
2.6 Regula Falsi ................................................... 28
2.6.1 Regula Falsi for Simple Roots .............................. 28
2.6.2 Modified Regula Falsi for Multiple Zeros ................... 30
2.6.3 Simplest Version of the Regula Falsi ....................... 30
2.7 Steffensen Method ............................................. 31
2.7.1 Steffensen Method for Simple Zeros ........................ 31
2.7.2 Modified Steffensen Method for Multiple Zeros ............. 31
2.8 Inclusion Methods ............................................. 32
2.8.1 Bisection Method .......................................... 32
2.8.2 Pegasus Method ........................................... 34
2.8.3 Anderson-Bjorck Method .................................. 36
2.8.4 The King and the Anderson-Bjorck-King Methods, the Illinois Method ........................................ 39
2.8.5 Zeroin Method ............................................ 39
2.9 Efficiency of the Methods and Aids for Decision Making ....... .40
3 Roots of Polynomials ........................................... 43
3.1 Preliminary Remarks .......................................... 43
3.2 The Horner Scheme ........................................... 44
3.2.1 First Level Horner Scheme for Real Arguments ............ .44
3.2.2 First Level Horner Scheme for Complex Arguments ........ 45 3.2.3 Complete Horner Scheme for Real Arguments .............. 47 3.2.4 Applications .............................................. .49
3.3 Methods for Finding all Solutions of Algebraic Equations ...... 49
3.3.1 Preliminaries .............................................. 49
3.3.2 Muller's Method ........................................... 51 3.3.3 Bauhuber's Method ........................................ 54
3.3.4 The Jenkins-'!raub Method ................................ 55
3.3.5 The Laguerre Method ..................................... 56
3.4 Hints for Choosing a Method .................................. 56
4 Direct Methods for Solving Systems of Linear Equations .. 59
4.1 The Problem .................................................. 59
4.2 Definitions and Theoretical Background ........................ 60
4.3 Solvability Conditions for Systems of Linear Equations ......... 66 4.4 The Factorization Principle .................................... 67
4.5 GauE Algorithm ............................................... 68
4.5.1 GauE Algorithm with Column Pivot Search ................ 68
Contents xv
4.5.2 Pivot Strategies ........................................... 72
4.5.3 Computer Implementation of GauB Algorithm .............. 73 4.5.4 GauB Algorithm for Systems with Several Right Hand Sides 76
4.6 Matrix Inversion via GauB Algorithm .......................... 77 4.7 Linear Equations with Symmetric Strongly Nonsingular
System Matrices ............................................... 78 4.7.1 The Cholesky Decomposition .............................. 78
4.7.2 The Conjugate Gradient Method ........................... 83 4.8 The GauB - Jordan Method .................................... 87 4.9 The Matrix Inverse via Exchange Steps ........................ 88
4.10 Linear Systems with Tridiagonal Matrices ...................... 89 4.10.1 Systems with Tridiagonal Matrices ......................... 89 4.10.2 Systems with Tridiagonal Symmetric Strongly
Nonsingular Matrices ...................................... 92
4.11 Linear Systems with Cyclically Tridiagonal Matrices ........... 94 4.11.1 Systems with a Cyclically Tridiagonal Matrix .............. 94
4.11.2 Systems with Symmetric Cyclically Tridiagonal Strongly Nonsingular Matrices ............................. 96
4.12 Linear Systems with Five-Diagonal Matrices ................... 98 4.12.1 Systems with Five-Diagonal Matrices ...................... 98 4.12.2 Systems with Five-Diagonal Symmetric Matrices .......... 100
4.13 Linear Systems with Band Matrices .......................... 102 4.14 Solving Linear Systems via Householder Transformations ...... 107 4.15 Errors, Conditioning and Iterative Refinement ................ 112
4.15.1 Errors and the Condition Number ........................ 112 4.15.2 Condition Estimates ...................................... 114 4.15.3 Improving the Condition Number ......................... 116 4.15.4 Iterative Refinement ...................................... 117
4.16 Systems of Equations with Block Matrices .................... 119 4.16.1 Preliminary Remarks ..................................... 119 4.16.2 GauB Algorithm for Block Matrices ....................... 120 4.16.3 GauB Algorithm for Block Tridiagonal Systems ........... 121 4.16.4 ()ther Block Methods ..................................... 121
4.17 The Algorithm of Cuthill-McKee for Sparse Symmetric Matrices ..................................................... 122
4.18 Recommendations for Selecting a Method ..................... 127
XVI Contents
5 Iterative Methods for Linear Systems ....................... 131
5.1 Preliminary Remarks ......................................... 131 5.2 Vector and Matrix Norms .................................... 132 5.3 The Jacobi Method .......................................... 133 5.4 The GauB-Seidel Iteration .................................... 137 5.5 A Relaxation Method using the Jacobi Method ............... 139 5.6 A Relaxation Method using the GauB-Seidel Method .......... 140
5.6.1 Iteration Rule ............................................ 140 5.6.2 Estimate for the Optimal Relaxation Coefficient,
an Adaptive SOR Method ................................ 141
6 Systems of Nonlinear Equations ............................. 143
6.1 General Iterative Methods .................................... 143 6.2 Special Iterative Methods .................................... 148
6.2.1 Newton Methods for Nonlinear Systems ................... 148 6.2.1.1 The Basic Newton Method ............................. 148 6.2.1.2 Damped Newton Method for Systems ................... 149 6.2.2 Regula Falsi for Nonlinear Systems ....................... 151 6.2.3 Method of Steepest Descent for Nonlinear Systems ........ 152 6.2.4 Brown's Method for Nonlinear Systems ................... 154
6.3 Choosing a Method .......................................... 154
7 Eigenvalues and Eigenvectors of Matrices .................. 155
7.1 Basic Concepts ............................................... 155 7.2 Diagonalizable Matrices and the Conditioning of the
Eigenvalue Problem .......................................... 157 7.3 Vector Iteration .............................................. 159
7.3.1 The Dominant Eigenvalue and the Associated Eigenvector of a Matrix ................................... 159
7.3.2 Determination of the Eigenvalue Closest to Zero .......... 164 7.3.3 Eigenvalues in Between ................................... 164
7.4 The Rayleigh Quotient for Hermitian Matrices ................ 166 7.5 The Krylov Method .......................................... 167
7.5.1 Determining the Eigenvalues .............................. 167 7.5.2 Determining the Eigenvectors ............................. 169
7.6 Eigenvalues of Positive Definite Tridiagonal Matrices, the QD Algorithm ............................................ 170
7.7 Transformation to Hessenberg Form, the LR and QR Algorithms ............................................... 171
Contents XVII
7.7.1 Transformation of a Matrix to Upper Hessenberg Form .... 172 7.7.2 The LR Algorithm ....................................... 174 7.7.3 The Basic QR Algorithm ................................. 175
7.8 Eigenvalues and Eigenvectors of a Matrix via the QR Algorithm 176 7.9 Decision Strategy ............................................ 178
8 Linear and Nonlinear Approximation ....................... 179
8.1 Linear Approximation ........................................ 180 8.1.1 Statement of the Problem and Best Approximation ....... 180 8.1.2 Linear Continuous Root-Mean-Square Approximation ..... 184 8.1.3 Discrete Linear Root-Mean-Square Approximation ........ 188 8.1.3.1 Normal Equations for Discrete Linear Least Squares .... 188 8.1.3.2 Discrete Least Squares via Algebraic Polynomials
and Orthogonal Polynomials ............................ 191 8.1.3.3 Linear Regression, the Least Squares Solution Using
Linear Algebraic Polynomials ........................... 193 8.1.3.4 Solving Linear Least Squares Problems using
Householder Transformations ........................... 194 8.1.4 Approximation of Polynomials by Chebyshev Polynomials .196 8.1.4.1 Best Uniform Approximation ........................... 197
8.1.4.2 Approximation by Chebyshev Polynomials .............. 198 8.1.5 Approximation of Periodic Functions and the FFT ........ 204 8.1.5.1 Root-Mean-Square Approximation of Periodic Functions 204 8.1.5.2 Trigonometric Interpolation ............................ 205 8.1.5.3 Complex Discrete Fourier Transformation (FFT) ........ 207 8.1.6 Error Estimates for Linear Approximation ................ 209 8.1.6.1 Estimates for the Error in Best Approximation ......... 209 8.1.6.2 Error Estimates for Simultaneous Approximation
of a Function and its Derivatives ....................... 211 8.1.6.3 Approximation Error Estimates using Linear Projection
Operators .............................................. 213 8.2 Nonlinear Approximation ..................................... 215
8.2.1 Transformation Method for Nonlinear Least Squares ...... 215 8.2.2 Nonlinear Root-Mean-Square Fitting ...................... 217
8.3 Decision Strategy ............................................ 218
XVIII Contents
9 Polynomial and Rational Interpolation ..................... 219
9.1 The Problem ................................................. 219
9.2 Lagrange Interpolation Formula .............................. 221
9.2.1 Lagrange Formula for Arbitrary Nodes .................... 221
9.2.2 Lagrange Formula for Equidistant Nodes .................. 222 9.3 The Aitken Interpolation Scheme for Arbitrary Nodes ......... 223 9.4 Inverse Interpolation According to Aitken ..................... 225 9.5 Newton Interpolation Formula ................................ 226
9.5.1 Newton Formula for Arbitrary Nodes ..................... 226 9.5.2 Newton Formula for Equidistant Nodes ................... 227
9.6 Remainder of an Interpolation and Estimates of the Interpolation Error ........................................... 229
9.7 Rational Interpolation ........................................ 235
9.8 Interpolation for Functions in Several Variables ............... 239
9.8.1 Lagrange Interpolation Formula for Two Variables ........ 239 9.8.2 Shepard Interpolation .................................... 241
9.9 Hints for Selecting an Appropriate Interpolation Method ...... 247
10 Interpolating Polynomial Splines for Constructing Smooth Curves ................................................ 251
10.1 Cubic Polynomial Splines ..................................... 251 10.1.1 Definition of Interpolating Cubic Spline Functions ......... 252 10.1.2 Computation of Non-Parametric Cubic Splines ............ 254 10.1.3 Computing Parametric Cubic Splines ..................... 259 10.1.4 Joined Interpolating Polynomial Splines ................... 266 10.1.5 Convergence and Error Estimates for Interpolating
Cubic Splines ............................................. 272 10.2 Hermite Splines of Fifth Degree .............................. 275
10.2.1 Definition of Hermite Splines ............................. 275 10.2.2 Computation of Non-Parametric Hermite Splines .......... 276
10.2.3 Computation of Parametric Hermite Splines .............. 280
10.3 Hints for Selecting Appropriate Interpolating or Approximating Splines ....................................... 282
11 Cubic Fitting Splines for Constructing Smooth Curves ... 287
11.1 The Problem ................................................. 287 11.2 Definition of Fitting Spline Functions ......................... 288 11.3 Non-Parametric Cubic Fitting Splines ........................ 289
Contents XIX
11.4 Parametric Cubic Fitting Splines ............................. 296 11.5 Decision Strategy ............................................ 297
12 Two-Dimensional Splines, Surface Splines, Bezier Splines, B-Splines ..................................... 299
12.1 Interpolating Two-Dimensional Cubic Splines for Constructing Smooth Surfaces ................................ 299
12.2 Two-Dimensional Interpolating Surface Splines ............... 309
12.3 Bezier Splines ................................................ 313 12.3.1 Bezier Spline Curves ...................................... 313 12.3.2 Bezier Spline Surfaces .................................... 316 12.3.3 Modified Interpolating Cubic Bezier Splines ............... 324
12.4 B-Splines ..................................................... 325 12.4.1 B-Spline-Curves .......................................... 325 12.4.2 B-Spline-Surfaces ......................................... 331
12.5 Hints ........................................................ 335
13 Akima and Renner Subsplines ............................... 341
13.1 Akima Subsplines ............................................ 341
13.2 Renner Sub splines ............................................ 344 13.3 Rounding of Corners with Akima and Renner Splines ......... 347 13.4 Approximate Computation of Arc Length ..................... 349 13.5 Selection Hints ............................................... 350
14 Numerical Differentiation .................................... 353
14.1 The Task .................................................... 353 14.2 Differentiation Using Interpolating Polynomials ............... 354 14.3 Differentiation via Interpolating Cubic Splines ................ 358 14.4 Differentiation by the Romberg Method ...................... 358 14.5 Decision Hints ................................................ 360
15 Numerical Integration ........................................ 361
15.1 Preliminary Remarks ......................................... 361
15.2 Interpolating Quadrature Formulas ........................... 364 15.3 Newton-Cotes Formulas ....................................... 366
15.3.1 The Trapezoidal Rule ..................................... 367 15.3.2 Simpson's Rule ........................................... 370
xx Contents
15.3.3 The 3/8 Formula ......................................... 371 15.3.4 Other Newton-Cotes Formulas ............................ 373 15.3.5 The Error Order of Newton-Cotes Formulas ............... 375
15.4 Maclaurin Quadrature Formulas .............................. 376 15.4.1 The Tangent Trapezoidal Formula ........................ 376 15.4.2 Other Maclaurin Formulas ................................ 378
15.5 Euler-Maclaurin Formulas .................................... 380 15.6 Chebyshev Quadrature Formulas ............................. 382 15.7 GauB Quadrature Formulas ................................... 385 15.8 Calculation of Weights and Nodes of Generalized Gaussian
Quadrature Formulas ......................................... 389 15.9 Clenshaw-Curtis Quadrature Formulas ........................ 392
15.10 Romberg Integration ......................................... 394 15.11 Error Estimates and Computational Errors ................... 397 15.12 Adaptive Quadrature Methods ............................... 400 15.13 Convergence of Quadrature Formulas ......................... 400 15.14 Hints for Choosing an Appropriate Method ................... 401
16 Numerical Cubature .......................................... 403
16.1 The Problem ................................................. 403 16.2 Interpolating Cubature Formulas ............................. 406 16.3 Newton-Cotes Cubature Formulas for Rectangular Regions ... .408 16.4 Newton-Cotes Cubature Formulas for Triangles ............... 413 16.5 Romberg Cubature for Rectangular Regions .................. 414 16.6 GauB Cubature Formulas for Rectangles ...................... 417 16.7 GauB Cubature Formulas for Triangles ........................ 419
16.7.1 Right Triangles with Legs Parallel to the Axis ............ 419 16.7.2 General Triangles ........................................ .420
16.8 Riemann Double Integrals using Bicubic Splines .............. 421 16.9 Decision Strategy ............................................ 422
17 Initial Value Problems for Ordinary Differential Equations ....................................................... 423
17.1 The Problem ................................................. 423 17.2 Principles of the Numerical Methods ......................... .424 17.3 One-Step Methods ........................................... 426
17.3.1 The Euler-Cauchy Polygonal Method ..................... 426 17.3.2 The Improved Euler-Cauchy Method ..................... .427
Contents XXI
17.3.3 The Predictor-Corrector Method of Heun ................. 428 17.3.4 Explicit Runge-Kutta Methods ........................... 430 17.3.4.1 Construction of Runge-Kutta Methods ................. 430 17.3.4.2 The Classical Runge-Kutta Method .................... .430
17.3.4.3 A List of Explicit Runge-Kutta Formulas ............... 432 17.3.4.4 Embedding Formulas ................................... 436 17.3.5 Implicit Runge-Kutta Methods of Gaussian Type ......... 449 17.3.6 Consistence and Convergence of One-Step Methods ....... 451
17.3.7 Error Estimation and Step Size Control ................... 452 17.3.7.1 Error Estimation ....................................... 452 17.3.7.2 Automatic Step Size Control, Adaptive Methods
for Initial Value Problems .............................. 454 17.4 Multi-Step Methods .......................................... 457
17.4.1 The Principle of Multi-Step Methods ..................... 457 17.4.2 The Adams-Bashforth Method ........................... .458
17.4.3 The Predictor-Corrector Method of Adams-Moulton ...... 460 17.4.4 The Adams-Stormer Method ............................. 465 17.4.5 Error Estimates for Multi-Step Methods ................... 466
17.4.6 Computational Error of One-Step and Multi-Step Methods 467 17.5 Bulirsch-Stoer-Gragg Extrapolation .......................... .468 17.6 Stability ..................................................... 471
17.6.1 Preliminary Remarks ..................................... 471 17.6.2 Stability of Differential Equations ......................... 472 17.6.3 Stability of the Numerical Method ........................ 473
17.7 Stiff Systems of Differential Equations ........................ 477 17.7.1 The Problem ............................................. 477 17.7.2 Criteria for the Stiffness of a System ...................... 478 17.7.3 Gear's Method for Integrating Stiff Systems .............. .479
17.8 Suggestions for Choosing among the Methods ................ .484
18 Boundary Value Problems for Ordinary Differential Equations ....................................................... 489
18.1 Statement of the Problem .................................... 489 18.2 Reduction of Boundary Value Problems to Initial
Value Problems ............................................... 490 18.2.1 Boundary Value Problems for Nonlinear Differential
Equations of Second Order ............................... 490 18.2.2 Boundary Value Problems for Systems of Differential
Equations of First Order .................................. 492
XXII Contents
18.2.3 The Multiple Shooting Method ........................... 494 18.3 Difference Methods ........................................... 497
18.3.1 The Ordinary Difference Method .......................... 497 18.3.2 Higher Order Difference Methods ......................... 504
18.3.3 Iterative Solution of Linear Systems for Special Boundary Value Problems ................................ 506
18.3.4 Linear Eigenvalue Problems .............................. 507
A Appendix: ANSI C Functions ................................ 509
Contents of the Appendix .................................... 511 A.l Preface of the Appendix ...................................... 515 A.2 Contents of the Enclosed CD ................................. 517
A.3 Information on Campus and Site Licenses, as well as on Other Software Packages .................................. 518
A.4 ANSI C Functions ............................................ 521
B Bibliography ................................................... 569
Literature for Other Topics ....................................... 587
- Numerical Treatment of Partial Differential Equations ........ 587 - Finite Element Method ....................................... 588
C Index ........................................................... 591