ebook img

An introduction to numerical methods with Pascal PDF

316 Pages·19.741 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 An introduction to numerical methods with Pascal

An Introduction to Numerical Methods with Pascal L.V. Atkinson & RJ. Harley procedure Newton (function f{x ; real):.real; function fdashed (x : real) : real; xO, xtol: real; maxits : posints; var root,fatroot: real; var noofits : posints; var outcome ; newtoutcomes); const assumedzero = IE-20; var state : newtstates; x, oldx,fx,fdx : real; itcount: 0 ... max in t; begin x:=xO; fx: = f(x); itcount : = 0; state := iterating; repeat if abs(x) <= assumedzero then state := toonearzero else begin itcount := itcount + 1; fdx : = fdashed (x); if abs(fdx) < assumedzero then state : = tooflat else begin oldx : = x; x : = x — fx/fdx; fx : = f(x); if abs( (x-oldx)loldx) < = xtol then state : = withintol else if itcount = maxits then state : = maxitsreached end end until state <> iterating; outcome ; = state; noofits := itcount; root ;= x; fatroot: = fx end { Newton }; INTERNATIONAL COMPUTER SCIENCE SERIES - . fYed Me t&T CH-ot) an introduction to NUMERICAL METHODS WITH PASCAL INTERNATIONAL COMPUTER SCIENCE SERIES Consulting editors A D McGettrick University of Strathclyde J van Leeuwen University of Utrecht an introduction to NUMERICAL METHODS WITH PASCAL L. V. ATKINSON P. J. HARLEY ADDISON-WESLEY PUBLISHING COMPANY London • Reading, Massachusetts • Menlo Park, California • Amsterdam Don Mills, Ontario • Manilla • Singapore • Sydney • Tokyo ® 1983 Addison-Wesley Publishers Limited All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without prior written permission of the publisher. Phototypesetting by Parkway Group, London and Abingdon Printed in Finland by Soderstrbm Osakeyhtio, Member of Finnprint British Library Cataloguing in Publication Data Atkinson, Laurence An introduction to numerical methods with Pascal. (International computer science series; 6) 1. Numerical analysis—Data processing 2. PASCAL (Computer program language) I. Title II. Harley, P. J. III. Series 519.4 QA297 ISBN 0-201-13788-7 Library of Congress Cataloging in Publication Data Atkinson, Laurence. An introduction to numerical methods with Pascal. (The International computer science series) Bibliography; p. Includes index. 1. Numerical analysis—Data processing. 2. PASCAL (Computer program language) I. Harley, P. J. 1948- . II. Title. III. Series. QA297.A85 1983 519.4'028'5424 83-2520 ISBN 0-201-13788-7 BCDEF 8987654 To ANNE and JENNIFER PREFACE At the University of Sheffield, as at many other universities, numerical analysis is a major topic in undergraduate mathematics. Students are ex¬ pected to carry out some hand calculations to acquire a basic understanding of numerical methods and, in order to solve more taxing problems and gain a deeper insight into the application of the methods, are also expected to implement them on a computer. The main undergraduate programming language at Sheffield is Pascal and it has been our experience that students find difficulty in making the change from writing the programs expected in a general purpose Pascal programming course to writing programs for numerical methods. In this book, it is our intention to introduce some of the numerical methods forming the basis of those in current use, together with their implementation in Pascal. Rather than simply accompany each method by a Pascal routine, we have attempted to integrate programming aspects with the descriptions of the methods. All routines in the book are stored in a library file and are made available to the students. Copies of this file can be obtained from the authors. We would like to acknowledge the assistance given to us during the preparation of this book. We are deeply indebted to Andrew McGettrick and Jan van Leeuwen, the series editors, for their many suggested improvements to early drafts. Thanks are also due to David ‘Berto’ Windle, of the University of Sheffield, for spotting some mistakes in part of the manuscript and to Jack Lambert of the University of Dundee for several helpful suggestions. An extremely convivial discussion with Jack laid the foundations for Chapter 8; it is obvious from the text that we found invaluable his excellent book on the numerical solution of ordinary differential equations. Any errors, omissions or lack of clarity naturally remain our responsibility and not that of those named above. Figure 6.2 is taken from Fig. 10.5 in ‘Applied Numerical Analysis’ by C. F. Gerald, 1978, Addison-Wesley, Reading, MA, and is reprinted with permission. Finally, on the publishing side, we would like to extend thanks to Alan Whittle for copy editing ‘above and beyond the call of duty’ and to Sarah Mallen and Simon Plumtree for coping promptly with all queries and for maintaining a final submission date which was forever flexible. Sheffield L. V. Atkinson February 1983 P. J. Harley Digitized by the Internet Archive in 2018 with funding from Kahle/Austin Foundation https://archive.org/details/introductiontonu00atki_0

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.