**Preface ****iii**

**Chapter 1 ***Introduction ***1**

1.1 Background **1**

1.2 Representation of Numbers on a Computer **4**

1.3 Errors in Numerical Solutions **10**

1.4 Computers and Programming **15**

1.5 Problems **18**

**Chapter 2 ***Mathematical Background ***23**

2.1 Background **23**

2.2 Concepts from Pre-Calculus and Calculus **24**

2.3 Vectors **28**

2.4 Matrices and Linear Algebra **32**

2.5 Ordinary Differential Equations (ODE) **41**

2.6 Functions of Two or More Independent Variables **44**

2.7 Taylor Series Expansion of Functions **47**

2.8 Inner Product and Orthogonality **50**

2.9 Problems **51**

**Chapter 3 ***Solving Nonlinear Equations ***57**

3.1 Background **57**

3.2 Estimation of Errors in Numerical Solutions **59**

3.3 Bisection Method **61**

3.4 Regula Falsi Method **64**

3.5 Newton’s Method **66**

3.6 Secant Method **71**

3.7 Fixed-Point Iteration Method **74**

3.8 Use of MATLAB Built-In Functions for Solving Nonlinear Equations **77**

3.9 Equations with Multiple Solutions **79**

3.10 Systems of Nonlinear Equations **81**

3.11 Problems **88**

**Chapter 4 ***Solving a System of Linear Equations ***99**

4.1 Background **99**

4.2 Gauss Elimination Method **102**

4.3 Gauss Elimination with Pivoting **112**

4.4 Gauss–Jordan Elimination Method **115**

4.5 LU Decomposition Method **118**

4.6 Inverse of a Matrix **128**

4.7 Iterative Methods **132**

4.8 Use of MATLAB Built-In Functions for Solving a System of Linear Equations **136**

4.9 Tridiagonal Systems of Equations **141**

4.10 Error, Residual, Norms, and Condition Number **146**

4.11 Ill-Conditioned Systems **151**

4.12 Problems **155**

**Chapter 5 ***Eigenvalues and Eigenvectors ***165**

5.1 Background **165**

5.2 The Characteristic Equation **167**

5.3 The Basic Power Method **167**

5.4 The Inverse Power Method **172**

5.5 The Shifted Power Method **173**

5.6 The QR Factorization and Iteration Method **174**

5.7 Use of MATLAB Built-In Functions for Determining Eigenvalues and

Eigenvectors **184**

5.8 Problems **186**

**Chapter 6 ***Curve Fitting and Interpolation ***193**

6.1 Background **193**

6.2 Curve Fitting with a Linear Equation **195**

6.3 Curve Fitting with Nonlinear Equation by Writing the Equation in a Linear Form **201**

6.4 Curve Fitting with Quadratic and Higher-Order Polynomials **205**

6.5 Interpolation Using a Single Polynomial **210**

6.6 Piecewise (Spline) Interpolation **223**

6.7 Use of MATLAB Built-In Functions for Curve Fitting and Interpolation **236**

6.8 Curve Fitting with a Linear Combination of Nonlinear Functions **238**

6.9 Problems **241**

**Chapter 7 ***Fourier Methods ***251**

7.1 Background **251**

7.2 Approximating a Square Wave by a Series of sine functions **254**

7.3 General (Infinite) Fourier Series **257**

7.4 Complex Form of the Fourier Series **262**

7.5 The Discrete Fourier Series and Discrete Fourier transform **263**

7.6 Complex Discrete Fourier Transform **269**

7.7 Power (Energy) Spectrum **272**

7.8 Aliasing and Nyquist Frequency **273**

7.9 Alternative Forms of the Discrete Fourier Transform **278**

7.10 Use of MATLAB Built-In Functions for Calculating Discrete Fourier Transform **279**

7.11 Leakage and Windowing **284**

7.12 Bandwidth and Filters **286**

7.13 The Fast Fourier Transform (FFT) **288**

7.14 Problems **298**

**Chapter 8 ***Numerical Differentiation ***303**

8.1 Background **303**

8.2 Finite Difference Approximation of the Derivative **305**

8.3 Finite Difference Formulas Using Taylor Series Expansion **310**

8.4 Summary of Finite Difference Formulas for Numerical Differentiation **317**

8.5 Differentiation Formulas Using Lagrange Polynomials **319**

8.6 Differentiation Using Curve Fitting **320**

8.7 Use of MATLAB Built-In Functions for Numerical Differentiation **320**

8.8 Richardson’s Extrapolation **322**

8.9 Error in Numerical Differentiation **325**

8.10 Numerical Partial Differentiation **327**

8.11 Problems **330**

**Chapter 9 ***Numerical Integration ***341**

9.1 Background **341**

*9.1.1 Overview of Approaches in Numerical Integration ***342**

9.2 Rectangle and Midpoint Methods **344**

9.3 Trapezoidal Method **346**

9.4 Simpson’s Methods **350**

9.5 Gauss Quadrature **355**

9.6 Evaluation of Multiple Integrals **360**

9.7 Use of MATLAB Built-In Functions for Integration **362**

9.8 Estimation of Error in Numerical Integration **364**

9.9 Richardson’s Extrapolation **366**

9.10 Romberg Integration **369**

9.11 Improper Integrals **372**

9.12 Problems **374**

**Chapter 10 ***Ordinary Differential Equations: Initial-Value*

*Problems ***385**

10.1 Background **385**

10.2 Euler’s Methods **390**

10.3 Modified Euler’s Method **401**

10.4 Midpoint Method **404**

10.5 Runge–Kutta Methods **405**

10.6 Multistep Methods **417**

*10.6.1 Adams–Bashforth Method ***418**

*10.6.2 Adams–Moulton Method ***419**

10.7 Predictor–Corrector Methods **420**

10.8 System of First-Order Ordinary Differential Equations **422**

10.9 Solving a Higher-Order Initial Value Problem **432**

10.10 Use of MATLAB Built-In Functions for Solving Initial-Value Problems **437**

10.11 Local Truncation Error in Second-Order Range–Kutta Method **447**

10.12 Step Size for Desired Accuracy **448**

10.13 Stability **452**

10.14 Stiff Ordinary Differential Equations **454**

10.15 Problems **457**

**Chapter 11 ***Ordinary Differential Equations: Boundary-Value*

*Problems ***471**

11.1 Background **471**

11.2 The Shooting Method **474**

11.3 Finite Difference Method **482**

11.4 Use of MATLAB Built-In Functions for Solving Boundary Value Problems **492**

11.5 Error and Stability in Numerical Solution of Boundary Value Problems **497**

11.6 Problems **499**

**Appendix A ***Introductory MATLAB ***509**

A.1 Background **509**

A.2 Starting with MATLAB **509**

A.3 Arrays **514**

A.4 Mathematical Operations with Arrays **519**

A.5 Script Files **524**

A.6 Plotting **526**

A.7 User-Defined Functions and Function Files **528**

A.8 Anonymous Functions **530**

A.9 Function functions **532**

A.10 Subfunctions **535**

A.11 Programming in MATLAB **537**

*A.11.1 Relational and Logical Operators ***537**

*A.11.2 Conditional Statements, if-else Structures ***538**

*A.11.3 Loops ***541**

A.12 Problems **542**

**Appendix B ***MATLAB Programs ***547**

**Appendix C ***Derivation of the Real Discrete Fourier Transform ***551**

C.1 Orthogonality of Sines and Cosines for Discrete Points **551**

C.2 Determination of the Real DFT **553**

**Index ****555**