Example: air traffic controller

Numerical Methods for Engineers - Hong Kong University of ...

Numerical Methods for EngineersLecture Notes forJeffrey R. ChasnovThe Hong Kong University of Science and TechnologyDepartment of MathematicsClear Water Bay, KowloonHong KongCopyright 2020 by Jeffrey Robert ChasnovThis work is licensed under the Creative Commons Attribution Hong Kong License. To view a copy of thislicense, visit or send a letter to Creative Commons, 171 SecondStreet, Suite 300, San Francisco, California, 94105, the promotional video on YouTubeThese are the lecture notes for my upcoming Coursera course , Numerical Methods for Engineers (forrelease in January 2021). Before students take this course, they should have some basic knowledgeof single-variable calculus, vector calculus, differential equations and matrix algebra.

13 Bisection method 39 14 Newton’s method 41 15 Secant method 43 ... 55 Integrating odes in Matlab (Part A)143 56 Integrating odes in Matlab (Part B)145 ... but changes by a factor of two with each additional power of two. For example, the spacing of numbers between one and two is

Tags:

  Methods, Factors, Integrating

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Numerical Methods for Engineers - Hong Kong University of ...

1 Numerical Methods for EngineersLecture Notes forJeffrey R. ChasnovThe Hong Kong University of Science and TechnologyDepartment of MathematicsClear Water Bay, KowloonHong KongCopyright 2020 by Jeffrey Robert ChasnovThis work is licensed under the Creative Commons Attribution Hong Kong License. To view a copy of thislicense, visit or send a letter to Creative Commons, 171 SecondStreet, Suite 300, San Francisco, California, 94105, the promotional video on YouTubeThese are the lecture notes for my upcoming Coursera course , Numerical Methods for Engineers (forrelease in January 2021). Before students take this course, they should have some basic knowledgeof single-variable calculus, vector calculus, differential equations and matrix algebra.

2 Students shouldalso be familiar with at least one programming language. In this course, however, I will exclusivelyuse Matlab. I teach the basics of Matlabin the first week, but this may be too short an introductionfor students of limited programming ability and they may need to supplement their programminglessons have divided these notes into chapters called Lectures, with each Lecture corresponding to avideo on Coursera. I have also uploaded all my Coursera videos to YouTube, and links are placed atthe top of each are problems at the end of each lecture, some that require analytical solutions and othersthat require Matlabprograms.

3 Solutions to the analytical questions and Learner Templates for theMatlabprograms can be found in the the Coursera platform, at the end of each week there is also both an assessed multiple-choicequiz and a Matlabproject. Details of the Matlabprojects and their Learner Templates can also befound in these lecture ChasnovHong KongNov 2020iiiContentsI Scientific Computing11 Binary numbers52 Double precision73 Matlabas a calculator94 Scripts and functions115 Vectors136 Line plots177 Matrices218 Logicals259 Conditionals2710 Loops2911 Project I: Logistic map (Part A)3112 Project I: Logistic map (Part B)33II Root Finding3513 Bisection method3914 Newton s method4115 Secant method4316 Order of convergence4517 Convergence of Newton s method4718 Fractals from Newton s method49vviCONTENTS19 Coding the Newton fractal5120 Root finding inMatlab5521 Project II: Feigenbaum delta (Part A)5722 Project II: Feigenbaum delta (Part B)5923 Project II.

4 Feigenbaum delta (Part C)61 III Matrix Algebra6324 Gaussian elimination without pivoting6725 Gaussian elimination with partial pivoting6926 LU decomposition with partial pivoting7127 Operation counts7528 Operation counts for Gaussian elimination7729 Operation counts for forward and backward substitution7930 Eigenvalue power method8131 Eigenvalue power method (example)8332 Matrix algebra inMatlab8533 Systems of nonlinear equations8934 Systems of nonlinear equations (example)9135 Project III: Fractals from the Lorenz equations93IV Quadrature and Interpolation9536 Midpoint rule9937 Trapezoidal rule10138 Simpson s rule10339 Composite quadrature rules10540 Gaussian quadrature10741 Adaptive quadrature10942 Quadrature inMatlab11143 Interpolation113 CONTENTSvii44 Cubic spline interpolation (Part A)11545 Cubic spline interpolation (Part B)11746 Interpolation inMatlab12147 Project IV.

5 Bessel functions and their zeros123V Ordinary Differential Equations12548 Euler method12949 Modified Euler method13150 Runge-Kutta methods13351 Second-order Runge-Kutta methods13552 Higher-order Runge-Kutta methods13753 Higher-order odes and systems13954 Adaptive Runge-Kutta methods14155 integrating odes inMatlab(Part A)14356 integrating odes inMatlab(Part B)14557 Shooting method for boundary value problems14958 Project V: Two-body problem (Part A)15159 Project V: Two-body problem (Part B)153VI Partial Differential Equations15560 Boundary and initial value problems159 Practice quiz: Classify partial differential equations16161 Central difference approximation16362 Discrete Laplace equation16563 Natural ordering16764 Matrix formulation16965 Matlabsolution of the Laplace equation (direct method)17166 Jacobi, Gauss-Seidel and SOR methods17567 Red-black ordering177viiiCONTENTS68 Matlabsolution of the Laplace equation (iterative method)17969 Explicit Methods for solving the diffusion equation18170 Von Neumann stability analysis18371 Implicit Methods for solving the diffusion equation18572 Crank-Nicolson method for the diffusion equation18773 Matlabsolution of the diffusion equation18974 Project VI.

6 Two-dimensional diffusion equation193 Appendix195A Problem solutions and Matlab Learner Templates197 Week IScientific Computing13In this week s lectures, we learn how to program using Matlab. We learn how real numbers arerepresented in double precision and how to do basic arithmetic with Matlab. We learn how to usescripts and functions, how to represent vectors and matrices, how to draw line plots, how to use logicalvariables, conditional statements,forloops andwhileloops. Your programming project will be towrite a Matlabcode to compute the bifurcation diagram for the logistic 1 Binary numbersView this lecture on YouTubeWe do our arithmetic using decimals, which is a base-ten positional number system.

7 For example,the meaning of the usual decimal notation is illustrated 102+2 101+4 100+5 10 1+0 10 2+3 10 position in a decimal number corresponds to a power of 10. A digit in this number system isdefined as any of the numerals from 0 to 9, while digit is also the English word meaning a finger or atoe. Decimals probably arose from counting using ten count using two states, and this has led to the use of binary numbers, which is a base-two positional number system. Here, instead of digits, we use bits, defined as either a 0 or a 1. Themeaning of a binary number is illustrated 22+0 21+1 20+0 2 1+1 2 2+1 2 both decimal and binary, certain fractions can be represented only by infinitely repeated numer-als.

8 In decimal, only fully reduced fractions whose denominators are a product of powers of 2 and 5do not repeat. For example, we have12= ,14= ,15= ,18= ;but we also have13= ,16= ,17= ,19= ,where we use the bar notation to indicate repeating binary, only fully reduced fractions whose denominators are a product of powers of 2 do notrepeat. For example, using our more familiar digits to represent the fraction, the corresponding binarynumbers are given by12= ,14= ,18= ,and13= ,15= ,16= ,17= ,19= numbers with infinite repeats can not be represented exactly using a finite number of bits andare a potential source of round-off 1. BINARY NUMBERSP roblems for Lecture binary, round the fractions 1/3, 1/5, 1/6, 1/7 and 1/9 to six places after the binary numbers round down and which numbers round up?

9 Solutions to the ProblemsLecture 2 Double precisionView this lecture on YouTubeEight bits make a byte. Most Numerical computation is done in double precision, with numbersstored using eight bytes. The format of a double precision number iss 0e 1 2 3 4 5 6 7 8 9 10 11f 12 63#= ( 1)s 2e 1023 s is the sign bit, e is the biased exponent, and is the significand. Here,eis a whole numberwritten in binary, 1023 is in decimal, andfis the fractional part of the binary number following abinary 64 bits of a double precision number are distributed so that the sign uses one bit, the exponentuses 11 bits (in decimal, 0 e 2047), and the significand uses 52 bits.

10 The distribution of bitsreconciles two conflicting needs: that the numbers should range from the very large to the very small,and that numbers should be closely the largest and smallest exponents are reserved. Wheneis all ones (e=2047 in decimal),f=0 is used to represent infinity (written in MatlabasInf) and f6=0 is used to represent nota number (written in MatlabasNaN).NaNtypically results from a 0/0, / or all zeros, the double precision representation changes from , allowing these denor-mal numbers to gracefully underflow towards zero. The largest positive double precision number isrealmax = +308, and the smallest positive normal number isrealmin = important number is called machine epsilon (written in Matlabaseps) and is defined asthe distance between one and the next largest machine number.


Related search queries