ebook img

Introduction to Numerical and Analytical Methods with MATLAB® for Engineers and Scientists PDF

544 Pages·2013·8.38 MB·English
by  Bober
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Introduction to Numerical and Analytical Methods with MATLAB® for Engineers and Scientists

MATHEMATICS FOR ENGINEERS Introduction to Bober Numerical and Introduction to Numerical and Analytical Methods with MATLAB® Analytical Methods for Engineers and Scientists N u m Introduction to Numerical and Analytical Methods with MATLAB® for Engineers and e with MATLAB® r i Scientists provides the basic concepts of programming in MATLAB for engineering c a applications. l a for Engineers and f • Teaches engineering students how to write computer programs on the on rd MATLAB platform E A • Examines the selection and use of numerical and analytical methods through n Scientists gn examples and case studies ia In n l t • Demonstrates mathematical concepts that can be used to help solve engineering ey r o et problems, including matrices, roots of equations, integration, ordinary differential ric d equations, curve fitting, algebraic linear equations, and more s aal uc t nM i The text covers useful numerical methods, including interpolation, Simpson’s rule on o d e n integration, the Gauss elimination method for solving systems of linear algebraic St h t equations, the Runge–Kutta method for solving ordinary differential equations, and co o i the search method in combination with the bisection method for obtaining the roots of ed ns transcendental and polynomial equations. It also highlights MATLAB’s built-in functions. t iw These include interp1 function, the quad and dblquad functions, the inv function, the s ti st ode45 function, the fzero function, and many others. The second half of the text covers h more advanced topics, including the iteration method for solving pipe flow problems, M the Hardy–Cross method for solving flow rates in a pipe network, separation of A variables for solving partial differential equations, and the use of Laplace transforms T L to solve both ordinary and partial differential equations. A B This book serves as a textbook for a first course in numerical methods using MATLAB ® to solve problems in mechanical, civil, aeronautical, and electrical engineering. It can also be used as a textbook or as a reference book in higher level courses. K16725 William Bober 6000 Broken Sound Parkway, NW Suite 300, Boca Raton, FL 33487 711 Third Avenue New York, NY 10017 an informa business 2 Park Square, Milton Park www.crcpress.com Abingdon, Oxon OX14 4RN, UK www.crcpress.com Introduction to Numerical and Analytical Methods with MATLAB® for Engineers and Scientists Introduction to Numerical and Analytical Methods with MATLAB® for Engineers and Scientists William Bober Boca Raton London New York CRC Press is an imprint of the Taylor & Francis Group, an informa business MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The MathWorks does not warrant the accuracy of the text or exercises in this book. This book’s use or discussion of MATLAB® soft- ware or related products does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular use of the MATLAB® software. CRC Press Taylor & Francis Group 6000 Broken Sound Parkway NW, Suite 300 Boca Raton, FL 33487-2742 © 2014 by Taylor & Francis Group, LLC CRC Press is an imprint of Taylor & Francis Group, an Informa business No claim to original U.S. Government works Version Date: 20130827 International Standard Book Number-13: 978-1-4665-7609-4 (eBook - PDF) This book contains information obtained from authentic and highly regarded sources. Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint. Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmit- ted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers. For permission to photocopy or use material electronically from this work, please access www.copyright. com (http://www.copyright.com/) or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. CCC is a not-for-profit organization that provides licenses and registration for a variety of users. For organizations that have been granted a photocopy license by the CCC, a separate system of payment has been arranged. Trademark Notice: Product or corporate names may be trademarks or registered trademarks, and are used only for identification and explanation without intent to infringe. Visit the Taylor & Francis Web site at http://www.taylorandfrancis.com and the CRC Press Web site at http://www.crcpress.com Contents Preface ............................................................................................................xi Acknowledgments .........................................................................................xv Author .........................................................................................................xvii 1 Computer Programming with MATLAB• for Engineers ......................1 1.1 Introduction ......................................................................................1 1.2 C omputer Usage in Engineering ........................................................1 1.3 Mathematical Model .........................................................................2 1.4 Computer Programming ...................................................................3 1.5 Why MATLAB•? .............................................................................3 1.6 Programming Methodologies ............................................................4 1.7 MATLAB• Programming Language .................................................4 1.8 B uilding Blocks in Writing a Program ...............................................5 1.9 C onventions in This Book .................................................................5 1.10 Example Programs .............................................................................6 2 MATLAB• Fundamentals ......................................................................7 2.1 Introduction ......................................................................................7 2.2 MATLAB• Desktop .........................................................................8 2.3 Constructing a Program in MATLAB• ..........................................11 2.4 MATLAB• Fundamentals ..............................................................14 2.5 MATLAB• Input/Output ...............................................................23 2.5.1 Output ...............................................................................23 2.5.2 Input ..................................................................................26 2.6 Loops ...............................................................................................28 2.7 MATLAB• Graphics .......................................................................43 2.8 Conditional Operators and Alternate Paths .....................................58 2.9 W orking with Built-In Functions with Vector Arguments ...............70 2.10 More on MATLAB• Graphics ........................................................72 2.11 Debugging a Program......................................................................75 Projects .....................................................................................................77 References ..................................................................................................97 v vi  ◾  Contents 3 Taylor Series, Self-Written Functions and MATLAB•’s interp1 Function ...............................................................................................99 3.1 Introduction ....................................................................................99 3.2 F unctions Expressed as a Series ......................................................100 3.3 Self-Written Functions ...................................................................105 3.4 Anonymous Functions ...................................................................110 3.5 MATLAB•’s interp1 Function .................................................112 3.6 Working with Characters and Strings ............................................115 Projects ....................................................................................................121 References ................................................................................................125 4 Matrices ..............................................................................................127 4.1 Introduction ..................................................................................127 4.2 Matrix Operations .........................................................................127 4.3 System of Linear Equations ...........................................................133 4.4 Statics Truss Problem ....................................................................136 4.5 Resistive Circuit Problem ..............................................................143 4.6 Gauss Elimination .........................................................................147 4.7 Gauss–Jordan Method...................................................................152 4.8 Number of Solutions .....................................................................154 4.9 Inverse Matrix ...............................................................................155 4.10 Eigenvalue Problem in Mechanical Vibrations...............................160 4.11 Eigenvalue Problem in Electrical Circuits ......................................164 Projects ....................................................................................................168 Reference .................................................................................................173 5 Roots of Algebraic and Transcendental Equations .............................175 5.1 Introduction ..................................................................................175 5.2 The Search Method .......................................................................175 5.3 Bisection Method ..........................................................................176 5.4 Newton–Raphson Method ............................................................178 5.5 MATLAB•’s Root-Finding Functions ...........................................179 5.5.1 fzero Function ..............................................................179 5.5.2 roots Function ..............................................................186 Projects ....................................................................................................189 Reference .................................................................................................199 6 Numerical Integration ........................................................................201 6.1 Introduction ..................................................................................201 6.2 Numerical Integration with the Trapezoidal Rule .........................201 6.3 Numerical Integration and Simpson’s Rule ....................................203 6.4 Improper Integrals .........................................................................207 Contents  ◾  vii 6.5 MATLAB•’s quad Function ........................................................210 6.6 MATLAB•’s dblquad Function .................................................215 Projects ....................................................................................................219 7 Numerical Integration of Ordinary Differential Equations ...............231 7.1 Introduction ..................................................................................231 7.2 Initial Value Problem .....................................................................232 7.3 Euler Algorithm ............................................................................232 7.4 M odified Euler Method with Predictor–Corrector Algorithm.......233 7.5 Fourth-Order Runge–Kutta Method ............................................241 7.6 System of Two First-Order Differential Equations ........................244 7.7 Single Second-Order Equation ......................................................248 7.8 MATLAB•’s ODE Function .........................................................256 Projects ....................................................................................................259 8 Boundary Value Problems of Ordinary Differential Equations .........277 8.1 Introduction ..................................................................................277 8.2 Difference Formulas ......................................................................277 8.3 S olution of a Tri-Diagonal System of Linear Equations .................289 Projects ....................................................................................................293 9 Curve Fitting ......................................................................................303 9.1 Introduction ..................................................................................303 9.2 Method of Least Squares ...............................................................303 9.2.1 Best-Fit Straight Line ........................................................303 9.2.2 Best-Fit mth-Degree Polynomial .......................................305 9.3 Curve Fitting with the Exponential Function ...............................306 9.4 MATLAB•’s Curve Fitting Functions ...........................................309 9.5 Cubic Splines .................................................................................314 9.6 MATLAB•’s Cubic Spline Curve Fitting Function .......................316 9.7 Curve Fitting with Fourier Series ..................................................319 Projects ....................................................................................................324 10 Simulink• ...........................................................................................329 10.1 Introduction ..................................................................................329 10.2 Creating a Model in Simulink• .....................................................329 10.3 Typical Building Blocks in Constructing a Model .........................332 10.4 Tips for Constructing and Running Models .................................335 10.5 Constructing a Subsystem .............................................................337 10.6 Using the Mux and Fcn Blocks .....................................................340 10.7 Using the Transfer Fcn Block .......................................................340 10.8 Using the Relay and Switch Blocks ................................................341 10.9 Trigonometric Function Blocks ....................................................344 viii  ◾  Contents 10.10 To Workspace Block ......................................................................345 Projects ....................................................................................................351 Reference .................................................................................................355 11 Optimization ......................................................................................357 11.1 Introduction ..................................................................................357 11.2 Unconstrained Optimization Problems .........................................358 11.3 Method of Steepest Descent ..........................................................361 11.4 MATLAB•’s fminbnd and fminsearch Functions ................365 11.5 Optimization with Constraints .....................................................368 11.6 Lagrange Multipliers .....................................................................371 11.7 MATLAB•’s fmincon Function .................................................373 Projects ....................................................................................................383 Reference .................................................................................................387 12 Iteration Method ................................................................................389 12.1 Introduction ..................................................................................389 12.2 Iteration in Pipe Flow Analysis ......................................................389 12.3 Hardy–Cross Method ....................................................................394 Projects ...................................................................................................406 References ................................................................................................413 13 Partial Differential Equations ............................................................415 13.1 Classification of Partial Differential Equations ..............................415 13.2 Solution by Separation of Variables................................................416 13.2.1 Vibrating String ................................................................416 13.2.2 Unsteady Heat Transfer I .................................................420 13.2.3 Unsteady Heat Transfer in 2-D ........................................425 13.3 Review of Finite-Difference Formulas ..........................................430 13.4 Finite-Difference Methods Applied to Partial Differential Equations .....................................................................................430 13.4.1 Explicit Method ................................................................431 13.4.2 Implicit Method ...............................................................433 13.5 The Gauss–Seidel Method ............................................................434 Projects ....................................................................................................437 14 Laplace Transforms ............................................................................449 14.1 Introduction ..................................................................................449 14.2 Laplace Transform and Inverse Transform ....................................449 14.3 Transforms of Derivatives ..............................................................452 14.4 Ordinary Differential Equations, Initial Value Problem ................453 14.5 MATLAB•’s residue Function .................................................457 14.6 Unit Step Function ........................................................................459 14.7 Convolution .................................................................................464 Contents  ◾  ix 14.8 Laplace Transforms Applied to Circuits ........................................466 14.9 Delta Function ..............................................................................471 14.10 Laplace Transforms Applied to Partial Differential Equations .......474 Projects ....................................................................................................479 References ................................................................................................487 Review Answers ...........................................................................................489 Appendix A: Special Characters in MATLAB• Plots ..................................499 Appendix B: Derivation of the Heat Transfer Equation in Solids ...............503 Appendix C: Derivation of the Beam Deflection Equation .........................509 Appendix D: Proof of Orthogonal Relationship of the cos(λ x) Functions .........513 n Appendix E: Getting Started with MATLAB• Version R2012a ............................517

See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.