Thompson - Computing for Scientists and Engineers (523188)
Текст из файла
Home NextCOMPUTING FORSCIENTISTS ANDENGINEERSCOMPUTING FORSCIENTISTS ANDENGINEERSA Workbook of Analysis,Numerics, and ApplicationsWILLIAM J. THOMPSONUniversity of North CarolinaChapel Hill, North CarolinaA Wiley-Interscience PublicationJOHN WILEY & SONS, INC.New York / Chichester / Brisbane / Toronto / SingaporeThis text is printed on acid-free paper.Copyright © 1992 by John Wiley & Sons, Inc.All rights reserved. Published simultaneously in Canada.Reproduction or translation of any part of this workbeyond that permitted by Section 107 or 108 of the1976 United State Copyright Act without the permissionof the copyright owner is unlawful. Requests forpermission or further information should be addressed tothe Permissions Department, John Wiley & Sons, Inc.,605 Third Avenue, New York, NY 10158-0012Library of Congress Cataloging in Publication Data:Thompson, William J.
(William Jackson), 1939 Computing for Scientists and Engineers : a workbook of analysis,numerics, and applications /William J. Thompson.p.cm.Rev. ed. of: Computing in applied science. c1984.“A Wiley-Interscience publication.”Includes bibliographical references and indexes.ISBN O-471-54718-2 (cloth)1.
Numerical analysis-Data processing. 2. Science-Dataprocessing. 3. Engineering-Data processing. I. Thompson, WilliamJ. (William Jackson), 1939- Computing in applied science.II. Title.QA297.T5 1992519.4–dc2092-16744Printed in the United States of America10 9 8 7 6 5 4 3 2PREFACEThis preface is addressed to readers who are interested in computing but who seldom either consult manuals or read prefaces. So, I will be brief.Computing requires an integrated approach, in which scientific and mathematicalanalysis, numerical algorithms, and programming are developed and used together.The purpose of this book is to provide an introduction to analysis, numerics, andtheir applications.
I believe that a firm grounding in the basic concepts and methodsin these areas is necessary if you wish to use numerical recipes effectively. Thetopics that I develop extensively are drawn mostly from applied mathematics, thephysical sciences, and engineering. They are divided almost equally among reviewof the mathematics, numerical-analysis methods (such as differentiation, integration,and solution of differential equations from the sciences and engineering), and dataanalysis applications (such as splines, least-squares fitting, and Fourier expansions).I call this a workbook, since I think that the best way to learn numerically oriented computing is to work many examples.
Therefore, you will notice and, I hope,solve many of the exercises that are strewn throughout the text like rocks in thestream of consciousness. I try to introduce you to a technique, show you some ofthe steps, then let you work out further steps and developments yourself. I alsosuggest new and scenic routes rather than overtraveled highways.
There are occasional diversions from the mainstream, often to point out how a topic that we are developing fits in with others in computing and its applications.The programming language in which I present programs is C. This language isnow used extensively in systems development, data-acquisition systems, numericalmethods, and in many engineering applications. To accommodate readers who prefer Fortran or Pascal, I have used only the numerically oriented parts of C and I havevvistructured the programs so that they can usually be translated line-by-line to theseother languages if you insist. The appendix summarizes the correspondences between the three languages. All programs and the functions they use are listed in theindex to programs. The fully-developed programs are usually included in the projects near the end of each chapter.This book may be used either in a regular course or for self-study.
In a onesemester course for college students at the junior level or above (including graduatestudents), more than half the topics in the book could be covered in detail. There isadequate cross-referencing between chapters, in addition to references to sources forpreparation and for further exploration of topics. It is therefore possible to beselective of topics within each chapter.Now that we have an idea of where we’re heading, let’s get going and compute!William J. ThompsonChapel Hill, July 1992CONTENTS1.
Introduction to Applicable Mathematics and Computing1.1 What is applicable mathematics? 11Analysis, numerics, and applications 2Cooking school, then recipes 3Diversions and new routes 4Roads not taken 41.2 Computing, programming, coding 5The C language for the programs 6Learning to program in C 7Translating to Fortran or Pascal from C 8The computing projects and the programs 9Caveat emptor about the programs 10The index to computer programs 111.3One picture is worth 1000 words 11Why and when you should use graphics 11Impressive graphics, or practical graphics 121.4 Suggestions for using this book 12Links between the chapters 13The exercises and projects 13References for the introduction 14General references 14References on learning and using C 152.
A Review of Complex Variables2.1 Algebra and computing with complex numbers 1817The algebra of complex numbers 18Programming with complex numbers 20Complex conjugation, modulus, argument 23A program for complex conjugate and modulus 25viiCONTENTSviii2.2 The complex plane and plane geometry 27Cartesian and plane-polar coordinates 28De Moivre’s theorem and its uses 292.3 Functions of complex variables 31Complex exponentials: Euler’s theorem 3 1Applications of Euler’s theorem 3 2Hyperbolic functions and their circular analogs 3 4Trajectories in the complex plane 382.4 Phase angles, vibrations, and waves 41Phase angles and phasors 4 1Vibrations and waves 422.5 Diversion: Interpreting complex numbers 43Are complex numbers real? 43Analytic continuation 442.6Project 2: Program to convert between coordinates 45Stepping into the correct quadrant 45Coding, testing, and using the program 46References on complex numbers 493.
Power Series and Their Applications3.1 Motivation for using series: Taylor’s theorem 51The geometric series 52Programming geometric series 53Alternating series 56Taylor’s theorem and its proof 58Interpreting Taylor series 593.2 Taylor expansions of useful functions 60Expansion of exponentials 61Computing the exponential series 62Series for circular functions 65Inverse circular functions 70Hyperbolic function expansions 71Logarithms in series expansions 72Series expansion of x In(x) 733.3 The binomial approximation 76Deriving the binomial approximation 76Applications of the binomial approximation 7 8Linearized square-root approximations 78Financial interest schemes 803.4Diversion: Repetition in mathematics and computing 83Iteration 84Recurrence 84Recursion 843.5Project 3: Testing the convergence of series 85Coding and checking each series expansion 85Including the hyperbolic functions 91File output and graphics options 92The composite program for the functions 92Using the program to test series convergence 97References on power series 9851CONTENTS4.
Numerical Derivatives and Integrals4.1 The working function and its properties 100ix99Properties of the working function 100A C function for Homer’s algorithm 103Programming the working function 1064.2Discrete data and numerical mathematics 110The discreteness of data 110Numerical mathematics 1114.3 Numerical noise in computing 111Roundoff and truncation errors 112Unstable problems and unstable methods 114Errors from subtractive cancellation 116Program for roots of quadratic equations 1194.4 How to approximate derivatives 122Forward-difference derivatives 123Derivatives by central differences 125Numerical second derivatives 126Better algorithms for second derivatives 1284.5Project 4A: Computing derivatives numerically 130Derivatives of the exponential function 130Differentiating the cosine function 1324.6 Numerical integration methods 133Trapezoid formula and program for integration 135Simpson formula and program for integrals 140Integrals with cosines 143Higher-order polynomial integration 1444.7Project 4B: Electrostatic potential from a charged wire 145Potentials by analytical integration 147Potentials by numerical-integration methods 148References on numerical derivatives and integrals 1515.
Fitting Curves through Data5.1 How to fit curves using splines 154What is a spline? 154Properties for spline fits 156Deriving the spline equations 156The spline algorithm 1585.2 Boundary conditions for spline fitting 159Natural splines 1605.3Project 5: Program for spline fitting 161The main program, Cubic Splines 166The function SplineFit 1675.4 Interpolating by splines 168Interpolating values and derivatives 168The C function Splinelnterp 169Interpolating working-function values and derivatives 170Interpolating cosine values and derivatives 173153CONTENTSx5.5 Integration methods using splines 175Deriving the integration algorithm 175The C function for spline integration 176Integrating the working function and cosine 1775.6 Diversion: Computers, splines, and graphics 178References on spline fitting 1796.
Least-Squares Analysis of Data6.1 Introduction to the least-squares criterion 182181Maximum likelihood and least squares 182Least squares and the objective function 1856.2Orthogonal functions and linear least squares 185What are orthogonal functions? 186Orthogonality and least squares 1886.3Errors in both variables: Straight-line least squares 190Weighting models 190Constant ratio of weights 192Properties of the least-squares slopes 1966.4 Least-squares normalization factors 199NormalizingNormalizingThe best-fitProgram for6.5fitting-function values to data 200data to fitting values 201objective function 203normalizing factors 204Logarithmic transformations and parameter biases 208The origin of bias 209Probability analysis for bias 210Dependence of bias on error distribution 2126.6Project 6: Program for straight-line least-squares fits 214Organization of Straight-Line Least Squares 214Testing and using the least-squares program 217References on least-squares analysis 2187.
Характеристики
Тип файла PDF
PDF-формат наиболее широко используется для просмотра любого типа файлов на любом устройстве. В него можно сохранить документ, таблицы, презентацию, текст, чертежи, вычисления, графики и всё остальное, что можно показать на экране любого устройства. Именно его лучше всего использовать для печати.
Например, если Вам нужно распечатать чертёж из автокада, Вы сохраните чертёж на флешку, но будет ли автокад в пункте печати? А если будет, то нужная версия с нужными библиотеками? Именно для этого и нужен формат PDF - в нём точно будет показано верно вне зависимости от того, в какой программе создали PDF-файл и есть ли нужная программа для его просмотра.