MATLAB for Engineers

Similar documents
Feedback Control of Dynamic Systems

An Introduction to Computer Simulation Methods

9TH EDITION. George B. Thomas, Jr. Massachusetts Institute of Technology. Ross L. Finney. With the collaboration of Maurice D.

ALGEBRA AND ALGEBRAIC COMPUTING ELEMENTS OF. John D. Lipson. Addison-Wesley Publishing Company, Inc.

Numerical Methods with MATLAB

Statistical Signal Processing Detection, Estimation, and Time Series Analysis

Numerical Methods for Engineers. and Scientists. Applications using MATLAB. An Introduction with. Vish- Subramaniam. Third Edition. Amos Gilat.

NUMERICAL METHODS USING MATLAB

NUMERICAL METHODS. lor CHEMICAL ENGINEERS. Using Excel', VBA, and MATLAB* VICTOR J. LAW. CRC Press. Taylor & Francis Group

College Algebra. Third Edition. Concepts Through Functions. Michael Sullivan. Michael Sullivan, III. Chicago State University. Joliet Junior College

Signals and Systems Laboratory with MATLAB

Introduction to Numerical Analysis

Chabot College Fall Course Outline for Mathematics 25 COMPUTATIONAL METHODS FOR ENGINEERS AND SCIENTISTS

Adaptive Filtering. Squares. Alexander D. Poularikas. Fundamentals of. Least Mean. with MATLABR. University of Alabama, Huntsville, AL.

Mathematics for Engineers and Scientists

Dynamic Systems. Modeling and Analysis. Hung V. Vu. Ramin S. Esfandiari. THE McGRAW-HILL COMPANIES, INC. California State University, Long Beach

With Modern Physics For Scientists and Engineers

Preface. 2 Linear Equations and Eigenvalue Problem 22

An Introduction to. Michael E. Peskin. Stanford Linear Accelerator Center. Daniel V. Schroeder. Weber State University. Advanced Book Program

UNDERSTANDING ENGINEERING MATHEMATICS

NUMERICAL MATHEMATICS AND COMPUTING

Companion. Jeffrey E. Jones

NUMERICAL COMPUTATION IN SCIENCE AND ENGINEERING

MATHEMATICAL FORMULAS AND INTEGRALS

FINITE-DIMENSIONAL LINEAR ALGEBRA

Steven J. Leon University of Massachusetts, Dartmouth

Differential Equations with Mathematica

Signals and Systems with MATLAB Applications

Differential Equations

Mathematica. A Systemjor Doing Mathematics by Computer. Stephen Wolfral1l. ~ C;:tr lju J. ~c~~

AN INTRODUCTION TO NUMERICAL METHODS USING MATHCAD. Mathcad Release 14. Khyruddin Akbar Ansari, Ph.D., P.E.

Numerical Methods for Engineers

DISCRETE-TIME SIGNAL PROCESSING

CLASSICAL ELECTRICITY

Applied Linear Algebra in Geoscience Using MATLAB

Mathematics for Chemists

Theory and Problems of Signals and Systems

Essentials of College Algebra

Preface to Second Edition... vii. Preface to First Edition...

Digital Power System Protection

Digital Control Engineering Analysis and Design

LINEAR AND NONLINEAR PROGRAMMING

Table 1 Principle Matlab operators and functions Name Description Page reference

WILEY. Differential Equations with MATLAB (Third Edition) Brian R. Hunt Ronald L. Lipsman John E. Osborn Jonathan M. Rosenberg

ELEMENTARY MATRIX ALGEBRA

Boundary. DIFFERENTIAL EQUATIONS with Fourier Series and. Value Problems APPLIED PARTIAL. Fifth Edition. Richard Haberman PEARSON

MULTIVARIABLE CALCULUS, LINEAR ALGEBRA, AND DIFFERENTIAL EQUATIONS

Computational Methods

A THEORETICAL INTRODUCTION TO NUMERICAL ANALYSIS

GAME PHYSICS SECOND EDITION. дяййтаййг 1 *

TABLE OF CONTENTS INTRODUCTION, APPROXIMATION & ERRORS 1. Chapter Introduction to numerical methods 1 Multiple-choice test 7 Problem set 9

FEEDBACK and CONTROL SYSTEMS

ALGEBRAIC SHIFT REGISTER SEQUENCES

Excel for Scientists and Engineers Numerical Method s. E. Joseph Billo

Math 307 Learning Goals. March 23, 2010

Mathematics with Applications

CONTROL SYSTEMS ENGINEERING Sixth Edition International Student Version

Numerical Analysis. A Comprehensive Introduction. H. R. Schwarz University of Zürich Switzerland. with a contribution by

Integrated Arithmetic and Basic Algebra

USE OF MATLAB TO UNDERSTAND BASIC MATHEMATICS

ADVANCED ENGINEERING MATHEMATICS

Mathematical Methods for Engineers and Scientists 1

MATHEMATICAL HANDBOOK. Formulas and Tables

Basic. Theory. ircuit. Charles A. Desoer. Ernest S. Kuh. and. McGraw-Hill Book Company

NUMERICAL METHODS FOR ENGINEERING APPLICATION

MATHEMATICAL FORMULAS AND INTEGRALS

CAM Ph.D. Qualifying Exam in Numerical Analysis CONTENTS

Spis treści Contents List of Examples Preface to Third Edition 21

Advanced. Engineering Mathematics

Fundamentals of Applied Probability and Random Processes

Consider the following example of a linear system:

Continuous and Discrete Time Signals and Systems

Contents. I Basic Methods 13

THEORY OF DISTRIBUTIONS

SECTION 7: CURVE FITTING. MAE 4020/5020 Numerical Methods with MATLAB

Lesson 1: Inverses of Functions Lesson 2: Graphs of Polynomial Functions Lesson 3: 3-Dimensional Space

System Dynamics for Engineering Students Concepts and Applications

ENGINEERING MATHEMATICS I. CODE: 10 MAT 11 IA Marks: 25 Hrs/Week: 04 Exam Hrs: 03 PART-A

Contents. UNIT 1 Descriptive Statistics 1. vii. Preface Summary of Goals for This Text

Engineering. Mathematics. GATE 2019 and ESE 2019 Prelims. For. Comprehensive Theory with Solved Examples

Numerical Methods. Scientists. Engineers

Numerical Methods for Differential Equations Mathematical and Computational Tools

From Practical Data Analysis with JMP, Second Edition. Full book available for purchase here. About This Book... xiii About The Author...

COMPLEX VARIABLES. Principles and Problem Sessions YJ? A K KAPOOR. University of Hyderabad, India. World Scientific NEW JERSEY LONDON

Linear Algebra I for Science (NYC)

xvi xxiii xxvi Construction of the Real Line 2 Is Every Real Number Rational? 3 Problems Algebra of the Real Numbers 7

Mathematics for Engineers. Numerical mathematics

Musimathics The Mathematical Foundations of Music Volume 2. Gareth Loy. Foreword by John Chowning

Reduction to the associated homogeneous system via a particular solution

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA

An Introduction to the Finite Element Method

CONTENTS. Preface Preliminaries 1

Calculus. Preliminary Edition. Robert Decker. Dale Varberg. Prentice Hall, Upper Saddle River, New Jersey UNIVERSITY OF HARTFORD

Contents. Preface to the Third Edition (2007) Preface to the Second Edition (1992) Preface to the First Edition (1985) License and Legal Information

Applied Numerical Analysis

Contents. Preface xi. vii

BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination December, 2015 BCS-054 : COMPUTER ORIENTED NUMERICAL TECHNIQUES

MATHEMATICAL OBJECTS in

Introduction to Economic Geography

MATHEMATICS. Course Syllabus. Section A: Linear Algebra. Subject Code: MA. Course Structure. Ordinary Differential Equations

Transcription:

MATLAB for Engineers Adrian Biran Moshe Breiner ADDISON-WESLEY PUBLISHING COMPANY Wokingham, England Reading, Massachusetts Menlo Park, California New York Don Mills, Ontario Amsterdam Bonn Sydney Singapore Tokyo Madrid San Juan Milan Mexico City Seoul Taipei

Contents Preface 1 MATLAB in a nutshell 1 1.1 Desktop calculations 1 1.1.1 Getting started 1 1.1.2 Arithmetic operations 2 1.1.3 Last-line editing 3 1.1.4 A few built-in functions 3 1.1.5 Naming constants and variables 6 1.1.6 Format 8 1.1.7 Diary 10 1.2 One-dimensional arrays and graphics 10 1.2.1 Arrays - elementary operations 10 1.2.2 More operations on arrays 12 1.2.3 Row vectors and column vectors 14 1.2.4 The scalar product 15 1.2.5 Simple plots 16 1.3 Matrices 17 1.3.1 Defining a matrix 17 1.3.2 Elementary operations with matrices 19 1.3.3 Printing a table 21 1.4 Complex numbers 22 1.4.1 Complex numbers - elementary operations 22 1.4.2 Two notes on the use of i and j 23 1.4.3 Plotting a complex number 24 1.4.4 Trigonometric and exponential representations 25 1.4.5 Functions of complex variables 27 1.4.6 Arrays of complex numbers 27 1.5 Systems of linear equations 28 1.5.1 Determinants 28 1.5.2 Cramer's rule 29 1.5.3 Matrix inversion 31 v ix

X 1.5.4 Solving Systems of linear equations in MATLAB... 31 1.6 Polynomials 32 1.6.1 Polynomial roots 32 1.6.2 Retrieving polynomial coefficients from polynomial roots 33 1.6.3 Polynomial evaluation 33 1.6.4 Multiplication and division of polynomials 34 1.7 Programming in MATLAB 35 1.7.1 Programming a function 36 1.7.2 Repetitive control structures - FOR loops 37 1.7.3 Conditional control structures 38 1.7.4 Repetitive control structures - WHILE loops 40 1.8 External files and programs 42 1.8.1 Saving and loading data 42 1.8.2 The CUMSUM and DIFF functions 43 1.8.3 Reading data from external files 45 1.8.4 Issuing commands to the operating system 46 1.8.5 Writing output to external files 46 1.9 Regression and interpolation 47 1.9.1 Tables with one entry 47 1.9.2 Tables with two entries 48 1.9.3 Polynomial fit and polynomial interpolation 49 1.9.4 Spline interpolation 51 1.10 More about plotting 52 1.10.1 Function evaluation 52 1.10.2 Histograms 53 1.10.3 Polar plots 54 1.10.4 A more elaborate polar plot 55 1.10.5 Three-dimensional plots in MATLAB 3.5 56 1.11 Interpolation and 3D plots in MATLAB 4 58 1.11.1 More interpolating functions in MATLAB 4 58 1.11.2 The GRIDDATA function and 3D plots 60 1.11.3 More 3D plots 62 1 MATLAB - AN INTRODUCTION FOR ENGINEERS 65 2 Desktop calculations with graphics 67 2.1 Introduction 67 2.2 Computer-aided mistakes 67 2.3 Computer representation of numbers 68 2.4 Roundoff 71 2.5 Roundoff errors 72 2.6 The set of machine numbers 74 2.7 Vectors 76 2.8 Column vectors 78 2.9 A spreadsheet. 79

2.10 Geometrical significance of the scalar product 81 2.11 Graphical solution of equations 82 2.12 Summary 86 2.13 Examples 88 2.14 Exercises 110 2.15 Appendix - a note on Fourier series 124 3 Two-dimensional arrays and matrices 125 3.1 Building a matrix out of vectors 125 3.2 Vector-by-matrix multiplication 128 3.3 Matrix-by-matrix multiplication 130 3.4 Array division 132 3.5 Summary 133 3.6 Examples 134 3.7 Exercises 146 3.8 Where to find more examples and exercises 160 4 Complex numbers 161 4.1 Introduction 161 4.2 The introduction of complex numbers 162 4.3 Operations with complex numbers 163 4.4 Geometric representation 165 4.5 Trigonometric representation 167 4.6 Functions of complex variables 170 4.7 Mapping by functions of complex variables 173 4.8 Conformal mapping 176 4.9 Harmonic motion - phasors 180 4.10 A simple MATLAB program - visualizing a rotating vector.. 184 4.11 Summary 187 4.12 Examples 189 4.13 Exercises 209 4.14 Where to find more examples 214 4.15 Appendix 214 4.15.1 Operations with complex numbers 214 4.15.2 AC circuits - phasors in electrical engineering 214 5 Geometric calculations 219 5.1 Introduction 219 5.2 Rotation of coordinate axes in the plane 220 5.3 Matrix inversion 221 5.4 Programming a function 223 5.5 Euler's angles, 224 5.6 Determinants 228 5.7 Summary 231 5.8 Affine transformations 232 5.9 Inverse affine transformations 237 XI

Xll 5.10 Examples 239 5.11 Exercises 243 6 Solving equations 247 6.1 Systems of linear equations - introduction 247 6.2 Inhomogeneous linear equations 248 6.3 Homogeneous linear equations 252 6.4 MATLAB's solution of linear systems 254 6.5 Overdetermined systems - least-squares solution 257 6.6 Ill-conditioned systems 260 6.7 Polynomial equations - introduction 262 6.8 Finding roots of polynomials in MATLAB 263 6.9 Retrieving polynomial coefficients from roots 264 6.10 Summary 264 6.11 Examples - linear equations 266 6.12 Examples - polynomial equations 287 6.13 Exercises 298 6.14 Appendix - least squares fit 307 7 Programming in MATLAB 311 7.1 Introduction 311 7.2 Conditional branching 311 7.3 WHILE loops 315 7.4 Iterative solution of equations 318 7.5 The Newton-Raphson method 321 7.6 Recursion 328 7.7 A note on complexity 330 7.8 Summary 334 7.9 Examples 336 7.10 Exercises 347 7.11 Appendix - the contractive Lipschitz condition 351 8 External files 353 8.1 Introduction 353 8.2 A log-book of calculations 353 8.3 Reading data from M-files 355 8.4 Linear interpolation 356 8.4.1 Tables with one entry 356 8.4.2 Tables with two entries 359 8.5 Switching to the operating system 362 8.6 Writing output to external files 363 8.7 Additions in MATLAB 4 365 8.8 Summary 365 8.9 Examples 366 8.10 Exercises 372

9 Regression and interpolation 379 9.1 Introduction 379 9.2 Polynomial fit 380 9.3 Polynomial interpolation 383 9.4 Assessing the quality of a regression 386 9.5 Power regression 388 9.6 Exponential regression 391 9.7 Spline interpolation 394 9.8 Summary 397 9.9 Examples 399 9.10 Exercises 414 10 More about plotting 419 10.1 Introduction 419 10.2 Histograms 420 10.3 Polar plots 423 10.4 Three-dimensional plots 425 10.5 Animation 425 10.6 Examples 427 10.7 Exercises 438 10.8 Appendix - the equation of orbits of planets and satellites... 441 ХШ 11 MORE APPLICATIONS 447 11 Numerical integration 449 11.1 Introduction 449 11.2 The trapezoidal rule 451 11.3 Error of integration by the trapezoidal rule 454 11.4 Simpson's rule 458 11.5 Error of integration by Simpson's rule 461 11.6 MATLAB QUAD and QUAD8 functions 463 11.7 Examples 463 11.8 Exercises 473 12 Graph theory 477 12.1 Definitions 477 12.2 Graph of a railway network 480 12.3 Sparse matrix 484 12.4 Exercises 485 13 Dimensional analysis 489 13.1 Introduction 489 13.2 Dimensional analysis 489 13.3 Examples 493 13.4 Summary 505 13.5 Exercises 506

XIV 14 System modelling and simulation 509 14.1 Introduction 509 14.2 Five ways of modelling dynamic systems 510 14.2.1 Transfer functions 510 14.2.2 Zero-pole-gain models 511 14.2.3 Partial fractions 512 14.2.4 State space 513 14.2.5 Cauchy form 514 14.3 Numerical solution of ordinary differential equations 515 14.4 Ordinary differential equations and simulation 518 14.5 Stiff problems 522 14.6 Conclusion 523 14.7 Exercises 523 15 Control 531 15.1 Introduction 531 15.2 Root locus design 532 15.3 Design in the frequency domain 534 15.4 Optimal design 544 15.5 Exercises 547 16 Signal processing 557 16.1 Signals and signal processing 557 16.2 The FILTER function 558 16.3 Calling the filter with initial conditions 564 16.4 Design of digital filters 568 16.4.1 Definitions 568 16.4.2 Defining the frequency characteristics of the filter... 569 16.4.3 The Tustin bilinear transformation 574 16.5 The Discrete Fourier Transform 577 16.6 A short introduction to the DFT 579 16.7 The power spectrum 582 16.8 Trigonometric expansion of a signal 587 16.9 High frequency signals and aliasing 589 16.10 Exercises 594 17 Case studies in mechanical engineering 601 17.1 Bending moment caused by a moving vehicle 601 17.2 One-dimensional heat conduction 605 17.3 Using a sparse matrix 610 17.4 Exercises 613 Answers to selected exercises 615 Bibliography 653 Index 659