You are on page 1of 295
pete swmien of FORTRAN 7780 ha ee gv whi Aare ptt beginere an 3. a Bare slant ar ofeach tod ie VE 0 Dd he ag f i ferstanding of numerical analysis E eRe prorame fr aisost all numerical methods diacyoay [a a ee esas eee eis: ce rs ES acter caren eee ee.” a eee ecient cse na ter [ erage om phan eared conscious efor: to make the book student-oreted al! rcs fl ke the bok aden i maaan {rer bap the students would find the bok mt cY atinowledgs the many helpful soggestions of reviewers Fac eee improved both ts content and quality of the ale 0 Contents 1 Gnredectio to Namerea Gompaiog ; 1 Nene Bia 1 huang Oonptbg 2 15 Pee ote Mifenoegoce § fon 17 Cece Brinn # 1) er Namen Coming. 9 18 Note acgrund 1 a: tntrection to Competes and Computing Cones ST laren i te ee Mele computed Pinter ‘Mand coped 18 a4 Gonpolog neo 29 computing and Computers Mil contr £25 Computer Organisation 21 Input dries 21 Proestng wie 22 126 Driving the Computer: The Software 24 Operating ten 24 iy programe 35 Language prcesors 26 Application programs 26 27 Programming Languages 27 Mechine language 27 ‘Assmbiy language 27 Prosedwreorented language (POL) 28 Common high-ew! languages 29 25 nee ning Problem Solving and Algorithms 30 210 Flow Charting 32 212 Ung te Camper eas” Kyun 36 Reve questions 37 a 4s 49 410 on 4a 4a a 15 a ‘eeioden Gt hs Tae Significant Digits 62 Inherent Erore 6 Conterhon erore 62 Numerical Erors 5 Roundof errs 65 Chopping 05 Symmetric roundoff 66 Truncation rare 67 Modelling Berns Blunders 69) ‘Abeolite and Relative Errore 70 Machine Epsilon 71 Error Propagation 73 Addition and subtraction 73 Multiplication 73 Division 74 Sequence of computations 78 ‘Aadiition of chin of numbers 77 Polynomial functions, 78 Conditioning and Stability. 80 Convergence of Terative Pocesee 6 Error Evtimation 67 ‘Minimising the Total Error 89 Pitfalls and Precautions 58 Summary 89 Key terms 90 ‘Review questions 90 Reve eserasce 91 5. FORTRAN 77 Overview 51 52 53 54 35 58 a 58 Need and Seope ‘ASample Program 99 FORTRAN Constants $7 FORTRAN Variables 88 Subserpied Variables $9 npotOutpot Statements 200 Computations 107 ‘Msc moce expressions, 102 Control of Execution 18, ‘Block tae wrctare 208, Relational expressions 104 agiva expremans 105, Dovwhile seractare 106 contri a « i. He “a Corer 59 Subprogame 109, Ponti subprograms 109 ‘Sabrontinesubprogra 110 ‘suo frre Ponetions 222 $1 pabopging, Testing and Documentation 175 a2 Summary 114 eytems 114 Revie questions 115 Review errses 116 6 Roots of Nonlinear Bquations 1a 1 iatrodecion 127 Algebra equations 122 ‘Polynomial equotions 122 Tronsendental equations 122 652 Methods of Suton 129 163 Kerative Methods 124 £84 Stating and Stopeag an Terative Process ‘Staring the press 125, Deflation and soit division 178 Parteaton of rote 171 Program MULTIR 78 Complex Resta by Bairstow Method 183 Program COMPR 188 6.6 Mollers Method 185 Complex rats 190 Matiple rts 189 Program MULLER. 199 17 Summary 199 Key terme 200 Reviee questions 200 evinw exercises 202 Programing projets 206 Direct Solution of Linear Bquations "11. Need and Scope 206 1712 Exsatence of Setion 207 Unigue station 208 No olution 208 Nounigue sluion 209 Hteondtioned sate 208 3 Solution by Bimsnation 208 414 Basie Gauss Elimination Method 272 Computational effort 205 Program LEGI 216 7 Cavss Bliination with Pioting 209 Program LEG3 222 7.8 Gavsesondan Method 228 Computational effort 229 117 "Tesaugular Factorization Methods 230 Dolite algorithm 237 Program DOLIT 235 Croat aigorith 240, CCholnty method 241 118 Rownd-off rors and Refinement, 32 78 MConditionod Systeme, 244 {a0 Matrix Inversion Method 245 OP Camputng matresineroe 246 Condition number 26 san Somiacy "247 Key tra 20 ‘Rese questions 248 Renew series 209 Programming prets 252 fe Methed 178 1 terative Solution of Linear Bawation Ted and Soe 243i Med 252 Yer ACT 255 ta Gone Satel Meet. 259 SS Riri, 251 Pron CAST 2 4 Nett Reason 268 £4 Meese eration Mathes 257 Canina renee 207 atefcomergence 28 a6 Sonmey 22 Kgnre 272 Reine gestions 272 Rona recs 273 Prarammingproicts 274 4 Carve Fiting Interpolation Br tsdecine 275 f £2 Pavoomil Forme 277 $3 Unrate 72 4 Lage neltin Poel 281 k 0 Fee La | ro ert Pri k (96 Divided Difference Table 290 “ee Provan NEWINT 20 Parsrddifieceole08 ‘echearddifene abe 208 48 Spleens 209 Gab pines 302 Aortin 37 ‘rere SPLINE. 308 oy Beaten Se | erie al me a ao eazahe Parmite 15 Kouens ite Reet eine 317 Sa 7 Preranning rane 321 Ping Rerenion Review quitions 283 Renew carcass 344 11, Numerical Differentiation a0 II Net and Seope 367 112 Difeentiating Continues Functions 948 Forward difrence quatient 348 Corral difrene uctient $49 25 Higher order derivates 35 11 Dillerctiating Tabulted Functions 935 Brooms 57 114 Difference Tables 360 113 Richardson Estapalation 902 116 Sommery” 364 Keyterms 365 97 Interpation with Pauiditant Pints 204 Re 308 Programming projets. 368 12, Numerical Integration 21 Nect and Scope 260 122 Newton-Cotes Meds 371 123 raped ale 372 Error anciyis 973 Compontetrapesidal rile 376 Prouram TRAPEL 377 124 Simeon’ V0 le 379 Brrr ancsl 280 Errno Singin’ 1/9 rae 382 Premrm SIMS 382 125 Simpeon's 98 Rule 386 126 Mgr Order Rules 987 12 Romberg integrate 988 ses Preeram ROMBRG 322 120 Couminnnatin 24, Canta hme wecraion 337 Sane eer Gneuon orm 39 Rquations 3 BT Newland Spo 408 “I inter ofindependent variables £10 Onder of equations 10 Deg of equations 410 inca od nontincer equations At Gert ond particular solutions 421 Anal vate problems 412 Daestepand mutitrp methods 412 Siope 02 a2 Taglar Series Method 413 accuracy At Peurdemethod 417 3 Bry, Acura of Bul’ method $21 ‘Program EULER 123, 184 Hous Matbod 25 Erm onciyas 428 ag Pesan HEUN 129 185 Paton Method 32 FOLYGN 44 13 PavnomiaMthed a7 rir td ‘Determining th gence 478 146 Power Method. i Kates 400 Review questions 480 Review verses 481 Programming projets 482 15, Solution of Partial Differential Equations 151 New and Scope 463, > 152 Dering Difterence Equations 494 158 Blige uations 480 Laplace's equation 486 Liebman’ erative method 189 Pawns equation 490 164 Parabolic Equations, 492 Solution of feat equation 499, Bender Schmidt method $84 ‘The Crant-icholoon method 495 155 Hyperbolic Bquatons 497 ‘Sutin of fyperbolc equations. 498 Storing ontaes 499 156 Summary 500 oy torme 501 Retina questions 501 Review exeries 502 Programing pres $04 ‘Appendix A: Solution of Linear Systems by Mates Mathes RY Overview of Matrices 505 a AY CNtrton of Linear Systeme ky Determinants AS Solution of Linear Sytem by Matrix versa 510, a 14 ee oedan Matrix Inversion 519 ‘Appendix B Solution of Polynesia by Grace's Raat ‘Squaring Mees eo 9 =o sting 600 * Introduction to Sees! es « Numerical Computing TEE wropuction in the sppiation de unslly deal with he nal america computing et “2 NanerciNerons “a nvingeytors of linear esac equstion= 3 ierpltion at eresion analysis 4 mumercal negation {5 ume dilerentation Sty of ferential equations teundary vase preblere 1 elt of ati prolems nl bak we il dca rome of the popular ag ese areas TEER numeric dara usa apg mon ne on oft. nmy in ations daa Data tha ae bined by counting are eld Gert data. Examples of dicot deta are te total number of ems {Smo the tal numberof people paricpating in 8 race Data that ate obtained through measurement are called continuous ata amples of continu data are the speedo «vehicle ae given by speedometer, oF tomperature of a patient as meavured by ¢ thermemter. ANALOG COMPUTING ‘tsar eh pince o tring abe by sing whi exis noses tne pnis, For maps see ai ual computr at analogously othe prion oe Set Ang engine's ise on aps thas yeti Sipe. alae lepers. The un conpeien ee a farce nt bn ctl itp Claltons ing brat linn diving walages heir cenracy is limited bythe precision ati an be read ‘of the dependent method, im whic indented =. lll heaicten Mera Camas 8 TH vicman compunnic ne eee ve trent Sis nuser Seen! oe ee eeeement nen eal vic fr esp tne sl bao eit ace change continental wa eer exert the se eet ime tony ire mee by he Me ease nea. ‘iat computer are more aca han aang mp Ag const tay be arate own par eto the cre a Fete we ommters ca ona wiser doe bre) aa cane the corms hunter a cma pans: Hy = Fan cag ae una, nd xp pele ut ie Baba jane’ son mare Digkal Campane wiley wd ie anaes and are shen aed ened urrne [TBI Process OF NUMERICAL COMPUTING he etted calor, numeri) computing snveles formulation of Jrenmatical medcle of physical problems that can be slved using ate ‘mesa aan se oprtans Toe pe coma Sea Swing br pae which oe aed Ae onotaomtemate mel farm an eprops numeral ee Fa of ened i san 9 4 Walden othe ston Sp ration of 0 scion fhe robin. A wefan eran + mi peal em ert tet eunin 0 som ad Ue ‘ace the bance of fret * 6 Nmerca Memos ea ie problems ave ‘pair, be penny #0 take cetain ee ere Bo tae tars ofthe problem tht ore conde and oinlade oaly Cian, An oversimplied ode! ay hove ly i Ee mal ay ean Inter. neeanay. The ed een ay nk te elton procedure tore dificul. We Bode een a te tlonce of enincerent of the sede! ang ‘Roary athe ston reed. Ben cattle mele vslbl, oo fst sep would Be to try oa en eal analyse suo. In most cee, the mathematical Betts any not amenable to analytical elution oF they may not Tea cent ning enc tchniqus. In such cas, we have to Creat apprpete umercal maths to solve mathematical models ‘Rescate carer, a smercalethed ix a computational technique ‘ich involves only finite murberof base arithmetic operations er ren pobem, there might be several alternative numtieal ‘mets, We mst conde diferent factors or trade-off before selecting Sri id ch rf eine cme ual (euy, sped of ection siming snd msintenence efforts pera ‘Modelling is the proces of translating = physical problem into « athens mol Seton ae righ pita nt Pe)= Pye 2 baci ticle eat atin yee tn anton erent rg tS ne ea |b Marae Motos CHARACTERISTICS OF NUMERICAL COMPUTING Sper cnhts x ccain computational hace ur Natit paint to consider thee cheractrintg fhe pena Teale method for implementation, Thy eae eel tothe wccre of mplernentin are Seems eamreresn, mural laity, and fie ‘Accuracy secret of ume compating introns eros. They may by Bar at gam apposition i place ofan exact mathemati, tr norms rancor errr) oF det nent representation Pernt of umber nthe comps (ko. 98 You error Terenas the arcaracyof tbe reals, The results we obtain Base (variety acurate to serve the purpose for which the stomatal model was bull. Choice of « method is therefore, very Tat dependent onthe prticlar probe. The general nature ofthese (Grose be dacused i detail in Copter 4 ihe f Convergence Mg em pt hed ee of a ais ees ee eee greneecon oe ose rei peerage Ssh era oo nas ayn ce tetas ep wa crn sn arte nest mess tes oases Regence pet ma ev fps eeu carats te Sg ve Seat «Se aired Garros retical sity : le lectnag is cnet nl. reiterate oe efficiency ling ine and le propane ad a TERI compuranional envinonnent eee erase ieieg ox oe Se fa eid hr ra channel nd nga competitor fr FORT gor fetuea and power ctrl sri ee sate pe oe ne NEW TRENDS IN NUMERICAL COMPUTING, tn resent year, the increaing pow of compute areas Bes SS Teen yar mere compaing ore wa, aly the approsch of mri earch regs tha roan scents and soe inprtant mew tend ti See oy San aa geo pclae mee a Shae se parle compas, Saat Se seer comp gn wan on Fentcaly and advise the comer reer Somatic compat °SPeCte 2 pg nay Sti Ienosctonto Manat Coming LL 1 tes ha he tine ate of dmg Pope and Java They Incorporate copy waned hat prograzuoits should tay mn rear dfn trices. They ala ena, De ces ote exiting ote without modiying i, MATHEMATICAL BACKGROUND asus that be rads Rave some mathematical background Tac kownlaie flea, functons, matrices, and nega ales caplr we hae itdoced the cncept of numerical computing fled in saving a physical problem wing ethode We aus dstussed the characteristics of numeral ire 0 Sortementnn aes 4 joe ak ot Retipritance, orsmorphism and operat i cemenilan sUoly ogee at ‘Uaing tie ew, ise» tual mae ea ternal roby oT egies to soe eee The News law o olng nate hae ta bet im 3 {uid proportional the diference tprse tae he Iiuid andthe sumoundingn. Posmulate © othemat odlto 6. Wun = bot mes trough water, he retarding resis ropa {othe ware of he wens. Formulae fret equi in terms of ety gin hes 3 ad he dg eit 2, State the four cheraceiicr mame campting Syl scary? How ital Goig the oa fame 9 Wn cversenc? How iit patna numeral cma? 16, Wht do youn by aera ota? 10 egw beween eenaiueny of tind and seman of 1a ee eure eure fr implementing a manera ometng ea Introduction to Computers and Computing Concepts © Be nmonucrion Tn Chapter 1, we aisconed that mumericel sais twat numeral computing egies ino pent ahem ne and computers. Most ‘Peper melds cannt be saved without the help of computers (Rie, ctmchownd tari seo Tae Be sttaatine of toplomentaton af mera CSputng cee MAPA Provides some basic information om i ete lensing apron sing omer. chat sr iy cr chin Sa ee development o «variety ofporonal zz that they have baxame indispensable 0 Hi rapidly and accurately information for utbeequest model wh, ante epored in many dierent srexton ora Computing Concepts 19 end engl to chapel have bem poe ie But for spur Teed astoraton of any "Toey ere ed extensively a cheats a poe idling tad inns esate ara wary eps a te ot hes pony soared es ea eer Sil sense men etennay ood meee ca epee md fore al or eel ae sr spre mh eg aa Tein paral acuning res edn cg nancement pert Compaen ees mah Finan aa care sorgs oop them at nl sie ely Sa an erence eget of ia bane Se Pt etn Ld Ses Ca real ene uh st Om 1 Compe tt ave tind snd rae introatn Sacre all ner Sn revatio th a sc rar in ang snd ang a a a anng. Ti proms si er nr can commensal ht sented ain de Ung ab sere a sais novo ne and pos te coma rn oe =P ig. Comps oe cman rr and th de tem ea mie crolectronicn revolution has paced coermus complaint pees mlceltrech aevery eat and engineer. Hower eee 6 cto eaten comer mae al n Piles en, so meter wna eee per ck commen tron, Te ee ‘oftware EVOLUTION OF NUMERICAL COMPUTING AND ‘COMPUTERS ‘oes ofermputing techniques over 6000 ears old. The Babylonians, Pianeta Baypans ued mmerial methods forthe survey ol dhe callton tase early as 2000 BC. Compatin hst Site neopment of deve ald he obocus by the Chinese around Thi prt. Ths was uve forthe apematicealealation of arithmetic Sines then the user stem bas undergone various changes Sedtbas teen used in diferent forme in computing. The most signfieant ‘evelopment in somputing was the formulation ofthe decimal number ‘orton in India areund 800 AD. Another sigucant development wae {heisventioneflogrthm by John Napier in 181, which made computing oan 2 of matin emerged uring tho 1th cesry ‘eho phase Kepler nd Gaile Galle dood th las fr panciary Tin and Sir Ieue Nevion formulated the law of xrevty. The Sergent inmates and cer science incroased cool 18 29 eesti Cs) domanarae by Chi ey 100 third peurtion come wsng TO BAL Eun Corer ge MPC internets ry Ree COMES ee i 1961 when the UNIVAC! (Universal Mode Com et en a NS Ga Besa Saupe sa Atmatie Compe are sare oman CO ren 1b Naretea ene ‘enpuerederned er BSIN hav er clasid th Tor generat 1946-10 i et gers 196 — 1965 ‘ccna generation 168 1975, ‘hid generation 1976 prosent Prarth goers 1946, cach decade has contributed eng on may oto at fom 1846, eomputers fabs were ted. Magna ee carat yer fovened deci tape ees and magnate core me ede is Te ft gneation campers posses the omar to theater mel: rei ie 2 low operating sped 2 retried computing eapcity {lied programming cabin § ae ue 6. compen maintenance sheds ‘he send generation computes were marked by the use ofa soli State devi, ald the traitor, inthe place of vacuum tahoe. These Suchlace were much fater and more teliale than their earlier Gounteraris Further, they ecuped Ines space, ragured less power, Sod proficed mack ae beat esearch m the field of clectroics led to the innovation of the Aaterated cit, nom popalelyKoown as IC chips, Tho use of 1C ‘ips is the place of transinars gave birth to the thind generation ‘quite Thy mere ill more cumpacy, faster and lees expec than seer, (Ge eevine generation computers, newer and faster ‘ipmenis ware intedsed fr hanling sey en rage and input-otpt scaicwed fers toarisminiaturisation ld to the evelopment of Sigmaton (LSD techoaag. Intel Corporation ttroluced aed ericson fr = stoeation computers aze marked th fe mae ana cancion snd ped Tae 2 ges sn and wold ‘with the help organised mond Comer Concept AD This generation of empiri lle th 0h sorton cout Zieh tootsie seus ae exami od in 1a ull hey are kay to become more poplar i the coming TBBIL nes oF compares Computers may be cased hosed on operating pind, sae and pully and pplentone Principles of Operation Based on the operating pens tne of the flowing Spee Digital computers operate eet res, computers canbe dasifed inn any iat computer anaig ermpues, aod er cers Deel enpuer are il SIRE ern expr und for munipsatios of dt cach 2 rearing er than ty tng The aon erp aroed athe Geek word enol, densest te rae en cio by evtabiahng saris betes te duets fat ae ually ete iterenal equation, Computers ti are powerful fol flog and ial pen ar ale ride —=— is viere were originally designed to perform: Mainframe computers Computers on Sarge storaae eaten ot sana a ee eg gcd ning naw nei Siti min are of peti cr ee ree are se spans, a dal icin rend ie ee Special purpose computers are tailor made to cater solely AMHR ‘cule numerical problems in scientific and enginesring dispar HES requirements paricular task of application. They incorporate igl clade aplicatons in electronic, ptroleun enginaering naib re Oat ier nd rl mer nator deine SM eyelet n td 1M hs aed a ers eee to perform parla tack are mok wi ™SCTSERI paring theo Sen Jah he era et e a ‘shows the characteristics of Tats pst paryes cadias ais sod b Deron a upe Neo hat tings PCS We vonert recs oepocaaa CHER Ste and Capcity Tele 23, Chaos ot a shiomsis tani snd eperepae Ihe slack alae baa gad ait ot IS Tee eric osem mary depends the aus of Gate be Ss similar to any other larg Son) sed unis ad ae usuly deemed #4 | Senaryase 610K 200 ‘Sse miecomputere can by aa eo Merocomputert 2. micrcompute Sosempetes ave slfcnn HES? + impr set epi ame Same Se Mnicomputos min Speed oss 8 teeny an eehnot 8 wetomsinad comput MR SRS) | oop ne san rea ante hn micecompter An inet i Nunherof 20900 ano” "78 Soe Halo mcrae Ayman thal ion Bs tre time hating apse: ene pine ait MON ayn ane Pear 7 9 Nemoto vcing per, A wosatin lnk ke « personal compute al prec Pwr engnering and graphics applications Peston ooo i Sarco a i programs drumatialy Parallel TEBBIL computer orGANtsATion re a fraction of the cost TEBEL_cowputins cOncePrS ‘pvnough computers difler widely im their deta al of them fille = ‘Althoud eraional structure as shown n Bg 22. tn order to ary oot ai orci operations, namely, Spt, proces and out a compear te hr flowing herdware components: inpt devin, proce vaca utput devices and external starage devices ost f execution of om Eich the oped of supercon Aconpeter, nal or bi, s basically «device used for processing af A Santon aod text ond) Tt performs essentially the following thr Tress data (and instructions 2 pct data (ak pr the instructions) ter is known as the input-proene ses the data withthe help Drovers meaningful and desired aut) example, if the data consists of 98 tnd the inertia is wo ad them apd at known te frei wanbern fe 25 Ae in accordance wi he uae (or aplication). The roay be saan ine © eyboar re std ter od ke» pert and uM Input Devk ero dpa aA7PO 84 on paper Conan ats Primer, While re ee nad hon rain hard Sh ina dvi ea ven the tpt belo frm. Although the @ arse toble 24 Input devices rodscon eo Comenten ond Comping Conese 2 tevion uch a plotrs any alae Lacing popular Same Sie Dee eam of da, a) etoton output deviees are given in Table 2.5 eee araar_ Spi ae icment_ Only ap : Dea of prsaton Remar ae nya TE aay wn vou) peyagoe ae Pe ik mele Tar Se, a cat pe ee eee cara ronal orage Extemal Storage Devices pai Dees Inpat, utp IE he purpose of external storage in to retain data and programs for tre |». conom rie eonom oa Te tle program my be seguir aga Ao a in information is stored in an ‘external storage ole. See ‘one ean. rocessir i it as and when necessary, tus ‘avoiding the need to type it Processing Unis Teer a a en mang man Memory unt The menor unit ls stores) all da, inatructions rly. The ery const of ards of hos cn each capable of storing ene word of fc semary unit, arithmetic logic unit, and contol nit All athe central provesing unit (CPUS ae nr an th ie an a ga te me ermal morage, med ce ara dk bard ins a CD HOM ori ge The man conn dee Rt Se a on er exile plastic dik contd with Sue ie a Dene plastic =| ert inumory unit is called by different names, such a yuters today ix @ flopPy . ary orgy in meray or Sony mem eter on ie 8 nO ST aed rec fol uit This uit _ ani mie reed iy ineerng tnt © Oh A paper ick Be cc ie to pao allt be ard cs are granny eel ay te ma sted ttn, man, prim i cn an i re csi il asthe ton a two numbers A and Be Th Pe edn ond wring of forma wf te shee Th rou el ‘thetic uni or further eleuatonk = Cte te a aoa os may Although «pth CPU aod present mace 2 ee = =A fot neaton ne memory and a han it wil select the number 8 and he etored in mal instructions, Coneept —_-__—“‘(i

You might also like