Numerical Methods: Using MATLAB [4 ed.] 978-0-12-812256-3

he fourth edition of Numerical Methods Using MATLAB® provides a clear and rigorous introduction to a wide range of numer

4,953 717 9MB

English Pages 593 Year 2019

Report DMCA / Copyright

DOWNLOAD FILE

Polecaj historie

Numerical Methods: Using MATLAB [4 ed.]
 978-0-12-812256-3

Table of contents :
Cover......Page 1
Numerical Methods: Using MATLAB
......Page 4
Copyright
......Page 5
Dedication
......Page 6
List of Figures......Page 7
About the Authors......Page 14
Preface......Page 15
Acknowledgment......Page 17
1.1 The Software Package Matlab......Page 18
1.2 Matrices in Matlab......Page 20
1.3 Manipulating the Elements of a Matrix......Page 22
1.4 Transposing Matrices......Page 25
1.5 Special Matrices......Page 26
1.6 Generating Matrices and Vectors With Specified Element Values......Page 27
1.7 Matrix Algebra in Matlab......Page 30
1.8 Matrix Functions......Page 31
1.10 Element-by-Element Operations......Page 32
1.11 Scalar Operations and Functions......Page 34
1.12 String Variables......Page 37
1.13 Input and Output in Matlab......Page 42
1.14 Matlab Graphics......Page 45
1.15 Three-Dimensional Graphics......Page 52
1.16 Implicit Graphics......Page 54
1.17 Manipulating Graphics - Handle Graphics......Page 56
1.18 Scripting in Matlab......Page 62
1.19 User-Defined Functions in Matlab......Page 68
1.20 Data Structures in Matlab......Page 75
1.21 Editing Matlab Scripts......Page 79
1.22 Some Pitfalls in Matlab......Page 81
1.23 Speeding up Calculations in Matlab......Page 82
1.26 Problems......Page 83
2.1 Introduction......Page 90
2.2 Linear Equation Systems......Page 93
2.3 Operators \ and / for Solving Ax = b......Page 98
2.4 Accuracy of Solutions and Ill-Conditioning......Page 102
2.5 Elementary Row Operations......Page 105
2.6 Solution of Ax = b by Gaussian Elimination......Page 106
2.7 LU Decomposition......Page 108
2.8 Cholesky Decomposition......Page 112
2.9 QR Decomposition......Page 114
2.10 Singular Value Decomposition......Page 118
2.11 The Pseudo-Inverse......Page 121
2.12 Over- and Under-Determined Systems......Page 126
2.13 Iterative Methods......Page 134
2.14 Sparse Matrices......Page 135
2.15 The Eigenvalue Problem......Page 145
2.15.1 Eigenvalue Decomposition......Page 152
2.15.2 Comparing Eigenvalue and Singular Value Decomposition......Page 155
2.16 Iterative Methods for Solving the Eigenvalue Problem......Page 157
2.17 Solution of the General Eigenvalue Problem......Page 162
2.18 The Google `PageRank' Algorithm......Page 166
2.19 Summary......Page 168
2.20 Problems......Page 169
3.1 Introduction......Page 174
3.2 The Nature of Solutions to Non-Linear Equations......Page 176
3.4 Iterative or Fixed Point Methods......Page 177
3.5 The Convergence of Iterative Methods......Page 178
3.6 Ranges for Convergence and Chaotic Behavior......Page 179
3.7 Newton's Method......Page 181
3.8 Schroder's Method......Page 186
3.9 Numerical Problems......Page 187
3.10 The Matlab Function fzero and Comparative Studies......Page 188
3.11.1 Bairstow's Method......Page 190
3.11.2 Laguerre's Method......Page 194
3.12 Solving Systems of Non-Linear Equations......Page 195
3.13 Broyden's Method for Solving Non-Linear Equations......Page 198
3.14 Comparing the Newton and Broyden Methods......Page 201
3.16 Problems......Page 202
4.2 Numerical Differentiation......Page 208
4.3 Numerical Integration......Page 212
4.4 Simpson's Rule......Page 213
4.5 Newton-Cotes Formulae......Page 217
4.6 Romberg Integration......Page 218
4.7 Gaussian Integration......Page 220
4.8.1 Gauss-Laguerre Formula......Page 222
4.8.2 Gauss-Hermite Formula......Page 225
4.10 Gauss-Lobatto Integration......Page 227
4.11 Filon's Sine and Cosine Formulae......Page 231
4.12 Adaptive Integration......Page 235
4.13 Problems in the Evaluation of Integrals......Page 240
4.14 Test Integrals......Page 241
4.15.1 Simpson's Rule for Repeated Integrals......Page 242
4.15.2 Gaussian Integration for Repeated Integrals......Page 244
4.16 Matlab Functions for Double and Triple Integration......Page 247
4.18 Problems......Page 248
5.1 Introduction......Page 255
5.2 Euler's Method......Page 256
5.3 The Problem of Stability......Page 258
5.4 The Trapezoidal Method......Page 260
5.5 Runge-Kutta Methods......Page 263
5.6 Predictor-Corrector Methods......Page 267
5.7 Hamming's Method and the Use of Error Estimates......Page 269
5.9 The Stability of Particular Numerical Methods......Page 272
5.10.1 Zeeman Model......Page 276
5.10.2 The Predator-Prey Problem......Page 278
5.11.1 Conversion to a Set of Simultaneous First-Order Differential Equations......Page 280
5.11.2 Newmark's Method......Page 281
5.12.1 The Lorenz Equations......Page 287
5.12.2 Duffing's Equation......Page 289
5.13 Differential Equations Applied to Neural Networks......Page 292
5.14 Stiff Equations......Page 296
5.15 Special Techniques......Page 298
5.16 Extrapolation Techniques......Page 301
5.17 Simulink......Page 303
5.19 Problems......Page 311
6.1 Classification of Second-Order Differential Equations......Page 316
6.2 The Shooting Method......Page 317
6.3 The Finite Difference Method......Page 319
6.4 Two-Point Boundary Value Problems......Page 321
6.5 Parabolic Partial Differential Equations......Page 328
6.6 Hyperbolic Partial Differential Equations......Page 331
6.7 Elliptic Partial Differential Equations......Page 334
6.9 Problems......Page 341
7.2 Interpolation Using Polynomials......Page 344
7.3 Interpolation Using Splines......Page 348
7.4 Multiple Regression: Least Squares Criterion......Page 351
7.5 Diagnostics for Model Improvement......Page 354
7.6 Analysis of Residuals......Page 358
7.7 Polynomial Regression......Page 363
7.8 Fitting General Functions to Data......Page 370
7.9 Non-Linear Least Squares Regression......Page 371
7.10 Transforming Data......Page 374
7.11 The Kalman Filter......Page 377
7.12 Principal Component Analysis......Page 386
7.14 Problems......Page 392
8.2 Fourier Analysis of Discrete Data......Page 397
8.3 The Hilbert Transform......Page 412
8.4 The Walsh Transforms......Page 421
8.5 Introduction to Wavelet Analysis......Page 427
8.6.1 Haar Wavelet......Page 429
8.6.2 Daubechies Wavelets......Page 437
8.7 Continuous Wavelet Transforms......Page 439
8.9 Problems......Page 443
9.2 Linear Programming Problems......Page 446
9.3 Optimizing Single-Variable Functions......Page 453
9.4 The Conjugate Gradient Method......Page 456
9.5 Moller's Scaled Conjugate Gradient Method......Page 462
9.6 Conjugate Gradient Method for Solving Linear Systems......Page 468
9.8 Simulated Annealing......Page 470
9.9 Evolutionary Algorithm......Page 474
9.10 Differential Evolution......Page 479
9.11 Constrained Non-Linear Optimization......Page 485
9.12 The Sequential Unconstrained Minimization Technique......Page 489
9.13 Summary......Page 492
9.14 Problems......Page 493
10.1 Introduction to the Symbolic Toolbox......Page 497
10.2 Symbolic Variables and Expressions......Page 498
10.3 Variable Precision Arithmetic in Symbolic Calculations......Page 502
10.4 Series Expansion and Summation......Page 503
10.5 Manipulation of Symbolic Matrices......Page 506
10.6 Symbolic Methods for the Solution of Equations......Page 510
10.7 Special Functions......Page 512
10.8 Symbolic Differentiation......Page 514
10.9 Symbolic Partial Differentiation......Page 515
10.10 Symbolic Integration......Page 516
10.11 Symbolic Solution of Ordinary Differential Equations......Page 520
10.12 The Laplace Transform......Page 525
10.13 The Z-Transform......Page 527
10.14 Fourier Transform Methods......Page 529
10.15 Linking Symbolic and Numerical Processes......Page 533
10.17 Problems......Page 535
A.2 Matrices and Vectors......Page 540
A.3 Some Special Matrices......Page 541
A.5 Matrix Operations......Page 542
A.6 Complex Matrices......Page 544
A.9 Eigenvalues......Page 545
A.10 Definition of Norms......Page 546
A.12 Differentiating Matrices......Page 547
A.13 Square Root of a Matrix......Page 548
B.1 Introduction......Page 550
B.2 Errors in Arithmetic Operations......Page 551
B.3 Errors in the Solution of Linear Equation Systems......Page 552
Chapter 1......Page 556
Chapter 2......Page 559
Chapter 3......Page 561
Chapter 4......Page 563
Chapter 5......Page 566
Chapter 6......Page 568
Chapter 8......Page 569
Chapter 9......Page 571
Chapter 10......Page 572
Bibliography......Page 576
Index......Page 579
Back Cover......Page 593

Citation preview

Numerical Methods Using M ATLAB®

Numerical Methods Using M ATLAB® Fourth Edition

George Lindfield Aston University, School of Engineering and Applied Science, Birmingham, England, United Kingdom

John Penny Aston University, School of Engineering and Applied Science, Birmingham, England, United Kingdom

Academic Press is an imprint of Elsevier 125 London Wall, London EC2Y 5AS, United Kingdom 525 B Street, Suite 1650, San Diego, CA 92101, United States 50 Hampshire Street, 5th Floor, Cambridge, MA 02139, United States The Boulevard, Langford Lane, Kidlington, Oxford OX5 1GB, United Kingdom Copyright © 2019 Elsevier Inc. All rights reserved. M ATLAB® 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 M ATLAB® software or related products does not constitute endorsement or sponsorship by The MathWorks of a particular pedagogical approach or particular use of the M ATLAB® software. No part of this publication may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or any information storage and retrieval system, without permission in writing from the publisher. Details on how to seek permission, further information about the Publisher’s permissions policies and our arrangements with organizations such as the Copyright Clearance Center and the Copyright Licensing Agency, can be found at our website: www.elsevier.com/permissions. This book and the individual contributions contained in it are protected under copyright by the Publisher (other than as may be noted herein). Notices Knowledge and best practice in this field are constantly changing. As new research and experience broaden our understanding, changes in research methods, professional practices, or medical treatment may become necessary. Practitioners and researchers must always rely on their own experience and knowledge in evaluating and using any information, methods, compounds, or experiments described herein. In using such information or methods they should be mindful of their own safety and the safety of others, including parties for whom they have a professional responsibility. To the fullest extent of the law, neither the Publisher nor the authors, contributors, or editors, assume any liability for any injury and/or damage to persons or property as a matter of products liability, negligence or otherwise, or from any use or operation of any methods, products, instructions, or ideas contained in the material herein. Library of Congress Cataloging-in-Publication Data A catalog record for this book is available from the Library of Congress British Library Cataloguing-in-Publication Data A catalogue record for this book is available from the British Library ISBN: 978-0-12-812256-3 For information on all Academic Press publications visit our website at https://www.elsevier.com/books-and-journals

Publisher: Katey Birtcher Acquisition Editor: Steve Merken Editorial Project Manager: Peter Jardim / Michael Lutz Production Project Manager: Sruthi Satheesh Designer: Matthew Limbert Typeset by VTeX

This book is for my wife Zena. With tolerance and patience, she has supported and encouraged me for many years and for our grown up children Katy and Helen. George Lindfield This book is for my wife Wendy, for her patience, support and encouragement, and for our grown up children, Debra, Mark and Joanne. Also to our cat Jeremy who provided me with company whilst I worked on this book. John Penny

List of Figures

Fig. 1.1

Superimposed graphs obtained u si ng plot (x, y) and ho 1 d sta teme nt s .

30

Fig. 1.2

Plot of y = sin ( x 3 ) using 51 cqLli�pact:d plotti ng rx>inls.

31

Fig. 1.3

Plot of y = sin(x3) us in g the function fp lot to c hoose plotting points adapt ively.

Fig. 1.4

Function plotted over the range from -4 to 4. [t has a maximum value of 4

Fig. 1.5

T he

x

106,

Fig. 1.7

same fllnction as p loned in Fig. 1 .4 but with a limit on the ral)ge of the y- axis. An example of the use of the subp lot function. po 1 a r and campa 5S plots showing the roots of x5 - 1 = O.

Fig. 1.8

Polar scalIe r plots . Left diagram with defclUlt size circle markers . Right diagram with larger

Fig. 1.6

31 32 32 33 34

filled black circles.

35

Fig. 1.9

Pol�lr scatter histog ram.

35

Fig. 1.10

Three-dimensional surface us ing default view.

37

Fig. 1.11

Three-dimensional contour plot.

37

Fig. 1.12

Filled contour plot.

37

Fig. 1.13

I mp licit quadrafolium and folium of Descartes.

38

Fig. I. 14

Plots illus trati ng aspecr.s of handle gmphics.

41

Fig.l.IS

Plot of funct.ions shown in Fi g. 1.14 illustratjng further handle graphs fcmures.

42

Fig. 1.16

Piol of cos(2x). The axes of the right-hand plot arc t:nhanced using handle graphics.

43

Fig. 1.17

Plot of (W2 + x)2a COS(W1X).

44

Fig. 2.1

Electrical network.

74

Fig. 2.2

Three inIerSecling pl anes represeming three equations in three variables. (A) Three plane surfaces intcr);ccting in