Fundamentals - Shampine_ L. F_.pdf

(339 KB) Pobierz
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
878513247.003.png
FUNDAMENTALS OF
NUMERICAL COMPUTING
L. F. Shampine
Southern Methodist University
R. C. Allen, Jr.
Sandia National Laboratories
S. Pruess
Colorado School of Mines
JOHN WILEY & SONS, INC.
New York Chichester Brisbane Toronto Singapore
878513247.004.png 878513247.005.png 878513247.006.png 878513247.001.png
Acquisitions Editor
Barbara Holland
Editorial Assistant
Cindy Rhoads
Marketing Manager
Cathy Faduska
Senior Production Manager
Lucille Buonocore
Senior Production Editor
Nancy Prinz
Manufacturing Manager
Murk Cirillo
Cover Designer
Steve Jenkins
This book was set in Times Roman, and was printed and bound by R.R. Donnelley &
Sons Company, Crawfordsville. The cover was printed by The Lehigh Press, Inc.
Recognizing the importance of preserving what has been written, it is a
policy of John Wiley & Sons, Inc. to have books of enduring value published
in the United States printed on acid-free paper, and we exert our best
efforts to that end.
The paper in this book was manufactured by a mill whose forest management programs
include sustained yield harvesting of its timberlands. Sustained yield harvesting
principles ensure that the number of trees cut each year does not exceed the amount of
new growth.
Copyright © 1997, by John Wiley & Sons, Inc.
All rights reserved. Published simultaneously in Canada.
Reproduction or translation of any part of
this work beyond that permitted by Sections
107 and 108 of the 1976 United States Copyright
Act without the permission of the copyright
owner is unlawful. Requests for permission
or further information should be addressed to
the Permissions Department, John Wiley & Sons, Inc.
Library of Congress Cataloging-in-Publication Data:
Shampine, Lawrence
Fundamentals of numerical computing / Richard Allen, Steve
Pruess, Lawrence Shampine.
p. cm.
Includes bibliographical reference and index.
ISBN 0-471-16363-5 (cloth : alk. paper)
1. Numerical analysis-Data processing. I. Pruess, Steven.
II. Shampine, Lawrence F. III. Title.
QA297.A52 1997
519.4’0285’51—dc20
96-22074
CIP
Printed in the United States of America
10 9 8 7 6 5 4 3 2 1
PRELIMINARIES
The purpose of this book is to develop the understanding of basic numerical meth-
ods and their implementations as software that are necessary for solving fundamental
mathematical problems by numerical means. It is designed for the person who wants
to do numerical computing. Through the examples and exercises, the reader studies the
behavior of solutions of the mathematical problem along with an algorithm for solv-
ing the problem. Experience and understanding of the algorithm are gained through
hand computation and practice solving problems with a computer implementation. It
is essential that the reader understand how the codes provided work, precisely what
they do, and what their limitations are. The codes provided are powerful, yet simple
enough for pedagogical use. The reader is exposed to the art of numerical computing
as well as the science.
The book is intended for a one-semester course, requiring only calculus and a
modest acquaintance with FORTRAN, C, C++, or M ATLAB . These constraints of
background and time have important implications: the book focuses on the problems
that are most common in practice and accessible with the background assumed. By
concentrating on one effective algorithm for each basic task, it is possible to develop
the fundamental theory in a brief, elementary way. There are ample exercises, and
codes are provided to reduce the time otherwise required for programming and debug-
ging. The intended audience includes engineers, scientists, and anyone else interested
in scientific programming. The level is upper-division undergraduate to beginning
graduate and there is adequate material for a one semester to two quarter course.
Numerical analysis blends mathematics, programming, and a considerable amount
of art. We provide programs with the book that illustrate this. They are more than mere
implementations in a particular language of the algorithms presented, but they are not
production-grade software. To appreciate the subject fully, it will be necessary to study
the codes provided and gain experience solving problems first with these programs and
then with production-grade software.
Many exercises are provided in varying degrees of difficulty. Some are designed
to get the reader to think about the text material and to test understanding, while others
are purely computational in nature. Problem sets may involve hand calculation, alge-
braic derivations, straightforward computer solution, or more sophisticated computing
exercises.
The algorithms that we study and implement in the book are designed to avoid
severe roundoff errors (arising from the finite number of digits available on computers
and calculators), estimate truncation errors (arising from mathematical approxima-
tions), and give some indication of the sensitivity of the problem to errors in the data.
In Chapter 1 we give some basic definitions of errors arising in computations and
study roundoff errors through some simple but illuminating computations. Chapter 2
deals with one of the most frequently occurring problems in scientific computation,
the solution of linear systems of equations. In Chapter 3 we deal with the problem of
V
878513247.002.png
vi
PRELIMINARIES
interpolation, one of the most fundamental and widely used tools in numerical com-
putation. In Chapter 4 we study methods for finding solutions to nonlinear equations.
Numerical integration is taken up in Chapter 5 and the numerical solution of ordinary
differential equations is examined in Chapter 6. Each chapter contains a case study
that illustrates how to combine analysis with computation for the topic of that chapter.
Before taking up the various mathematical problems and procedures for solving
them numerically, we need to discuss briefly programming languages and acquisition
of software.
PROGRAMMING LANGUAGES
The FORTRAN language was developed specifically for numerical computation and
has evolved continuously to adapt it better to the task. Accordingly, of the widely
used programming languages, it is the most natural for the programs of this book. The
C language was developed later for rather different purposes, but it can be used for
numerical computation.
At present FORTRAN 77 is very widely available and codes conforming to the
ANSI standard for the language are highly portable, meaning that they can be moved
to another hardware/software configuration with very little change. We have chosen
to provide codes in FORTRAN 77 mainly because the newer Fortran 90 is not in wide
use at this time. A Fortran 90 compiler will process correctly our FORTRAN 77
programs (with at most trivial changes), but if we were to write the programs so as
to exploit fully the new capabilities of the language, a number of the programs would
be structured in a fundamentally different way. The situation with C is similar, but
in our experience programs written in C have not proven to be nearly as portable as
programs written in standard FORTRAN 77. As with FORTRAN, the C language has
evolved into C++, and as with Fortran 90 compared to FORTRAN 77, exploiting fully
the additional capabilities of C++ (in particular, object oriented programming) would
lead to programs that are completely different from those in C. We have opted for a
middle ground in our C++ implementations.
In the last decade several computing environments have been developed. Popular
ones familiar to us are M ATLAB [l] and Mathematica [2]. M ATLAB is very much in
keeping with this book, for it is devoted to the solution of mathematical problems by
numerical means. It integrates the formation of a mathematical model, its numerical
solution, and graphical display of results into a very convenient package. Many of the
tasks we study are implemented as a single command in the M ATLAB language. As
M ATLAB has evolved, it has added symbolic capabilities. Mathematica is a similar
environment, but it approaches mathematical problems from the other direction. Orig-
inally it was primarily devoted to solving mathematical problems by symbolic means,
but as it has evolved, it has added significant numerical capabilities. In the book we
refer to the numerical methods implemented in these widely used packages, as well
as others, but we mention the packages here because they are programming languages
in their own right. It is quite possible to implement the algorithms of the text in these
languages. Indeed, this is attractive because the environments deal gracefully with a
number of issues that are annoying in general computing using languages like FOR-
TRAN or C.
Zgłoś jeśli naruszono regulamin