NUMERICAL METHODS FOR ENGINEERS, SEVENTH EDITION
Published by McGraw-Hill Education, 2 Penn Plaza, New York, NY 10121. Copyright © 2015 by McGraw-Hill Education. All rights reserved. Printed in the United States of America. Previous editions © 2010, 2006, and 2002. 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 McGraw-Hill Education, 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 DOC/DOC 1 0 9 8 7 6 5 4
ISBN 978–0–07–339792–4 MHID 0–07–339792–x
Senior Vice President, Products & Markets: Kurt L. Strand Vice President, General Manager, Products & Markets: Marty Lange Vice President, Content Production & Technology Services: Kimberly Meriwether David Executive Brand Manager: Bill Stenquist Managing Director: Thomas Timp Global Publisher: Raghothaman Srinivasan Developmental Editor: Lorraine Buczek Marketing Manager: Heather Wagner Director, Content Production: Terri Schiesl Senior Content Project Manager: Melissa M. Leick Buyer: Jennifer Pickel Cover Designer: Studio Montage, St. Louis, MO Cover Image: Peak towering above clouds: Royalty-Free/CORBIS; Skysurfers: Getty Images/Digital Vision/RF Media Project Manager: Sandra M. Schnee Compositor: Aptara®, Inc. Typeface: 10/12 Time Roman Printer: R. R. Donnelley
All credits appearing on page or at the end of the book are considered to be an extension of the copyright page.
Library of Congress Cataloging-in-Publication Data
Chapra, Steven C. Numerical methods for engineers / Steven C. Chapra, Berger chair in computing and engineering, Tufts University, Raymond P. Canale, professor emeritus of civil engineering, University of Michigan. — Seventh edition. pages cm Includes bibliographical references and index. ISBN 978-0-07-339792-4 (alk. paper) — ISBN 0-07-339792-X (alk. paper) 1. Engineering mathematics—Data processing. 2. Numerical calculations—Data processing 3. Microcomputers—Programming. I. Canale, Raymond P. II. Title. TA345.C47 2015 518.024’62—dc23 2013041704
cha9792x_fm_i_xvi.indd Page ii 22/11/13 6:42 PM F-468 cha9792x_fm_i_xvi.indd Page ii 22/11/13 6:42 PM F-468 /207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles/207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles
To
Margaret and Gabriel Chapra
Helen and Chester Canale
cha9792x_fm_i_xvi.indd Page iii 22/11/13 6:42 PM F-468 cha9792x_fm_i_xvi.indd Page iii 22/11/13 6:42 PM F-468 /207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles/207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles
iv
CONTENTS
PREFACE xiv
ABOUT THE AUTHORS xvi
PART ONE
MODELING, PT1.1 Motivation 3 COMPUTERS, AND PT1.2 Mathematical Background 5 ERROR ANALYSIS 3 PT1.3 Orientation 8
CHAPTER 1 Mathematical Modeling and Engineering Problem Solving 11
1.1 A Simple Mathematical Model 11 1.2 Conservation Laws and Engineering 18 Problems 21
CHAPTER 2 Programming and Software 27
2.1 Packages and Programming 27 2.2 Structured Programming 28 2.3 Modular Programming 37 2.4 Excel 39 2.5 MATLAB 43 2.6 Mathcad 47 2.7 Other Languages and Libraries 48 Problems 49
CHAPTER 3 Approximations and Round-Off Errors 55
3.1 Signifi cant Figures 56 3.2 Accuracy and Precision 58 3.3 Error Defi nitions 59 3.4 Round-Off Errors 65 Problems 79
cha9792x_fm_i_xvi.indd Page iv 22/11/13 6:42 PM F-468 cha9792x_fm_i_xvi.indd Page iv 22/11/13 6:42 PM F-468 /207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles/207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles
CONTENTS v
CHAPTER 4 Truncation Errors and the Taylor Series 81
4.1 The Taylor Series 81 4.2 Error Propagation 97 4.3 Total Numerical Error 101 4.4 Blunders, Formulation Errors, and Data Uncertainty 106 Problems 108
EPILOGUE: PART ONE 110 PT1.4 Trade-Offs 110 PT1.5 Important Relationships and Formulas 113 PT1.6 Advanced Methods and Additional References 113
PART TWO
ROOTS OF PT2.1 Motivation 117 EQUATIONS 117 PT2.2 Mathematical Background 119
PT2.3 Orientation 120
CHAPTER 5 Bracketing Methods 123
5.1 Graphical Methods 123 5.2 The Bisection Method 127 5.3 The False-Position Method 135 5.4 Incremental Searches and Determining Initial Guesses 141 Problems 142
CHAPTER 6 Open Methods 145
6.1 Simple Fixed-Point Iteration 146 6.2 The Newton-Raphson Method 151 6.3 The Secant Method 157 6.4 Brent’s Method 162 6.5 Multiple Roots 166 6.6 Systems of Nonlinear Equations 169 Problems 173
CHAPTER 7 Roots of Polynomials 176
7.1 Polynomials in Engineering and Science 176 7.2 Computing with Polynomials 179 7.3 Conventional Methods 182
cha9792x_fm_i_xvi.indd Page v 22/11/13 6:42 PM F-468 cha9792x_fm_i_xvi.indd Page v 22/11/13 6:42 PM F-468 /207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles/207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles
vi CONTENTS
7.4 Müller’s Method 183 7.5 Bairstow’s Method 187 7.6 Other Methods 192 7.7 Root Location with Software Packages 192 Problems 202
CHAPTER 8 Case Studies: Roots of Equations 204
8.1 Ideal and Nonideal Gas Laws (Chemical/Bio Engineering) 204 8.2 Greenhouse Gases and Rainwater (Civil/Environmental Engineering) 207 8.3 Design of an Electric Circuit (Electrical Engineering) 209 8.4 Pipe Friction (Mechanical/Aerospace Engineering) 212 Problems 215
EPILOGUE: PART TWO 226 PT2.4 Trade-Offs 226 PT2.5 Important Relationships and Formulas 227 PT2.6 Advanced Methods and Additional References 227
PART THREE
LINEAR ALGEBRAIC PT3.1 Motivation 231 EQUATIONS 231 PT3.2 Mathematical Background 233
PT3.3 Orientation 241
CHAPTER 9 Gauss Elimination 245
9.1 Solving Small Numbers of Equations 245 9.2 Naive Gauss Elimination 252 9.3 Pitfalls of Elimination Methods 258 9.4 Techniques for Improving Solutions 264 9.5 Complex Systems 271 9.6 Nonlinear Systems of Equations 271 9.7 Gauss-Jordan 273 9.8 Summary 275 Problems 275
CHAPTER 10 LU Decomposition and Matrix Inversion 278 10.1 LU Decomposition 278 10.2 The Matrix Inverse 287 10.3 Error Analysis and System Condition 291 Problems 297
cha9792x_fm_i_xvi.indd Page vi 22/11/13 6:42 PM F-468 cha9792x_fm_i_xvi.indd Page vi 22/11/13 6:42 PM F-468 /207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles/207/MH02101/cha9792x_disk1of1/007339792x/cha9792x_pagefiles
CONTENTS vii
CHAPTER 11 Special Matrices and Gauss-Seidel 300