This book is for people who need to solve ordinary differential equations (ODEs), both initial value problems (IVPs) and boundary value problems (BVPs) as well as delay differential equations (DDEs). These topics are usually taught in separate courses of length one semester each, but Solving ODEs with MATLAB provides a sound treatment of all three in about 250 pages. The chapters on each of these topics begin with a discussion of “the facts of life” for the problem, mainly by means of examples. Numerical methods for the problem are then developed – but only the methods most widely used. Although the treatment of each method is brief and technical issues are minimized, the issues important in practice and for understanding the codes are discussed. Often solving a real problem is much more than just learning how to call a code. The last part of each chapter is a tutorial that shows how to solve problems by means of small but realistic examples.
About the Authors
L. F. Shampine is Clements Professor of Applied Mathematics at Southern Methodist University in Dallas, Texas. I. Gladwell is Professor of Mathematics at Southern Methodist University in Dallas, Texas. S. Thompson is Professor of Mathematics at Radford University in Radford, Virginia.
This book distills decades of experience helping people solve ODEs. The authors accumulated this experience in industrial and laboratory settings that include NAG (Numerical Algorithms Group), Babcock and Wilcox Company, Oak Ridge National Laboratory, Sandia National Laboratories, and The MathWorks – as well as in academic settings that include the University of Manchester, Radford University, and Southern Methodist University. The authors have contributed to the subject by publishing hundreds of research papers, writing or editing a half-dozen books, editing leading journals, and writing mathematical software that is in wide use. With associates at The MathWorks, Inc., they wrote all the programs for solving ODEs in Matlab, programs that are the foundation of this book.
Preface page vii
1 Getting Started 1
1.1 Introduction 1
1.2 Existence, Uniqueness, andWell-Posedness 6
1.3 Standard Form 19
1.4 Control of the Error 27
1.5 Qualitative Properties 34
2 Initial Value Problems 39
2.1 Introduction 39
2.2 Numerical Methods for IVPs 40
2.2.1 One-Step Methods 41
2.2.2 Methods with Memory 57
2.3 Solving IVPs in Matlab 81
2.3.1 Event Location 92
2.3.2 ODEs Involving a Mass Matrix 105
2.3.3 Large Systems and the Method of Lines 114
2.3.4 Singularities 127
3 Boundary Value Problems 133
3.1 Introduction 133
3.2 Boundary Value Problems 135
3.3 Boundary Conditions 138
3.3.1 Boundary Conditions at Singular Points 139
3.3.2 Boundary Conditions at Infinity 146
3.4 Numerical Methods for BVPs 156
3.5 Solving BVPs in Matlab 168
4 Delay Differential Equations 213
4.1 Introduction 213
4.2 Delay Differential Equations 214
4.3 Numerical Methods for DDEs 217
4.4 Solving DDEs in Matlab 221
4.5 Other Kinds of DDEs and Software 247
This book is for people who want to solve ordinary differential equations (ODEs), both initial value problems (IVPs) and boundary value problems (BVPs) as well as delay differential equations (DDEs). Solving ODEs withMATLAB is a text for a one-semester course for upper-level undergraduates and beginning graduate students in engineering, science, and mathematics. Prerequisites are a first course in the theory of ODEs and a survey course in numerical analysis. Implicit in these prerequisites is some programming experience, preferably in Matlab, and some elementary matrix theory. Solving ODEs withMATLAB is also a reference for professionals in engineering, science, and mathematics. With it they can quickly obtain an understanding of the issues and see example problems solved in detail. They can use the programs supplied with the book as templates.
It is usual to teach the three topics of this book at an advanced level in separate courses of one semester each. Solving ODEs with MATLAB provides a sound treatment of all three topics in about 250 pages. This is possible because of the focus and level of the treatment.
The book opens with a chapter called Getting Started. Next is a chapter on IVPs. These two chapters must be studied in order, but the remaining two chapters (on BVPs and DDEs) are independent of one another. It is easy to cover one of these chapters in a one-semester course, but the preparation and sophistication of the students will determine whether it is possible to do both. The chapter on DDEs can be covered more quickly than the one on BVPs because only one approach is taken up and it is an extension of methods studied in the chapter on IVPs. Each chapter begins with a discussion of the “facts of life” for the problem, mainly by means of examples. Numerical methods for the problem are then developed – but only the methods most widely used. Although the treatment of each method is brief and technical issues are minimized, the issues important in practice are discussed. Often solving a real problem is much more than just learning how to call a code. The last part of the chapter is a tutorial that shows how to solve problems by means of small but realistic examples.
Although quality software in general scientific computing is discussed, all the examples and exercises are solved in Matlab. This is most advantageous because Matlab (2000) has become an extremely important problem-solving environment (PSE) for both teaching and research. The solvers of Matlab are unusually capable. Moreover, they have a common design and “feel” that make it easy to learn how to use them. Matlab is such a high-level language that programs are short. This makes it possible to provide complete programs in the text for all the examples. The programs are also provided in electronic form so that they can be used conveniently as templates for similar problems. In particular, the student is asked to modify some of these programs in exercises. Graphics are a part of this PSE, so solutions are typically studied by plotting them. Matlab has some symbolic algebra capabilities by virtue of a Maple kernel (Maple 1998).
Solving ODEs with MATLAB exploits these capabilities in the analysis and solution of some of the examples and exercises. There is an Instructor’s Manual with solutions for all the exercises. Most of these solutions involve a program, which is available to instructors in electronic form.
The first ODE solver of Matlab was based on a FORTRAN program written by Larry Shampine and H.A. (Buddy)Watts. For Matlab 5, Cleve Moler initiated a long and productive relationship between Shampine and The MathWorks. A research and development effort by Shampine and Mark Reichelt (1997) resulted in the Matlab ODE Suite. The ODE Suite has evolved considerably as a result of further work by Shampine, Reichelt, and Jacek Kierzenka (1999) and the evolution of Matlab itself. In particular, some of the IVP solvers were given the ability to solve differential algebraic equations (DAEs) of index 1 arising from singular mass matrices. Subsequently, Kierzenka and Shampine (2001) added a program for solving BVPs. Most recently, Skip Thompson, Shampine, and Kierzenka added a program for solving DDEs with constant delays (Shampine & Thompson 2001). We mention this history in part to express our gratitude to Cleve, Mark, and Jacek for the opportunity to work with them on software for this premier PSE and also to make clear that we have a unique understanding of the software that underlies Solving ODEs with MATLAB.
Each of us has decades of experience solving ODEs in both academic and nonacademic settings. In this we have contributed to the subject well over 200 papers and half a dozen books, but we have long wanted to write a book that makes our experience in advising people on how to solve ODEs available to a wider audience. Solving ODEs with MATLAB is the fulfillment of that wish. We appreciate the help provided by many experts who have commented on portions of the manuscript. Wayne Enright and Jacek Kierzenka have been