13.07.2015 Views

xiii Note to the reader: This is a customized book for Old Dominion ...

xiii Note to the reader: This is a customized book for Old Dominion ...

xiii Note to the reader: This is a customized book for Old Dominion ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

TABLE OF CONTENTS<strong>Note</strong> <strong>to</strong> <strong>the</strong> <strong>reader</strong>: <strong>Th<strong>is</strong></strong> <strong>is</strong> a cus<strong>to</strong>mized <strong>book</strong> <strong>for</strong> <strong>Old</strong> <strong>Dominion</strong> University. However,all available content <strong>is</strong> l<strong>is</strong>ted here in <strong>the</strong> table of contents, and <strong>the</strong> content that <strong>is</strong> not in<strong>the</strong> <strong>book</strong> <strong>is</strong> shown with a strikethrough (e.g. Chapter 02.00B Physical problem - chemicalengineering). If you are an instruc<strong>to</strong>r <strong>for</strong> a numerical methods course and you areinterested in adopting th<strong>is</strong> <strong>book</strong>, we can cus<strong>to</strong>mize a <strong>book</strong> <strong>for</strong> you based on your syllabus.Please contact <strong>the</strong> first author at autarkaw@yahoo.com or 813-974-5626.INTRODUCTION, APPROXIMATION & ERRORS 1Chapter 01.01 Introduction <strong>to</strong> numerical methods 1Multiple-choice test 7Problem set 9Chapter 01.02 Measuring errors 11True error 11Relative true error 12Approximate error 13Relative approximate error 14Significant digits 16Multiple-choice test 18Problem set 20Chapter 01.03 Sources of error 22What <strong>is</strong> round off error? 22What problems can be created by round off errors? 22What <strong>is</strong> truncation error? 23Can you give me o<strong>the</strong>r examples of truncation error? 24Multiple-choice test 28Problem set 30Chapter 01.04 Binary representation of numbers 34Multiple-choice test 41Problem set 43Chapter 01.05 Floating point representation 44Multiple-choice test 52Problem set 54Chapter 01.06 Propagation of errors 55Multiple-choice test 58Chapter 01.07 Taylor <strong>the</strong>orem rev<strong>is</strong>ited 60Multiple-choice test 68<strong>xiii</strong>


DIFFERENTIATION 70Physical problemsChapter 02.00A Physical problem - general engineering 70Chapter 02.00B Physical problem - chemical engineeringChapter 02.00C Physical problem – civil engineering 72Chapter 02.00D Physical problem - computer engineeringChapter 02.00E Physical problem - electrical engineeringChapter 02.00F Physical problem - industrial engineeringChapter 02.00G Physical problem - mechanical engineering 76Chapter 02.01 Primer on differential calculus (View it on <strong>the</strong> web)Go <strong>to</strong> http://numericalmethods.eng.usf.edu>Keyword> Primer on differential calculusMultiple-choice test 80Problem set 82Chapter 02.02 Differentiation of continuous functions 84Forward difference approximation of <strong>the</strong> first derivative 84Backward difference approximation of <strong>the</strong> first derivative 87Forward difference approximation from <strong>the</strong> Taylor series 89Finite difference approximation of higher derivatives 92Multiple-choice test 97Problem set 99Chapter 02.03 Differentiation of d<strong>is</strong>crete functions 101Forward difference approximation of <strong>the</strong> first derivative 101Direct fit polynomials 103Lagrange polynomial 105Multiple-choice test 108Problem set 110xiv


NONLINEAR EQUATIONS 112Physical problemsChapter 03.00A Physical problem - general engineering 112Chapter 03.00B Physical problem - chemical engineeringChapter 03.00C Physical problem - civil engineering 116Chapter 0.3.00D Physical problem - computer engineeringChapter 03.00E Physical problem - electrical engineeringChapter 03.00F Physical problem – industrial engineeringChapter 03.00G Physical problem - mechanical engineering 122Chapter 03.01 Solution of quadratic equations 126Multiple-choice test 129Problem set 131Chapter 03.03 B<strong>is</strong>ection method of solving a nonlinear equation 133B<strong>is</strong>ection method 133Algorithm <strong>for</strong> <strong>the</strong> b<strong>is</strong>ection method 136Advantages of b<strong>is</strong>ection method 139Drawbacks of b<strong>is</strong>ection method 140Multiple-choice test 142Problem set 144Chapter 03.04 New<strong>to</strong>n-Raphson method of solving a nonlinear equation 146Introduction 146Derivation 146Algorithm 147Drawbacks of <strong>the</strong> New<strong>to</strong>n-Raphson method 150What <strong>is</strong> an inflection point? 154Derivation of New<strong>to</strong>n Raphson method from Taylor series 154Multiple-choice test 156Problem set 158Chapter 03.05 Secant method of solving nonlinear equations 160What <strong>is</strong> <strong>the</strong> secant method and why would I want <strong>to</strong> use it instead of <strong>the</strong> New<strong>to</strong>n-Raphson method? 160Multiple-choice test 165Problem set 167Chapter 03.06 False-Position method of solving a nonlinear equation 169Introduction 169False-Position method 170Step-by-step False-Position algorithms 170Multiple-choice test 175xv


SIMULTANEOUS LINEAR EQUATIONS 179Physical problemsChapter 04.00A Physical problem - general engineering 179Chapter 04.00B Physical problem - chemical engineeringChapter 04.00C Physical problem - civil engineering 182Chapter 04.00D Physical problem - computer engineeringChapter 04.00E Physical problem - electrical engineeringChapter 04.00F Physical problem – industrial engineeringChapter 04.00G Physical problem - mechanical engineering 187Chapter 4.1 Introduction <strong>to</strong> matrix algebra 193What does a matrix look like?What <strong>is</strong> a matrix? 193What are <strong>the</strong> special types of matrices? 194Square matrix 195Upper triangular matrix 195Lower triangular matrix 195Diagonal matrix 196Identity matrix 196Zero matrix 196Tridiagonal matrices 197When are two matrices considered <strong>to</strong> be equal? 197How do you add two matrices? 198How do you subtract two matrices? 199How do I multiply two matrices? 200What <strong>is</strong> a scalar product of a constant and a matrix? 202What <strong>is</strong> a linear combination of matrices? 203What are some of <strong>the</strong> rules of binary matrix operations? 203Transpose of a matrix 205Symmetric matrix 206Matrix algebra <strong>is</strong> used <strong>for</strong> solving system of equations. Can you illustrate th<strong>is</strong> concept?206Can you divide two matrices? 208Can I use <strong>the</strong> concept of <strong>the</strong> inverse of a matrix <strong>to</strong> find <strong>the</strong> solution of a set of equations[A] [X] = [C]? 209How do I find <strong>the</strong> inverse of a matrix? 209If <strong>the</strong> inverse of a square matrix [A] ex<strong>is</strong>ts, <strong>is</strong> it unique? 212Multiple-choice test 214Problem set 216Chapter 04.02 Vec<strong>to</strong>rsWhat <strong>is</strong> a vec<strong>to</strong>r?When are two vec<strong>to</strong>rs equal?How do you add two vec<strong>to</strong>rs?What <strong>is</strong> a null vec<strong>to</strong>r?What <strong>is</strong> a unit vec<strong>to</strong>r?How do you multiply a vec<strong>to</strong>r by a scalar?What do you mean by a linear combination of vec<strong>to</strong>rs?What do you mean by vec<strong>to</strong>rs being linearly independent?xvi


What do you mean by <strong>the</strong> rank of a set of vec<strong>to</strong>rs?Prove that if a set of vec<strong>to</strong>rs contains <strong>the</strong> null vec<strong>to</strong>r, <strong>the</strong> set of vec<strong>to</strong>rs <strong>is</strong> linearlydependent.Prove that if a set of vec<strong>to</strong>rs are linearly independent, <strong>the</strong>n a subset of <strong>the</strong> m vec<strong>to</strong>rs alsohas <strong>to</strong> be linearly independent.Prove that if a set of vec<strong>to</strong>rs <strong>is</strong> linearly dependent, <strong>the</strong>n at least one of <strong>the</strong> vec<strong>to</strong>rs can bewritten as a linear combination of o<strong>the</strong>rs.Prove that if <strong>the</strong> dimension of a set of vec<strong>to</strong>rs <strong>is</strong> less than <strong>the</strong> number of vec<strong>to</strong>rs in <strong>the</strong> set,<strong>the</strong>n <strong>the</strong> set of vec<strong>to</strong>rs <strong>is</strong> linearly dependentHow can vec<strong>to</strong>rs be used <strong>to</strong> write simultaneous linear equations?What <strong>is</strong> <strong>the</strong> definition of <strong>the</strong> dot product of two vec<strong>to</strong>rs?Chapter 04.03 Binary matrix operationsHow do you add two matrices?How do you subtract two matrices?How do I multiply two matrices?What <strong>is</strong> a scalar product of a constant and a matrix?What <strong>is</strong> a linear combination of matrices?What are some of <strong>the</strong> rules of binary matrix operations?Commutative law of additionAssociative law of additionAssociative law of multiplicationD<strong>is</strong>tributive lawIs [A][B] = [B][A]?Chapter 04.04 Unary matrix operationsWhat <strong>is</strong> <strong>the</strong> transpose of a matrix?What <strong>is</strong> a symmetric matrix?What <strong>is</strong> a skew-symmetric matrix?What <strong>is</strong> <strong>the</strong> trace of a matrix?Define <strong>the</strong> determinant of a matrix.Is <strong>the</strong>re a relationship between det(AB), and det(A) and det(B)?Are <strong>the</strong>re some o<strong>the</strong>r <strong>the</strong>orems that are important in finding <strong>the</strong> determinant?Chapter 04.05 System of equationsMatrix algebra <strong>is</strong> used <strong>for</strong> solving systems of equations. Can you illustrate th<strong>is</strong> concept?A system of equations can be cons<strong>is</strong>tent or incons<strong>is</strong>tent. What does that mean?How can one d<strong>is</strong>tingu<strong>is</strong>h between a cons<strong>is</strong>tent and incons<strong>is</strong>tent system of equations?If a solution ex<strong>is</strong>ts, how do we know whe<strong>the</strong>r it <strong>is</strong> unique?If we have more equations than unknowns in [A] [X] = [C], does it mean <strong>the</strong> system <strong>is</strong>incons<strong>is</strong>tent?Can I use <strong>the</strong> concept of <strong>the</strong> inverse of a matrix <strong>to</strong> find <strong>the</strong> solution of a set of equations[A] [X] = [C]?How do I find <strong>the</strong> inverse of a matrix?Is <strong>the</strong>re ano<strong>the</strong>r way <strong>to</strong> find <strong>the</strong> inverse of a matrix?If <strong>the</strong> inverse of a square matrix [A] ex<strong>is</strong>ts, <strong>is</strong> it unique?Chapter 04.06 Gaussian elimination 220How are a set of equations solved numerically? 220Forward elimination of unknowns 220Back substitution 222xvii


Are <strong>the</strong>re any pitfalls of Naïve Gauss elimination method? 228Round-off error 229What are <strong>the</strong> techniques <strong>for</strong> improving Naïve Gauss elimination method? 231How does Gaussian elimination with partial pivoting differ from Naïve Gausselimination? 232Can we use Naïve Gauss elimination methods <strong>to</strong> find <strong>the</strong> determinant of a square matrix?235What if I cannot find <strong>the</strong> determinant of <strong>the</strong> matrix using Naive Gauss eliminationmethod, <strong>for</strong> example, if I get div<strong>is</strong>ion by zero problems during Naïve Gauss eliminationmethod? 236Multiple-choice test 238Problem set 241Chapter 04.07 LU decomposition 243I hear about LU decomposition used as a method <strong>to</strong> solve a set of simultaneous linearequations? What <strong>is</strong> it? 243How do I decompose a non-singular matrix [A], that <strong>is</strong>, how do I find A LU?246How do I find <strong>the</strong> inverse of a square matrix using LU decomposition? 250Multiple-choice test 253Problem set 257Chapter 04.08 Gauss-Seidel method 259Why do we need ano<strong>the</strong>r method <strong>to</strong> solve a set of simultaneous linear equations? 259The above system of equations does not seem <strong>to</strong> converge. Why? 264Multiple-choice test 269Problem set 373Chapter 04.09 Adequacy of solutionsWhat does it mean by ill conditioned and well-conditioned system of equations?So what if <strong>the</strong> system of equations <strong>is</strong> ill conditioning or well conditioning?To calculate condition number of an invertible square matrix, I need <strong>to</strong> know what normof a matrix means. How <strong>is</strong> <strong>the</strong> norm of a matrix defined?How <strong>is</strong> norm related <strong>to</strong> <strong>the</strong> conditioning of <strong>the</strong> matrix?What are some of <strong>the</strong> properties of norms?ProofHow do I use <strong>the</strong> above <strong>the</strong>orems <strong>to</strong> find how many significant digits are correct in mysolution vec<strong>to</strong>r?Chapter 04.10 Eigenvalues and eigenvec<strong>to</strong>rsWhat does eigenvalue mean?Can you give me a physical example application of eigenvalues and eigenvec<strong>to</strong>rs?What <strong>is</strong> <strong>the</strong> general definition of eigenvalues and eigenvec<strong>to</strong>rs of a square matrix?How do I find eigenvalues of a square matrix?What are some of <strong>the</strong> <strong>the</strong>orems of eigenvalues and eigenvec<strong>to</strong>rs?How does one find eigenvalues and eigenvec<strong>to</strong>rs numerically?Chapter 04.11 Cholesky and LDL T Decomposition 274Symmetrical positive definite (SPD) SLE 274Re-ordering algorithms <strong>for</strong> minimizing fill-in terms [1,2] 287xviii


On-line chess-like game <strong>for</strong> reordering/fac<strong>to</strong>rized phase 289Multiple-choice test 292xix


INTERPOLATION 300Physical problemsChapter 05.00A Physical problem - general engineering 300Chapter 05.00B Physical problem - chemical engineeringChapter 05.00C Physical problem - civil engineering 302Chapter 05.00D Physical problem - computer engineeringChapter 05.00E Physical problem - electrical engineeringChapter 05.00F Physical problem - industrial engineeringChapter 05.00G Physical problem - mechanical engineering 305Chapter 05.01 Background of interpolationMultiple-choice test 309Chapter 05.02 Direct method of interpolation 311What <strong>is</strong> interpolation? 311Direct method 312Multiple-choice test 320Problem set 322Chapter 05.03 New<strong>to</strong>n’s divided difference interpolation 324What <strong>is</strong> interpolation? 324New<strong>to</strong>n’s divided difference polynomial method 324Linear interpolation 325Quadratic interpolation 327General <strong>for</strong>m of New<strong>to</strong>n’s divided difference polynomial 330Multiple-choice test 335Problem set 337Chapter 05.05 Spline method of interpolationWhat <strong>is</strong> interpolation?Linear spline interpolationQuadratic splinesMultiple-choice testProblem setChapter 05.06 Extrapolation <strong>is</strong> a bad ideaChapter 05.07 Higher order interpolation <strong>is</strong> a bad ideaChapter 05.08 Why do we need splines?Chapter 05.10 Shortest path of a robotxx


REGRESSION 339Physical problemsChapter 06.00A Physical problem - general engineering 339Chapter 06.00B Physical problem - chemical engineeringChapter 06.00C Physical problem - civil engineering 343Chapter 06.00D Physical problem - computer engineeringChapter 06.00E Physical problem - electrical engineeringChapter 06.00F Physical problem - industrial engineeringChapter 06.00G Physical problem - mechanical engineering 346Chapter 06.01 Stat<strong>is</strong>tics background of regression analys<strong>is</strong> 351Review of stat<strong>is</strong>tical terminologies 351Elementary stat<strong>is</strong>tics 351A brief h<strong>is</strong><strong>to</strong>ry of regression 355Multiple-choice test 359Chapter 06.02 Introduction of regression analys<strong>is</strong> 359What <strong>is</strong> regression analys<strong>is</strong>? 359Compar<strong>is</strong>on of regression and correlation 360Uses of regression analys<strong>is</strong> 360Abuses of regression analys<strong>is</strong> 360Extrapolation 361Least squares methods 363Why minimize <strong>the</strong> sum of <strong>the</strong> square of <strong>the</strong> residuals? 363Multiple-choice testProblem set 365Chapter 06.03 Linear regression 366Why minimize <strong>the</strong> sum of <strong>the</strong> square of <strong>the</strong> residuals? 366Multiple-choice test 379Problem set 381Chapter 06.04 Nonlinear models <strong>for</strong> regression 383Nonlinear models using least squares 383Exponential model 383Growth model 387Polynomial models 389Linearization of data 393Exponential model 393Logarithmic functions 396Power functions 399Multiple-choice test 405Problem set 408Chapter 06.05 Adequacy of models <strong>for</strong> regression 411Quality of fitted model 411Plot <strong>the</strong> data and <strong>the</strong> regression model. 411Calculate <strong>the</strong> standard error of estimate. 412Calculate <strong>the</strong> coefficient of determination. 414xxi


Find if <strong>the</strong> model meets <strong>the</strong> assumptions of random errors. 416Problem set 422INTEGRATION 425Physical problemsChapter 07.00A Physical problem - general engineering 425Chapter 07.00B Physical problem - chemical engineeringChapter 07.00C Physical problem - civil engineering 428Chapter 07.00D Physical problem - computer engineeringChapter 07.00E Physical problem - electrical engineeringChapter 07.00F Physical problem – industrial engineeringChapter 07.00G Physical problem - mechanical engineering 534Chapter 07.01 Primer on integration (View it on <strong>the</strong> web)Go <strong>to</strong> http://numericalmethods.eng.usf.edu>Keyword> Primer on integral calculusMultiple-choice test 438Problem set 440Chapter 07.02 Trapezoidal rule of integration 443What <strong>is</strong> integration? 443What <strong>is</strong> <strong>the</strong> trapezoidal rule? 443Derivation of <strong>the</strong> trapezoidal rule 444Multiple-segment trapezoidal rule 450Error in multiple-segment trapezoidal rule 456Multiple-choice test 459Problem set 461Chapter 07.03 Simpson’s 1/3 rule of integration 464What <strong>is</strong> integration? 464Simpson’s 1/3 rule 464Multiple-segment Simpson’s 1/3 rule 471Error in multiple-segment Simpson’s 1/3 rule 474Multiple-choice test 476Problem set 478Chapter 07.05 Gauss quadrature 480What <strong>is</strong> integration? 480Gauss quadrature rule 481Derivation of two-point Gaussian quadrature rule 482Higher point Gaussian quadrature <strong>for</strong>mulas 484Arguments and weighing fac<strong>to</strong>rs <strong>for</strong> n-point Gauss quadrature rules 485Multiple-choice test 494Problem set 497Chapter 07.06 Integrating d<strong>is</strong>crete functionsWhat <strong>is</strong> integration?Integrating d<strong>is</strong>crete functionsTrapezoidal rule <strong>for</strong> d<strong>is</strong>crete functions with unequal segmentsxxii


Problem setChapter 07.07 Integrating improper functionsWhat <strong>is</strong> integration?What <strong>is</strong> an improper integral?Problem setChapter 07.08 Simpson’s 3/8 Rule <strong>for</strong> integration 499Introduction 499Simpson’s 3/8 Rule <strong>for</strong> integration 502Computer algorithm <strong>for</strong> mixed Simpson’s 1/3 and 3/8 rule <strong>for</strong> integration 507Multiple-choice test 509x<strong>xiii</strong>


ORDINARY DIFFERENTIAL EQUATIONS 511Physical problemsChapter 08.00A Physical problem - general engineering 511Chapter 08.00B Physical problem - chemical engineeringChapter 08.00C Physical problem - civil engineering 515Chapter 08.00D Physical problem - computer engineeringChapter 08.00E Physical problem - electrical engineeringChapter 08.00F Physical problem – industrial engineeringChapter 08.00G Physical problem - mechanical engineering 517Chapter 08.01 Primer <strong>for</strong> ordinary differential equations (View it on web)Go <strong>to</strong> http://numericalmethods.eng.usf.edu>Keyword> Primer on ordinary differential equationsMultiple-choice test 523Problem set 525Chapter 08.02 Euler’s method <strong>for</strong> ordinary differential equations 527What <strong>is</strong> Euler’s method? 527Derivation of Euler’s method 528Multiple-choice test 536Problem set 539Chapter 08.03 Runge-Kutta 2nd order method 543What <strong>is</strong> <strong>the</strong> Runge-Kutta 2nd order method? 543Heun’s method 546Midpoint method 546Rals<strong>to</strong>n’s method 547How do <strong>the</strong>se three methods compare with results obtained if we found f x,ydirectly? 550How do we get <strong>the</strong> 2nd order Runge-Kutta method equations? 551Multiple-choice test 554Problem set 557Chapter 08.04 Runge-Kutta 4th order methodWhat <strong>is</strong> <strong>the</strong> Runge-Kutta 4th order method?How does one write a first order differential equation in <strong>the</strong> above <strong>for</strong>m?Multiple-choice testProblem setChapter 08.05 On Solving higher order equations 561Problem set 570Chapter 08.07 Finite difference method 572What <strong>is</strong> <strong>the</strong> finite difference method? 572Multiple-choice test 586Problem set 590xxiv


FAST FOURIER TRANSFORM 593Physical ProblemsChapter 11.00C Physical problem – civil engineering 593Chapter 11.01 Introduction <strong>to</strong> Fourier series 606Chapter 11.02 Continuous Fourier series 611Derivation of <strong>for</strong>mulas <strong>for</strong> a 0 , a k , and b k 611A FORTRAN program <strong>for</strong> finding Fourier coefficients a 0 , a k , and b k 612Multiple-choice test 621Chapter 11.03 Fourier trans<strong>for</strong>m pair: frequency and time domain 624Representation of a complex number in polar coordinates 629Important notes 630Non-periodic function 632Multiple-choice test 635Chapter 11.04 D<strong>is</strong>crete Fourier trans<strong>for</strong>m 637Derivations of DFT Formulas 637Detailed explanation about aliasing phenomenon, Nyqu<strong>is</strong>t samples, Nyqu<strong>is</strong>t rate 641Multiple-choice test 646Chapter 11.05 In<strong>for</strong>mal development of Fast Fourier Trans<strong>for</strong>m (FFT) 648Fac<strong>to</strong>rized matrix and fur<strong>the</strong>r operation count 650Companion node observation 655Companion node spacing 655Companion node computation 655Determination of W P 656Computer implementation <strong>to</strong> find value of “P” (in W P ) 657Multiple-choice test 666Chapter 11.06 Theoretical Development of FFT 669FFT algorithms <strong>for</strong> N = 2 r 669Consider <strong>the</strong> case N = 2 r = 2 3 = 8 671Consider <strong>the</strong> general case N = 2 r (r = any integer number) 673FFT algorithms <strong>for</strong> N = r 1 r 2 (where r 1 , r 2 are integers) 675General FFT algorithms and relationships between FFT <strong>for</strong> N = 2N = r 1 r 2 r 3 = (2)(2)(2) = 8 679Twiddle fac<strong>to</strong>r FFT algorithms <strong>for</strong> N = (r 1 = 4) (r 2 = 4) = 16 681Multiple-choice test 684(r = 3)=8 versusIndex 688Answers <strong>to</strong> Selected Problems 694xxv

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!