ebook img

Numerical Methods in Science and Engineering Theories with MATLAB, Mathematica, Fortran, C and Python Programs PDF

389 Pages·2022·6.79 MB·english
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Numerical Methods in Science and Engineering Theories with MATLAB, Mathematica, Fortran, C and Python Programs

NUMERICAL METHODS IN SCIENCE AND ENGINEERING Theories with MATLAB, Mathematica, Fortran, C and Python Programs NUMERICAL METHODS IN SCIENCE AND ENGINEERING Theories with MATLAB, Mathematica, Fortran, C and Python Programs P. Dechaumpwwhai N. Wansophark α Alpha Science International Ltd. Oxford, U.K. Numerical Methods in Science and Engineering Theories with MATLAB, Mathematica, Fortran, C and Python Programs 388 pgs. P. Dechaumphai N. Wansophark Mechanical Engineering Department Chulalongkorn University Payathai Road, Pathumwan Bangkok 10330, Thailand Copyright © 2020 ALPHA SCIENCE INTERNATIONAL LTD. 7200 The Quorum, Oxford Business Park North Garsington Road, Oxford OX4 2JZ, U.K. www.alphasci.com ISBN 978-1-78332-554-2 E-ISBN 978-1-78332-579-5 Printed from the camera-ready copy provided by the Authors. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without prior written permission of the publisher. Preface The book, Numerical Methods in Science and Engineering: Theories with MATLAB, Mathematica, Fortran, C and Python Programs, is written in a clear, easy-to-understand manner on theories and the use of the numerical methods. Topics and materials of the methods in this book were taught at George Washington University, NASA Langley Research Center campus while the first author was a NASA aerospace engineer. Such materials were also taught at Old Dominion University, Norfolk, Virginia, and have been currently taught at Chulalongkorn University. By teaching and performing research on the numerical methods for the past 30 years, the materials in this book have been improved and updated continuously. The main objective of this book is to present the numerical methods in their simplest form so that engineers and scientists can understand them easily and quickly. The book contains 8 chapters which are essential in the study of the numerical methods. The materials in these chapters are suitable to be used in both the undergraduate and graduate levels. The first chapter introduces the methods and the need to study them for solving practical engineering problems today. The chapter also explains different types of numerical errors and the use of hardware and software. The second chapter explains several methods for finding roots from a single nonlinear equation. The methods are extended to find roots from a set of nonlinear equations. Popular methods for finding roots by solving a set of linear simultaneous equations are presented in chapter 4. These methods are classified into two groups of the direct and iterative techniques. Their detailed computational procedures including advantages and disadvantages are presented. Interpolation and extrapolation methods for finding an appropriate function to represent a set of data are presented in chapter 4. Chapter 5 explains several least-squares regression methods to provide a function that best fit a set of data. Many types of functions to best fit sets of linear and nonlinear data are presented. Numerical integration and differentiation methods are explained in chapter 6. Basic and popular integration methods that are employed in commercial software for analyzing practical engineering problems are explained. Chapter 7 presents several methods for solving the ordinary differential equations. The methods can be used to analyze the first- and higher-order ordinary differential equations. Methods for solving partial differential equations are presented in chapter 8. The finite difference methods for analyzing the elliptic, parabolic and hyperbolic differential equations are explained in details. For all the methods presented in these chapters, listings of the corresponding computer programs are provided. These computer programs are written in MATLAB, Mathematica, Fortran, C, Pascal and Python so that readers can select the preferred computer language. These programs can be downloaded from the book website: http://bit.ly/2WCRIExNumCodes The computational procedures in these computer programs follow the theories presented in the text. They are easy to modify for solving a large number of problems at the end of chapters. Readers are encouraged to practice with these programs to appreciate the ability of numerical methods that are embedded in commercial software today. vi Preface The first author would like to thank his former Professor, Dr. Earl A. Thornton, and his supervisor, Dr. Allan R. Wieting of the Aerothermal Loads Branch at NASA Langley Research Center. He expresses his appreciation to the students at NASA Langley Research Center, Old Dominion University and Chulalongkorn University who took his courses on the numerical methods and helped him to improve the presentation of materials in this book. The authors wish to thank Mr. Sascha J. Mehra, the Director and the staff of Alpha Science International Ltd. for their advice and cooperation. The authors appreciate Dr. Edward Dechaumpahi and Mrs. Anna D. McDermott for proofreading the book. The authors would like to thank their wives Mrs. Yupa Dechaumphai and Patcharin Wansophark for the understanding and support in writing this book. Pramote Dechaumphai Niphon Wansophark Contents Preface v 1. First Step to Numerical Methods 1 1.1 Introduction 1 1.2 What are the Numerical Methods? 3 1.3 Need for Studying Numerical Methods 3 1.4 Computer Hardware and Software 8 1.5 Errors 11 1.6 Closure 13 Exercises 13 2. Root of Equations 19 2.1 Introduction 19 2.2 Graphical Method 20 2.3 Bisection Method 22 2.4 False-Position Method 25 2.5 One-Point Iteration Method 28 2.6 Newton-Raphson Method 32 2.7 Secant Method 37 2.8 MATLAB Functions for Finding Root of Equation 38 2.9 Roots of System of Non-linear Equations 41 2.9.1 Direct iteration method 42 2.9.2 Newton-Raphson iteration method 43 2.10 Closure 46 Exercises 46 3. System of Linear Equations 53 3.1 Introduction 53 3.2 Cramer’s Rule 55 3.3 Gauss Elimination Method 57 3.4 Problems of Gauss Elimination Method 62 3.4.1 Division by zero 62 3.4.2 Round-off error 62 3.4.3 Ill-conditioned system 63 viii Contents 3.5 Improved Gauss Elimination Method 63 3.5.1 Pivoting 64 3.5.2 Scaling 65 3.5.3 Tridiagonal system 66 3.6 Gauss-Jordan Method 68 3.7 Matrix Inversion Method 70 3.8 Solving System of Linear Equations by MATLAB 71 3.9 LU Decomposition Method 72 3.10 MATLAB Function for LU Decomposition 77 3.11 Cholesky Decomposition Method 78 3.12 MATLAB Function for Cholesky Decomposition 81 3.13 Jacobi Iteration Method 82 3.14 Gauss-Seidel Iteration Method 85 3.15 Successive Over-relaxation Method 87 3.16 Conjugate Gradient Method 88 3.17 Closure 101 Exercises 101 4. Interpolation and Extrapolation 111 4.1 Introduction 111 4.2 Newton’s Divided Differences 112 4.2.1 Linear interpolation 112 4.2.2 Quadratic interpolation 113 4.2.3 nth-order Polynomial interpolation 115 4.3 Lagrange Interpolating Polynomials 118 4.3.1 Linear interpolation 118 4.3.2 Quadratic interpolation 120 4.3.3 Polynomial interpolation 122 4.4 Spline Interpolations 124 4.4.1 Linear spline 125 4.4.2 Quadratic spline 126 4.4.3 Cubic spline 128 4.5 MATLAB Functions for Interpolations 132 4.6 Extrapolation 134 4.7 Closure 135 Exercises 136 5. Least-Squares Regression 141 5.1 Introduction 141 5.2 Linear Regression 142 5.3 Linear Regression for Nonlinear Data 146 5.4 Polynomial Regression 150 5.5 MATLAB Functions for Least-Squares Regression 154 Contents ix 5.6 Multiple Regression 156 5.6.1 Linear 156 5.6.2 Polynomial 162 5.7 Closure 164 Exercises 164 6. Numerical Integration and Differentiation 173 6.1 Introduction 173 6.2 Trapezoidal Rule 175 6.3 Composite Trapezoidal Rule 180 6.4 Simpson’s Rule 184 6.5 Composite Simpson’s Rule 186 6.6 Newton-Cotes Formulas 188 6.7 Romberg Integration 192 6.8 Gauss Integration 197 6.9 Multiple Integration 205 6.10 MATLAB Commands for Integration 208 6.11 Differentiation 210 6.12 MATLAB Commands for Differentiation 216 6.13 Closure 217 Exercises 217 7. Ordinary Differential Equations 227 7.1 Introduction 227 7.2 Euler’s Method 230 7.3 Heun’s Method 234 7.4 Modified Euler’s Method 237 7.5 Runge-Kutta Method 239 7.5.1 Second-order 240 7.5.2 Third-order 242 7.5.3 Fourth-order 243 7.6 System of Equations 246 7.7 MATLAB Commands 250 7.8 Multistep Methods 252 7.8.1 Non-self-starting Heun’s method 253 7.8.2 Adams-Bashforth method 255 7.8.3 Adams-Moulton method 258 7.9 Closure 260 Exercises 260 8. Partial Differential Equations 269 8.1 Introduction 269

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.