Numerical Methods for Engineers
p p p
Lecture Notes for
p p
Jeffrey R. Chasnov
p p
, ThepHongpKongpUniversitypofpSciencepandpTechnologypDepartm
entpofpMathematics
ClearpWaterpBay,pKowloonpHo
ngpKong
Copyrightp©p2020-2022pbypJeffreypRobertpChasnov
ThispworkpisplicensedpunderpthepCreativepCommonspAttributionp3.0pHongpKongpLicense.p Topviewpapcopypofpthi
splicense,pvisitphttp://creativecommons.org/licenses/by/3.0/hk/porpsendpapletterptopCreativepCommons,p171pSec
ondpStreet,pSuitep300,pSanpFrancisco,pCalifornia,p94105,pUSA.
,Preface
ViewptheppromotionalpvideoponpYouTub
e
ThesepareptheplecturepnotespforpmypupcomingpCourserapcoursep,pNumericalpMethodspforpEngineersp(forprele
asep inp Januaryp 2021).p Beforep studentsp takep thisp course,p theyp shouldp havep somep basicp knowledgepof
psingle-
variablepcalculus,pvectorpcalculus,pdifferentialpequationspandpmatrixpalgebra.p Studentspshouldp alsop bep fa
miliarp withp atp leastp onep programmingp language.p Inp thisp course,p however,p Ip willp exclusivelypusep MA
TLAB.p Ip teachp thep basicsp ofp MATLABp inp thep firstp week,p butp thisp mayp bep toop shortp anp introductionpforps
tudentspofplimitedpprogrammingpabilitypandptheypmaypneedptopsupplementptheirpprogrammingp lessonspe
lsewhere.
Ip havep dividedp thesep notesp intop chaptersp calledp Lectures,p withp eachp Lecturep correspondingp top a
pvideop onp Coursera.p Ip havep alsop uploadedp allp myp Courserap videosp top YouTube,p andp linksp arep placed
p atptheptoppofpeachpLecture.
Thereparepproblemspatpthependpofpeachplecture,psomepthatprequirepanalyticalpsolutionspandpothers
pthatprequirepMATLABpprograms.p SolutionsptopthepanalyticalpquestionspandpLearnerpTemplatespforpth
epMATLABpprogramspcanpbepfoundpinpthepAppendix.
OnpthepCourserapplatform,patpthependpofpeachpweekptherepispalsopbothpanpassessedpmultiple-
choicepquizpandpapMATLABpproject.p DetailspofpthepMATLABpprojectspandptheirpLearnerpTemplatespcanp
alsopbepfoundpinptheseplecturepnotes.
JEFFREYpR.pCHASNOV
HongpKong
pNovp 202
0
iii
, Contents
I Scientific Computing
p 1
1p p Binaryp numbers 3
2p p Doublep precision 5
3p p MATLABp asp ap calculator 7
4p p Scriptsp andp functions 9
5p p Vectors 11
6p p Linep plots 15
7p p Matrices 19
8p p Logicals 23
9p p Conditionals 25
10p Loops 27
11p ProjectpI:pLogisticpmapp(PartpA) 29
12p ProjectpI:pLogisticpmapp(PartpB) 31
II Root Finding
p 33
13p Bisectionpmethod 35
14p Newton’spmethod 37
15p Secantpmethod 39
16p Orderpofpconvergence 41
17p Convergencep ofp Newton’sp method 43
18p FractalspfrompNewton’spmethod 45
19p Codingp thep Newtonp fractal 47
20p Rootp findingp inp MATLAB 51
21p ProjectpII:pFeigenbaumpdeltap(PartpA) 53
iv
p p p
Lecture Notes for
p p
Jeffrey R. Chasnov
p p
, ThepHongpKongpUniversitypofpSciencepandpTechnologypDepartm
entpofpMathematics
ClearpWaterpBay,pKowloonpHo
ngpKong
Copyrightp©p2020-2022pbypJeffreypRobertpChasnov
ThispworkpisplicensedpunderpthepCreativepCommonspAttributionp3.0pHongpKongpLicense.p Topviewpapcopypofpthi
splicense,pvisitphttp://creativecommons.org/licenses/by/3.0/hk/porpsendpapletterptopCreativepCommons,p171pSec
ondpStreet,pSuitep300,pSanpFrancisco,pCalifornia,p94105,pUSA.
,Preface
ViewptheppromotionalpvideoponpYouTub
e
ThesepareptheplecturepnotespforpmypupcomingpCourserapcoursep,pNumericalpMethodspforpEngineersp(forprele
asep inp Januaryp 2021).p Beforep studentsp takep thisp course,p theyp shouldp havep somep basicp knowledgepof
psingle-
variablepcalculus,pvectorpcalculus,pdifferentialpequationspandpmatrixpalgebra.p Studentspshouldp alsop bep fa
miliarp withp atp leastp onep programmingp language.p Inp thisp course,p however,p Ip willp exclusivelypusep MA
TLAB.p Ip teachp thep basicsp ofp MATLABp inp thep firstp week,p butp thisp mayp bep toop shortp anp introductionpforps
tudentspofplimitedpprogrammingpabilitypandptheypmaypneedptopsupplementptheirpprogrammingp lessonspe
lsewhere.
Ip havep dividedp thesep notesp intop chaptersp calledp Lectures,p withp eachp Lecturep correspondingp top a
pvideop onp Coursera.p Ip havep alsop uploadedp allp myp Courserap videosp top YouTube,p andp linksp arep placed
p atptheptoppofpeachpLecture.
Thereparepproblemspatpthependpofpeachplecture,psomepthatprequirepanalyticalpsolutionspandpothers
pthatprequirepMATLABpprograms.p SolutionsptopthepanalyticalpquestionspandpLearnerpTemplatespforpth
epMATLABpprogramspcanpbepfoundpinpthepAppendix.
OnpthepCourserapplatform,patpthependpofpeachpweekptherepispalsopbothpanpassessedpmultiple-
choicepquizpandpapMATLABpproject.p DetailspofpthepMATLABpprojectspandptheirpLearnerpTemplatespcanp
alsopbepfoundpinptheseplecturepnotes.
JEFFREYpR.pCHASNOV
HongpKong
pNovp 202
0
iii
, Contents
I Scientific Computing
p 1
1p p Binaryp numbers 3
2p p Doublep precision 5
3p p MATLABp asp ap calculator 7
4p p Scriptsp andp functions 9
5p p Vectors 11
6p p Linep plots 15
7p p Matrices 19
8p p Logicals 23
9p p Conditionals 25
10p Loops 27
11p ProjectpI:pLogisticpmapp(PartpA) 29
12p ProjectpI:pLogisticpmapp(PartpB) 31
II Root Finding
p 33
13p Bisectionpmethod 35
14p Newton’spmethod 37
15p Secantpmethod 39
16p Orderpofpconvergence 41
17p Convergencep ofp Newton’sp method 43
18p FractalspfrompNewton’spmethod 45
19p Codingp thep Newtonp fractal 47
20p Rootp findingp inp MATLAB 51
21p ProjectpII:pFeigenbaumpdeltap(PartpA) 53
iv