ebook img

Microcomputer Modelling by Finite Differences PDF

137 Pages·1986·8.436 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 Microcomputer Modelling by Finite Differences

Microcomputer Modelling by Finite Differences Other Macmillan titles of related interest Ian O. Angell Advanced Graphics with the IBM Personal Computer Ian O. Angell and Brian J. Jones Advanced Graphics with the BBe Model B Microcomputer A. N. Barrett and A. L. Mackay Spatial Structures and the Microcomputer G. P. McKeown and V. J. Rayward-Srnith Mathematics for Computing Microcomputer Modelling by Finite Differences Gordon Reece Department of Engineering Mathematics University of Bristol M MACMILLAN © Gordon Reece 1986 All rights reserved. No reproduction, copy or transmission of this publication may be made without written permission. No paragraph of this publication may be reproduced, copied or transmitted save with written permission or in accordance with the provisions ofthe Copyright Act 1956 (as amended). Any person who does any unauthorised act in relation to this publication may be liable to criminal prosecution and civil claims for damages. First published 1986 Published by MACMILLAN EDUCATION LTD Houndmills, Basingstoke, Hampshire RG21 2XS and London Companies and representatives throughout the world Typeset by TecSet Ltd, Wallington, Surrey British Library Cataloguing in Publication Data Reece, Gordon Microcomputer modelling by finite differences. 1. Differential equations - Data processing 2. Mathematical physics - Date processing I. Title 530.1'5535 QC20.7.D5 ISBN 978-0-333-42692-0 ISBN 978-1-349-09051-8 (eBook) DOI 10.1007/978-1-349-09051-8 Associated software diskette (see end of book) ISBN 978-0-333-43937-1 For Nesta - who encouraged me to start this book and who would have loved to see it finished - for Miriam, Helen and David Contents Preface be 1 Introduction: What this Book is about 1 1.1 Why numerical methods? 1 1.2 The problems we shall solve 3 1.3 The computer program 4 2 The Finite-difference Method 7 2.1 Finite-difference methods 7 2.2 Second-order problems 13 2.3 The general second-order problem 18 2.4 Graphics 21 3 Convergence and Divergence 25 3.1 Convergence 25 3.2 Divergence 27 3.3 A cautionary tale 27 3.4 Solving systems of linear equations 29 4 Better Solution Methods 33 4.1 The general problem 33 4.2 The algorithm - a smart trick 34 4.3 The program revisited 36 4.4 A neater algorithm 40 4.5 Gradient boundary conditions 42 5 Further Improvements 45 5.1 Non-constant coefficients 45 5.2 Gradients at the boundaries 46 5.3 The non-uniform grid 47 5.4 The fmite-difference equations 48 6 More Ambitious Applications: The Heat Equation 51 6.1 Background 51 6.2 A simple form of the equation 54 6.3 The finite-difference form 54 Contents vii 7 Two-dimensional Phenomena - a Glimpse of Reality S9 7.1 Heat conduction in two dimensions 59 7.2 Deriving the heat equation 60 7.3 The fmite-difference form of the equation 62 7.4 The model of kpN etc. 62 7.5 Boundary conditions 64 Adiabatic boundary 64 Fixed-temperature boundaries 64 Finite heat transfer at the boundaries 65 Gradient-type boundary conditions 66 8 The THC (Transient Heat Conduction) Computer Program 68 8.1 Introduction 68 8.2 The MAIN control segment (1-999) 69 8.3 The START subroutine (1000-1999) 72 8.4 The PHYS subroutine (2000-2999) 75 8.5 The EDGE subroutine (3000-3999) 76 8.6 The WORK subroutine (4000-4999) 78 8.7 The PLOT subroutine (5000-5999) and the DRAW subroutine (9000-9999) 82 9 Elementary Applications of the THC Program 84 9.1 Introduction 84 9.2 One-dimensional problems 84 9.2.1 Fixed temperatures at two ends of an insulated bar (RUN 9.1) 84 9.2.2 Fully-developed laminar flow between parallel plates (Couette flow) (RUN 9.2) 85 9.2.3 Flow in a circular pipe (poiseuille flow) (RUN 9.3) 86 9.2.4 The distribution of heat in an annular cylinder (RUNS 9.4 and 9.5) 87 9.2.5 Cylindrical annulus with heat source (RUN 9.6) 88 9.3 Two-dimensional problems 88 9.3.1 The superposition principle (RUN 9.7) 88 9.3.2 Fully-developed laminar flow in a rectangular-sectioned duct 89 9.3.3 The electric potential inside an infmite box 90 10 Further Applications of the THC Program 98 10.1 Update to allow for further modifications 98 10.2 Applications with standard-type boundary conditions 100 10.2.1 Rectangular intrusion 100 10.2.2 Hollow square 100 10.2.3 Non-uniform conductivity 101 10.3 Non-standard boundary conditions 101 viii Contents 10.3.1 Specified-gradient boundary conditions 101 10.3.2 Sine wave along an edge 101 10.4 Modifications to the contour plot: standardised contours 102 10.5 Epilogue 102 Appendix: Full Listing of the THC Program for the IBM PC (Apple II modifications listed in REM statements) 115 Index 124 Details of associated software diskette 126 Preface Mathematics should be fun. Too many maths teachers spend their time convincing their pupils that maths is boring - and that it is difficult. I was lucky enough to be taught by people who enjoyed maths and who showed me how to enjoy it. One of the most exciting things that has happened in my life-time has been the spread of knowledge and the removal of the mystique that used to surround the possession of some items of knowledge. I do not mean just particle physics or the structure of the earth's core - I mean things like how to mend a burst pipe, service a car, buy a house or deal with the taxman. A new generation of people has grown up that is not afraid to try things out for itself. Teachers and publishers have a duty to provide people with books showing them how things are done. 'Experts' have been reluctant to do this in the past - probably because they were afraid that their expertise would be seen to be pretty trivial once any one could use it. The usual excuse was that people might misuse the information - well, that is our right. Probably the greatest single liberator of the intellectual curiosity of ordinary people will be the microcomputer. It is possible to buy a perfectly good computer today for less than the cost of a new suit. With it there will usually come an excellent manual on BASIC. Such computers can be used for playing games, but far more excitingly they can be used to illustrate - even to solve - some prob lems in maths that would have been virtually impossible to undertake when I was born. We have not even begun to explore the real capabilities of the smallest com puters - in maths or in the physical and social sciences. Some attempts have been made to use computers in teaching, and a whole area of study (CAL: Computer Assisted Learning) exists, but CAL is probably only in its babyhood and has yet to reach its infancy. This book takes subjects that have never been tackled in schools and are hardly covered in undergraduate courses. Using the simplest (or anyway the most popular) computer language, BASIC, and a knowledge of maths little beyond O-level, it illustrates most of the ideas with computer programs that can be run on most microcomputers. You will obviously have to make occasional slight modifications to handle the variations in BASIC dialects. The spirit of this book is, I hope, entirely in keeping with the ideal of making the maths in it be fun. I enjoy it and hope you will too. The subjects covered are fmite-difference methods and how they can be used to solve real problems in physics and engineering. be

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.