




























































































Estude fácil! Tem muito documento disponível na Docsity
Ganhe pontos ajudando outros esrudantes ou compre um plano Premium
Esta página não é visível na pré-visualização
Não perca as partes importantes!





























































































The first edition of this book was published by McGraw-Hill,Inc. (NewYork, 1992).
ISBN: 0-8247-0443-
This book is printed on acid-free paper.
Headquarters Marcel Dekker, Inc. 270 Madison Avenue, blew York, NY tel: 212-696-9000;fax: 212-685-
Eastern HemisphereDistribution Marcel Dekker AG Hutgasse 4, Postfach 812, CH-4001Basel, Switzerland tel: 41-61-261-8482;fax: 41-61-261-
World Wide Web http://www.dekker.com
Thepublisher offers discounts on this book whenordered in bulk quantities. For more information, write to Special Sales/’Professional Marketingat the headquarters address above.
Copyright © 2001 by Marcel Dekker, Inc. All Rights Reserved.
Neither this book nor any part maybe reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying,microfilming, and recording, or by any informa- tion storage and retrieval system, without permissionin writing from the publisher.
Currentprinting (last digit) 10987654321
PRINTED IN THE UNITED STATES OF AMERICA
vi (^) Preface
a form similar to pseudocodeto facilitate the implementationof the algorithms in other programminglanguages. More examples and more problems have been added throughout the book. The overall objective of the secondedition is to improvethe presentation format and material content of the first edition in a mannerthat not only maintains but enhancesthe usefullness and ease of use of the first edition. Manypeople have contributed to the writing of this book. All of the people acknowledgedin the Preface to the First Edition are again acknowledged,especially my loving wife, Cynthia Louise Hoffman. Mymanygraduate students provided much help and feedback, especially Drs. D. Hofer, R. Harwood,R. Moore,and R. Stwalley. Thanks, guys. All of the figures were prepared by Mr. MarkBass. Thanks, Mark. Onceagain, my expert wordprocessing specialist, Ms. Janice Napier, devoted herself unsparingly to this second edition. Thankyou, Janice. Finally, I wouldlike to acknowledgemycolleague, Mr. B. J. Clark, Executive Acquisitions Editor at Marcel Dekker,Inc., for his encouragement and support during the preparation of both editions of this book.
Joe D. Hoffman
Contents
Preface
Chapter 0. 0.1. 0.2. 0.3. 0.4. 0.5. 0.6. 0.7. 0.8.
Part I. 1.1. 1.2. 1.3. 1.4. 1.5. 1.6. 1.7.
Introduction Objectives and Approach Organization of the Book Examples Programs Problems Significant Digits, Precision, Accuracy,Errors, and NumberRepresentation Software Packages and Libraries The Taylor Series and the Taylor Polynomial Basic Tools of NumericalAnalysis Systems of Linear Algebraic Equations Eigenproblems Roots of Nonlinear Equations Polynomial Approximationand Interpolation NumericalDifferentiation and Difference Formulas NumericalIntegration Summary Chapter 1. Systems of Linear Algebraic Equations 1.1. Introduction 1.2. Properties of Matrices and Determinants 1.3. Direct Elimination Methods 1.4. LUFactorization 1.5. (^) Tridiagonal Systems of Equations 1.6. (^) Pitfalls of Elimination Methods 1.7. Iterative Methods 1.8. Programs 1.9. Summary Exercise Problems
Chapter 2. Eigenproblems 2.1. Introduction 2.2. MathematicalCharacteristics of Eigenproblems 2.3. The Power Method
vii
Contents ix
6.4. Extrapolation and RombergIntegration 6.5. Adaptive Integration 6.6. Gaussian Quadrature 6.7. Multiple Integrals 6.8. Programs 6.9. Summary Exercise Problems Part II. II.1. 11.2. II.3. II.4. II.5. 11.6. 11.7.
OrdinaryDifferential Equations Introduction General Features of Ordinary Differential Equations Classification of OrdinaryDifferential Equations Classification of Physical Problems Initial-Value OrdinaryDifferential Equations Boundary-ValueOrdinary Differential Equations Summary
Chapter 7. 7.1. 7.2. 7.3. 7.4. 7.5. 7.6. 7.7. 7.8. 7.9. 7.10. 7.11. 7.12. 7.13. 7.14. 7.15. 7.16.
One-DimensionalInitial-Value Ordinary Differential Equations Introduction General Features of Initial-Value ODEs The Taylor Series Method The Finite Difference Method The First-Order Euler Methods Consistency, Order, Stability, and Convergence Single-Point Methods Extrapolation Methods Multipoint Methods Summaryof Methods and Results Nonlinear Implicit Finite Difference Equations Higher-Order Ordinary Differential Equations Systemsof First-Order Ordinary Differential Equations Stiff OrdinaryDifferential Equations Programs Summary Exercise Problems
Chapter 8. 8.1. 8.2. 8.3. 8.4. 8.5. 8.6. 8.7. 8.8. 8.9. 8.10. 8.11.
One-DimensionalBoundary-ValueOrdinary Differential Equations Introduction General Features of Boundary-Value ODEs The Shooting (initial-Value) Method The Equilibrium (Boundary-Value) Method Derivative (and Other) BoundaryConditions Higher-Order Equilibrium Methods The Equilibrium Method for Nonlinear Boundary-ValueProblems The Equilibrium Method on Nonuniform Grids Eigenproblems Programs Summary Exercise Problems
x (^) Contents
Part III. III. 1. 111.2. III.3. 111.4. 111.5. III.6. Ill.7. 111.8. 111.9. III. 10. IlL 11.
Partial Differential Equations Introduction General Features of Partial Differential Equations Classification of Partial Differential Equations Classification of Physical Problems Elliptic Partial Differential Equations Parabolic Partial Differential Equations HyperbolicPartial Differential Equations The Convection-Diffusion Equation Initial Values and BoundaryConditions Well-Posed Problems Summary
Chapter 9.1. 9.2. 9.3. 9.4. 9.5. 9.6. 9.7. 9.8. 9.9. 9.10. 9.11. 9.12. 9.13. 9.14.
Chapter 10.1. 10.2. 10.3. 10.4. 10.5. 10.6. 10.7. 10.8. 10.9. 10.10. 10.11. 10.12. 10A3.
Chapter 11.1. 11.2.
Introduction
0.1. Objective and Approach 0.2. Organization of the Book 0.3. Examples 0.4. Programs 0.5. Problems 0.6. Significant Digits, Precision, Accuracy,Errors, and NumberRepresentation 0.7. Software Packages and Libraries 0.8. The Taylor Series and the Taylor Polynomial
This Introduction contains a brief description of the objectives, approach,and organization of the book. The philosophy behind the Examples,Programs, and Problemsis discussed. Several years’ experiencewith the first edition of the bookhas identified several simple, but significant, concepts whichare relevant throughoutthe book, but the place to include them is not clear. Theseconcepts, whichare presented in this Introduction, include the definitions of significant digits, precision, accuracy,and errors, and a discussionof number representation. A brief description of software packagesand libraries is presented. Last, the Taylor series and the Taylor polynomial, which are indispensable in developing and understanding manynumerical algorithms, are presented and discussed.
The objective of this book is to introduce the engineer and scientist to numericalmethods which can be used to solve mathematicalproblemsarising in engineering and science that cannot be solved by exact methods. With the general accessibility of high-speed digital computers, it is nowpossible to obtain rapid and accurate solutions to manycomplex problemsthat face the engineer and scientist. The approach taken is as follows:
(^2) Chapter
The material in the book is divided into three mainparts.:
I. Basic Tools of Numerical Analysis II. Ordinary Differential Equations III. Partial Differential Equations : Part I considers manyof the basic problemsthat arise in all branchesof engineering and science. These problemsinclude: solution of systems of linear algebraic equations, eigenproblems, solution of nonlinear equations, polynomial approximationand interpola- tion, numerical differentiation and difference formulas, and numerical integration. These topics are importantboth in their ownright and as the foundation for Parts II and III. Part II is devoted to the numerical solution of ordinary differential equations (ODEs). The general features of ODEsare discussed. The two classes of ODEs(i.e., initial-value ODEsand boundary-value ODEs)are introduced, and the two types of physical problems (i.e., propagation problems and equilibrium problems) are discussed. Numerousnumerical methods for solving ODEsare presented. Part III is devotedto the numericalsolution of partial differential equations (PDEs). Somegeneral features of PDEsare discussed. The three classes of PDEs(i.e., elliptic PDEs,parabolic PDEs,and hyperbolic PDEs)are introduced, and the two types of physical problems (i.e., equilibrium problems and propagation problems) are discussed. Several model PDEsare presented. Numerousnumerical methodsfor solving the model PDEsare presented. The material presented in this book is an introduction to numerical methods. Many practical problems can be solved by the methodspresented here. Manyother p[actical problems require other or more advanced numerical methods. Mastery of the material presented in this book will prepare engineers and scientists to solve manyof their ex)eryday problems, give them the insight to recognize whenother methodsare required, and give them the backgroundto study other methodsin other books and journals.
All of the numerical methodspresented in this book are illustrated by applying themto solve an example problem. Each chapter has one or two example problems, which are solved by all of the methodspresented in the chapter. This approachallows the analyst to comparevarious methodsfor the same problem, so accuracy, efficiency, robustness, and ease of application of the various methodscan be evaluated.
(^4) Chapter
Exercise problems are straightforward problems designed to give practice in the application of the numerical algorithms presented in each chapter. Exercise problems emphasize the mechanics of the methods. Applied problems involve more applied engineering and scientific applications which require numericalsolutions. Manyof the problems can be solved by hand calculation. A large number of the problems require a lot of computational effort. Those problems should be solved by writing a computerprogramto performthe calculations. Evenin those cases, however,it is recommendedthat one or two passes through the algorithm be madeby hand calculation to ensure that the analyst fully understandsthe details of the algorithm. Theseresults also can be used to validate the computerprogram. Answersto selected problemsare presented in a section at the end of the book. All of the problemsfor which answers are given are denoted by an asterisk appearing with the corresponding problem numberin the problem sections at the end of each chapter. The Solutions Manualcontains the answers to nearly all of the problems.
Numericalcalculations obviously involve the manipulation(i.e., addition, multiplication, etc.) of numbers.Numberscan be integers (e.g., 4, 17, -23, etc.), fractions (e.g., -2/3, etc.), or an inifinite string of digits (e.g., n--3.1415926535...). Whendealing with numericalvalues and numericalcalculations, there are several concepts that must be considered: ,
Theseconceptsare discussed briefly ha this section.
Significant Digits
The significant digits, or figures, in a numberare the digits of the numberwhich are knownto be correct. Engineeringand scientific calculations generally begin with a set of data having a knownnumber of significant digits. Whenthese numbers are processed through a numericalalgorithm, it is important to be able to estimate howmanysignificant digits are present in the final computedresult.
Precision and Accuracy Precision refers to howclosely a number represents the number it is representing. Accuracy refers to howclosely a numberagrees with the true value of the numberit is representing. Precision is governed by the number of digits being carried in the numerical calculations. Accuracyis governedby the errors in the numericalapproximation,precision and accuracy are quantified by the errors in a numericalcalculation.
Introduction 5
Errors
The accuracy of a numerical calculation is quantified by the error of the calculation. Several types of errors can occur in numericalcalculations.
NumberRepresentation Numbersare represented in number systems. Any number of bases can be employedas the base of a numbersystem, for example, the base 10 (i.e., decimal) system, the base (i.e., octal) system,the base 2 (i.e., binary) system,etc. Thebase 10, or decimal,system the most commonsystem used for humancommunication.Digital computers use the base 2, or binary, system. In a digital computer,a binary numberconsists of a numberof binary bits. The numberof binary bits in a binary numberdeterminesthe precision with whichthe binary numberrepresents a decimal number. The most commonsize binary numberis a 32 bit number, which can represent approximately seven digits of a decimal number. Some digital computershave 64 bit binary numbers,whichcan represent 13 to 14 decimal digits. In manyengineering and scientific calculations, 32 bit arithmetic is adequate. However,in manyother applications, 64 bit arithmetic is required. In a fewspecial situations, 128 bit arithmetic maybe required. On 32 bit computers, 64 bit arithmetic, or even 128 bit arithmetic, can be accomplished using software enhancements. Such calculations are called double precision or quad precision, respectively. Such software enhancedpre- cision can require as muchas 10 times the executiontime of a single precision calculation.
Introduction 7
and the capability to create your own functions. Mathsoft, Inc., 101 Main Street, Cambridge, MA02142-1521. (800) 628-4223, (617) 577-1017, [email protected], www.mathcad.com. Matlab Matlab is an integrated computing environment that combines numeric computation, advanced graphics and visualization, and a high-level programming language. It provides core mathematicsand advancedgraphics tools for data analysis, visualization, and algorithm and application development, with more than 500 mathe- matical, statistical, and engineering functions. The Mathworks,Inc., 3 AppleHill Drive, Natick, MA01760-2090. (508) 647-7000, [email protected], www.mathworks.com.
B. Libraries GAMSGAMS(Guide to Available Mathematical Software) is a guide to over 9000 software modulescontained in some80 software packages at NIST(National Institute for Standards and Technology) and NETLIB.gams.nist.gov. IMSLIMSL(International Mathematicsand Statistical Library) is a comprehensive resource of more than 900 FORTRANsubroutines for use in general mathematics and statistical data analysis. Also available in C and Java. Visual Numerics,Inc., 1300 W.Sam Houston Parkway S., Suite 150, Houston TX77042. (800) 364-8880, (713) 781-9260, [email protected], www.vni.com. LAPACKLAPACKis a library of FORTRAN77 subroutines for solving linear algebra problems and eigenproblems. Individual subroutines can be obtained through NETLIB.The complete package can be obtained from NAG. NAGNAGis a mathematical software library that contains over 1000 mathematical and statistical functions. Available in FORTRANand C. NAG,Inc., 1400 Opus Place, Suite 200, Downers Grove, IL 60515-5702. (630) 971-2337, [email protected], www.nag.com. NETLIBNETLIBis a large collection of numerical libraries, [email protected]. com, [email protected], [email protected].
C. Numerical Recipes NumericalRecipes is a book by WilliamH. Press, Brian P. Flarmery, Saul A. Teukolsky, and William T. Vetterling. It contains over 300 subroutines for numerical algorithms. Versions of the subroutines are available in FORTRAN,C, Pascal, and Basic. The source codes are available on disk. CambridgeUniversity Press, 40 West20th Street, NewYork, NY10011. www.cup.org.
A powerseries in powersof x is a series of the form
Y~.anx~ = ao + a~x + azx^2 +... n=O A powerseries in powersof (x - x0) is given
~ an(x- Xo)"=o +at(x - Xo) + az(x -- X0)^2 --{ - ¯ ¯ ¯ n=
(^8) Chapter
Within its radius of convergence, r, any continuous function, f(x), can be represented exactly by a powerseries. Thus,
f(x) = ~ a,(x - Xo)" (^) (0.3) n= is continuousfor (x 0 - r) < x < (xo + r).
A. Taylor Series in One Independent Variable
If the coefficients, an, in Eq. (0.3) are givenby the rule: a0 =f(xo) ’ al = ~.f,(xo) (^) ’ a2 1 " x , = ~f (0) ... (0.4)
then Eq. (0.3) becomesthe Taylor series off(x) at x o.Thus,
f(x) =f(xo) ~.f’(xo)(X - Xo) + ~ f" (xo)(X - Xo)^2 +... (0.5)
Equation (0.5) can be written in the simpler appearing form
, 1 ,, ~ (^) lf(n)Ax f(x) =fo +f~Ax + -~f~ ~ +. .. + ~ n! o + "" (0.6)
wherefo = f (xo),f (n) = df(") / ", and Ax= (x - Xo) Equation (056)can bewrittenin the compact form
f(x) = Y~ ~fot")(x - Xo)" (^) , (0.7) n=0 n! Whenx0 = 0, the Taylor series is knownas the Madaurinseries. In that case, Eqs. (0.5) and (0.7) become
f(x) =f(0) + f’(O)x + ½ f"(O)x^2 +... (0.8)
f(x) = (n)(0)x~ (0.9)
It is, of course, impractical to evaluate an infinite Taylor series term by term. The Taylor series can be written as the finite Taylor series, also knownas the Taylor formula or Taylor polynomial with remainder, as follows: f(x) =/(Xo) _+ f’(xo)(X - Xo) +l_g f,,(Xo)( x __ Xo)2+...
+ ~.f(")(Xo)(X n + Rn+l
where the term Rn+l is the remainder term given by
R,+I _ 1 f(n+l)(~)(x - "+1 Xo)^ (0.11) (n+~ 1)! where~ lies betweenx0 and x. Equation(0. i0) is quite useful in numericalanalysis, where an approximation off@) is obtained by truncating the remainder term.