ebook img

Numerical analysis PDF

570 Pages·2004·9.235 MB·English
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 Numerical analysis

Numerical Analysis Using MATLAB® and Spreadsheets Second Edition Steven T. Karris Orchard Publications www.orchardpublications.com Students and working professionals will Numerical Analysis find Numerical Analysis Using MATLAB® and Spreadsheets, Second Edition, to be a Using MATLAB® and Spreadsheets concise and easy-to-learn text. It provides complete, clear, and detailed explanations Second Edition of the principal numerical analysis meth- ods and well known functions used in sci- ence and engineering. These are illustrat- ed with many real-world examples. This text includes the following chapters: • Introduction to MATLAB • Root Approximations • Sinusoids and Complex Numbers • Matrices and Determinants • Review of Differential Equations • Fourier, Taylor, and Maclaurin Series • Finite Differences and Interpolation • Linear and Parabolic Regression • Solution of Differential Equations by Numerical Methods • Integration by Numerical Methods • Difference Equations • Partial Fraction Expansion • The Gamma and Beta Functions • Orthogonal Functions and Matrix Factorizations • Bessel, Legendre, and Chebyshev Polynomials • Optimization Methods Each chapter contains numerous practical applications supplemented with detailed instructions for using MATLAB and/or Microsoft Excel® to obtain quick solutions. Steven T. Karris is the president and founder of Orchard Publications. He earned a bachelors degree in electrical engineering at Christian Brothers University, Memphis, Tennessee, a masters degree in electrical engineering at Florida Institute of Technology, Melbourne, Florida, and has done post-master work at the latter. He is a registered professional engineer in California and Florida. He has over 30 years of professional engineering experience in industry. In addition, he has over 25 years of teaching experience that he acquired at several educational institutions as an adjunct professor. He is currently with UC Berkeley Extension. Orchard Publications Visit us on the Internet www.orchardpublications.com or email us: [email protected] ISBN 0-9744239-1-2 $39.95 U.S.A. Numerical Analysis Using MATLAB and Spreadsheets Second Edition Steven T. Karris Orchard Publications www.orchardpublications.com Numerical Analysis Using MATLAB and Spreadsheets, Second Edition Copyright ” 2004 Orchard Publications. All rights reserved. Printed in the United States of America. No part of this publication may be reproduced or distributed in any form or by any means, or stored in a data base or retrieval system, without the prior written permission of the publisher. Direct all inquiries to Orchard Publications, [email protected] Product and corporate names are trademarks or registered trademarks of the Microsoft Corporation and The MathWorks, Inc. They are used only for identification and explanation, without intent to infringe. Library of Congress Cataloging-in-Publication Data Library of Congress Control Number (LCCN) 2003099336 Copyright TX 5-589-152 ISBN 0-9744239-1-2 Disclaimer The author has made every effort to make this text as complete and accurate as possible, but no warranty is implied. The author and publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this text. Preface Numerical analysis is the branch of mathematics that is used to find approximations to difficult problems such as finding the roots of non-linear equations, integration involving complex expressions and solving differential equations for which analytical solutions do not exist. It is applied to a wide variety of disciplines such as business, all fields of engineering, computer science, education, geology, meteorology, and others. Years ago, high-speed computers did not exist, and if they did, the largest corporations could only afford them; consequently, the manual computation required lots of time and hard work. But now that computers have become indispensable for research work in science, engineering and other fields, numerical analysis has become a much easier and more pleasant task. This book is written primarily for students/readers who have a good background of high-school algebra, geometry, trigonometry, and the fundamentals of differential and integral calculus.* A prior knowledge of differential equations is desirable but not necessary; this topic is reviewed in Chapter 5. One can use Fortran, Pascal, C, or Visual Basic or even a spreadsheet to solve a difficult problem. It is the opinion of this author that the best applications programs for solving engineering problems are 1) MATLAB which is capable of performing advanced mathematical and engineering computations, and 2) the Microsoft Excel spreadsheet since the versatility offered by spreadsheets have revolutionized the personal computer industry. We will assume that the reader has no prior knowledge of MATLAB and limited familiarity with Excel. We intend to teach the student/reader how to use MATLAB via practical examples and for detailed explanations he/she will be referred to an Excel reference book or the MATLAB User’s Guide. The MATLAB commands, functions, and statements used in this text can be executed with either MATLAB Student Version 12 or later. Our discussions are based on a PC with Windows XP platforms but if you have another platform such as Macintosh, please refer to the appropriate sections of the MATLAB’s User Guide that also contains instructions for installation. MATLAB is an acronym for MATrix LABoratory and it is a very large computer application which is divided to several special application fields referred to as toolboxes. In this book we will be using the toolboxes furnished with the Student Edition of MATLAB. As of this writing, the latest release is MATLAB Student Version Release 13 and includes SIMULINK which is a * These topics are discussed in Mathematics for Business, Science, and Technology by this author, Orchard Publications, ISBN 0-9709511-0-8. This text includes probability and other advanced topics which are supplemented by many practical applications using Microsoft Excel and MATLAB. software package used for modeling, simulating, and analyzing dynamic systems. SIMULINK is not discussed in this text; the interested reader may refer to the documentation which also includes demo models with detailed explanations. Additional information including purchasing may be obtained from The MathWorks, Inc., 3 Apple Hill Drive, Natick, MA 01760-2098. Phone: 508 647-7000, Fax: 508 647-7001, e-mail: [email protected] and web site http:// www.mathworks.com. The author makes no claim to originality of content or of treatment, but has taken care to present definitions, statements of physical laws, theorems, and problems. Chapter 1 is an introduction to MATLAB. The discussion is based on MATLAB Student Version 5 and it is also applicable to Version 6. Chapter 2 discusses root approximations by numerical methods. Chapter 3 is a review of sinusoids and complex numbers. Chapter 4 is an introduction to matrices and methods of solving simultaneous algebraic equations using Excel and MATLAB. Chapter 5 is an abbreviated, yet practical introduction to differential equations, state variables, state equations, eigenvalues and eigenvectors. Chapter 6 discusses the Taylor and Maclaurin series. Chapter 7 begins with finite differences and interpolation methods. It concludes with applications using MATLAB. Chapter 8 is an introduction to linear and parabolic regression. Chapters 9 and 10 discuss numerical methods for differentiation and integration respectively. Chapter 11 is a brief introduction to difference equations with a few practical applications. Chapters 12 is devoted to partial fraction expansion. Chapters 13, 14, and 15 discuss certain interesting functions that find wide application in science, engineering, and probability. This text concludes with Chapter 16 which discusses three popular optimization methods. New to the Second Edition This is an extensive revision of the first edition. The most notable changes are the inclusion of Fourier series, orthogonal functions and factorization methods, and the solutions to all end-of- chapter exercises. It is in response to many readers who expressed a desire to obtain the solutions in order to check their solutions to those of the author and thereby enhancing their knowledge. Another reason is that this text is written also for self-study by practicing engineers who need a review before taking more advanced courses such as digital image processing. The author has prepared more exercises and they are available with their solutions to those instructors who adopt this text for their class. Another change is the addition of a rather comprehensive summary at the end of each chapter. Hopefully, this will be a valuable aid to instructors for preparation of view foils for presenting the material to their class. The last major change is the improvement of the plots generated by the latest revisions of the MATLAB® Student Version, Release 13. Orchard Publications Fremont, California www.orchardpublications.com [email protected] Table of Contents Chapter 1 Introduction to MATLAB Command Window.......................................................................................................................1-1 Roots of Polynomials.....................................................................................................................1-3 Polynomial Construction from Known Roots..............................................................................1-4 Evaluation of a Polynomial at Specified Values...........................................................................1-5 Rational Polynomials....................................................................................................................1-7 Using MATLAB to Make Plots....................................................................................................1-9 Subplots.......................................................................................................................................1-18 Multiplication, Division and Exponentiation.............................................................................1-18 Script and Function Files............................................................................................................1-25 Display Formats..........................................................................................................................1-29 Summary.....................................................................................................................................1-30 Exercises......................................................................................................................................1-35 Solutions to Exercises.................................................................................................................1-36 Chapter 2 Root Approximations Newton’s Method for Root Approximation.................................................................................2-1 Approximations with Spreadsheets..............................................................................................2-7 The Bisection Method for Root Approximation........................................................................2-19 Summary.....................................................................................................................................2-27 Exercises......................................................................................................................................2-28 Solutions to Exercises.................................................................................................................2-29 Chapter 3 Sinusoids and Phasors Alternating Voltages and Currents..............................................................................................3-1 Characteristics of Sinusoids..........................................................................................................3-2 Inverse Trigonometric Functions...............................................................................................3-10 Phasors........................................................................................................................................3-10 Addition and Subtraction of Phasors.........................................................................................3-11 Multiplication of Phasors............................................................................................................3-12 Division of Phasors.....................................................................................................................3-12 Numerical Analysis Using MATLAB and Spreadsheets, Second Edition i Orchard Publications Exponential and Polar Forms of Phasors....................................................................................3-13 Summary......................................................................................................................................3-18 Exercises......................................................................................................................................3-21 Solutions to Exercises..................................................................................................................3-22 Chapter 4 Matrices and Determinants Matrix Definition.........................................................................................................................4-1 Matrix Operations........................................................................................................................4-2 Special Forms of Matrices............................................................................................................4-5 Determinants................................................................................................................................4-9 Minors and Cofactors.................................................................................................................4-12 Cramer’s Rule.............................................................................................................................4-16 Gaussian Elimination Method...................................................................................................4-18 The Adjoint of a Matrix.............................................................................................................4-19 Singular and Non-Singular Matrices.........................................................................................4-20 The Inverse of a Matrix..............................................................................................................4-21 Solution of Simultaneous Equations with Matrices...................................................................4-23 Summary.....................................................................................................................................4-29 Exercises.....................................................................................................................................4-33 Solutions to Exercises.................................................................................................................4-35 Chapter 5 Differential Equations, State Variables, and State Equations Simple Differential Equations.......................................................................................................5-1 Classification.................................................................................................................................5-2 Solutions of Ordinary Differential Equations (ODE)...................................................................5-5 Solution of the Homogeneous ODE.............................................................................................5-8 Using the Method of Undetermined Coefficients for the Forced Response...............................5-10 Using the Method of Variation of Parameters for the Forced Response....................................5-19 Expressing Differential Equations in State Equation Form........................................................5-23 Solution of Single State Equations..............................................................................................5-27 The State Transition Matrix.......................................................................................................5-28 Computation of the State Transition Matrix..............................................................................5-30 Eigenvectors................................................................................................................................5-37 Summary......................................................................................................................................5-41 Exercises......................................................................................................................................5-46 Solutions to Exercises..................................................................................................................5-47 ii Numerical Analysis Using MATLAB and Spreadsheets, Second Edition Orchard Publications Chapter 6 Fourier, Taylor, and Maclaurin Series Wave Analysis..............................................................................................................................6-1 Evaluation of the Coefficients......................................................................................................6-2 Symmetry......................................................................................................................................6-7 Waveforms in Trigonometric Form of Fourier Series.................................................................6-12 Alternate Forms of the Trigonometric Fourier Series................................................................6-25 The Exponential Form of the Fourier Series..............................................................................6-28 Line Spectra................................................................................................................................6-33 Numerical Evaluation of Fourier Coefficients............................................................................6-36 Power Series Expansion of Functions.........................................................................................6-37 Taylor and Maclaurin Series.......................................................................................................6-40 Summary.....................................................................................................................................6-47 Exercises......................................................................................................................................6-50 Solutions to Exercises.................................................................................................................6-52 Chapter 7 Finite Differences and Interpolation Divided Differences......................................................................................................................7-1 Factorial Polynomials....................................................................................................................7-6 Antidifferences............................................................................................................................7-11 Newton’s Divided Difference Interpolation Method.................................................................7-15 Lagrange’s Interpolation Method...............................................................................................7-18 Gregory-Newton Forward Interpolation Method.......................................................................7-19 Gregory-Newton Backward Interpolation Method....................................................................7-20 Interpolation with MATLAB.....................................................................................................7-23 Summary.....................................................................................................................................7-37 Exercises......................................................................................................................................7-42 Solutions to Exercises.................................................................................................................7-43 Chapter 8 Linear and Parabolic Regression Curve Fitting.................................................................................................................................8-1 Linear Regression..........................................................................................................................8-2 Parabolic Regression.....................................................................................................................8-7 Regression with Power Series Approximations..........................................................................8-14 Summary.....................................................................................................................................8-24 Numerical Analysis Using MATLAB and Spreadsheets, Second Edition iii Orchard Publications Exercises.....................................................................................................................................8-26 Solutions to Exercises.................................................................................................................8-28 Chapter 9 Solution of Differential Equations by Numerical Methods Taylor Series Method...................................................................................................................9-1 Runge-Kutta Method...................................................................................................................9-5 Adams’ Method..........................................................................................................................9-13 Milne’s Method..........................................................................................................................9-16 Summary.....................................................................................................................................9-17 Exercises.....................................................................................................................................9-20 Solutions to Exercises.................................................................................................................9-21 Chapter 10 Integration by Numerical Methods The Trapezoidal Rule.................................................................................................................10-1 Simpson’s Rule...........................................................................................................................10-6 Summary...................................................................................................................................10-13 Exercises...................................................................................................................................10-15 Solution to Exercises................................................................................................................10-16 Chapter 11 Difference Equations Definition, Solutions, and Applications.....................................................................................11-1 Fibonacci Numbers....................................................................................................................11-7 Summary...................................................................................................................................11-10 Exercises...................................................................................................................................11-13 Solutions to Exercises...............................................................................................................11-14 Chapter 12 Partial Fraction Expansion Partial Fraction Expansion.........................................................................................................12-1 Alternate Method of Partial Fraction Expansion....................................................................12-13 Summary...................................................................................................................................12-18 Exercises...................................................................................................................................12-21 Solutions to Exercises...............................................................................................................12-22 iv Numerical Analysis Using MATLAB and Spreadsheets, Second Edition Orchard Publications

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.