d d d
Lecture Notes for
d d
Jeffrey R. Chasnov
d d
, ThedHongdKongdUniversitydofdSciencedanddTechnologydDepartm
entdofdMathematics
CleardWaterdBay,dKowloondHo
ngdKong
Copyrightd©d2020-2022dbydJeffreydRobertdChasnov
ThisdworkdisdlicenseddunderdthedCreativedCommonsdAttributiond3.0dHongdKongdLicense.d Todviewdadcopydofdthi
sdlicense,dvisitdhttp://creativecommons.org/licenses/by/3.0/hk/dordsenddadletterdtodCreativedCommons,d171dSec
onddStreet,dSuited300,dSandFrancisco,dCalifornia,d94105,dUSA.
,Preface
ViewdthedpromotionaldvideodondYouTub
e
ThesedaredthedlecturednotesdfordmydupcomingdCourseradcoursed,dNumericaldMethodsdfordEngineersd(fordrele
ased ind Januaryd 2021).d Befored studentsd taked thisd course,d theyd shouldd haved somed basicd knowledgedof
dsingle-
variabledcalculus,dvectordcalculus,ddifferentialdequationsdanddmatrixdalgebra.d Studentsdshouldd alsod bed fa
miliard withd atd leastd oned programmingd language.d Ind thisd course,d however,d Id willd exclusivelydused MA
TLAB.d Id teachd thed basicsd ofd MATLABd ind thed firstd week,d butd thisd mayd bed tood shortd and introductiondfords
tudentsdofdlimiteddprogrammingdabilitydanddtheydmaydneeddtodsupplementdtheirdprogrammingd lessonsde
lsewhere.
Id haved dividedd thesed notesd intod chaptersd calledd Lectures,d withd eachd Lectured correspondingd tod a
dvideod ond Coursera.d Id haved alsod uploadedd alld myd Courserad videosd tod YouTube,d andd linksd ared placed
d atdthedtopdofdeachdLecture.
Theredaredproblemsdatdthedenddofdeachdlecture,dsomedthatdrequiredanalyticaldsolutionsdanddothers
dthatdrequiredMATLABdprograms.d SolutionsdtodthedanalyticaldquestionsdanddLearnerdTemplatesdfordth
edMATLABdprogramsdcandbedfounddindthedAppendix.
OndthedCourseradplatform,datdthedenddofdeachdweekdtheredisdalsodbothdandassesseddmultiple-
choicedquizdanddadMATLABdproject.d DetailsdofdthedMATLABdprojectsdanddtheirdLearnerdTemplatesdcand
alsodbedfounddindthesedlecturednotes.
JEFFREYdR.dCHASNOV
HongdKong
dNovd 202
0
iii
, Contents
I Scientific Computing
d 1
1d d Binaryd numbers 3
2d d Doubled precision 5
3d d MATLABd asd ad calculator 7
4d d Scriptsd andd functions 9
5d d Vectors 11
6d d Lined plots 15
7d d Matrices 19
8d d Logicals 23
9d d Conditionals 25
10d Loops 27
11d ProjectdI:dLogisticdmapd(PartdA) 29
12d ProjectdI:dLogisticdmapd(PartdB) 31
II Root Finding
d 33
13d Bisectiondmethod 35
14d Newton’sdmethod 37
15d Secantdmethod 39
16d Orderdofdconvergence 41
17d Convergenced ofd Newton’sd method 43
18d FractalsdfromdNewton’sdmethod 45
19d Codingd thed Newtond fractal 47
20d Rootd findingd ind MATLAB 51
21d ProjectdII:dFeigenbaumddeltad(PartdA) 53
iv