Table Of ContentRichard Khoury
Douglas Wilhelm Harder
Numerical
Methods and
Modelling for
Engineering
Numerical Methods and Modelling for Engineering
Richard Khoury (cid:129) Douglas Wilhelm Harder
Numerical Methods
and Modelling
for Engineering
RichardKhoury DouglasWilhelmHarder
LakeheadUniversity UniversityofWaterloo
ThunderBay,ON,Canada Waterloo,ON,Canada
ISBN978-3-319-21175-6 ISBN978-3-319-21176-3 (eBook)
DOI10.1007/978-3-319-21176-3
LibraryofCongressControlNumber:2016933860
©SpringerInternationalPublishingSwitzerland2016
Thisworkissubjecttocopyright.AllrightsarereservedbythePublisher,whetherthewholeorpartof
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission
or information storage and retrieval, electronic adaptation, computer software, or by similar or
dissimilarmethodologynowknownorhereafterdeveloped.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this
publicationdoesnotimply,evenintheabsenceofaspecificstatement,thatsuchnamesareexempt
fromtherelevantprotectivelawsandregulationsandthereforefreeforgeneraluse.
Thepublisher,theauthorsandtheeditorsaresafetoassumethattheadviceandinformationinthis
book are believed to be true and accurate at the date of publication. Neither the publisher nor the
authors or the editors give a warranty, express or implied, with respect to the material contained
hereinorforanyerrorsoromissionsthatmayhavebeenmade.
Printedonacid-freepaper
ThisSpringerimprintispublishedbySpringerNature
TheregisteredcompanyisSpringerInternationalPublishingAGSwitzerland
Conventions
Throughout this textbook, the following conventions are used for functions and
variables:
Object Format Example
Scalarnumber Lowercase x¼5
(realor italics
complex)
Vector Lowercase v¼½x0;x1;...;xi;...;xN(cid:2)1(cid:3)
bold
2 3 2 3
Matrix bUoplpdercase 6 x0,0 x0,1 ... x0,j ... x0,N(cid:2)1 7 6 v0 7
6 x1,0 x1,j x1,N(cid:2)1 7 6 v1 7
6 ... ... ... 7 6 ... 7
M¼6664 x.i.,.0 xi,1 ... x.i.,.j ... xi,.N.(cid:2).1 7775¼6664 .v.i. 7775
xM(cid:2)1,0 xM(cid:2)1,1 ... xM(cid:2)1,j ... xM(cid:2)1,N(cid:2)1 vM(cid:2)1
Scalar-valued Lowercase fðxÞ¼5xþ2
functionof italicswith
scalar lowercase
italics
Scalar-valued Lowercase fðvÞ¼fðx0;x1;...;xi;...;xN(cid:2)1Þ
functionof italicswith ¼5x0þ2x1þ(cid:4)(cid:4)(cid:4)þ7xiþ(cid:4)(cid:4)(cid:4)þ4xN(cid:2)1þ3
vector lowercase
bold
Vector- Lowercase fðxÞ¼½f0ðxÞ,f1ðxÞ,...,fiðxÞ,...,fN(cid:2)1ðxÞ(cid:3)
valuedfunction boldwith
ofscalar lowercase
italic
Vector-valued Lowercase fðvÞ¼½f0ðvÞ,f1ðvÞ,...,fiðvÞ,...,fN(cid:2)1ðvÞ(cid:3)
functionof boldwith
vector lowercase
bold
(continued)
v
vi Conventions
Object Format Example
2 3
Mfsucanaltcartirixo-nvaolfued Ubloopwlpdeerwrccaiatshsee 666 ff01,,.00.ðð.xxÞÞ f0,1ðxÞ ... ff01.,,jj.ðð.xxÞÞ ... ff01,,NN.(cid:2)(cid:2).11.ððxxÞÞ 777
italics MðxÞ¼6664 fi,.0.ð.xÞ fi,1ðxÞ ... fi,.j.ð.xÞ ... fi,N.(cid:2).1.ðxÞ 7775
fM(cid:2)1,0ðxÞ fM(cid:2)1,1ðxÞ ... fM(cid:2)1,jðxÞ ... fM(cid:2)1,N(cid:2)1ðxÞ
2 3
Mfvuenactctrotiirxo-nvaolfued Ubloopwlpdeerwrccaiatshsee 666 ff01,,.00.ðð.vvÞÞ f0,1ðvÞ ... ff01,,.jj.ðð.vvÞÞ ... ff01,,NN.(cid:2)(cid:2).11.ððvvÞÞ 777
bold MðvÞ¼6664 fi,.0.ð.vÞ fi,1ðvÞ ... fi,.j.ð.vÞ ... fi,N.(cid:2).1.ðvÞ 7775
fM(cid:2)1,0ðvÞ fM(cid:2)1,1ðvÞ ... fM(cid:2)1,jðvÞ ... fM(cid:2)1,N(cid:2)1ðvÞ
Acknowledgements
Thanks to the following for pointing out mistakes, providing suggestions, or
helpingtoimprovethequalityofthistext:
(cid:129) KhadijehBayat
(cid:129) DanBusuioc
(cid:129) TimKuo
(cid:129) AbbasAttarwala
(cid:129) PrashantKhanduri
(cid:129) MatthewChan
(cid:129) ChristopherOlekas
(cid:129) JaroslawKuszczak
(cid:129) ChenHe
(cid:129) HansJohannesPetrusVanleeuwen
(cid:129) DavidSmith
(cid:129) JeffTeng
(cid:129) RomanKogan
(cid:129) MohamedOussamaDamen
(cid:129) RudkoVolodymyr
(cid:129) VladimirRutko
(cid:129) GeorgeRizkalla
(cid:129) AlexandreJames
(cid:129) ScottKlassen
(cid:129) BradMurray
(cid:129) BrendanBoese
(cid:129) AaronMacLennan
vii
Contents
1 ModellingandErrors. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 SimulationandApproximation. . . . . . . . . . . . . . . . . . . . . . . 2
1.3 ErrorAnalysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.1 PrecisionandAccuracy. . . . . . . . . . . . . . . . . . . . . . 5
1.3.2 AbsoluteandRelativeError. . . . . . . . . . . . . . . . . . . 6
1.3.3 SignificantDigits. . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.3.4 BigONotation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.4 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.5 Exercises. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 NumericalRepresentation. . .. . . . .. . . . .. . . .. . . . .. . . . .. . . .. 13
2.1 Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 DecimalandBinaryNumbers. . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.1 DecimalNumbers. . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.2 BinaryNumbers. . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2.3 BaseConversions. . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3 NumberRepresentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3.1 Fixed-PointRepresentation. . . . . . . . . . . . . . . . . . . . 19
2.3.2 Floating-PointRepresentation. . . . . . . . . . . . . . . . . . 20
2.3.3 Double-PrecisionFloating-PointRepresentation. . . .. 22
2.4 LimitationsofModernComputers. . . . . . . . . . . . . . . . . . . . . 24
2.4.1 UnderflowandOverflow. . . . . . . . . . . . . . . . . . . . . 24
2.4.2 SubtractiveCancellation. . . . . . . . . . . . . . . . . . . . . . 25
2.4.3 Non-associativityofAddition. . . . . . . . . . . . . . . . . . 27
2.5 Summary. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.6 Exercises. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
ix