Table Of ContentNUMERICAL
METHODS
FOR ENGINEERS
AND SCl:ENTISTS
3rdE dition
An IntroductwiiotnhA ppliicatioUnssi ngM ATLAB®
NumericMaelt hods
foErn gineearnsdS cientists
An Introducwtiitohn
ApplicatuisoinnsMg A TLAB®
ThiErddi tion
AmosG ilat
VisShu bramaniam
DepartmeonfMt e chanicEanlg ineering
TheO hioS tatUen iversity
WILEY
Publisher: DonF owley
AcquisiEtdiiotno r: LindRaa tts
EditorAisasli stant: HopeE llis
CoveDre signer: WendyL ai
AssociPartoed uctMiaonna ger:J oycPeo h
CoveIrm ageT:h ei magoen t hec ovesrh owasn umerisciamlu latoifao nna luminpurmo jecpteinleet raat ing
compospiltaet Ceo.u rteosfDy r .K ellCya meyN,A SA GlenRne searCcehn teCrl,e velaOnhdi,o
Thibso okw ass eitn T imeRso manb yt hea uthoPrrsi.n taenddb ounbdy R .RD.o nnellTehyec. o vewra sp rintbeyd
R.RD.o nnellTehyi.bs o oki sp rintoenad c ifrde ep aper.
Foundeidn1 807J,o hWni le&y SonsI,n ch.a sb eeanv aluesdo urocfek nowledagnedu nderstanfodrim nogr et han
200y earhse,l pipnego plaer ountdh ew orlmde ett heniere dasn dfu lfiltlh eaisrp iratOiuornc so.m paniysb uiolnta
foundatioofnp rincitphlaeitsn clurdees ponsitboit lhiect oym munitwiee sse rvaen dw herwee livaen dw orkI.n
2008w,e l aunchae Cdo rporaCtiet izenIsnhiitpi aatg ilvoeb,ea flfo rttoa ddretshsee nvironmesnotcailea,cl o,n omic,
ande thiccahla llenwgee fasc ei no urb usineAsmso.n gt hei ssuwees area ddressairnecg a rboinm pacpta,p er
specificatainodpn rso curemeetnhti,cc aoln duwcitt hionu rb usineasnsda mongo urv endorasn,dc ommuniatnyd
charitsaubplpeo Frotr.m orei nformatipolne,av sies oiutrw ebsitwwwe: .wiley.com/go/citizenship.
Copyrig©h 2t0 142,0 11J ohnW iley& SonsI,n c.A llr ighrtess erveNdo. p arotf t hipsu blicamtaiyo bne
reproducsetdo,r eidn rae triesvyaslt eomr t ransmiitnta endy fo rm orb y anym eanse,l ectromneicch,a nical,
photocopyriencgo,r disncga,n nionrog t herwiesxec,e apstp ermitutnedde Sre ctio1n0s7o r1 08o ft he1 976 United
StatCeosp yriAgchttw, i thoeuitt htehrep riowrr ittpeenr missoifto hneP ublisohrea ru,t horiztahtrioounpg ahy ment
oft hea pproprpieart-ec ofepey t ot heC opyriCglheta raCnecnet eIrn,c2 .2 2R osewooDdr ivDea,n verMsA, 0 1923,
websiwtwew .copyright.comR.e questtost heP ublisfohre pre rmisssihoonu lbde a ddrestsoet dh eP ermissions
DepartmeJnoth,nW ile&y SonsI,n c1.1,1 R iveSrt reHeotb,o keNnJ, 0 7030-57(7240,1 )748-6fa0x1 (12,0 1)748-
6008w,e bsihttetp :www//.wiley.copme/rgmoi/s sions.
Evaluatcioopni aerse p rovidteoqd u alifiaecda demiacnsdp rofessiofonra rlesv iepwu rposeosn lyfo,r usei nt heir
coursdeusr itnhgen exatc ademyieca rT.h esceo piaersel icenasneddm ayn otb es olodr t ransfertroae t dh ipradr ty.
Uponc ompletoifto hne r eviepwe riopdl,e arseeturn thee valuatcioopnyt oW ileyR.e turn instrucatnido nfrase eo f
chargree tumrna ililnagb ealr ea vailaabtlw ew w.wiley.com/go/reItfuy moluha abveelc .h osetno a doptth is
textbofoork u sei ny oucro urspel,e aascec etphti bso oka sy oucro mplimendteasrckyo pyO.u tsiodfet heU nited
Statpelse,a csoen taycotu lro casla lerse presentative.
LibraorfCy o ngreCsast aloging-in-PDuabtlai cation
GilaAtm,o s.
Numericmaelt hofodrse ngineaenrdss c ient:ia snit nstroducwtiitaohpn p licautsiionnmgsa tlaIAb m osG ilaVti,s h
Subramaniam, DeopfaM retcmheannti cal EngitnheeOe hriioSn tga,tU en ivers-i-Tthyi.r edd ition.
pagecsm
Inclubdiebsl iograrpehfeirceanlac nedsi ndex.
ISBN9 78-1-118-55(4c9l3o-t7h )
1.M ATLAB.2 .N umericaanla lysis-p-rDoacteas s3i.nE gn.g ineermiantgh ematIi.cS su.b ramaniVaims,hI .I .
Title.
QA297.G4290 14
5l 8 .0285'53--dc23
2013016217
Printientd h Uen iteSdt atoefsA merica
10987654321
Preface
Thitse xtboiosik n tendfoerd a firscto ursienn umericmaelt hodfosr
studeinnte sn gineearnidns gc ience, ttyapuigcihantlt lhyes econyde ar
ofc ollegTehe.b ookc overtsh efu ndamentaolfns u merical methods
from ana pplipeodi notfv iewI.te xplatihnebs a siicd eabse hintdh ev ar
ioumse thodasn ds howtsh euisre fulnefosrs s olvipnrgo bleimnse ngi
neerianngd science.
Int hep asatn ,u merimceatlh odcso urswea se ssentimaaltlhye mati
cale,m phasizniunmge ricaanla lyasnidst heorMyo.r er ecentdluyet, o
thea vailaboiflp iotwye rfudle sktcoopm putearnsdc omputisnogf tware
thaits b otahff ordabalnedp owerfutlh,e c onteanntd n aturoefa first
coursienn umericmaelt hodfosr engineerainndsg c ienscteu denatrse
changiTnhge.e mphasiisss h iftmionrgea ndm oret owaradp plications
andt owaridm plementniunmge ricmaelt hodwsi trhe ady-tot-ouosles .
Ina typiccaolu rsset,u densttsil lelarn thefu ndamentaolfns u merical
methodIsn.a dditihoonw,e vetrh,e lye arnc omputperro grammi(nogr
improvteh epirro grammsikngi lilfts h ehya vea lreabdeye ni ntroduced
top rogrammianngd)u ,s ea dvancseodft waraesa t oofolr s olvipnrgo b
lemsM.A TLAB isa goode xamploefs ucsho ftwarIetc. a nb eu sebdy
studetnotw sr ite othwenpi rro graamnsd,c anb eu seads a t oofolr s olv
ingp robleumssi nigt bsu iltfu-nicnt ionOsn.e o ft heo bjectiovfae s
coursienn umerimceatlh odisst op repasrteu deinnts sc ienacned engi
neerifonrg futurceo ursienst heiarr eaosf s pecializ(aatnidto hne ir
futurcea reewrhse)r teh ewyi lhla vet ou sec omputeforrss olvipnrgo b
lems.
Maionb jecotfit vhbeeos o k
To teacht hef undamentoafl sn umericmaelt hodsw,i th
emphasiosnt hem oste ssentmieatlh ods.
Top rovisdteu denwtist thh eo pportutnoie tnyh ancteh epirro
gramminsgk ilulssi ntgh eM ATLABe nvironmteoni tm plement
algorithms.
Tot eacthh eu seo fM ATLABa sa too(lu siintgbs u iltf-uinnc
tionfso)rs olvipnrgo blemisns ciencaen de ngineerainndg ,
forc heckitnhger esulotfas n yp rogramsst udenwtrsi tteh em
selves.
iii
iv Preface
Features/poefdt ahbgeoo ogyk
• Thibso oki sw rittienns implcel,e aarn,d d irelcatn guagFer.e
quentbluyl,l eatnsda l isotfs teprsa,t htehra lne ngttheyx atr,eu sed
tol isfatc tasn dd etaiolfas s pecisfiucb ject.
• Numerouisl lustraarteiu osnesfod r e xplaintihnepg r inciopflt ehse
numerimceatlh ods.
• Manyo ft hee xamplaensd e nd-of-chparpotbelre imnsv olrveea lis
tipcr obleimnss c ienacnede ngineering.
• MATLAB isi ntegrwaitetdht ihne t exatn di nt hee xamplAe sl.i ght
colorbeadc kgroiusnu ds ewdh enM ATLAB syntiasxd isplayed.
• Annotatcionmgm enttsh aetx platihnec ommandasr ep ostaeldo ng
sidteh eM ATLAB syntax.
• MATLAB'sb uiltfu-nicnt iotnhsa atr ea ssociawtietdth h en umeri
camle thodasr ep resenitned de tail.
• Theh omeworpkr obleamtts h ee ndo ft hec haptearrsed ividiendt o
threger oups:
(a) Probtlobe ems so lvbeyhd a ndPr:o blermesl atteodi mproving
understanodfin nugm ericmaelt hodIsn.t hesper obletmhse s tu
dentasr ea sketdo a nsweqru estiroenlsa tteotd h efu ndamentoafl s
numerical meatnhdto odc sa,r royu ta few steposft hen umerical
methodbsyh and.
(bP)r oblteobm esp rogramimnMe AdTL AB:P robledmess ignteod
provitdhee o pportuntioit myp rovper ogrammisnkgi lIlnst .h ese
problesmtsu denatrsea sketdo u seM ATLAB tow ritceo mputer
progra(mssc rifiplte sa ndu ser-defifnuendc tioinmsp)l ementing
varionuusm erimceatlh ods.
(c) Probilnme amtssh c,i eanncdee n,g ineePrroibnlegim:nss cience
ande ngineetrhianhtga vteo b es olvbeydu sinngu merimceatlh ods.
Theo bjectiistv oet ratihne s tudenttous s en umerimcaelt hodfosr
solvipnrgo bletmhse cya ne xpetcots eei nfu turceo ursoeris n p rac
ticSet.u denatrsee xpectteoud s et hep rogratmhsa atr ep resenitne d
theb ookp,r ogratmhsa tth ewyr itaen,d t heb uiltfu-nicnt ioinns
MATLAB.
Organizoaftt hibeoo no k
Chap1t:e Trh efi rscth aptgeirv eas g enerianlt roducttoni uomne rical
methodasn dt ot hew ayt hacto mputesrtso rneu mberasn dc arroyu t
numericoaple ratiIotan lss.io n cludae sse ctioonne rroirnsn umerical
solutiaonndas s ectioonnc omputearnsdp rogramming.
Chap2t:eT rhe s econcdh aptperre senrtesv iaeo wffu ndamentmaalt h
ematiccaoln ceptthsaa tr eu seidn t hefo llowicnhga ptetrhsac to vetrh e
numericmaelt hodIst.i si ntendteodb e useda s rae mindeorr,a
refreshoefrc ,o nceptthsa tth es tudenatrsea ssume(de xpectteodb )e
Brief ToafbC loen tents
Preface iii
Chapte1r Introduct1i on
Chapte2r MathematiBcaaclk groun2d3
Chapte3r SolviNnogn lineaErq uation5s7
Chapte4r Solvian Sgy steomf L ineaErq uation9s9
Chapte5r EigenvalaunedsE igenvecto16r5s
Chapte6r CurvFei ttianngdI nterpolat1i93o n
Chapte7r FouriMeert hods2 51
Chapte8r NumericDaiflf erentiat3i0o3n
Chapte9r NumericIanlt egrati34o1n
Chapte1r oO rdinaDrifyf erentEiqaula tioInnsi:t ial-Value
Problems38 5
Chapte1r1 OrdinaDrifyf erentEiqaula tioBnosu:n dary-Value
Problems47 1
AppendiAx I ntroducMtAoTryL AB 509
AppendiBx M ATLAB Programs5 47
Appendicx Derivatoifot nh eR ealD iscreFtoeu riTerra nsform
(DFT) 551
Index 555
ix
Preface v
familiwairt hfr om theifirr sta-nds econd-ymeaatrh ematciocusr ses.
Sincmea nyo ft hesteo piacrsea ssociawtietvdha rionuusm erimceatlh
odsw,e feelt haitti sb ettteorh avet hem athematbiaccaklg roguantd h
ereidn o nec hapt(earn de asiteorfi ndw henn eededr)a thtehra bne
dispertsherdo ughtohuebt o okS.e veroaflt het opitchsa atr ec overiend
Chapte2r a ndt haatr ee ssentiinat lh ee xplanatoifao nn umerical
methoadr er epeatienod t hecrh aptewrhse rteh en umerimceatlh odasr e
presentMeods.ti nstrucwtiolprlrs o babclhyo osneo tt oc oveCrh apt2e r
aso neu niitn t hec lasbsu,tw ilmle ntiao tno piwch enn eedeadn dr efer
thes tudetnott sh ec hapter.
Chapte3r tsh roug11h: Thesnei nceh apteprrse setnhtev arionuusm er
icamle thodisna no rdetrh aitst ypicalfollyl oweidna firscto ursoen
numerimceatlh odTsh.e sceh apteforlsl otwh efo rmate xplainneexdt .
Organizatoifao tynp icaclh apter
An itemizleidso tft het opitchsa atr ec overiendt hec haptiesdr i splayed
belowt het itolfe t hec hapteTrh.e l isits d ividiendt coo rea nd
complementtaorpyi cTsh.ec oret opicasr et hem oste ssential topics
relatteotd h es ubjeocft tchhea ptTehre.c omplementtaoryp iicnsc lude
morea dvancteodp icOsb.v iousal dyi,v isiooftn o pircesl atteood n e
subjeicnttc oo raen dc omplementiassr uyb jectTihveie n.t einstt o h elp
instrucitnto hreds e siogfnt hecioru rwshee nt heriesn ote nougthi mteo
covearl lt het opicIsn.p ractic,a tlhiedt iyvisicoannb ei gnoriend
courses wahltelhr ete o piacrsec overed.
Thefi rsste ctiooftn h ec haptperro vidae gse nerbaalc kgrowuintdh
illustreaxtaimvpel eosfs ituatiiontn hse s ciencaensd e ngineering
wherteh em ethoddse scriibnet dh ec haptaerreu sedT.h isse ctiaolns o
explaitnhseb asiicd eabse hintdh es pecicfilca sosfn umerimceatlh ods
thaatr ed escriibnet dh ec haptTehre.fo llowisnegc ticoonvse trh ec ore
topiocfst hec haptNeerx.t a,s pecisaelc tidoins custsheebs u iltfu-nicn
tionisnM ATLAB thaitm plemetnhten umericmaelt hoddse scriibne d
thec haptaenrd,h owt hemya y bues etdo s olvper obleTmhse.l atseerc
tionosft hec haptceorv etrh ec omplementtaorpyi cs.
Theo rdeorf t opics
Iti sp robabilmyp ossitbowl rei taet exbto okw herael tlh et opifoclsl ow
ano rdetrh aitsa greeudp onb ya liln strucItnot rhsep. r esebnoto kt,h e
mains ubjeacrteis n a no rdetrh aitst ypicianal fi rscto urisnen umerical
methodCsh.a pt3e rc oversso lutioofnn o nlineeqaura tioIntms o.s tly
dealwsi tthh es olutoifoa n s ingelqeu atiwohni,c ihs a simplaep plica
tioonf numermiectahlo dTsh.ec haptaelrs ion cludaesas c ,o mplemen
tartyo piacs ,e ctioontn h seo lutoifoa ns ysteomfn onlineeqaura tions.
Chapt4e dre alwsi tthh es olutoifoa n s ysteomfl ineeaqru atioNnesx.t ,
Chapt5ed re alwsi tehi genvaalnudee si genvecatnodrC sh,a pt6e cro v
ersc urvfiet tianngd i nterpolaCthioanp.t7 e,rw hicihs n ewi nt he3 rd
editicoonv,e rasn i ntroducttoFi oounr imeert hodCsh.a pte8r asn d9
vi Preface
covedri fferentiaantdii onnt egrarteisopne,c tiFvienlayl.sl oyl,u tioofn
ordinadriyff erenetqiuaalt i(oOnDsE )i sp resenitnet dh el asttw oc hap
terCsh.a pt1e0rd ealwsi tthh es olutoifoi nn itial-pvraolbulee( mfisr st
order, syasntdeh misg,h er-oarnddeC rh)a pt1e1rc onsidbeorusn dary
valuper oblems.
Theo rdeorf s omeo ft het opiicssd ictabtyet dh es ubjectthse m
selveFso.re xampldei,ff erentiaantdii notne granteieodtn ob ec overed
beforoer dinadriyff erenetqiuaalt ioIntis sp. o ssibhloew,e vetro,c over
theo thesru bjeicntd si ffereonrtd etrh apnr esenitnet dh eb ookT.h ev ar
ioucsh aptearnsds ectioinnts h eb ooka rew rittienna self-contained
mannetrh amta kei te asfoyr t hei nstructtoorc ovetrh es ubjeicnta sd if
ferenotr deirfd, e sired.
MATLABp rograms
Thisb ookc ontaimnasn yM ATLAB programTsh.e p rogramasr e
clearildye ntiafiseu ds er-defifnuendc tioonras s,s crifiplte sA.l lt he
prograamrse l istiendA ppendiBx.T hep rogramosrt, h es cripatrse,
writtienna simplwea yt haits e astyo fo llowT.h ee mphasoifst hese
prograimsos n t heb asiacnsd o nh owt op rograamna lgoriotfha ms pe
cifincu mericmaelt hoOdb.v ioustlhyep, r ograamrsen otg eneraanld,
don otc ovearl plo ssibclier cumstawnhceenes x ecutTehde.p rograms
aren otw rittfreonm thep erspecotfib veei nsgh ortefasstt,e sotrm, o st
efficienRta.t hetrh,e ayr ew rittseunc thh atth eayr ee astyo fo llowI.ti s
assumetdh amto sto ft hes tudenhtasv eo nllyi mituendd erstanodfi ng
MATLAB andp rogrammianngdp, r esentMiAnTgL AB int himsa nner
wilald vantchee ciorm putisnkgi lMlosr.e a dvancuesde rosfM ATLAB
aree ncouratgoew dr itmeo res ophistiacnadte effidc ienptr ograamnsd
scripatnsdc, o mparteh epierr formanwciet thh eo neisn t heb ook.
Thiredd ition
Them ainc hangienst het hierddi tiaorne :
FouriMeert hodsI:nr espontsome a nyr equesfrtosm professotrhsa t
7)
uset heb ooki nt heicro urseas n,e wc hapt(eCrh aptero nF ourier
methodhsa sb eeand detdo t heb ookT.h ec haptceorv erFso uriseerr ies,
discrFeotuer iseerr iDeiss,c reFtoeu riTerra nsforamn,da ni ntroduction
tot heF asFto uriTerra nsfor(mF FT)w hicahr ew ideluys eidn e ngineer
ingfo rp rocessdiinggi dtaatla .
EignvalaunedsE ignvectoTrhsits:o piwch icwha sp arotf C hapt4e r
(Solvian gS ystoefLm i neaErq uatioinnts h)e fi rsttw oe ditioofnt sh e
booki sn owc overienda sepacrhaatpet er.
MATLAB: Thet hiredd itioofnt heb ooki su pdatetdoM ATLAB
R2012Abl.l t hep rograumssea nonymofuunsc tioannsdfu nctihoann
dleasr eu sefodr p assifunngc tioinnst fou nctiAopnpse.n dAi xh asb een
updatteodt hec urrevnetr sioofMn A TLAB.
Homeworpkr oblemAsb:o ut5 0%o ft hep roblehmasv eb eena dded
orc hangeMdo.s to ft heC haptehrasv e4 0o rm orep roblems.
Preface vii
Suppomratt erial
The followinigs a vailabolne t hei nstrucctoomrp amons itaet
www.wil.ecyom/college/gilat):
()
a forfa cultwyh oh avaed opttehdet exfotr u sei nt hecioru rsaefu ,l ly
workesdo lutmiaonnu atlr,i pclhee ckfoerda ccuracy.
b)
( suggestceodu rse sywliltahbs iu ggestaesds ignmetnot hse lp
quickilnyt egrtahtete e xitn tyoo ucro urse.
()
c conversgiuoind efrso m othemra jonru mericmaelt hodtsi tlteos
showw hereea cshe ctioofyn o ucru rretnetxi tsc overiendt hinse w
texhte,l piynoguq uickcloyn vefrrotm oldt on ew.
(d) electrovneircsi oonfas l tlh efi gureasn dt ablfreosm thet exfot,r
creatliencgt usrlei daensdq uizzes/ebxaasmeosdn i magefrso m the
book.
()
e m-fileosfa ltlh ep rograimnst het ext.
Manyp eoplhea vea ssisdtuerdi ntgh ep reparaotfit ohnefi rsttw o
editioofnt sh eb ookW.e woulldi kteot hantkh er eviewaenrdsu serfosr
them anyc ommentasn ds uggesttihoenhysa vmea de.
LawrenKc.eA gbezugReo,c hesItnesrt iotfuT teec hnology
DaviAdl ciatCoorleo,r aSdtoa tUen iversity
SalamAem r,Vi rginiSat atUen iversity
JohnR .C ottoVinr,g inPioal ytecIhnnsitci atuntdSe t atUen iversity
DaviDdu x,P urduUen iversity
VenkaGta nesaUnn,i versoifTty e xas-Austin
MichaRe.lG ustafsIoID,nu keU niversity
AlaiKna ssaUbn,i versoifCty e ntrFallo rida
TribikKruanmd uU,n iversoifAty r izona
RonalAd. M ann,U niversoifLty o uisville
Pete0r. O ronoI,n diaUnnai verPsuirty duUen iverIsnidtyi anapolis
CharlReist zC,a liforniSat atPeo lytechUnniicv ersity-Pomona
DouglaEs.S mithU,n iversoifMty i ssouri-Columbia
AnatolSiwyi shchUunk,i versoifCty a lgary
RonalFd.T ayloWrr,i gShtta tUen iversity
BriaVni ckVi,r ginPioal ytecIhnnsitci atnudtS et atUen iversity
JohnS ilzBeilo,/ Uan iversity
JameGsu ilkeUyn,i versoifUty t ah
We woulda lsloi kteo t hanLki ndRaa ttasc,q uisitiona nedd itor,
Renata Marcheidointeo,ra isasli stfraonmt ,Wi leyS.p ecitahla nktso
ProfessSourb ramaniadma'usg hteSrosn,y aan dP riyfoar, t ypienagr ly
drafotfss omec haptearnsdfo rp roofreadtihnegm .
Ouri ntentwiaosnt ow ritae b ookt haits u sefult os tudenatnsd
instructoarlsi kWee. w oulldi kteo t hanuks erosfp revioeudsi tioofn s
theb ookw hoh aves enuts c omplimeanntdss uggestiWoen wso.u ld
apprecainayct oem mentthsa wti lhle ltpoi mprofuvteu reed itions.
AmosG ila(tg [email protected])
VisShu bramani(asmu [email protected])
ColumbuOsh,i o
Jun2e0 13