1. Trang chủ
  2. » Khoa Học Tự Nhiên

Applied numerical methods with MATLAB for engineers and scientists

585 6 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Cấu trúc

  • EL SOLUCIONARIO

  • Contents

    • Cover.PDF

    • Contents.PDF

  • Part 1 - Chapters 1-4

    • Part 1 Overview.PDF

    • Ch 1.PDF

    • Modeling, Computers, and Error Analysis Ch 4.PDF

  • Part 2 - Chapters 5-7

    • Part 2 Overview.PDF

    • Roots and Optimization Ch 5-7.PDF

  • Part 3 - Chapters 8-12

    • Part 3 Overview.PDF

    • Linear Systems Ch 8-12.PDF

  • Part 4 - Chapters 13-16

    • Part 4 Overview.PDF

    • Curve Fitting Ch 13-16.PDF

  • Part 5 - Chapters 17-19

    • Part 5 Overview.PDF

    • Integration and Differentiation Ch 17-19.PDF

  • Part 6 - Chapters 20-22

    • Part 6 Overview.PDF

    • Ordinary Differential Equations Ch 20-22.PDF

  • __Appendix

    • Appendix.PDF

Nội dung

www.elsolucionario.net www.elsolucionario.net www.elsolucionario.net CONTENTS Prefoce iv xiii Guided Tour xvii PanrOur Modeling,Computers, ond ErrorAnolysis I l I Motivofion I 1.2 Port Orgonizotion CHAPTER I Mothemqticol Modeling, Numericol Methods, ond Problem Solving I l A S i m p l eM o t h e m o t i c M o lo d e l 1.2 Conservotion Lowsin Engineering ond Science 12 1.3 NumericolMethodsCoveredin ThisBook l3 P r o b l e m s1 CHAPTER2 MATLAB Fundomeniqls 2.1 2.2 2.3 2.4 2.5 2.6 2.7 ^ 20 TheMATIABEnvironmenl21 A s s i g n m e n t2 Mothemoticol Operotions 27 U s eo f B u i l t l nF u n c t i o n s3 Groohics 33 OtherResources36 CoseStudy:Explorotory DotoAnolysis 37 l l rroblems JY CHAPTER3 Progromming with MATTAB 42 3.1 M-Files43 3.2 InputOutput 47 www.elsolucionario.net About the Aufhor www.elsolucionario.net CONTENTS vl S h u c t u r ePdr o g r o m m i n g5 l N e s t i n go n d I n d e n t o t i o n6 g u n c t i o nt os M - F i l e s 6 P o s s i nF 3.6 CoseStudy:BungeeJumperVelocity 71 Problems 75 Roundoff qnd Truncotion Errors 79 4.1 ErrorsB0 4.2 RoundoffErrors 84 4.3 Truncotion Errors 92 ,l03 T o t oN l u m e r i c oEl r r o r B l u n d e r sM, o d e lE r r o r so, n d D o t oU n c e r t o i n t y1 ,l09 Problems |11 PnnrTwo Roots ondOptimizotion 2.1 Overview tll 2.2 Port Orgonizotion I 12 CHAPTER Roois: Brocketing Methods I l4 R o o t si n E n g i n e e r i nogn d S c i e n c e I l 5 G r o p h i c oM l ethods I l6 g e t h o d so n d I n i t i oG B r o c k e t i nM l u e s s e s1 B i s e c t i o n1 2 F o l s eP o s i t i o n 5.6 CoseStudv:Greenhouse Gosesond Roinwoter 132 ,l35 Problems CHAPTER Roots: Open Methods | 39 S i m p l eF i x e d - P o ilnt ei r o t i o n N e w t o n - R o p h s o1n4 S e c o nM t ethods 149 6.4 MATLAB F u n c t i o nf :z e r o r P o l v n o m l o l s1 : i p eF r i c t i o n C o s eS t u d yP Problems 162 www.elsolucionario.net CHAPTER www.elsolucionario.net CONTENTS Yrt CHAPTER Optimizofion 166 ,|89 PrnrTxnrr LineorSystems 3.1 Overview 189 3.2 Port Orgonizotion l9l CHAPTER Lineqr Algebroic Equofions ond Motrices | 93 8.1 MotrixAlgebroOverview 194 with MATLAB 203 8.2 SolvingLineorAlgebroicEquotions ond Voltogesin Circuits 205 8.3 CoseStudy:Currents Problems 209 CHAPTER Gouss Eliminotion 212 S o l v i n gS m o l N l u m b e r so f E q u o t i osn N o i v eG o u s sE l i m i n o t i o n2 9.3 Pivoting225 T r i d i o g o n oSly s t e m s2 9.5 CoseStudy:Model of o HeotedRod 229 Problems 233 IO CHAPTER [U Foctorizotion 236 l l O v e r v i e wo f l U F o c t o r i z o t i o n2 G o u s sE l i m i n o t i oons l U F o c t o r i z o t i o n2 C h o l e s kF y o c t o r i z o t i o n2 4 'l0.4 MATLABLeftDivision 246 Problems 247 www.elsolucionario.net 7.1 Introduciion ond Bockground 167 O n e - D i m e n s i o n o l O p t i m i z o t i1o7n0 M u l t i d i m e n s i o n o l O p t i m i z o t i1o7n9 C o s eS t u d yE : q u i l i b r i uomn d M i n i m u mP o t e n t i oEln e r g y l l P r o b l e m s1 www.elsolucionario.net CONIENTS vIt! CHAPTERI I Motrix lnverse ond Condition 249 CHAPTER I2 Iterotive Methods 264 l2.l LineorSystems: Gouss-Seidel264 ,l2.2 N o n l i n e oS r y s t e m s2 C o s eS t u d vC : h e m i c oRl e o c t i o n s2 7 P r o b l e m s2 PtrnrFoun CurveFitting 281 4.1 Overview 281 4.2 Port Orgonizotion 283 CHAPTER I3 Lineor Regression 284 I S t o t i s t i cRse v i e w L i n e o Lr e o s t - S q u oR r eesg r e s s i o n2 ,l3.3 L i n e o r i z o t i o nf N o n l i n e oR r e l o t i o n s h i p3s0 C o m p u t eAr p p l i c o t i o n s3 C o s eS i u d y E : n z y m eK i n e t i c s ^ l l rroDtems | z CHAPTER I4 Generol lineqr Leosf-Squores qnd Nonlineqr Regression 316 I P o l y n o m i o Rle g r e s s i o n3 16 M u l t i p l eL i n e oR r e g r e s s i o n3 O G e n e r oLl i n e oLr e o sSt o u o r e s 2 14.4 QR Foctorizotion ond the Bockslosh Ooerotor 325 N o n l i n e oR e g r e s s i o n r C o s eS l u d y F : i t t i n gS i n u s o i d s3 h l l rrontcms 1/ www.elsolucionario.net i l TheMotrix lnverse 249 I I ErrorAnolysisond SystemCondition 253 I C o s eS t u d yI:n d o o rA i r P o l l u t i o n2 Problems 261 CONIENIS www.elsolucionario.net t6 cHAPTER Splines ond piecewise Inferpofofion I I l n k o d u c t i otno S p l i n e s 359 l o z L i n e aSr p l i n e s3 1 Q u o d r o i i cS p l i n e s 365 C u b i cS p l i n e s 359 inMATLAB l9: liTewiseInrerpotorion 374 i 6.6 Multidimensionol Interpolotion 37g l6 Z CoseStudy:HeotTronsfer 3g2 rrobtems 386 PnnrFvr Infegrotion ond Differentiotion3g9 5.1 Overview 3g9 5.2 Port Orgonizotion 39O !H,\PTER| Numericof fnfegrofion Formutos Sg2 'l Z.J lnhoduction ond Bocrground 393 I7.2 Newton-Cotes Formutos 396 17.3 TheTropezoidol Rule 39g S i m p s o n ,Rsu l e s 17.5 Higher-Order Newfon_Cotes Formulos 4j j l7 lntegration with UnequolSegments 412 17.7 OpenMerhods 416 I M u h , p l eI n t e g r o l s 4j CompuringWork wirh Numericol lnregrorion 4j9 ;lJ;:r";udy: t I ! t I i{ Numericof Integrotion of Functions 'l 8.I Introducfion 426 R o m b e r Iqn i e q r o t i o n 427 www.elsolucionario.net 'I 5.'l lntroduction to Interpotofion336 I5.2 NewronInterpoloring polynomiol 33g polynomiol j: j tosron9etnrerpoloring 347 rJ.4 tnversetnterpolotion 350 I J.J txkopolotion o n d O s c i l l o t i o n s3 Problems 355 www.elsolucionario.net CONTENTS G o u s sQ u o d r o t u r e4 I A d o p t i v eQ u o d r o t u r e4 I8.5 CoseStudy:Root-Meon-Squore Current 440 Problems 444 CHAPTER I9 448 19.I 19.2 I9.3 ,l9.4 ,l9.5 Inhoduction ond Bockground 449 High-Accurocy Differentiotion Formulos 452 R i c h o r d s oEnx t r o p o l o t i o n4 5 Derivotives of UnequollySpocedDoto 457 Derivotivesond lntegrolsfor Dofo with Errors 458 19.6 PortiolDerivotives 459 I9.2 NumericolDifferentiotion with MATLAB 460 I C o s eS t u d yV : i s u o l i z i nFgi e l d s Problems 467 Pnnr5x OrdinoryDifferentiol Equotions473 6.1 Overview 473 6.2 Porl Orgonizofion 477 CHAPTER 20 Initiol-Volue Problems 479 20.I Overview 481 20.2 EuleisMethod 481 20.3 lmprovemenls of Euler'sMethod 487 20.4 Runge-Kutfo Methods 493 20.5 Systems of Equotions 498 20.6 CoseStudy:Predotory-Prey Modelsond Choos 50A Problems 509 CHAPTER 2I Adopfive Merhods ond Stiff Systems 514 21 'l AdoptiveRunge-Kutto Methods 514 2l MultistepMethods 521 2l Stiffness525 2l MATLAB A p p l i c o t i o nB: u n g e Je u m p ew r i t hC o r d 2l CoseStudy:Pliny'slntermittent Fountoin 532 r r o D l e m s3 J / www.elsolucionario.net Numericql Differentiqtion www.elsolucionario.net CONTENTS xl 22 CHAPTER Boundory-Volue Problems 540 22.1 lntrodvction ond Bockground 541 22.2 lhe ShootingMethod 545 22.3 Finite-Difference Methods 552 P r o b l e m s5 APPENDIXB: MATLABBUILT-INFUNCTIONS 576 APPENDIX€: MATIAB M-FltE FUNCTIONS 578 BIBLIOGRAPHY579 rNDEX 580 www.elsolucionario.net APPENDIXA: EIGENVALUES 565 www.elsolucionario.net Modqling,CoTpute''i, t.t MoTtvATtoN What are numericalmethodsand why shouldyou stridythem? Numericalmethodsare techniquesby which mathematicalproblemsare formulatedso that they can be solved with arithmeticand logical operations.Becausedigital computers excel at perform.ingsuchoperations.numericalmethodsare sometimesreferredto as computer mathematics In the pre-computerera, the time and drudgeryof implementingsuchcalculationsse.-riously limited their practical use However, with the advent of fast, inexpensivedigttul computers,the role of numerical methodsin engineeringand scientific problem solving has exploded.Becausethey figure so prominently in,:' much of our work, I believe that numerical methods should be a part of every engineer'sand scientist's basic education.Just as we a.ll must have solid foundationsin the other areasof mathematicsand science, we should also have a fundamentalunderstandingof numerical methods.In particular,we should have a solid appreciationof both their capabilitiesand their limitations Beyond contributing to your overall education .thog T9 several additibnat reasons why you shoutO ",,,,rr,,,r,,,r,,,,,, study numerical methods: Numerical methods greatly expqld the types of , problems you can address.They are capableof handlinglarge systemsof equations.nonlineari, , d.l, and complicated geometriesthat are not uncommon in engineeringand scienceand that are often impossibleto solve analyticallywith standard calculus.As such"they greatlyenhanceyour problem-solving skills Numorical methods allow you to use "canned" so-ftwarewith insight During your career,you will q*" www.elsolucionario.net qnd Erior Anolysis www.elsolucionario.net BOUNDARY-VALUE PROBLEMS where x : distance(m), K : hydraulic conductivity (m/d), ft : height of the water table (m), and N : infiltration rate (m/d) Solve for the height of the water table for the same c a s ea s i n P r o b 2 T h a t i s , s o l v ef r o m x : t o 0 0m with ft(0) : l0 m, ft(1000): m, K: I m/d, and N : 0.0001 m/d Obtain your solution with (a) the shooting method and (b) the finite-differencemethod (Ar: 100 m) 22.20 Justas Fourier's law and the heatbalancecan be employed to characterizetemperaturedistribution, analogous relationshipsare availableto model field problemsin other areasofengineering.For example,electricalengineersuse a similar approachwhen modeling electrostaticfields Under a numberof simplifying assumptions,an analogof Fourier's law can be representedin one-dimensionalform as D: -t- dv dx whereD is calledthe electricflux densityvector,s : permittivity of the material,and V : electrostaticpotential.Similarly, a Poisson equation (see Prob 22.8) for electrostatic fields can be represented in one dimensionas d2v Pu dx' € where pu : chargedensity.Use the finite-difference technique with Lx : to determineV for a wire whereV(0)= 1000,Y(20): 0, e : 2, L:20, and pu : 30 22.21 Supposethat the position of a falling objectis governed by the following differential equation: 11 d'x ' c dx L _,'-il I t I at' r tn dt -v where c : a first-order drag coefficient : 12.5kg/s, rz = : 9.81mA2 mass: 70 kg, andg : gravitationalacceleration Use the shooting method to solve this equationfor the boundaryconditions: r(0) : O t(12):500 www.elsolucionario.net 564 www.elsolucionario.net Eigenvalue, or characteristic-value,problems are a special class of problems that are common in engineeringand scientificproblemcontextsinvolving vibrationsand elasticity In addition, they are usedin a wide variety of other areasincluding the solution of linear differentialequationsand statistics Before describingnumericalmethodsfor solving suchproblems,we will presentsome generalbackgroundinformation.This includesdiscussionof both the mathematicsand the engineeringand scientific significanceof eigenvalues A.l Morhemoticol Bockground Chapters8 through 12 dealt with methodsfor solving setsof linear algebraicequationsof the generalform [A]{r} : {b} Such systemsare callednonhontogeneoas becauseof the presenceof the vector { b } on the right-hand side of the equality If the equationscomprising such a system are linearly independent(i.e., have a nonzerodeterminant),they will have a unique solution.In other words, thereis one set of x valuesthat will make the equationsbalance In contrast,a homogeneorrs linear algebraicsystemhasthe generalform l A l { t }: Although nontrivialsolutions(i.e.,solutionsother than all x's:0) of suchsystemsare possible.they are generallynot unique.Rather,the simultaneousequationsestablishrelationshipsamongthe r's that can be satisfiedby variouscombinationsof values Eigenvalueproblemsassociatedwith engineeringare typically of the generalform ( a 1- ) " ) x | anxt*'.'* { t y x 1I ( a 2 - } , ) r 2+ + I q,1.1 I -T alnxu:0 a2rFu:0 n r x l * - - + ( e , , , ,- , , ) x , , - www.elsolucionario.net APPENDIX A EIGENVALUES www.elsolucionario.net APPENDIX A EIGENVALUES where)' is an unknown parametercalledthe eigenvalue,or characteristicvalue.A solution {,r} tbr sucha systemis referredto as an eigenvector.The abovesetof equationsmay also be expressedconciselyas l t a t - ^ t I ] ] { x :} o (A.l) The solutionof Eq (A.l) hingeson determining.l One way to accomplishthisis * ),[1]] must equalzerofor nonbasedon the fact that the determinantof the matrix ltal trivial solutionsto be possible.Expandingthe determinantyields a polynomialin )" which is called the characteristic'pol ,-nomial.Theroots of this polynornialare the solutionsfor the eigenvalues.An exampleof rhis approach,called the poll,yorrro,methocl,will be provided in SectionA.3 Beforedescribingthe method,we will first describehow eisenvalues a r i s ei n e n g i n e e r i nagn ds c i e n c e A.2 PhysicolBockground The mass-spring systemin Fig.A.lo is a simplecontextto illustratehow eigenvalues occur in physical ploblem settings.It also will help to illustrate some of the mathernatical conceptsintroducedin SectionA l ?l sintplity the analysis,assumethat eachrnasshasno externalor dampingfbrcesacting on it ln addition, assumethat each spring has the samenaturallength / and the same springconstantt Finally assumethat the displacernent of eachspringis rneasuledrelative to its own local coordinatesystem with an origin at the spring's equilibrium position (Fig.A la) Undertheseassumprions, Newton'ssecondlaw can be employedto develop a force balancelbr eachmass: d-Xr mr-,i krr 1k(x: l 1.1 FIGURE A.I Positioning lhe mossesowoy from eqi,ilibriumcreotesforcesin the sprinoslhoi on rereoseieod to oscillctionsof lhe nrosses.The positionsof the mossescon be referenledfo locoJcoordinotes w i i h o r i g i n so t t h e i rr e s p e c t i veeq u i l i b r i u m posifions 000-l tttt 7f -7t f 000-l nt2 ?T-,7f | - _0r 0 www.elsolucionario.net 566 www.elsolucionario.net APPENDIX A EIGENVALUES 567 and 't) -' tn: u \l -:-k(.r:-11)-(r3 dt- where,t; is the displacement of massi away from its equilibriumposition(Fig.A.lb) By as collectingterms,theseequationscanbe expressed d-r' - ft(-2.r1*.r;1 : g nr t'4 dt- (4.2a) (A.2b) From vibration theory,it is known that solutionsto Eq (A.2) can take the form xi : Xi sin(a.rr) (A.3) where X; : the amplitudeof the vibration of massi anda: tion, which is equalto 2n the frequencyof the vibra- (A.4) 7,, where {, is the period.From Eq (A.3) it follows that x'i : -Xia2 sin(a''t) (A.5) Equations(A.3) and (A.5) can be substitutedinto Eq (A.2), which after collection of terms,can be expressedas (# ')", -kX z - (A.6ru) m1 - !-x, (# - ,')x, : o (A.6b) Comparisonof Eq (4'.6) with Eq (A l) indicatesthat at this point, the solutionhas beenreducedto an eigenvalueproblem.That is, we can determinevaluesof the eigenvalue systemsuch as Fig A.l, there ol2 Ihat satisfy the equations.For a two-degree-of-freedom will be two such values Each of these eigenvaluesestablishesa unique relationship betweenthe unknownsX calledan eigenvector.SectionA.3 describesa simpleapproachto determine both the eigenvaluesand eigenvectors.lt also illustratesthe physical significanceof thesequantitiesfbr the mass-springsystem A.3 The Polynomiol Merhod As stated at the end of Section A.1, the polynomictlnrcthod consistsof expandingthe determinantto generatethe characteristicpolynomial.The roots of this polynomial are the solutions for the eigenvalues.The following example illustrateshow it can be used to determineboth the eigenvaluesand eigenvectors for the mass-sprinqsystem(Fie A.1) www.elsolucionario.net t) X1 n 1- : -t r-: - - f t ( r t - x ; ) : g www.elsolucionario.net s68 APPENDIX A EIGENVALUES EXAMPLE A.l T h e P o l y n o m i oM l ethod Problem Stotement Evaluatethe eigenvalues anclthe eigenvectors of Eq (A.6) for the casewhererl | : tt12: 40 kg and li : 200 N/m Solution Substitutingthe parametervaluesinto Eq (A.6) yields (f0 @2)xt- X z- - X * ( - r r , r ; X 2- o The determinantof this systemis ( r ' ) t - o o 2+ : o which can be solved by the quadraticformula for o,f : l-5 ancl-5s Therefore,thefrequenciesfor the vibrationsof the massesare D: 3.873s I and 2.236 s-t, respectively Thesevaluescan be usedto determinethe periodsfbr the vibrationswith Eq (A.4) Forthe first mode"Tp : 1.62s and fbr the second,7,, :2.81 s As statedin SectionA.l, a unique set of valuescannot be clbtainedfor the unknown amplitudesX However,their ratios can be specifiedby substitutingthe eigenvalues back A.2 FIGURE T h e p r i n c i p o lm o d e so f v l b r o t l o no f t w o e q u o l m o s s e sc o n n e c t e db y t h r e ei d e n l i c osl p rn g s betweenfixed wolls T_ 1.62 2.81 (a) First mode (b) Secondmode www.elsolucionario.net I i www.elsolucionario.net APPENDIX A EIGENVALUES For example.for the flrst mode(ro2: into the equations 569 l5 s 2): T h u s w e c o n c l u d e t h a t X- -l X l n a s i n r i l a r f a s h i o n f b r t h e s e c o n d m o d e (:r5, s,-1r ) arethe eigenvectors Xr : Xt Theserelationships This exampleprovidesvaluableinformation regardingthe behaviorof the systentin Fig A.L Aside from its period,we know that if the systemis vibratingin the first mode, the eigenvectortells us that the amplitucle of the secondmasswill be equalbut of opposite sign to the amplitudeof the first As in Fig A.2a, the massesvibrateapartand thentogether indefinitely In the secondmode, the eigenvectorspecifiesthat the two mersses have equal amplitudesat all times.Thus,as in Fig 4.2b, they vibratebackand forth in unison.We should note that the configurationof the amplitudesprovidesguidanceon how to set their initial valuesto attain pure motion in either of the two modes.Any other configurntionwill lead of tlrerrodes to superposition We shouldrecognizethatMATLAB hasbuilt-infunctionsto facilitatethe polynomial method.For ExarnpieA.l, the poly functioncan be usedto generatethe characteristic polynontial as in >> A = t10 -5;-5 -_.-> p IO); = pot\,(A) r -20 7a Then,the roots functioncan be employedto computethe eigenvalues: >> roots (p) utt t=, A.4 The Power Merhod The power method is an iterativeapproachthat can be employedto determinethe largest or dominanteig,envctlue With slight modification,it can alsobe employedfo determinethe smallestvalue.It hasthe additionalbenefitthat the corlesponding ei-eenvector is obtained as a by-productof the method To implementthe power method,the systembeing analyzedis expressedin the form [ A l { r }: ) " { r ) (4.7) As illustratedby the following example,Eq (A.7) forms the basisfbr an iterativesolr.rtion techniquethat eventuallyyields the highesteigenvalueand its associatedeigenvector www.elsolucionario.net (10-15)xr -5X2:g - X r * ( - ) X 2: www.elsolucionario.net APPENDIX A EIGENVALUES PowerMethodfor HighestEigenvolue A.2,we canderivethefolasin Section ProblemStotement.Usingthesameapproach for a threemass-fourspringsystembetween two lowing homogeneous setof equations fixed walls: ( ' * _ - ' ) x ,\lnr r r :0 htt / k - v /2k - (l?1r ,\ ')r, - ^t, m) X,:o fr,, (* -')x,:o If all the massesm : I kg and all the spring constantsk : 20 N/m, the systemcan be expressedin the matrix format of Eq (A 1) as [40 -20 | L -20 I 40 -20 - rli l:0 - )| ) is the squareof the angularfiequencyc,r2.Employthe power wherethe eigenvalue andits associated eigenvector methodto determine thehighesteigenvalue is firstwrittenin thelbrm of Eq.(A.7): Solution Thesystem X r- X : ),Xt -20X1+40X2-20X2:)"Xz -20x2 -l40Xt : )'Xs At this point, we can make initial valuesof the X's and usethe lefrhand sideto computean eigenvalueand eigenvector.A good first choiceis to assumethat all the X's on the left-hand side of the equationare equal to one: :20 ( )- ( l ) -20(1)+40(l)-20(1):0 -20(l) -l40(l) :20 Next, the right-handside is normalizedby 20 to make the largestelementequalto one: [20] [tl { 0l:20{01 lzol lrl Thus, the normalizationfactor is our first estimateof the eigenvalue(20) and the conespondingeigenvectoris I I I lr This iterationcan be expressedconciselyin matrix form as 40 [ -20 | Inan -20 40 www.elsolucionario.net EXAMPLE A.2 www.elsolucionario.net APPENDIX A EIGENVALUES 571 T h e n e x ti t e r a t i o nc o n s i s l o s f m u l t i p l y i n gl h e m a t r i xb y I -1ll:-' jl, -n] [1l' l?]: 1lz togive I -l 'r,,,:l 140-l0l ^ lxlf)07: I +r, The processcan then be repeated Tltird iterutiott: [ 4- 200 | -20 40 0lll -l(l I I -l L;" -; r;ll where le,,| : 60 -80 60 - _RO -0.75 I -0.75 l50c/o(which is high becauseof the signchange) Fourtlt iteratiou: : :;;n] rl:l [1$ { i,,}: " 'or'.;troo'"nul where lc,,| : 2147o(wlrichis high becauseof the signchange) FiJthiteratiort: [40 t-20 L o -20 40 0l]-0.1142e -t0t{ | :llfii'i^ _20 +ol[_.0.1142s -0.70833 :68.57141 I t -0.70833 wherele,,| : 2.08c/c Thus, the eigenvarlue is convergir.rg Afier severalmore iterations,it stabilizeson a value of 68.28421with a correspondingeigenvectorof | -0.707 107 I -0.101 lU )r Note that there are some instanceswhere the power method will convergeto the second-largest eigenvalueinsteadof to the largest.James.Snrith,andWolford( 1985)proin Fadeevand Fadeeva vide an illustrationof sucha case.Otherspecialcasesarediscussed (l 963) In addition, there are sometimescaseswhere we are interestedin determining the This can be doneby applyingthe powermethodto the matrixinverse smallesteigenvalue other of [Al For this case,the powermethodwill convergeon the largestvalueof l/l-in will be left as words,thesmallestvalueof i An applicationto find the smallesteigenvalire a problemexercise www.elsolucionario.net Therefore.the eieenvalueestimatefor the seconditerationis 40 which can be emplovedto detenrinethe errorestimate: www.elsolucionario.net 572 APPENDIX A EIGENVALUES Finally, after finding the largesteigenvalue,it is possibleto deternine the next highest by replacingthe original matrix by one that includesonly the remainingeigenvalues.The processof removing the largestknown eigenvalueis calleddeflation We shouidmentionthat aithoughthe power methodcan be usedto iocateintermediate values,bettermethodsare availablefor caseswherewe needto determineall the eigenvalues as describedin SectionA.5 Thus, the power methodis primarily usedwhen we want to locatethe largestor the smallesteigenvalue As might be expected,MATLAB haspowerful and robustcapabilitiesfor evaluatingeigenvaluesand eigenvectors.The function e:ig, which is usedfor this purpose,can be usedto generatea vector of the eigenvaluesas in - e elgt'4t where e is a vector containingthe eigenvaluesof a squarematrix a Alternatively.it canbe invokedas where Dis a diagonalrnatrix of the eigenvaluesand I'is a full matrix whose columnsare the correspondingeigenvectors E X A M P L EA U s e o f M A T L A Bt o D e t e r m i n eE i g e n v o l u e os n d E i g e n v e c t o r s Problem Stotement Use MAILAB to determineall the eigenvaluesand eigenvectors for the systemdescribedin ExampleA.2 Solution Recall that the n.ratrixto be analyzedis [ 4-20 | L -20 I 40 -20 | -20 40 _.1 The matrix can be enteredas >> A = 140 -20 O;-2A 4A -2A;0 20 4al; If we just desirethe eigenvalueswe can enter r e = eiq(Al II I51 e= 40 OOOO 68.2,843 Notice that the highesteigenvalue(68.2843)is consistentwith the value previouslydetermined with the power methodin ExampleA.2 www.elsolucionario.net A.5 MATLAB Function: ers www.elsolucionario.net APPENDIX A EIGENVALUES 573 If we want both the eigenvaluesand eigenvectors,we can enter 0.5000 a.7alI 0.5000 0.7411 -0.0000 LI.1 I51 0 40.0000 -0.5000 4.107r -0.5000 0.70?1 0 68.2843 Again, although the results are scaled differently the eigenvectorconespondingto the 0.707I -0.5]7 is consistentwith the value previously highest eigenvalue[-0.5 d e t e r r n i n ewd i t h t h ep o w e rm c t h o di n E x a m p l eA : | - 7 | - 7) ' AND EARTHAUAKES , EIGENVALUES Engineersand scientistsusemass-springmodelsto gain insight into the Bockground dynamicsof structuresunderthe influenceof disturbancessuchas earthquakes FigureA.3 shows such a representationfor a three-storybuilding Each floor massis representedby nt,, and each floor stiffnessis representedby ft, for i : to For this case,the analysisis limited to horizontalmotion of the structureas it is subjected to horizontalbasemotion due to earthquakes Using the sameapproachasdeveloped in SectionA.2 dvnamic force balancescan be developedfor this svstemas -^t { ^ 'lrr - r l l x , /t I t \ \ K2 t _: mz /kz*kz Xt I l - - u t , l \ tTlt L ^3 *, -n x2 *t / '\ / L- X::0 X2mZ *,*(h-oi)x.:o where X, representshorizontal floor translations (rn), and @,,is the natura[ or rcsonant, frequency (r'adians/s).The resonantfiequency can be expressedin Hertz (cycles/s)by dividing itby 21r radians/cycle Use MATLAB to determinethe eigenvaluesand eigenvectorsfor this system.Graphically representthe modesof vibration for the structureby displayingthe amplitudesversusheight for eachof the eigenvectors.Normalizethe amplitudesso that the translationof rhe third floor is one www.elsolucionario.net C1 - www.elsolucionario.net APPENDIX A EIGENVALUES continued lar : 8,000 kg | -UUU- ] t,- 1,800kN/m t,- 2,400kN/m t.- 3.000 kN/m rh : 10,000kg l- * uuu l '|1r: 12.000kg [*- FIGURE A.3 Solution The parameterscan be substitutedinto the force balancesto give -o 2oox2 (+so-.|,)xr- X t +( - r T ) X ,- 180x,:s 225X2+(225-u'l)x.:g A MAILAB session can be conducted to evaluate the eigenvalues and eigenvectors as >> A= f 450 -2llC 0; -?.40 42i) '>:> lv, clr.-ciq 0.5!ll!r O.rl0'i _ 14 1 ci= irq3.!982 {t 18C;0 -225 2251; (;r) -Lr.6l4i1 -0.3506 0.5890 0.2911 0.5725 0.1654 139.4t'i9 0 56.9239 Therefore, the eigenvalues are 698.6, 339.5, and 56.92, and the resonant frequencies in Hz are :> L/:r-s.irt {ci-iaq(d)) 'i 2ipi 4.2t65 2.9324 1.2008 The corresponding eigenvectors are (normalizing is one) so that the amplitude for the third floor 0.38008e I } 0.746eee {lt:'#:}{-3.33il; www.elsolucionario.net 574 www.elsolucionario.net 575 A EIGENVALUES APPENDIX -1 Mode la\:1''OOU^r, Mode ( a L : t r Or r , -1 Mode ko,, = 4.2066 Hzl A.4 FIGUR.E A graph can be made showing the three modes (Fig A.4) Note that we have orderedthem fiom the lowest to the highest natural frequency as is customary in structural engineering Natural frequenciesand mode shapesare characteristicsof structuresin terms of their tendenciesto resonateat thesefrequencies.The frequencycontentof an eafihquaketypically has the most energy between0 to 20 Hz and is influenced by the earthquakemagnitude,the epicentral distance,and other factors Rather than a single frequency,they contain a spectrum of all frequencieswith varying amplitudes.Buildings are more receptiveto vibration at their lower modes of vibrations due to their simpler deformed shapesand requiring less strain energy to deform in the lower modes.When theseamplitudescoincide with the natural frequenciesof buildings, large dynamic responsesare induced creating large stresses and strainsin the structure'sbeams,columns,and foundations.Basedon analyseslike the one in this case study, structural engineerscan more wisely design buildings to withstand earthquakeswith a good factor of safety www.elsolucionario.net continued 1ilii;l '', ,iii' www.elsolucionario.net ,' i,ii ii.il" abs, 30 acos, 30 asci i, 5l axis square,35 beep,62 b,-ssel j, 356 ce11,31, I 80 chol,245 c1abe1, 180,466 clear, 50 cond, 257, 338 contour, 180,466 con_,,,157 cumtrapz,4l4 db1quad,4l8 deconv,156 det,2l7 dtaq,574 dlff.4l3, 460,462 disp,47 double,5l eis,572 e1fun,30 fminsearch , 181,326 format bank,23 format f crrmat format formac format forma[ compact,2l 7onrJ,23 tong e,23 iong eng,23 toose,2l short,23 format short format short fp1ot,67 fprint f, 48 fzero, l-51 gradient,463 grrlo! -1J help, 30 help elfun.30 hist,29l nord oIt, J4 hold on.34 humps, 78,440 eps, 90 erf,445 error, -52 exp,30 e1'e, 202 factorial.40,59 fix,365 inline,67 input,47 inr-erp1,376 interp2,38l int-erp3, 3[32 inv, 201,203 isempcrr, 127 e _ q e n d3, , 1engtl-r.32 f1oor,31,180 fminbnd, 178 linspace,26 1oad,50 e.23 eng,23 roq,30 1oql0,30 Ios2,30, 126 loslos, 40,106 logspace,26 Lookfor,36,44 ) )L'.) max,31,226,290 mearr,31,290 median, 290 mesh.62 m e s h s r i d , I 6 min.31,290 mode,290 riargin, 57 norm,25J ode1l3,5l7 ode15s,529 ode23,5l6 ode23s,529 ode23L,529 ode23tb,529 ode45,517,546 odeset,519 ones,25 o p t i m s e t , ,1 pause,62 pchip, 374,377 p1ot,33 p l o t , ,- porv 156,569 www.elsolucionario.net APPEND XB MATLABBUILT.IN FUNCTIONS www.elsolucionario.net APPENDIX B MATLABBUILT-IN FUNCTIONS reatmax,90 realmin,90 roots, 155,569 ror-rncl, | save, 50 semriogy,40 set,385 sign,55 sin,30 size,202 sort,3l sp1rne,374 sqrt, 30 sqrtm,3l srd,290 S U r r p LO t ! - surn,3 1, 246 surfc,180 tan, 30 l-anh, rrc,62 rr- o 11 toc,62 trapz,4l4,422 triplequad,4lS '",ar.290 vararqJin, T0 who, 25 whos, 25 )414De1, -1J ylabel, 33 zeros,25 :labe1.180 www.elsolucionario.net p o l y f i , r , , ,3 P o f y \ / a l ,3 , 339 prod,3l quad,439 qrLadi,439 quirrer,4(t5 577 www.elsolucionario.net M-file Nome Descripfion Poge brsecL euLode GaussNaive R o o tl o c o l i o nw i t h b i s e c t i o n n l e g r o l i o no f o s i n ge o r d i n o r yd l f f e r e n t i oe q u o t L o nw i l h E u l e r ' sm e t h o d S o v i n g l i n e c rs y s l e m sw i l h G o u s se i m i n o l i o nw f h o u lp i v o l r n g S o v i n g i n e c r s y s i e m sw i t h G o u s se m i n a l i o nw i t h p o r t i o lp i v o t i n g S o l v i n g i n e o r s y s l e m sw i t h t h - -G o u s s - S e i d eml e t h o d M i n l m u mo f o n e - d i n , e n s i c t nf o u in c t i o nw i t h g o l d e n - s e c t i osne o r c h R o o t o c o t i o n r , v i l ho n i n c r e m e n i csi e o r c h I n t e r p o l o l r ow n i t h t h e L o g r o n g ep o y n o m i o l l i r q o I ' og \ l l i r e r r ' r 'I ' r : o l e g - - , i o r 127 486 222 227 269 176 t2c 349 306 383 346 276 149 542 432 364 404 413 '2')9 t,allssPrvor GaussSeidel goldrrLin incse.rr-.:h 1rnregr n-rf cniina N e w Lr n t nerrtmu f t newtraph rk4 sys romberg Tabl eLo.ik arap r rapuneLl Tridiag C u b i cs p i n ew i t h n c l u r c e l nd conditions nlerpolotion with the Newion polynomiol R o o l o c o l i o n f o r n o n i n e o r s y s t e m so [ e q u o i r o n s Root locolion with lhe Ner,r,ion-Rophson method I n t e g r c l i o no l s y s t e mo l O D E s w l t h t h o r d e r R K m e t h o d I n t e g r o i i o no f o [ u n c l i o nv " , i l hR o m b e r gi n l e g r o t i o n T o b l e o o k u p w i t h l i n e o ri n t e r p o J o t i o n lniegrolioncl c funclicn \\,rthlhe ')rlposit6 i16pa1616Jo 1ul- Integrofion o f u n e q r i s p c c e dd c r t cw i t h t h e i r o p e z o i d c r u l e S o l v i n gl r i d i c g o n c ll i n e c rsr y s t e m s www.elsolucionario.net APPENDIX C MATLABM.FILEFUNCTIONS ... MoTtvATtoN What are numericalmethodsand why shouldyou stridythem? Numericalmethodsare techniquesby which mathematicalproblemsare formulatedso that they can be solved with arithmeticand logical operations.Becausedigital... DATAANALYSIS Your textbooks are filled with formulas developed in the past by Bockground renowned scientistsand engineers. Although theseare of great utility, engineersand scientists often must supplementtheserelationshipsby... numericalmethodsare and (b) how they figure in engineeringand scientificproblen solving.In so doing, we will also show how mathematicaln.rodels figure prominentlyin the way engineersand scientistsuse numericalmethodsin

Ngày đăng: 16/10/2021, 20:13