14
8/9/2019 Numerical Method-steven c Chapra http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 1/14 Numerical  Methods for Engineers Sixth Edition Steven C. Chapra Raymond P. Canale

Numerical Method-steven c Chapra

Embed Size (px)

Citation preview

Page 1: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 1/14

Numerical

 Methodsfor Engineers

Sixth Edition

Steven C. Chapra 

Raymond P. Canale

Page 2: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 2/14

Numerical Methodsfor Engineers

SIXTH EDITION

Steven C. ChapraBerger Chair in Computing and Engineering

Tufts University

Raymond P. CanaleProfessor Emeritus of Civil EngineeringUniversity of Michigan

Page 3: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 3/14

 NUMERICAL METHODS FOR ENGINEERS, SIXTH EDITION

Published by McGraw-Hill, a business unit of The McGraw-Hill Companies, Inc., 1221 Avenue of the Americas, New York, NY 10020.

Copyright © 2010 by The McGraw-Hill Companies, Inc. All rights reserved. Previous editions © 2006, 2002, and 1998. No part of this

 publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior 

written consent of The McGraw-Hill Companies, Inc., including, but not limited to, in any network or other electronic storage or 

transmission, or broadcast for distance learning.

Some ancillaries, including electronic and print components, may not be available to customers outside the United States.

This book is printed on acid-free paper.

1 2 3 4 5 6 7 8 9 0 VNH/VNH 0 9

ISBN 978–0–07–340106–5

MHID 0–07–340106–4

Global Publisher: Raghothaman Srinivasan

Sponsoring Editor: Debra B. HashDirector of Development: Kristine Tibbetts

Developmental Editor: Lorraine K. Buczek

Senior Marketing Manager: Curt Reynolds

Project Manager: Joyce Watters

Lead Production Supervisor: Sandy Ludovissy

Associate Design Coordinator: Brenda A. Rolwes

Cover Designer: Studio Montage, St. Louis, Missouri

(USE) Cover Image: © BrandX/JupiterImages

Compositor: Macmillan Publishing Solutions

Typeface: 10/12 Times RomanPrinter: R. R. Donnelley Jefferson City, MO

All credits appearing on page or at the end of the book are considered to be an extension of the copyright page.

MATLAB™ is a registered trademark of The MathWorks, Inc.

Library of Congress Cataloging-in-Publication Data

Chapra, Steven C.

 Numerical methods for engineers / Steven C. Chapra, Raymond P. Canale. — 6th ed.

 p. cm.Includes bibliographical references and index.

ISBN 978–0–07–340106–5 — ISBN 0–07–340106–4 (hard copy : alk. paper)

1. Engineering mathematics—Data processing. 2. Numerical calculations—Data processing 3. Microcomputers— 

Programming. I. Canale, Raymond P. II. Title.

TA345.C47 2010

518.02462—dc22 2008054296

www.mhhe.com

Page 4: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 4/14

To

Margaret and Gabriel Chapra

Helen and Chester Canale

Page 5: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 5/14

CONTENTS

PREFACE xiv 

GUIDED TOUR xvi

 ABOUT THE AUTHORS xviii

PART ONE

MODELING,   PT1.1 Motivation 3COMPUTERS, AND   PT1.2 Mathematical Background 5ERROR ANALYSIS 3   PT1.3 Orientation 8

CHAPTER 1

Mathematical Modeling and Engineering Problem Solving 111.1 A Simple Mathematical Model 111.2 Conservation Laws and Engineering 18Problems 21

CHAPTER 2Programming and Software 25

2.1 Packages and Programming 252.2 Structured Programming 262.3 Modular Programming 352.4 Excel 372.5 MATLAB 412.6 Mathcad 452.7 Other Languages and Libraries 46Problems 47

CHAPTER 3 Approximations and Round-Off Errors 52

3.1 Significant Figures 533.2 Accuracy and Precision 553.3 Error Definitions 563.4 Round-Off Errors 62Problems 76

iv 

Page 6: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 6/14

CONTENTS  v 

CHAPTER 4Truncation Errors and the Taylor Series 78

4.1 The Taylor Series 784.2 Error Propagation 944.3 Total Numerical Error 984.4 Blunders, Formulation Errors, and Data Uncertainty 103Problems 105

EPILOGUE: PART ONE 107PT1.4 Trade-Offs 107PT1.5 Important Relationships and Formulas 110PT1.6 Advanced Methods and Additional References 110

PART TWO

ROOTS OF PT2.1 Motivation 113EQUATIONS 113 PT2.2 Mathematical Background 115

PT2.3 Orientation 116

CHAPTER 5Bracketing Methods 120

5.1 Graphical Methods 1205.2 The Bisection Method 1245.3 The False-Position Method 1325.4 Incremental Searches and Determining Initial Guesses 138Problems 139

CHAPTER 6Open Methods 142

6.1 Simple Fixed-Point Iteration 1436.2 The Newton-Raphson Method 1486.3 The Secant Method 1546.4 Brent’s Method 1596.5 Multiple Roots 1646.6 Systems of Nonlinear Equations 167

Problems 171

CHAPTER 7Roots of Polynomials 174

7.1 Polynomials in Engineering and Science 1747.2 Computing with Polynomials 1777.3 Conventional Methods 180

Page 7: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 7/14

 vi   CONTENTS

7.4 Müller’s Method 1817.5 Bairstow’s Method 1857.6 Other Methods 1907.7 Root Location with Software Packages 190

Problems 200

CHAPTER 8Case Studies: Roots of Equations 202

8.1 Ideal and Nonideal Gas Laws (Chemical/Bio Engineering) 2028.2 Greenhouse Gases and Rainwater (Civil/Environmental Engineering) 2058.3 Design of an Electric Circuit (Electrical Engineering) 2078.4 Pipe Friction (Mechanical/Aerospace Engineering) 209

Problems 213

EPILOGUE: PART TWO 223PT2.4 Trade-Offs 223PT2.5 Important Relationships and Formulas 224PT2.6 Advanced Methods and Additional References 224

PART THREELINEAR ALGEBRAIC PT3.1 Motivation 227EQUATIONS 227 PT3.2 Mathematical Background 229

PT3.3 Orientation 237

CHAPTER 9Gauss Elimination 241

9.1 Solving Small Numbers of Equations 2419.2 Naive Gauss Elimination 2489.3 Pitfalls of Elimination Methods 2549.4 Techniques for Improving Solutions 2609.5 Complex Systems 2679.6 Nonlinear Systems of Equations 2679.7 Gauss-Jordan 2699.8 Summary 271Problems 271

CHAPTER 10LU Decomposition and Matrix Inversion 274

10.1   LU Decomposition 27410.2 The Matrix Inverse 28310.3 Error Analysis and System Condition 287Problems 293

Page 8: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 8/14

CONTENTS  vii

CHAPTER 11Special Matrices and Gauss-Seidel 296

11.1 Special Matrices 29611.2 Gauss-Seidel 30011.3 Linear Algebraic Equations with Software Packages 307Problems 312

CHAPTER 12Case Studies: Linear Algebraic Equations 315

12.1 Steady-State Analysis of a System of Reactors (Chemical/BioEngineering) 315

12.2 Analysis of a Statically Determinate Truss (Civil/EnvironmentalEngineering) 31812.3 Currents and Voltages in Resistor Circuits (Electrical Engineering) 32212.4 Spring-Mass Systems (Mechanical/Aerospace Engineering) 324Problems 327

EPILOGUE: PART THREE 337PT3.4 Trade-Offs 337

PT3.5 Important Relationships and Formulas 338PT3.6 Advanced Methods and Additional References 338

PART FOUR 

OPTIMIZATION 341 PT4.1 Motivation 341PT4.2 Mathematical Background 346PT4.3 Orientation 347

CHAPTER 13One-Dimensional Unconstrained Optimization 351

13.1 Golden-Section Search 35213.2 Parabolic Interpolation 35913.3 Newton’s Method 36113.4 Brent’s Method 364Problems 364

CHAPTER 14Multidimensional Unconstrained Optimization 367

14.1 Direct Methods 36814.2 Gradient Methods 372Problems 385

Page 9: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 9/14

 viii   CONTENTS

CHAPTER 15Constrained Optimization 387

15.1 Linear Programming 38715.2 Nonlinear Constrained Optimization 39815.3 Optimization with Software Packages 399Problems 410

CHAPTER 16Case Studies: Optimization 413

16.1 Least-Cost Design of a Tank (Chemical/Bio Engineering) 41316.2 Least-Cost Treatment of Wastewater (Civil/Environmental Engineering) 41816.3 Maximum Power Transfer for a Circuit (Electrical Engineering) 422

16.4 Equilibrium and Minimum Potential Energy (Mechanical/Aerospace Engineering) 426Problems 428

EPILOGUE: PART FOUR 436PT4.4 Trade-Offs 436PT4.5 Additional References 437

PART FIVE

CURVE FITTING 439 PT5.1 Motivation 439PT5.2 Mathematical Background 441PT5.3 Orientation 450

CHAPTER 17Least-Squares Regression 454

17.1 Linear Regression 454

17.2 Polynomial Regression 47017.3 Multiple Linear Regression 47417.4 General Linear Least Squares 47717.5 Nonlinear Regression 481Problems 484

CHAPTER 18Interpolation 488

18.1 Newton’s Divided-Difference Interpolating Polynomials 48918.2 Lagrange Interpolating Polynomials 50018.3 Coefficients of an Interpolating Polynomial 50518.4 Inverse Interpolation 50518.5 Additional Comments 50618.6 Spline Interpolation 50918.7 Multidimensional Interpolation 519Problems 522

Page 10: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 10/14

CONTENTS ix 

CHAPTER 19Fourier Approximation 524

19.1 Curve Fitting with Sinusoidal Functions 52519.2 Continuous Fourier Series 53119.3 Frequency and Time Domains 53419.4 Fourier Integral and Transform 53819.5 Discrete Fourier Transform (DFT) 54019.6 Fast Fourier Transform (FFT) 54219.7 The Power Spectrum 54919.8 Curve Fitting with Software Packages 550Problems 559

CHAPTER 20Case Studies: Curve Fitting 561

20.1 Linear Regression and Population Models (Chemical/BioEngineering) 561

20.2 Use of Splines to Estimate Heat Transfer (Civil/EnvironmentalEngineering) 565

20.3 Fourier Analysis (Electrical Engineering) 56720.4 Analysis of Experimental Data (Mechanical/Aerospace

Engineering) 568Problems 570

EPILOGUE: PART FIVE 580PT5.4 Trade-Offs 580PT5.5 Important Relationships and Formulas 581PT5.6 Advanced Methods and Additional References 583

PART SIX 

NUMERICAL PT6.1 Motivation 585DIFFERENTIATION PT6.2 Mathematical Background 595

 AND PT6.3 Orientation 597INTEGRATION 585

CHAPTER 21

Newton-Cotes Integration Formulas 60121.1 The Trapezoidal Rule 60321.2 Simpson’s Rules 61321.3 Integration with Unequal Segments 62221.4 Open Integration Formulas 62521.5 Multiple Integrals 625Problems 627

Page 11: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 11/14

 x    CONTENTS

CHAPTER 22Integration of Equations 631

22.1 Newton-Cotes Algorithms for Equations 63122.2 Romberg Integration 63222.3 Adaptive Quadrature 63822.4 Gauss Quadrature 64022.5 Improper Integrals 648Problems 651

CHAPTER 23Numerical Differentiation 653

23.1 High-Accuracy Differentiation Formulas 65323.2 Richardson Extrapolation 65623.3 Derivatives of Unequally Spaced Data 65823.4 Derivatives and Integrals for Data with Errors 65923.5 Partial Derivatives 66023.6 Numerical Integration/Differentiation with Software Packages 661Problems 668

CHAPTER 24Case Studies: Numerical Integration and Differentiation 671

24.1 Integration to Determine the Total Quantity of Heat (Chemical/BioEngineering) 671

24.2 Effective Force on the Mast of a Racing Sailboat (Civil/EnvironmentalEngineering) 673

24.3 Root-Mean-Square Current by Numerical Integration (ElectricalEngineering) 675

24.4 Numerical Integration to Compute Work (Mechanical/AerospaceEngineering) 678

Problems 682

EPILOGUE: PART SIX 692PT6.4 Trade-Offs 692PT6.5 Important Relationships and Formulas 693PT6.6 Advanced Methods and Additional References 693

PART SEVEN

ORDINARY  PT7.1 Motivation 697DIFFERENTIAL PT7.2 Mathematical Background 701EQUATIONS 697 PT7.3 Orientation 703

Page 12: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 12/14

CONTENTS  xi

CHAPTER 25Runge-Kutta Methods 707

25.1 Euler’s Method 70825.2 Improvements of Euler’s Method 71925.3 Runge-Kutta Methods 72725.4 Systems of Equations 73725.5 Adaptive Runge-Kutta Methods 742Problems 750

CHAPTER 26Stiffness and Multistep Methods 752

26.1 Stiffness 75226.2 Multistep Methods 756Problems 776

CHAPTER 27Boundary-Value and Eigenvalue Problems 778

27.1 General Methods for Boundary-Value Problems 77927.2 Eigenvalue Problems 786

27.3 Odes and Eigenvalues with Software Packages 798Problems 805

CHAPTER 28Case Studies: Ordinary Differential Equations 808

28.1 Using ODEs to Analyze the Transient Response of a Reactor (Chemical/BioEngineering) 808

28.2 Predator-Prey Models and Chaos (Civil/Environmental Engineering) 815

28.3 Simulating Transient Current for an Electric Circuit (Electrical Engineering) 81928.4 The Swinging Pendulum (Mechanical/Aerospace Engineering) 824Problems 828

EPILOGUE: PART SEVEN 838PT7.4 Trade-Offs 838PT7.5 Important Relationships and Formulas 839PT7.6 Advanced Methods and Additional References 839

PART EIGHT

PARTIAL PT8.1 Motivation 843DIFFERENTIAL PT8.2 Orientation 846EQUATIONS 843

Page 13: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 13/14

 xii   CONTENTS

CHAPTER 29Finite Difference: Elliptic Equations 850

29.1 The Laplace Equation 85029.2 Solution Technique 85229.3 Boundary Conditions 85829.4 The Control-Volume Approach 86429.5 Software to Solve Elliptic Equations 867Problems 868

CHAPTER 30Finite Difference: Parabolic Equations 871

30.1 The Heat-Conduction Equation 87130.2 Explicit Methods 87230.3 A Simple Implicit Method 87630.4 The Crank-Nicolson Method 88030.5 Parabolic Equations in Two Spatial Dimensions 883Problems 886

CHAPTER 31

Finite-Element Method 88831.1 The General Approach 88931.2 Finite-Element Application in One Dimension 89331.3 Two-Dimensional Problems 90231.4 Solving PDEs with Software Packages 906Problems 910

CHAPTER 32

Case Studies: Partial Differential Equations 91332.1 One-Dimensional Mass Balance of a Reactor (Chemical/Bio

Engineering) 91332.2 Deflections of a Plate (Civil/Environmental Engineering) 91732.3 Two-Dimensional Electrostatic Field Problems (Electrical

Engineering) 91932.4 Finite-Element Solution of a Series of Springs

(Mechanical/Aerospace Engineering) 922Problems 926

EPILOGUE: PART EIGHT 929PT8.3 Trade-Offs 929PT8.4 Important Relationships and Formulas 929PT8.5 Advanced Methods and Additional References 930

Page 14: Numerical Method-steven c Chapra

8/9/2019 Numerical Method-steven c Chapra

http://slidepdf.com/reader/full/numerical-method-steven-c-chapra 14/14

 APPENDIX A: THE FOURIER SERIES 931

 APPENDIX B: GETTING STARTED WITH MATLAB 933

 APPENDIX C: GETTING STARTED WITH MATHCAD 941

BIBLIOGRAPHY 952

INDEX 955

CONTENTS  xiii