cc - california institute of...

13

Upload: hoangnga

Post on 25-May-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

Ph~:1s:p note

cc:

and ModelingChemical Engineers

Mark E.. DavisVirginia Polytechnic Institute and State University

New York ChichesterJohn Wiley &.. Sons

Brisbane Toronto Singapore

Copyright © 1984, by John Wiley & Sons, Inc.

All rights reserved. Published simultaneously in Canada.

Reproduction or translation of any part ofthis work beyond that permitted by Sections107 and 108 of the 1976 United States CopyrightAct without the permission of the copyrightowner is unlawful. Requests for permissionor further information should be addressed tothe Permissions Department, John Wiley & Sons.

Library of Congress Cataloging in Publication Data:

Davis, Mark E.Numerical methods and modeling for chemical

engineers.

Bibliography: p.Includes index.

1. Chemical engineering-Mathematical models.2. Differential equations. 1. Title.

TP155.D33 1984ISBN 0-471-88761-7

660.2'8'0724 83-21590

Printed in the United States of America

10 9 8 7 6 5 4 3 2 1

To Mary Margaret

Preface

This book is an introduction to the quantitative treatment of differential equa­tions that arise from modeling physical phenomena in the area of chemicalengineering. It evolved from a set of notes developed for courses taught atVirginia Polytechnic Institue and State University.

An engineer working on a mathematical project is typically not interestedin sophisticated theoretical treatments, but rather in the solution of a model andthe physical insight that the solution can give. A recent and important tool inregard to this objective is mathematical software-preprogrammed, reliablecomputer subroutines for solving mathematical problems. Since numerical meth­ods are not infallible, a "black-box" approach of using these subroutines can bedangerous. To utilize software effectively, one must be aware of its capabilitiesand especially its limitations. This implies that the user must have at least anintuitive understanding of how the software is designed and implemented. Thus,although the subjects covered in this book are the same as in other texts, thetreatment is different in that it emphasizes the methods implemented in com­mercial software. The aim is to provide an understanding of how the subroutineswork in order to help the engineer gain maximum benefit from them.

This book outlines numerical techniques for differential equations that eitherillustrate a computational property of interest or are the underlying methods ofa computer software package. The intent is to provide the reader with sufficientbackground to effectively utilize mathematical software. The reader is assumedto have a basic knowledge of mathematics, and results that require extensivemathematical literacy are stated with proper references. Those who desire to

vii

viii Preface

delve deeper into a particular subject can then follow the leads given in thereferences and bibliographies.

Each chapter is provided with examples that further elaborate on the text.Problems at the end of each chapter are aimed at mimicking industrial mathe­matics projects and, when possible, are extensions of the examples in the text.These problems have been grouped into two classes:

Class 1: Problems that illustrate direct numerical application of the formulasin the text.

Class 2: Problems that should be solved with software of the type describedin the text (designated by an asterisk after the problem number).

The level of this book is introductory, although the latest techniques arepresented. The book can serve as a text for a senior or first-year graduate levelcourse. At Virginia Polytechnic Institute and State University I have successfullyused this material for a two-quarter sequence of first-year graduate courses. Inthe first quarter ordinary differential equations, Chapter 1 to 3, are covered.The second quarter examines partial differential equations using Chapters 4 and5.

I gratefully acknowledge the following individuals who have either directlyor indirectly contributed to this book: Kenneth Denison, Julio Diaz, Peter Mer­cure, Kathleen Richter, Peter Rony, Layne Watson, and John Yamanis. I amespecially indebted to Graeme Fairweather who read the manuscript and pro­vided many helpful suggestions for its improvement. I also thank the Departmentof Chemical Engineering at Virginia Polytechnic Institute and State Universityfor its support, and I apologize to the many graduate students who sufferedthrough the early drafts as course texts. Last, and most of all, my sincerestthanks go to Jan Chance for typing the manuscript in her usual flawless form.

I dedicate this book to my wife, who uncomplainingly gave up a portion ofher life for its completion.

Mark E. Davis

Chapter 1 Initial-Value Problems forOrdinary Differential Equations 1

Introduction 1Background 1

Explicit Methods 3Stability 8Runge-Kutta Methods 11Implicit Methods 19Extrapolation 11Multistep Methods 14High-Order Methods Based on Knowledge 18of allayStiffness 19Systems of Differential E.quations 31Step-Size Strategies 36Mathematical Software 37Problems 44References 49Bibliography 51

ix

x

Chapter 2

Chapter 3

Boundary-Value Problemsfor Ordinary DifferentialEquations: Discrete Variable Methods

IntroductionBackgroundInitial-Value Methods

Shooting MethodsMultiple ShootingSuperposition

finite Difference MethodsLinear Second-Order EquationsFlux Boundary ConditionsIntegration MethodNonlinear Second-Order EquationsFirst-Order SystemsHigher-Order Methods

Mathematical SoftwareProblemsReferencesBibliography

Boundary-Value Problemsfor Ordinary DifferentialEquations: finite Element Methods

IntroductionBackgroundPiecewise Polynomial FunctionsThe Galerkin Method

Nonlinear EquationsInhomogeneous Dirichletand Flux Boundary ConditionsMathematical Software

CollocationMathematical Software

ProblemsReferencesBibliography

Contents

53

5353545463656768717579838587919395

97

979799104109

110111112119123125126

Contents

Chapter 4

Chapter 5

Parabolic Partial DifferentialEquations in One Space Variable

IntroductionClassification ofPartial Differential EquationsMethod of Linesfinite Differences

Low-Order Time ApproximationsThe Theta MethodBoundary and Initial ConditionsNonlinear EquationsInhomogeneous MediaHigh-Order Time Approximations

Finite ElementsGalerkinCollocation

Mathematical SoftwareProblemsReferencesBibliography

Partial DifferentialEquations in Two Space Variables

127

127

127128130130133135140142147154154158162167172174

177

Introduction 177Elliptic PDEs-Finite Differences 177

Background 177Laplace's Equation in a Square 178

Dirichlet Problem 178Neumann Problem 179Robin Problem 180

Variable Coefficients and Nonlinear Problems 184Nonuniform Grids 185Irregular Boundaries 190

Dirichlet Condition 190Normal Derivative Conditions 191

Elliptic PDEs-finite Elements 192Background 192Collocation 194Gakr~n 200

xli

Appendices

Parabolic PDEs in Two Space VariablesMethod of LinesAlternating Direction Implicit Methods

Mathematical SoftwareParabolicsElliptics

ProblemsReferencesBibliography

Contents

211211212214215219222224227

A: Computer Arithmetic and Error Control 229Computer Number System 229Normalized Floating Point Number System 230Round-Off Errors 230

B: Newton's Method 235C: Gaussian Elimination 237

Dense Matrix 237Tridiagonal Matrix 241

D: B-Splines 243E: Iterative Matrix Methods 247

Appendix References 249

Author Index 251

Subject Index 255

Numerical Methodsand Modeling

for Chemical Engineers