COMPUTATIONAL METHODS IN ENGINEERING BOUNDARY VALUE PROBLEMS
This is Volume 145 in MATHEMATICS IN SCIENCE AND ENGINEE...
139 downloads
1680 Views
4MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
COMPUTATIONAL METHODS IN ENGINEERING BOUNDARY VALUE PROBLEMS
This is Volume 145 in MATHEMATICS IN SCIENCE AND ENGINEERING A Series of Monographs and Textbooks Edited by RICHARD BELLMAN, University of Southern California The complete listing of books in this series is available from the Publisher upon request.
COMPUTATIONAL METHODS IN ENGINEERING BOUNDARY VALUE PROBLEMS T.Y.Na Department of Mechanical Engineering University of Michigan-Dearborn Dearborn, Michigan
@
1979
ACADEMIC PRESS
A Subsidiary of Harcourt Brace Jovanovich, Publishers
New York London Toronto Sydney San Francisco
©
COPYRIGHT 1979, BY ACADEMIC PRESS, INC. ALL RIGHTS RESERVED. NO PART OF THIS PUBLICATION MAY BE REPRODUCED OR TRANSMITTED IN ANY FORM OR BY ANY MEANS, ELECTRONIC OR MECHANICAL, INCLUDING PHOTOCOPY, RECORDING, OR ANY INFORMATION STORAGE AND RETRIEVAL SYSTEM, WITHOUT PERMISSION IN WRITING FROM THE PUBLISHER.
ACADEMIC PRESS, INC. I II Fifth Avenue, New York, New York 10003
United Kingdom Edition published by ACADEMIC PRESS, INC. (LONDON) LTD. 24/28 Oval Road. London NWI 7DX
Library of Congress Cataloging in Publication Data Na, Tsung Yen. Computational methods in engineering boundary value problems. (Mathematics in science and engineering; v. Includes bibliographies and index. 1. Boundary value problems--Numerical solutions. I. Title. II. Series. TA347.B69N3 515'.35 79-51682 ISBN 0-12-512650-6
PRINTED IN THE UNITED STATES OF AMERICA
79 80 81 82
987654321
CONTENTS
Preface
CHAPTER
IX
1
Introduction
1.1
Introduction Methods of Solution Numerical Integration of Initial Value Problems Concluding Remarks References
1.2 1.3
1.4
CHAPTER
2
Method of Superposition
2.1 2.2
Introduction Reduction of Linear Boundary Value Problems to Initial Value Problems Reduction of Third-Order Boundary Value Problems to Initial Value Problems Concluding Remarks Problems References
2.3 2.4
CHAPTER
3
Method of Chasing
3.1 3.2
Introduction Derivation of Equations of Chasing By JonesSecond-Order Differential Equations Application of the Method Third-Order Differential Equations
3.3 3.4
I
3 7 II II
13 13
21 25 27
28
30 31 32 42 v
vi
CHAPTER
CHAPTER
CHAPTER
Contents
3.5
Concluding Remarks Problems References
4
The Adjoint Operator Method
4.1 4.2 4.3 4.4
Introduction Second-Order Differential Equations Third-Order Differential Equations Concluding Remarks Problems References
5
Iterative Methods-The Shooting Methods
5.1 5.2 5.3 5.4 5.5
Introduction Newton's Method Parallel Shooting Quasi Linearization Concluding Remarks Problems References
6
Iterative MethodsThe Finite-Difference Method
6.1 6.2 6.3
Introduction Finite Differences Solution of Boundary Value Problems by Finite Difference Second-Order Differential Equations Third-Order Differential Equations First-Order System and Newton's Method Concluding Remarks Problems References
6.4 6.5 6.6 6.7
CHAPTER
7
Method of TransformatlonDirect Transformation
7.1 7.2
Introduction Transformation for a Given Group of Transformations
48 49 51
52 54 62 65 66 69
70 71 76 84 90 91 92
93 93 96 98 107 126 132 134 135
137 143
Contents
vII
7.3 7.4
CHAPTER
8
Method of TransformatlonReduced Physical Parameters
8.1 8.2 8.3
Introduction Reduced Physical Parameters Application to Simultaneous Differential Equations Application to an Eigenvalue Problem Concluding Remarks Problems References
8.4 8.5
CHAPTER
9
Method of TransformatlonInvarlance of Physical Parameters
9.1 9.2
Introduction Boundary Value Problem with Two or More Parameters Systematic Search of Multiple Solutions Thin Struts with Large Elastic Displacement Problems References
9.3 9.4
CHAPTER
Extension of the Transformation Method for a Given Group of Transformations Uniqueness of the Solution Problems References
10
Method of Parameter Differentiation
10.1 10.2 10.3
Introduction Nonlinear Algebraic Equations Parameter Differentiation Applied to Differential Equations Application to Simultaneous Equations The General Parameter Mapping (GPM) of Kubicek and Hlavecek Method of Continuation of Roberts and Shipman Concluding Remarks Problems References
10.4 10.5 10.6 10.7
155 165 173 174
177 177 192 197 202 204 206
208 209 221 221 231 232
233 234 246 252 260 264 267 267 270
Contents
vIII CHAPTER
CHAPTER
Index
11
Method of Invariant Imbedding
11.1 11.2 11.3 11.4 11.5 11.6
Introduction Concept of Invariant Imbedding Isothermal Packed-Bed Chemical Reactor Radiation Fins Solution of Falkner-Skan Equation Concluding Remarks Problems References
12
Integral Equation Method
12.1 12.2 12.3 12.4
Introduction Linear Boundary Value Problems Nonlinear Boundary Value Problems Concluding Remarks Problems References
272
273 275 279 280 286 286 288
289 290 298 303 304
305 307
PREFACE
Two-point boundary value problems occur in all branches of engineering and science. In these problems the boundary conditions are specified at two points. To complicate the matter, the governing differential equations for a majority of such problems are nonlinear; since analytic solutions do not in general exist, solutions have to be obtained by numerical methods. Methods for the numerical solution of such problems can be separated into two groups, the iterative and the noniterative methods. For linear boundary value problems, solutions can always be obtained noniteratively. For nonlinear problems, iteration is usually needed. It should be emphasized however that there are many methods by which iteration of the solution can be eliminated, thus resulting in considerable savings in computation time. Three chapters in this book are devoted to iterative methods, including the shooting method, the finite-difference method, and the integral equation method. A total of six noniterative methods will be given. Following the order of presentation, these are the methods of superposition, chasing, adjoint operators, transformation, parameter differentiation, and invariant imbedding. This book is written for engineers and scientists who are interested in obtaining numerical solutions of boundary value problems in their particular fields. Emphasis is therefore placed on the computational instead of the mathematical aspects of the methods. All are presented in sufficient detail that the reader can follow through the examples and duplicate the numerical results, which are all tabulated. The author has therefore deviated from the axiomatic approach adopted in some other textbooks written by mathematicians. The intuitive approach presented here should be of greater help to those engineers and scientists whose principal need is the application of these methods, and not the mathematical theory. Learning the logical sequence of steps and trying them on the computer are the only ways to acquire a numerical technique. From the point of view of an Ix
x
Preface
educator the material covered in this book should occupy as important a place in a modern engineering curriculum as did the method of separation of variables a few years ago. It is difficult to acknowledge all the help given to the author in the preparation of this book. Above all, I thank Professor D. S. Jones, of the University of Dundee, who reviewed the manuscript twice, made many valuable suggestions, and was instrumental in the final publication of this book. Dr. Tuncer Cebeci of Douglas Aircraft Company provided constant encouragement and frequent help during the course of the work. This book was influenced by many useful discussions over the years with Dr. A. G. Hansen, President of Purdue University, who, in the successive roles of teacher, colleague, and friend, has initiated and greatly supported my interest in the general area of applied mathematics. I appreciate greatly the detailed comments of a reviewer for Academic Press. Thanks are also due to Professors I. S. Habib and G. M. Kurajian, both of the University of Michigan-Dearborn, for their considerable advice and administrative assistance. Last, but certainly not least, I wish to thank my wife, HwaSung, and our children, Arthur, Helen, and Patricia, for their understanding and encouragement and for the long hours they had to endure when, during the course of this work, I had to be away from them. TSUNG-YEN
NA
CHAPTER
1
INTRODUCTION
1.1
INTRODUCTION
The aim of this book is to describe in detail various methods for the solution of linear and nonlinear boundary value problems. A boundary value problem differs from an initial value problem in that the boundary conditions are specified at more than one point and in that solutions of the differential equation over an interval, satisfying the boundary conditions at the end points, are required. Consider, for example, the following boundary value problem: d
2T
dx 2
+
P dT X
dx
dT(O)
+ f( T) = 0,
d;-=O,
T(l)=l
(1.1)
which results from an analysis of the heat conduction through a solid with heat generation. The function f(T) represents the heat generation within the solid; this, in general, is a function of the local temperature T. The constant p is equal to 0, 1, or 2 depending on whether the solid is a plate, a cylinder, or a sphere. We shall now discuss the solutions of Eq. (1.1) for different values of p and f(T). A simple case occurs when the solid is a flat plate with constant heat generation, i.e.,
p=O
and
f(T)=q/k
where k is the heat conductivity and q is the heat generation per unit volume. Equation (1.1) then becomes dT(O)
d;- = 0, T(l) = 1
(1.2)
which is a linear differential equation with constant coefficients. The solution of this problem is simple and is reduced to the determination of 1
1. Introducllon
2
the two integration constants by the two algebraic equations which result from the two boundary conditions. The analytic solution of Eq. (1.2) is
T= -(qj2k)x 2+ C\x+ C2 The two algebraic equations for the determination of C\ and C2 are obtained from the two boundary conditions, which are
-(qj2k) + C 1 + C2 = I
and
The temperature distribution is therefore
T = I + (qj2k)(1 - x 2) The two-point nature of the problem enters at the point where the integration constants are determined by a set of algebraic equations. Consider next the case in which the solid is a cylindrical rod and the heat generation is linearly proportional to the temperature T. For this case,
p=l
and
and Eq. (1.1) becomes
2T d +.!. dT + {32T = 0 dx 2 x dx '
dT(O) = 0 dx '
T(l) = I
(1.3)
which is a linear differential equation with variable coefficients, the solution of which becomes complicated. One common method is the power series method. As is well known, the solution of Eq. (1.3) can be written in terms of the Bessel functions as
T= C 1JO({3x) + C2YO({3x) The two boundary conditions give C2
=0
C\J o({3) + C2YO({3) = I
and
which can be solved for C\ and C2 • The final form of the solution is therefore
T(x)
=
J o({3x)jJo({3)
While the series method of solution is standard, there are problems where the application of this method becomes either complicated or impossible. As an example, it is impossible to obtain the solution by the series method if the coefficients are solved from another differential equation (see, e.g., Section 2.2.2). For such cases, recourse must be made to numerical methods.
3
1.2 Methods of Solution
As a third example, let us consider the heat conduction through a sphere with heat generation proportional to the exponential of the temperature [l]. For this case, p = 2 and the heat generation is written as
f(T) = a.eT where a. is a constant. Eq. (1.1) then becomes dT(O) --=0 dx '
T(l) = I
(1.4)
The nonlineality of the heat generation term changes the nature of the problem to a nonlinear boundary value problem. For such problems, numerical methods are almost the only choice.
1.2 METHODS OF SOLUTION
We shall be concerned in this book with various methods of solving those linear and nonlinear boundary value problems whose solutions cannot be obtained analytically. Such methods can be classified into two categories, depending on whether or not the method involves an iterative process. They are Iterative methods: 1. Shooting methods (Newton's method, parallel shooting method, and quasi linearization) 2. Finite-difference methods 3. Integral equation method II. Noniterative methods: 1. Method of superposition 2. Method of chasing 3. Method of adjoint operators 4. Method of transformation 5. Parameter differentiation 6. Invariant imbedding I.
The shooting method is sometimes referred to as "the garden hose method." The principle recalls the situation of a gardner with the nozzle of a garden hose in his hand trying to water a distant plant. It usually takes a few adjustments before the jet of water finally hits the target. For a given boundary value problem, the missing initial condition is first assumed, and the resulting initial value problem can then be solved by one of the standard forward integration techniques. For a complete treatment of
4
1.
Introduction
initial value problems, the reader is referred to texts on this subject (e.g., that by Lambert [2]). The accuracy of the assumed initial condition is then checked by the boundary condition at the second point. If this boundary condition is not satisfied, another value may be assumed and the process is repeated again. This process is continued until satisfactory accuracy is achieved. For this kind of iterative method, the natural question is whether or not there is a systematic method by which new values of the missing boundary condition can be chosen so that the solution will rapidly converge to the final solution. Such methods do exist in the literature, and three of them will be presented in Chapter 5, namely Newton's method, the parallel shooting method, and the method of quasi linearization. The finite-difference method for the solution of boundary value problems is perhaps one of the most widely used. This discrete method consists of converting the set of ordinary differential equations into a finite set of algebraic equations by replacing the derivatives of the dependent variables by appropriate finite differences and subsequently solving the resulting algebraic equation to get approximations of the solution at nodal points. For linear boundary value problems, the algebraic equations are linear and the solution can be obtained in one step. For nonlinear boundary value problems, an iterative process is required, since now the problem has to be linearized. One commonly used method is to linearize the differential equation by using such methods as quasi linearization before derivatives are replaced by finite differences. Another approach is to replace derivatives by finite differences; the nonlinear algebraic equations are then linearized by Newton's method. Both techniques will be treated in detail in Chapter 6. In the integral equation method, the boundary value problem is replaced by an integral equation, which in turn is solved by numerical quadrature formulas. The derivation of the equivalent integral equation of a boundary value problem in general involves the determination of the Green function. For linear boundary value problems, the solution can be obtained without iteration. For nonlinear boundary value problems, however, an iteration process is required. This may be achieved by linearizing either the original boundary value problem or the nonlinear integral equation. The method will be treated in Chapter 12. The method of transforming linear boundary value problems to initial value problems by the method of superposition is well known and can be found in such standard texts as Collatz [3]. It is based on the principle of superposition, following which the solution of the boundary value problem is replaced by the solution of two or more initial value problems. Combining these solutions then yields the solution of the original equation. Chapter 2 will briefly summarize this method.
1.2 Methods of Solution
5
Not so well known for the transformation of boundary value problems to initial value problems is the method given in Chapter 3 of chasing, which was developed by Gel'fand and Lokutsiyevskii [4] in the Steklow Mathematics Institute of the Academy of Science U.S.S.R. In this method, the missing boundary condition at the second point is chased by creating a system of new differential equations governing the parameters in the boundary condition and integrating these equations from the first point. Once the missing boundary condition at the second point is found, the required solution can then be chased backward from the second point. The method of the adjoint operator for the solution of linear boundary value problems offers another simple alternative [5]. It is based on the idea that every set of ordinary differential equations is associated with a companion set of ordinary differential equations, known as the adjoint equations, defined as the set of linear ordinary differential equations whose coefficient matrix is the negative transpose of the coefficient matrix of the original set of ordinary differential equations. These adjoint equations provide the link between the initial and the terminal boundary conditions of the original differential equations. Details of this method will be outlined in Chapter 4. The method of transformation bases its concept on an interesting idea, introduced by Toepfer in 1912, of solving Balsius's equation [6] in the boundary layer theory. The successful application of this type of transformation makes one wonder whether it can be applied to other equations. No progress was made for 50 years, until 1962, when Klamkin [7], following the same reasoning, extended this method to many similar types of equations. Major extensions were made possible when the method was reexamined from the point of view of transformation groups by Na [8, 9], in whose work the steps followed were systematized and the missing initial condition was identified as the parameter of the transformation group. From this point of view, Toepfer's [6] and K1amkin's [7] transformations belong to the so-called "linear group" of transformations. By introducing other groups of transformations, the method was seen to be applicable to other types of equations. In addition, equations with boundary conditions specified at finite intervals can also be treated by this method. Details of the above will be treated in Chapter 7. For a complete treatment of the theories of transformation groups, the reader is referred to [10-13]. Although the concept introduced in Chapter 7 is useful, the class of equations which can be treated in this manner was still limited. Many attempts were made to extend the method. The first extension was made for those nonlinear two-point ordinary differential equations where a physical parameter appears either in the differential equation or in the boundary conditions and where solutions for a range of the physical
6
1.
Introduction
parameter are sought. By replacing the physical parameter by a "transformed" parameter, the method developed in Chapter 7 can then be followed. This extended method will be treated in Chapter 8. The extension is of significance since, in most physical problems in which a physical parameter appears in the formulation, it is always of interest to obtain the solutions for the complete range of the physical parameter, instead of a single solution for a particular value of the parameter. Although the extended method given in Chapter 8 greatly extended the range of application of the method, it can treat only problems involving one physical parameter. For problems with more than one parameter, introduction of transformed parameters cannot lead to useful solutions. Apparently, something of a fundamental nature is involved. This point was resolved recently (see, e.g., [14]) by investigating the invariance of the physical parameters under the transformation. As a result, problems with any number of parameters can be solved by this method. Details of this will be given in Chaper 9. Also given in Chapter 9 will be a systematical way of searching for multiple solutions. The method of parameter differentiation in reducing a boundary value problem to an initial value problem has been developed only for a few years, even though the idea was used in other contexts. Basically, the method involves the solution of a differential equation where a physical parameter appears either in the differential equation or in the boundary conditions. Starting with the known solution for a certain value of the parameter, the solution of the differential equation for other values of the parameter may be obtained by integrating the rate of change of the solution with respect to the parameter. Each step in the calculation involves only a small perturbation in the parameter. In this way, the equations solved are linear differential equations which can be solved noniteratively by the methods given in Chapters 2-4. The resulting solution can then be perturbed again, and in such a way the solution for a wide range of the parameter can be constructed without iteration. Chapter 10 gives details of this method. The method of invariant imbedding has a longer history than the methods of transformation and parameter differentiation for the transformation of boundary value to initial value problems. In basic concept this approach differs from the classical ones in that the study of a particular solution of a differential equation is carried out by studying a family of solutions. This may, at first sight, appear to complicate rather than simplify the problem; its justification lies in the fact that a bridge spanning the particular problem and other members of the family is constructed from which the characteristics of the particular member of the family can be obtained by studying the relation between neighboring
1.3 Numerical Integration of Initial Value Problems
7
solutions. Due to the thorough coverage of this method in the literature [15, 16], only a brief treatment will be given in Chapter 11.
1.3
NUMERICAL INTEGRATION OF INITIAL VALUE PROBLEMS
With the exception of Chapters 6, 11, and 12, all the chapters in this book rely heavily on the approximate numerical integration of initial value problems. The reader is therefore assumed to have a certain basic knowledge of this subject. An initial value problem is a differential equation whose boundary conditions are specified at a single point. In a numerical approach the value of the dependent variable and its derivatives are calculated at discrete values of the independent variable. By approximating derivatives by discrete expressions, the solution of an initial value problem can be obtained by "marching" out from the specified initial conditions. Modern computers can give numerical solutions of systems of large numbers of ordinary differential equations, given the complete set of initial conditions, with accuracy and speed. The numerical procedure for the numerical integration of initial value problems may be classified into two groups, namely the one-step and the multistep methods. Let us consider the nth-order ordinary differential equation in) = f(x,y,y',y", ... ,y(n-I»)
(3.1)
subject to the initial conditions
(where in) = d"y/dx n) and divide the interval [xo,xf ] over which the independent variable x is divided into I subintervals. The mesh or step size is given by (3.2)
from which Xi + 1
= Xi + h
(3.3)
To solve an initial value problem means to find approximate values of the dependent variable and its derivatives at the mesh points of the interval [x o' xf] on which the solution is sought. A method is called a one-step method if y/~\ can be calculated with only the knowledge of Yi(v),
i
V
)
8
1. Introduction
The method is therefore self-starting, meaning that only the boundary conditions at the initial point are needed for the evaluation of yfv), y1v),
Y3(v) , .... Two such methods, namely, Taylor's method and the Runge-Kutta method, will be mentioned here. The numerical algorithm of Taylor's method can be written as
(3.4) where
y(v) y(v+ I) ' Tk(V) = Tk(x. ,' I 'I
••• ,
=y~V+I)+.f!-y~V+I)+ 2!
I
I
y(n-I») I
+ •
•
•
n v 2 (n-I) P - I)! Yi
h - -
(n -
(3.5)
It is known that Taylor's method is conceptually very simple. Its difficulty lies in the necessity of taking the partial derivatives of the function f. The numerical algorithm of the Runge-Kutta method is perhaps the most widely used scheme, because of its low truncation error. The most frequently used fourth-order formulas for the numerical integration of Eq. (3.1) can be obtained as follows [3]: Let us assume that the solution of y(s)
(2.20)
where f3 is a constant to be determined. The two initial value problems can then be written as
dO (0)
~
= 0, 0(0) = 0 (2.21)
and
d 2cf> ds
-2
= RNpecf> -
dcf> s
N pe -d '
d~~O)
= 0, cf>(0) = I
(2.22)
The constant f3 in Eq, (2.20) can be determined by the boundary conditions at s = I, which give NpeO(I) + (dO(I)/ ds)
f3
= - N pecf>( I) + (dcf>( I)/ ds)
(2.23)
To illustrate the steps followed in the method, consider the case with Npe = 1.0 and R = 1.0. Integration of Eqs. (2.21) and (2.22) from s = 0 to s = I gives solutions 0 and cf> as functions of s. These solutions are shown in Fig. 2.2. At s = 1, we get
0(1) = -0.3973,
cf>( I) = 1.3972
which can be substituted into Eq, (2.23) to give
f3 = 0.5324 The solution of Eq. (2.17) can therefore be calculated by Eq, (2.20), which is also plotted in Fig. 2.2. No iteration is needed.
18
2.
for
Method of Superposition
e or ¢
1.5
1.0
0.5
0.0
-0.5
Fig. 2.2
2.2.2
Solutions of
(J,
, and
f
(N pe
= 1.0, R = 1.0).
Electrostatic Probe Measurements In Rocket Exhausts
The example given in the preceding section is a second-order differential equation with constant coefficients. The same method can be applied to differential equations with variable coefficients, or even to equations with coefficients whose values are calculated from another equation. We shall now present such a problem, which results from the analysis of flow around an electrostatic probe [3]. In the analysis of the performance of solid-propellant rockets, it was found necessary to measure accurately the distribution of local electron and ion densities in the exhaust plume. The analytical procedure for interpreting probe measurements leads to the following ordinary differential equation for the solution of concentration of charged species:
I+
I
E
+ f3
n.; R
d
2N
d1j2
+j
dN = 0 d1j
(2.24)
The boundary conditions are 1j
= 0: N = 0;
1j=00:
N=I
The independent variable 1j is defined by 1j = y( u 00/ VX)I/2, where U 00 and v are, respectively, the mainstream velocity and viscosity. Also, N is the normalized density of charged species, n / n 00' with nand n 00 representing the number density at any point and at infinity, respectively. The function j, which relates to the flow around the probe (stagnation point flow in the viscous flow theory), is given by the solution of another
2.2 Reduction to Initial Value Problem-Llnear Equations
19
nonlinear ordinary differential equation (2.25)
subject to the boundary conditions
1j
= 0: f(O) = df(O)/ d1j = 0;
Since the solutions of Eq. (2.25) are known [4], the function f appearing in Eq. (2.24) can be calculated as a function of 1j. Eq. (2.24) is therefore a linear second-order ordinary differential equation with variable coefficients. We shall now apply the method of superposition for the solution of this equation. Let us separate N as (2.26)
Substituting Eq. (2.26) into Eq. (2.24) and separating the resulting equations into two groups of terms in the same way as in Eq. (2.4), we get two initial value problems:
dO (0) d1j
0(0) = 0,
--=1
(2.27)
and
(0) = 0,
d(O) d1j
--=-1
(2.28)
which gives
dN(O)/ d1j
= 1-
s
(2.29)
The parameter s in Eq. (2.26) can be evaluated by using the boundary condition at 1j = 00, which gives
N ( 00) = 0( 00) + s( 00 ) = 1 or
s = [1
- 0( 00 ) ] / ( 00 )
(2.30)
In problems of this type, where the second boundary condition is given at infinity, no problem is experienced in determining these quantities at infinity, such as 0(00) and (00). In general, the solution approaches such limits at a finite distance.
20
2.
Method of Superposition
The solution of Eg. (2.24) therefore consists of the following steps: 1.
From [4], the second-order derivative of the function f at 1/ = 0 is
d'f(O)/ d1/2
= 0.927680
which, together with the two boundary conditions at 1/ = 0 given with Eg. (2.25),
f(O) = df(O)/ d1/ = 0 enables the solution f of Eg. (2.25) to be obtained by forward integration. 2. Integration of the two initial value problems, Egs. (2.27) and (2.28), gives 8(1/) and cj>(1/). In particular, we obtain 8(00) and cj>( (0). 3. Substituting 8( 00) and cj>( (0) into Eg. (2.30), the parameter s can be calculated. 4. The solution of N(1/) can be found by combining the solutions of the two initial value problems, according to Eg. (2.26). The concentration gradient on the surface of the probe, I, is given by
1= dN(O)/d1/ Using Eg. (2.29), we get
1= dN(O)/ dn = 1 - s
(2.31 )
Knowing s from step 3, I can be calculated. Figure 2.3 shows I plotted as a function of (l + €)Nre/(l + fJ)R. This curve agrees with that given in [3]. 0.7
0.5
0.3
0.1
o
5
10
(l+f)Nre/(l+iJ)R
Fig. 2.3 Surface concentration gradient of the probe.
21
2.3 Reduction to Initial Value Problem-Thlrd-Order Equations
2.3
REDUCTION OF THIRD-ORDER BOUNDARY VALUE PROBLEMS TO INITIAL VALUE PROBLEMS
Consider the third-order ordinary differential equation d 3y dy dy dx 3 + fl(x) dx 2 + f2(x) dx + f3(x)y = rex) subject to the boundary conditions:
yeO) = 0,
dy(O)/ dx = 0,
y(l) =
(3.1)
°
(3.2)
The solution can be obtained by assuming
y(x) = y,(x) + 1tY2(x)
(3.3)
As in the solution of second-order differential equations one begins with the integration of two initial value problems, namely d 3y, dy, dy, dx 3 + fl(x) dx 2 + fix) dx + f3(x)YI = rex) (3.4)
dy,(O) --=0 dx '
YI(O) = 0,
(3.5)
and
Y2(0) = 0,
(3.7)
until x = 1. The constant It can then be calculated by using the boundary condition at x = 1, which gives (3.8)
Finally, the solution of Eq. (3.1) can be calculated by using the Equation (3.3) since It is now a known constant. As an illustration, consider the differential equation
dy ely dx 3 - 7 dx + 6y = 6
(3.9)
subject to the boundary conditions:
yeO) = 0,
dy(O) - - =0 dx '
y(l) =0
Comparison with Eq. (3.1) shows that
fl(x) = 0,
f2(x) = -7,
f3(x) = 6,
rex)
= 6
22
2.
Integration of Eqs. (3.4) and (3.6) from x =
YI(I)
= 1.3509
and
Method
0' Superposition
°to x = 1 gives
h(l)
= 0.8007
which can be substituted into Eq. (3.8) to give /l =
- Yl(I)lh(l) = -1.6871
The solution of the given differential equation can therefore be calculated by using Eq. (3.3) since now YI(X), h(x), and the constant J-t are known. Because of its simplicity, no details will be given. 2.3.1
Three-Point Third-Order Differential Equations
It should be noted that the form of Eqs. (2.3) and (3.3) is not the only possible form. As a general rule, the number of unknown constants should be equal to the number of missing initial conditions. For example, if the boundary conditions specified in Eq. (3.1) are changed to a three-point form,
dyeD)
~=o,
y(b)
= 0,
dy(c) dx
--=0
(3.10)
then a solution involving two constants must be defined, i.e.,
y(x) = Yl(X) + J-tYix) + AYJ(X)
(3.11)
since there are two missing initial conditions at x = 0. To get the solution, we first integrate three (instead of two) initial value problems, namely
dYI dYI dYI dx 3 + fl(x) dx 2 + f2(x) dx + f3(x)YI = rex) dYl(O) = dx 2
°
dY2 dY2 dh dx3 + fl(x) dx 2 + f2(x) dx + f3(x)h =
°
YI(O)
= 0,
yiO) = 1,
°
dYI(O) -- = dx '
dh(O)
~ =0,
dY2(0) dx 2 =0
dY3 dY3 dY3 dx3 + fl(x) dx 2 + f2(x) dx + f3(x)Y3 YJ(O) = 0,
°
dY3(0) -- = dx '
=
°
dY3(0) =1 dx 2
(3.12)
(3.13)
(3.14)
2.3 Reduction to Initial Value Problem-Thlrd-Order Equations
23
and the constants JL and A. are found by using the two boundary conditions at x = b and x = c, respectively. We get y\(b)
+ JLY2(b) + A..Y3(b) = 0
dy\( c) dY2( c) dY3( c) - - +JL-- +'11.-- =0 dx dx dx
(3.15)
Since y\(b), Y2(b), Yib), dy\(c)/ dx, dY2(c)/ dx, and dY3(C)/ dx are known from the solution of Eqs. (3.12)-(3.14), the solutions of Eq. (3.15) give JL and A.. With these two constants known, the solution of the original equation can be found by Eq. (3.11). 2.3.2 Sandwich Beam Analysis
Beams formed by a few lamina of different materials are known as sandwich beams. In an analysis of such beams subject to uniformly distributed load along the entire length, Krajcinvic [5] found that the distribution of shear deformation I/; is governed by the linear ordinary differential equation d 31/; 2 dl/; - - k -+a=O (3.16) 3 dx dx where k 2 and a are physical constants which depend on the elastic properties of the lamina. For the free ends, the condition of zero shear bimoment at both ends leads to the boundary conditions dl/;(O)/dx = dl/;(I)/ dx
=0
(3.17)
From symmetry considerations,
1/;0)=0
(3.18)
Eq. (3.16), subject to the boundary conditions (3.17) and (3.18), constitutes a three-point boundary value problem. While the formulation of the problem is simply an application of the principle of minimum potential energy, details of the derivation are too involved to be included here. We shall apply the method of superposition to solve the problem. First, the solution is separated in accordance with the following equation: (3.19)
24
2. Method of Superposition
The three initial value problems, Eqs. (3.12)-(3.14), are d J, 1. _'1'_1
dx J
-kz
d,l, _'1'_1
dx
+a = 0 (3.20)
d\[J\(O) --=0 dx '
(3.21)
(3.22)
To find J.L and A., Eq. (3.15) is followed. We then get
\[JI( t ) + J.L\[Jz( t) + A.\[JJ( t)
=0
d\[JI(l) d\[Jz(l) d\[JJ(l) ~+J.L~+A.~=O
(3.23a) (3.23b)
from which
(d\[JJ(l)j dX)\[Jl( t) - (d\[J\(l)j dx)tf;J( t)
= (dtf;z(l)jdx)tf;J(t) _ (dtf;J(I)jdx)tf;z(t)
(3.24)
A. = (dtf;\(I)j dx)tf;z( t) - (dtf;z(l)j dx)tf;\( t) (dtf;z(l) j dx)tf;J( t ) - (dtf;J( 1) j dx)tf;z( t )
(3.25)
J.L
Solutions based on this method are obtained for a = 1 and k They are shown in Table 2.1. Calculations are also made based on the exact solution, tf;
= 5 and 10.
= aJ (sin t k - sinh k~) + az (~ - t) + aJ tanh t k ( cosh k~ - cosh t k) k
k
k
(3.26) The values of tf; calculated based on Eq. (3.26) are identical to those obtained by the method of superposition.
2.4
25
Concluding Remarks TABLE 2.1
Sample Solutions of Eq. (3.16) (for a = 1.(0) ~
",m
5.00
0.0 0.2 0.4 0.6 0.8 1.0
- 0.0121 - 0.0092 - 0.0033 0.0033 0.0092 0.0121
10.00
0.0 0.2 0.4 0.6 0.8 1.0
- 0.0040 - 0.0029 - 0.0010 0.0010 0.0029 0.0040
k
2.4 CONCLUDING REMARKS
The method of superposition described in this chapter is found in the mathematical literature as the method of complementary functions [6] and, in a slightly different form, as the method of particular solutions [7-10]. A few remarks about the latter method are in order at this point. Consider a third-order differential equation, written in terms of a system of first-order equations, dy dx = u,
du dx
=
1),
subject to the boundary conditions y(O) = Yi'
u(O)
= Ui '
y(l)
=
Yj
(4.2)
Miele and co-workers [7-10] assumed the solution to be y(x)
= b1i l ) + b 2y(2)
u(x)
= b1u(1) + b2u(2)
v(x)
=
b1v(l)
(4.3)
+ b2v(2)
where (y(i),u(i),v(i» satisfy the differential equation (4.1) and the boundary conditions (4.2). Substituting the solution from (4.3) into Eq.
26
2. Method of Superposition
(4.1), we get b
1(
d (I) -U(I) ) + b ~
( d (2) ~ -U(2) ) =0 2dx
dx
du( b ( -I)- v 1 dx
(I») +b ( -dU(2) - - v (2») =0 2dx
(4.4) (4.5)
bl ( d~~l) +1I V(I) + 12U(l) + 13y(l») + b2( d~~2) +1I V ( 2) + 12U(2) + 13/ 2») = rex)
(4.6)
Since (/i),u(i),v(i) are solutions of Eq. (4.1), Eqs. (4.4) and (4.5) are satisfied identically and Eq. (4.6) gives the following conditions between b, and b2 : b l + b2=1 (4.7) We will now show the equivalence of the method of complementary functions and the method of particular solutions. With the condition (4.7), the solution (4.3) can be written as y(x)
= y(l)(x) + b2[ /
u(x)
= U(I)(X) + b2[ U(2)(X) -
u(l)(x)]
vex)
= v(l)(x) + b2[ V(2)(X) -
v(l)(x)]
2)( X) - y(l)(x)]
(4.8)
or, since (/i) ,u(i) ,v(i) are unknown functions, Eq. (4.8) can be written in another form as:
= y(l)(x) + b2/ 3)(X) u(x) = u(\)(x) + b2u(3 )( x )
y(x)
vex)
where /3)
(4.9)
= V(I)(X) + b2v(3 )(x )
= /2) - y(l), etc. Similarly, Eqs. (4.4)-(4.6) can be written as d (I) -U(I) ) ~ ( dx
d (3) +b ( ~ 2
dx
-u(3) ) =0
(4.10) (4.11)
(4.12)
27
Problems
Separating terms with and without b2 , we then get two sets of differential equations, namely l d i ) _ u(l)
dx dV(I)
~
=0
dU(I) - V(I)
'
dx
=0 (4.13)
+ flv(l) + f2 U(I) + f 3 i
l)
= rex)
and dV(3) _:J'_ _
dx
dv(3) dx
u(3) = 0
'
d (3) _u_ dx
V(3)
=0
+fI V(3) + f 2 u(3) + t.3 y(3) = 0
(4.14)
which are the equations to be used in the method of complementary functions. The above shows that these two methods are in essence identical. PROBLEMS
1. A viscoelastic fluid is a fluid which possesses memory. In an analysis of the flow about an infinite horizontal plate in such a fluid (Na and Sidhom [11]), the following boundary value problem was obtained: p
d
2F
dTJ2
_ (>-'0/32 + /3)F= 0,
F(O) = Uo, F(oo) = 0
Solve the equation by the method of superposition and compare with the exact solution F
=
°
~) ( V------;--
U exp -
TJ
Note: Introduce the following transformation ~
= TJ
W
o/3 2+ /3 p
,
F
g=Uo
before applying the numerical method.
2. In an analysis of the mass transfer on a rotating disk in a nonNewtonian fluid (Greif and Anderson [12]), the concentration of the diffusing species was found to be governed by d
2C
ds 2
+1.9 [( 7+5n) +.§.] dC =0 2 + 2n s ds '
C(O) = 0, C(oo) = Crr;;
28
2.
Method 01 Superposition
Solve the equation by the method of superposition for n = 0.2, 1.0, and 1.5 and compare the result with the exact solution 7 + 5n ) / 6 + 6n
I s c/ Coo = y( "3'"3
( 1) r"3
where r is the gamma function and y is the incomplete gamma function. 3. In an analysis of the heat transfer in the radial flow between parallel circular disks [13], the following equation was obtained:
d~
+7) d7)2
2
df
d7)
3exrif= 0
,
f(O) = 1, f(oo) = 0
Solve the equation by the method of superposition for ex = 0, 5, and 10. Answer: The missing initial slopes are 1'(0) = - 0.77633, - 1.83778, and - 2.29040, respectively. 4. An electric circuit contains the following elements in series: an inductance L(l H), a resistance R(1000 ohm), and a capacitance C(6.25 X 10- 6 F). The initial charge in the circuit is zero and a constant emf of 24 V is applied at t = O. If the current at t = 0.001 sec is 0,031 A, it is desired to find the current at t = O. The boundary value problem for the solution of this problem is:
1!Q + 1000~ + 2 dt
dt
6.25
Q
X
10- 6
=24 '
Q(O) = 0
. dQ(O.OOl) 1(0.001) = dt = 0.031 Answer: i(O) = dQ(O)/ dt
=
5 A.
REFERENCES l.
2. 3. 4. 5. 6. 7.
Collatz, L., "The Numerical Treatment of Differential Equations," pp. 184-186, Springer-Verlag, New York, 1966. Lee, E. S., Quasilinearization, nonlinear boundary value problems and optimization, Chern. Eng. Sci., 21, 183-194 (1966). Maise, G., and A. J. Sabadell, Electrostatic probe measurements in solid-propellant rocket exhausts, AIAA J. 8, 895-901 (1970). Moore, F. K., "Theory of Laminar Flow," p. 127, Princeton Univ. Press, Princeton, New Jersey, 1964. Krajcinvic, D., Sandwich beam analysis, J. Appl. Mech. 39, 773-778 (1972). Robert, S. M., and Shipman, J. S., "Two-Point Boundary Value Problems: Shooting Methods," Chapter 4, Elsevier, New York, 1972. Heideman, J. C., Use of the method of particular solutions in nonlinear two-point boundary value problems, Part I, uncontrolled systems, Aero-Astronaut. Rep. No. 50, Rice Univ. (1968).
References
29
8. Heideman, J. C., Use of the method of particular solutions in nonlinear two-point boundary value problems, Part II, controlled systems, Aero-Astronaut. Rep. No. 51, Rice Univ. (1968). 9. Miele, A., Method of particular solutions for linear two-point boundary value problems, Part I, preliminary examples: Aero-Astronaut. Rep. No. 48, Rice Univ. (1968). 10. Miele, A., Method of particular solutions for linear two-point boundary value problems, Part II, general theory, Aero-Astronaut. Rep. No. 49, Rice Univ. (1968). II. Na, T. Y., and Sidhom, M. M., J. Appl. Mech. 34,1040-1042 (1967). 12. Grief, R., and Anderson, J. A., Phys. Fluids 16, 1816-1817 (1973). 13. Na, T. Y., and Chambers, R. C., ASME papers 67-WA/HT-16 (1967).
CHAPTER
3
METHOD OF CHASING
3.1 INTRODUCTION
The method of chasing was developed by Gel'fand and Lokutsiyevskii in the Steklov Mathematics Institute of the Academy of Science, U.S.S.R. It first appeared in the English literature in the book "Computing Methods" by I. S. Berzin and N. F. Zhidkov [1]. Briefly, the method starts by creating an ordinary differential equation, based on the form of the boundary condition at the initial point, which is one order less than the order of the given differental equation and the coefficients of which involve unknown functions. The number of such unknown functions is, as a rule, equal to the order of the given differential equation. This point will be made evident as we progress with the introduction of the method. Differentiating the created equation will make it the same order of differentiation as the given differential equation. Equating the coefficients of these two differential equations will lead to a system of first-order differential equations which can be integrated to give the solutions of the unknown coefficients. In particular, the solutions at the end point, together with the boundary conditions at this point, enable the complete set of boundary conditions at the end point to be evaluated. This process is called "forward chasing." With the complete set of boundary conditions at the end point now known, the original differential equation can be integrated backward as an initial value problem from the end point back to the initial point. This process is therefore called "backward chasing." Iteration can therefore be avoided. In this chapter, we will present the method for solution of second- and third-order linear differential equations. Examples with details of the analysis will also be given. 30
3.2 Derivation of Equations of Chasing
31
3.2 DERIVATION OF EQUATIONS OF CHASING BY JONEStSECOND-ORDER DIFFERENTIAL EQUATIONS
To illustrate the method, consider the linear second-order differential equation
d~
= p(x)y + q(x)
dx
(2.1)
where p(x) and q(x) are continuous functions. The boundary conditions are dy(a) (2.2) ~ = aooy(a) + a lO dy(b)
~
= /3ooy(b) + /310
(2.3)
where a oo, a lO , /300' and /310 are constants. We now consider a linear first-order differential equation, dy dx = ao(x)y + a)(x)
(2.4)
and choose ao(x) and a)(x) so that y still satisfies Eq. (2.1). Differentiating Eq. (2.4) with respect to x, we then get dy dx2
dao
dy
da,
= dx Y + dx + ao dx
(2.5)
Replacing dy/ dx by the right-hand side of Eq. (2.4), we get
;~
=(
~:o + a5)y + ( ::)
+ aOa) )
(2.6)
From comparison with Eq. (2.1), it is seen that the following equations must be satisfied, dao(X) ~ da)(x)
~
+ [ao(x)]
2
= p(x)
(2.7)
+ao(x)a)(x) = q(x)
(2.8)
As a first step, Eq. (2.7) and (2.8) are integrated, as an initial value t The proof of this section was given by Professor D. S. Jones of the University of Dundee (private communication).
32
3. Method 01 Chasing
problem, with the initial conditions given by
and the range of x from a to b. The two quantities (XoCb) and (X1(b) are obtained. From Eq. (2.4), we write (2.9)
On the other hand, the boundary condition at x = b, Eq. (2.3), gives dy(b)
~
= f3ooy(b) + 1310
(2.10)
Since (Xo(b) and (X1(b) are now known quantities, Eqs. (2.9) and (2.10) can be solved for y(b) and dy(b)j dx: y(b)
= 13 10 - (X](b) (Xo( b) - 1300
dyeb)
f3oo(Xl( b) - f3lO(XO( b)
dx
1300 - (Xo( b)
(2.11 ) (2.12)
As a result, Eq. (2.1) is tranformed into an initial value problem, since now Eq. (2.1) can be integrated backward from x = b by using the initial condition given by Eqs. (2.11) and (2.12). Another approach is to integrate Eq. (2.4) using (2.11) as the initial condition. 3.3 APPLICATION OF THE METHOD
The method described in Section 3.2 will now be applied to three examples. To demonstrate its accuracy, solutions calculated by the method of chasing are compared with the exact solutions. The method starts by solving Eqs. (2.7) and (2.8) for (Xo(x) and (XI(X) from x = a to x = b; the values of these functions at the end points, (Xo(b) and (X](b), are then obtained. This process is called forward chasing. From Eqs. (2.11) and (2.12), the boundary conditions at the second point, x = b, can be calculated. With y(b) and dy(b)j dx known, we can integrate Eq. (2.1) backward from x = b to x = a as an initial value problem. Alternatively, Eq. (2.4) can be integrated from x= b to x = a usingy(b) as initial condition. This is the backward chasing process. Details of the numerical results will be presented in the examples.
33
3.3 Application of the Method
3.3.1 A Simple Boundary Value Problem
Consider the solution of the boundary value problem
dy
-
dx 2
= -y + xcosx
(3.1)
subject to the boundary conditions
dy(O)
dY(1T/2) = -5Y(1T/2) + 2 dx
d;- = 3y(0) + 2,
(3.2)
For this problem, the exact solution is available and can be written as
y = -0.73cosx - 0.441 sinx + Hx 2sinx + xcosx)
(3.3)
At x = 1T /2, we get
Y(1T/2) =0.175
dY~:2) = 1.122
and
(3.4)
This problem will now be solved by the method of chasing and the same two quantities will be sought. From comparison with Eq. (2.1), it is seen that
p(x) = -1,
q(x) = xcosx
(3.5)
Eq. (2.7) and (2.8) therefore become
dao(x)
dX =
da,(x)
dX = xcosx - ao(x)a,(x)
-1 - aJ(x),
(3.6)
The boundary conditions are
ao(O) = 3, Eq. (3.6) can be integrated from x in Figs. 3.1 and 3.2. Now, since
a,(O) = 2
= 0 to x = 1T /2. The
results are shown
(3.7) we get
dy( 1T /2) = ( :!!.-) (:!!.-) ( :!!.- ) dx ao 2 y 2 + a, 2
(3.8)
Also, from the boundary condition at the second point,
dY~:2)
=
-5Y(1T/2) + 2
(3.9)
34
3. Method
0' Chasing
2
o 0.5
1.51
x
Fig. 3.1 uo(x) versus x from the solution uo(w/2) = -0.333. 2
o 0.5
1.0
1.5
x
Flg.3.2 ul(x) versus x from the solution u,(w/2) = 1.184.
Solving Eqs. (3.8) and (3.9), we get
7T )
2" =
2-aJ(7T/2) 5+a
o(7T/2) = 0.176
(3.10)
dY(7T /2) dx = -5Y(7T/2) + 2 = 1.122
(3.11 )
y(
which agrees with the exact solutions. 3.3.2 Heat Conduction In an Inllnlte Plate with Heat Generation
As another example, a classical problem from heat conduction will now be solved by this method. Consider an infinite flat plate which separates a
3.3 Application of the Method
35
I I
I
I I I I
Too
dx
x
Too
I
rFig. 3.3
I
2Q--i-----I
Schematic diagram of the plate.
fluid at a temperature of T OCJ' as shown in Fig. 3.3. Heat is generated within the plate at a constant rate, qs' It is required to find the temperature distribution in the plate. To formulate the problem, the first law of thermodynamics can be written as (rate of conduction into control volume) + (rate of heat generation in the control volume) = (rate of conduction out of control volume) which, referring to Fig. 3.3, becomes
{Aqx} + {qsAdx} = {A(qx + dqx)} where A is the area. Simplifying the above equation and introducing the Fourier law of conduction, qx = -kdT/dx the first law of thermodynamics becomes
d
2T
dx?
+ qs = 0 k
(3.12)
where total differentiation is used since the temperature is a function of x only. Eq. (3.12) will be solved with the following boundary conditions: because of symmetry, only half of the plate is considered. The boundary condition at x = 0 is based on the same consideration, since at the plane midway between the two surfaces of the plate, the temperature gradient must be zero, i.e., x =0: dT(O)/ dx = 0
3. Method of Chasing
36
The second boundary condition is written in the usual way when the solid surface is in contact with a fluid at a different temperature with negligible radiation: x
= I:
- k dT (l) / dx
= h[ T (l) -
Too]
where k is the heat conductivity, h is the convective heat transfer coefficient, Too is the temperature of the fluid away from the surface of the plate, and I is half the thickness of the plate. Introducing the dimensionless quantities
_ x x= I '
0=
T- T 00
qJ2/k
Eq. (3.12) becomes d
20
dX2
+ 1= 0
(3.13)
subject to the boundary conditions
x = 0:
dO(O)/ dx = 0
x = 1:
- dO(I)/ dx
= NbiO(I),
where N bi is the Biot number. The exact solution of Eq. (3.13) is
o= t (1 The boundary conditions at x
=I
O(l)=l/Nbi,
x2 ) + 1/ N bi
(3.14)
are therefore
dO(l)/dx = -I
(3.15)
We will now use the method of chasing to find the same two boundary conditions. Comparing Eq. (3.13) and its boundary conditions with Eqs. (2.1)-(2.3), we identify that p(x) = 0, lXoo
= 0,
lX lO
= 0,
q(x) = -I (300
= - Nb j ,
(310
=0
(3.16)
Eqs. (2.7) and (2.8) then become
dlXO(X)/ dX = - [ lXO(X)]2 dlX1(X)/ dx = -I - lXO(X)lXJ(X)
(3.17) (3.18)
subject to the boundary conditions (3.19)
3.3
37
Application of the Method
Eqs. (3.17) and (3.18) can now be integrated from which we get a o(1) and a l (1). Now, since
x = 0 to x = 1, from
dO(x)/ dx = ao(x)O(x) + a(x)
(3.20)
we can set x = 1 and get dO (1)/ dx = ao(1)O (1)
+ a( 1)
Also, from the boundary conditions at the second point, dO(l)/dX The boundary conditions at
x=
0(1) = _
= -NbiO(l)
(3.21)
1 can now be solved. They are a(l)
(3.22)
N b i + ao(1)
and dO(I)
Nb ia l(l)
dx
N b i + a o(1 )
--=
(3.23)
As illustrations, numerical results for three values of N bi are tabulated in Table 3.1, along with those calculated from exact solutions, Eq. (3.14). The agreement is excellent. TABLE 3.1
Comparison of Solutions with Exact Solutions By present method N bi
0(1)
dO(I)/ dx
0.5 1.5 3.0
2.ססOO
0.6667 0.3333
i.oooo i.oooo
t.oooo
Exact solutions 0(1) 2.ססOO
0.6667 0.3333
dO(l)/riX
t.oooo
i.oooo r.oooo
The above represents forward chasing for the purpose of obtaining the complete set of boundary conditions at the second point, as shown in Table 3.1. With the boundary conditions at the second point known, the second step is called backward chasing where integration is carried out backward from the second boundary point to the initial point. In the present example, it means integration from x = 1 to x = O. Equation (3.13) can now be integrated backward from x = 1 to x = O. The results are shown in Fig. 3.4. Physically, the curves in Fig. 3.4 represent the dimensionless temperature distribution for three values of N bi '
38
3. 2.5
Method of Chasing
r--=:::::::::==---------,
2.0
S ee " "-§ 0
1.5
.0
'J:
.E
Nbi = 1.5
"0
2
B ~
~
1.0
E
"
I-
(O) --2-
dx
dy(O)
= a oo -d- + aIOY(O) + a 20 x
(4.2) (4.3)
dj>(l)
dy(l)
----;;;z = Yoo d;- + YlOy(l) + Y20
(4.4)
Since Eq. (4.1) is third order, we therefore consider a second-order differential equation, dj> dy dx 2 = ao(x) dx
+ a(x)y + a2(x)
(4.5)
Differentiating Eq. (4.5) and eliminating dj>/ dx 2 by using Eq. (4.5), we get
Proceeding as in the second-order case, we choose ao(x), a(x), and az(x) such that y still satisfies Eq. (4.1). It is seen that the following
3.4 Third-Order DI"erentlal Equations
43
equations must be satisfied: dao dx
z
+ a o + a l = P(x)
da t dx + aoa l da z dx
(4.7a)
= Q(x)
(4.7b)
+ aoaz = R(x)
(4.7c)
As a first step, Eqs. (4.7) are integrated as an initial value problem, with the initial conditions given by az(O) = azo
and the range of integration from x = 0 to x following quantities will be obtained:
ao(l),
(4.8)
= I. In particular, the
a1(1),
From Eq. (4.5), we write dy(l)
----;J;l = ao(l)
dy(l)
~
+at(l)y(l) + az(l)
On the other hand, the boundary conditions at x give dy(l)
dy(l)
dy(l)
dy(l)
(4.9)
= I, Eqs. (4.3) and (4.4),
----;J;l = f300 ~ + f3lOy(l) +
f3zo
(4.10)
----;J;l = Yoo ~ + YlOy(l) + Yzo
(4.11)
The complete set of boundary conditions at x = l.namely y(l),dy(l)/ dx, and dy(l)/ dx', can now be solved from Eqs. (4.9)-(4.11). Using these conditions, Eqs. (4.1)-(4.4) can be integrated from x = I to x = 0 (the backward chasing) as an initial value problem. Due to the similarity between this case and the case of second-order differential equations treated in Section 3.3, no example will be given here. 3.4.2
Third-Order Differential Equations with Boundary Conditions Given at Three Points
Consider the third-order differential equation given by d 3y dy = P(x) -d dx x
-3
+ Q(x)y + R(x)
(4.12)
44
3.
Method of Chasing
dY(O) , + aIOY~O) + a20 dx
(4.13)
Subject to the boundary conditions
dy(O) x
- d - = aOO
--2-
dY(b) dy(b) y(b) = (300""dF + (310 ~ + (320 dy(c)
dy(c)
~ = Y00""dF
+ YlOy(c) + Y20
(4.14) (4.15)
where the boundary conditions are specified at three points. For this case, we have to introduce two equations, instead of one, as in the previous section. First, let us introduce a second-order differential equation:
dy -d x
=
dy ao(x) - 2 + a](x)y + ai x) dx
(4.16)
Differentiating Eq. (4.16) with respect to x and eliminating the term dy / dx2 by using Eq. (4.16), we get
3y d I { [dao(X) ] dy dx3 = [a 1- d;- -aO(x)al(x) dx o(x)]2 dao(x)
dal(x) ]
+ [ aleX) d;- -alex) - ao(x) d;- y (4.17)
Comparing Eq. (4.17) with Eq. (4.12) shows that, if y in Eq. (4.16) still satisfied Eq. (4.12), the coefficients must be equal, which gives
dao(x)
d;- = I - ao(x)a](x) - P(x)[ao(x)] da](x)
d;-
= -
2
(4.18)
2 [al(x)] - P(x)ao(x)a](x) - ao(x)Q(x)
da2(x)
d;- = - al(x)ai x) - P(x)aO(x)a2(x) - ao(x)R(x)
(4.19) (4.20)
Eqs. (4.18)-(4.20) can now be integrated as an initial value problem since the initial conditions are given by
ao(O)
= aoo,
a 1(0)
= a lO ,
a2(0)
= a20
(4.21)
45
3.4 Third-Order Differential Equations
Next, another second-order differential equation, corresponding to the boundary condition at x = a, is introduced:
dy dy Y = f3o(x) dx2 + f31(X) dx + f3 2(x)
(4.22)
Differentiating Eq. (4.22) with respect to x and eliminating dy / dx2 by using Eq. (4.22), we then get:
f30 - f3 o( df3./ dx) + f31( df3o/ dx) + f3~ dy
+
(df3o/ dx) + f3l
f3J dx f32( df3o/ dx) + f3l f3 2 - f3o( df32/ dx) 2
f3 0
f3J
y (4.23)
We again choose f3's such that y in Eq. (4.22) still satisfies Eq. (4.12). By comparing the coefficients of Eqs. (4.12) and (4.23), this condition requires that the corresponding coefficients must be equal. Equating these pairs of coefficients and rearranging the terms, we then have
df30 2 dx = - f3. - f3 oQ(x)
(4.24)
df3l dx
=I
(4.25)
df32 dx
= - f30f32Q(X) - f3o R(x)
- f30 f3. Q(x) - f3 oP(x)
(4.26)
The boundary conditions are (4.27)
Since the end point is at x = c, integration of Eqs. (4.18)-(4.20) and (4.24)-(4.26) is to end at this point. In particular, we get the following quantities:
ao(c), f3 o( c), At x
= c, Eqs. (4.16) and dy(c)
-d-
x
(4.22) give
dy(c)
= ao(c) - - 2 - +al(c)y(c) + a2(c) dx
dy(c) dy(c) y(c) = f3o(c) ~ +f3I(C) dX +f32(C)
(4.28) (4.29)
46
3. Method of Chasing
Also, from the boundary condition at x = c,
dy( c)
d:v( c)
~ = Yoo ~ +YIOY(c) + Y20
(4.30)
Equations (4.28)-(4.30) can be solved for the complete set of boundary conditions at y = c. This completes the forward chasing. Equations (4.28)-(4.30) can then be solved for y(c), dy(c)/ dx, and d:V(c)/ dx': By use of these three boundary conditions at x = c as the initial conditions, Eq. (4.12) can be solved by forward integration. This completes the backward chasing. 3.4.3
Sandwich Beam Analysis
The method introduced in Section 3.4.2 will now be applied to the solution of the sandwich beam equation, which was treated in Section 2.3.2. Starting from the differential equation
d 31fJ 2 dlfJ -k -+a=O 3 dx dx
(4.31)
and its boundary conditions
dlfJ(O) dx
dlfJ(l) dx
(4.32)
--=--=0
'
we can identify that
P(x)=k 2, aoo = a lO = a20 = 0,
Q(x)=O,
R(x)=-a
fJoo = fJlO = fJ 20 = 0,
b=L
Yoo
= YIO = Y20 =
°
c=l
The two systems of initial value problems, Eqs. (4.18)-(4.20) and Eqs. (4.24)-(4.26), become
dao(x)
---;tX = I da)(x)
- ao(x)a)(x) - k 2[ ao(x)]
2
2
---;tX = - [a1(x)] - k 2a o(x)a)(x) da2(x)
---;tX = - a)(x)a 2(x) - k 2a o(x)a 2(x) + aao(x)
(4.33)
47
3.4 Third-Order Differential Equations
subject to the boundary conditions
0: 0(0) = 0: 1(0)
= O:z(O) = 0
and d(30(x) dx
= _ (3 (x)
d(3l(x) dx
= 1 - e(3
1
(x)
(4.34)
0
d(3z(x) _ (3 ( ) dx -a 0 x
subject to the boundary conditions (300 )
= (310 ) = (3z0) = 0
As an example, let us consider the case
k = 5, a=1 Integration of Eqs. (4.33) and (4.34) as initial value problems gives the solutions of the o:'s and the (3's, as shown in Table 3.3. TABLE 3.3
Solution of the a's and f3's (k x
ao
al
a2
0.0 0.2 0.4 0.6 0.8 1.0
0.ססOO
0.00 0.00 0.00 0.00 0.00 0.00
0.ססOO
0.1523 0.1928 0.1990 0.1999 0.2000
= 5, a = I)
130
0.0141 0.0294 0.0360 0.0385 0.0395
-
13.
132
0.ססOO
0.ססOO
0.0051 0.0217 0.0541 0.1105 0.2053
0.1042 0.2350 0.4259 0.7254 1.2100
0.ססOO
-
0.0002 0.0014 0.0050 0.0130 0.0284
Next, the complete set of boundary conditions at x = 1 will be sought. For this problem, Eqs. (4.28)-(4.30) become d1[;(l) --=0 dx 0: 0
d~(1)
( 1) --z- + 0:(1)1[;(1) + O:z(l) = 0 dx
1[;(1) = (30(1)
d~~l) dx
+ (3z(1)
48
3. Method of Chasing
which can be reduced to
ao(1 ) f3 2( I) - 130(1 )a2( I) IjJ ( I) = a 1(1) 130 (1 ) + a o(1) dljJ(1) dx
--=0
(4.35)
+ a 2( I) a 1(I )130(1 ) + ao(1)
d~(1)
a 1(I) f32( I)
Since all the a's and f3's on the right-hand side of Eq. (4.35) are known from Table 3.3, we therefore have 1jJ(1)
= 0.0121,
dljJ(l)
d;- =0.0,
d~(1) = -0.1973 dx?
which can bs used as the boundary conditions for the integration of Eq. = I to x = O. The solutions from this final step ljJ(x) were found to be identical to those tabulated in Table
(4.31) in the backward chasing from x 2.1.
3.5
CONCLUDING REMARKS
The method described in this chapter offers a very interesting alternative for the conversion from a boundary value problem to an initial value problem. One other advantage of this method which has not been discussed so far is the property that under certain conditions the solutions of the equations of forward and backward chasing, i.e., ao(x) and a1(x), increase slowly with x even if the solution of the original equation y(x) does, thus making it possible to use larger intervals of the independent variable for the same accuracy. This can be explained by investigating the behavior of the solution of the homogeneous part of Eq. (2.1),
z" = p(x)z
(5.1 )
and the boundary condition at x = a, which is z'(a) = aooz(a)
(5.2)
where primes represent differentiation with respect to x. Let us first differentiate the product zz'; we get d(zz') ~ =(zy+zz"
(5.3)
49
Problems
Replacing z" in Eq. (5.3) by the right-hand side of Eq. (5.1), we then get
d(zz')
~
2.r cr[
= p(X)z2(x) + [z'(x)J
2
Eq. (5.4) is now integrated from a to x twice, and we get
Z2 =
(5.4)
1
p( 1J)Z2(1J) + Z,2(1J) Jd1J }d~ + [2lX OO(X - a) + ]Z2(a) (5.5)
where the boundary condition (5.2) is used in the evaluation of the integration constant. We now consider the case in which both p(x) and lXoo are greater than zero. For this case, the integrand is greater than zero (so is the constant term) and therefore z(x) will increase as x is increased. Consequently, z(x) can become very large if the lower bound of p(x) is large. The consequence is that for sufficient accuracy in the solution, the step size has to be very small. Next, let us consider the equation of chasing. We notice that by using the transformation
lXo(x) = z'(x)j z(x)
(5.6)
Eq. (5.1) becomes Eq. (2.7) and the boundary condition (5.2) is transformed to lXo(a) = lX OO ' Thus, if z(x) increases rapidly, lXo(x) will show a sharp decrease accordingly. Eq. (2.8) is linear in lX), and its solution is X
lX)(X) = exp( - i lXO(X)dX){ lX lO + i
X
exp(i~lXO(1J)d1J)q(~)d~}
(5.7)
Due to the factor on the right-hand side of Eq. (5.7) involving a negative exponential the solution will decrease rapidly with x. Due to this property, the solutions of lXO(X) and lX)(X) can be obtained by using larger step sizes, especially when x is large. The same is true for the inverse chasing using Eq. (2.4) and the initial condition (2.11). For nonlinear boundary value problems, the differential equation has to be linearized before this method can be applied. The method is suitable for boundary value problems where the interval of integration is finite.
PROBLEMS
1. Finish the solutions of heat transfer through a fin discussed in Section 3.3.3. Calculate solutions of Eqs. (3.27)-(3.29) for {3 = 0.1, 5.0, 10.0 and Nbi = 0.5, 1.5, 3.0, respectively and compare with the exact solution, Eq. (3.42).
50
3.
Method of Chasing
2. In the solution of the problem of heat transfer through the fin, Eqs. (3.27)-(3.29), the boundary conditions at x = 0, Eq. (3.28), are not given in the form of Eq. (2.2), and it was therefore found necessary to modify the equations derived in Section 3.2. This was done in a simple way by following Eqs. (3.31)-(3.38). The same equations can be derived, in a more
basic manner, by replacing Eq. (2.4) with Y
= yo(x)dy /
dx
+ y(x)
and following the same steps as in Section 3.2. Repeat the derivation and get Eqs. (3.34) and (3.35). 3. The motion of a heavy particle sliding without friction along a massless straight rod which rotates about its points in a vertical plane with constant angular velocity w can be represented by the following boundary value problem: d 2r - 2 - w2r dt
=
.
-gsmwt '
where rand t are the distance of the particle from the center of rotation and time, respectively. The constant g is the gravitational acceleration. The subscripts 0 and 1 represent conditions at t = 0 and t = t (, respectively. Suppose the angular speed is w = 12 rpm and the particle, which is at r = 5 ft initially, reaches r = 15 ft at t = 0.05 sec. Find the initial velocity of the particle by the method of chasing. Answer: 225.3 ft/sec. 4. In the analytical prediction of the temperature distribution in an incompressible Newtonian fluid held between two coaxial cylinders, the outer one is rotating at a steady angular velocity. Bird et al. [2] found that the dimensionless temperature 0 is given by the differential equation
dO) + 4N ~41 = 0 I1 d~d (ed~ subject to the boundary conditions:
O( ,,) = 0,
0(1)= 1
Solve the equation by the method of chasing and compare the results with the exact solution:
[
In~ eN] - [(N+ 1)- -N] -In"
0= (N+ 1)- -
,,2
The values of " and N are 0.9 and 0.4, respectively.
References
51
5. Derive the necessary equations for the solution of the fourth-order boundary value problem by the method of chasing. Solve problem 4 of Chapter 2 by this method.
REFERENCES Berzin, I. S., and Zhidkov, N. P., Method of chasing, in "Computing Methods" (0. M. Blum and A. D. Booth, trans.), Vol. II, Pergamon, Oxford, 1965. 2. Bird, R. B., Stewart, W. E., and Lightfoot, E. N., "Transport Phenomena," p. 326, Wiley, New York, 1960. I.
CHAPTER
4
THE ADJOINT OPERATOR METHOD
4.1
INTRODUCTION
The adjoint operator method was developed by Goodman and Lance [1]. As in the two methods treated in Chapters 2 and 3, the missing initial conditions of a linear boundary value problem can be found by a onesweep process. The general concept can be introduced as follows. Consider a general system of linear, ordinary differential equations, which can be written in matrix form as
Y = A(t)Y + F(t)
(1.1 )
where the dot denotes differentiation with respect to the independent variable. The coefficient matrix is a square matrix defined by
A=
(1.2)
The two column matrices Y and F(t) are
Y=
(1.3)
Yn and
(1.4) respectively. 52
53
4.1 Introduction
The boundary conditions are given at two points, namely
Yi(O) = (Xi Yi(T) = f3i
for for
i
= 1, ... , r
i = r
+ 1, ...
,n
(1.5)
To convert the above boundary value problem to an initial value problem, the so-called adjoint system of equations to Eq. (1.1) will be introduced. The definition of the adjoint equations of Eq. (1.1), as given by Bliss [2], Wright [3], and Goodman and Lance [1], can be written as
-x = AT(t)X
(1.6)
where the superscript T on A denotes the transposed matrix and the column matrix X is defined by
We next differentiate the product XTy with respect to the independent variable, which gives
; (XTy) = XTy + XTy Substituting
Y and XT from Eqs. (1.1) and
(1.7)
(1.6) into Eq. (1.7), we get
; (XTy) = XT(AY + F) - (ATX)Ty = XTAY + XTF - XTAY
(1.8)
where the property that AIT = A is applied. The first and the third terms on the right-hand side of Eq. (1.8) are equal in magnitude and opposite in sign and can therefore be canceled. This property is the key to the success of this method, since now the right-hand side does not involve Y. Next, Eq. (1.8) is integrated over the interval (0,T), and we get (1.9)
Eq. (1.9) can now be used to determine all the missing initial conditions of Eq. (1.1). We recall from Eq. (1.5) that (n - r) initial conditions are missing. Also, in the definition of the adjoint system of equations, Eq. (1.6), no boundary conditions are specified. Since (n - r) initial conditions are needed, Eq. (1.6) is integrated (n - r) times from t = T to t = 0, each time employing a different set of initial conditions at t = T. These (n - r)
54
4. The AdJoint Operator Method
sets of solutions will then be combined with Eq. (1.9) to solve for the (n - r) missing boundary conditions. Details of this last step are quite
abstract and can only be fully understood by actually working through a few examples. 4.2
SECOND-ORDER DIFFERENTIAL EQUATIONS
We will now introduce the details of the method by solving two second-order differential equations, namely the magnetohydrodynamic Couette flow and the bending of a beam. Numerical solutions obtained by this method are compared with exact solutions and are found to be very accurate. 4.2.1
Magnetohydrodynamlc CoueUe Flow
Magnetohydrodynamics involves the study of the motion of electrically conducting fluids subject to the influence of electric fields, magnetic fields, or both. To analyze such problems, use must be made of the hydrodynamic laws and concepts, together with the basic relations of the electromagnetic theory. In order to understand the interaction of electric, magnetic, and hydrodynamic forces in the fluid, let us consider a simple flow problem, known as the Couette flow, in which an electrically conducting fluid, subject to a uniform magnetic field in the y direction, flows between two parallel flat plates, one of which at rest and the other moving in its own plane with a velocity U, as shown in Fig. 4.1. y
y=L ====t===:;=====r===== -
y=O
U
=======:!!5::======:--_X Fig. 4.1 The Couette flow.
The governing differential equations, which include the equations of continuity and momentum, can be written as Continuity:
~=o
ax
(2.1)
4.2
55
Second-Order Differential Equations
Momentum:
pu -au
ax
= -
2 ap + J-t (a - u + -a2u ) ax ax 2 ay 2
-
aB 2u 0
ap
(2.2) (2.3)
0=- -
ay
where u and p are the velocity and the pressure, respectively. The physical properties p, J-t, a, and Bo are the density, the viscosity, the electrical conductivity and the imposed magnetic field, respectively. Physically, the extra term in the x direction momentum aBJu, represents the electric body force. Other than this term, the basic equations are identical to those for the Couette flow of a Newtonian fluid. Equation (2.1) means that the velocity u is independent of x. Similarly, Eq. (2.3) shows that p is independent of y. This reduces Eq. (2.2) to
d 2u aBJ I dp ----u=-dy 2 pv pv dx
(2.4)
The boundary conditions are y
= 0:
u
= 0;
y
= L: u =
U
In terms of dimensionless quantities
u = u/ U,
Y/=y/L
Eq. (2.4) becomes
(2.5) subject to the boundary conditions
u(O) = 0;
y/=l:
u(l)=l
(2.6)
where the two dimensionless quantities M and P are defined as a
)1/2
M
= ( pv
P
= 1-( dp ) L U
dx
BoL 2
ov
(Hartmann number) (Pressure number)
Equation (2.5), subject to the boundary conditions (2.6), will now be solved by the adjoint method.
56
4. The Adjoint Operator Method
First, Eq. (2.5) is written as a system of first-order differential equations, dU 1
--;J;j = U z = (0)u 1 + (l)u z + (0)
(2.7)
duz
--;J;j = MZu 1 + P = (Mz)u 1 + (O)u z + (P)
(2.8)
subject to the boundary conditions Tj = 0:
u1(0) = 0;
where u 1 = U. In matrix notations, Eqs. (2.7) and (2.8) can be written as
u = A(Tj)u + F(Tj) where the dot represents differentiation with respect to n; matrix of the unknowns,
(2.9) U
is the column
A(Tj) is the square matrix A=
[~z ~]
and the forcing function F(Tj) is another column matrix,
We next introduce the adjoint system,
-x = ATX
(2.10)
where the column matrix is defined as
and AT is the transpose of A. For this example, the transpose of A is
AT=[~ ~Z] The adjoint differential equations are therefore dx.] dTj
= - MZxz
(2.11 )
dx z/ dn
= - XI
(2.12)
57
4.2 Second-Order DIfferential Equations
The steps outlined in Eqs. (1.7) and (1.8) can be carried out as follows. Multiplying Eqs. (2.7), (2.8), (2.11) and (2.12) by xl> x 2 ' u., and u2 , respectively, and summing up these four expressions, we then get d
dTJ (x)u) + X2U2) = PX2
(2.13)
Integrating Eq. (2.13) from 0 to I, we get
[x.(I)u)(I) + x 2(I)u2( 1) ] - [x)(O)u)(O) + xiO)u2(0)] =
L
1 pX2dTJ (2.14)
Since one boundary condition at TJ = 0 is missing, Eq. (2.14) and the adjoint equations (2.11) and (2.12) will be applied once. First, let us substitute the known boundary conditions into Eq. (2.14); we get
[x.(l) + x 2(1)u2(1)] - [X2(0)U2(0)] = L·PX2dTJ
(2.15)
Now, u2 (0) is the missing initial condition of Eqs. (2.7) and (2.8), which can be solved from Eq. (2.15):
u2(0) = x)O) { [x.(I) + x 2(I)u2( 1) ] - L1pX2dTJ}
(2.16)
In Eq. (2.16), uil) is an unknown quantity, whereas the two quantities x.(l) and x 2(l) are the initial conditions for the integration of Eqs. (2.11) and (2.12) and can be assigned arbitrarily. The natural choice of xiI) is zero, since this will set the second term on the right-hand side of Eq. (2.16) to zero no matter what the value of uil) may be. The simplest choice of x)(l) is, of course, unity. Equation (2.16) therefore becomes
u2(0) =
X2~0)
(I - L PX2dTJ )
(2.17)
1
To summarize, the solution of Eqs. (2.7) and (2.8) takes the following steps. 1. Equations (2.11) and (2.12) are integrated backward from TJ
TJ
= 0, using the boundary conditions x 1( 1) = I and x 2(l) = o.
= I to
2. With the solutions of x. and x 2 known from step 1, u2(0) can be found by Eq. (2.17). 3. Since both u 1(0) (given) and uiO) (found in step 2) are known, Eqs. (2.7) and (2.8) become an initial value problem and can be integrated to get the final solution. As an example, consider the solution for M
= 2 and
P
= 4. Solutions of
58 XI
4.
and
X2
The Adjoint Operator Method
from step 1 are tabulated in Table 4.1, from which we find x 2 (0) = 1.8129
Substituting the solutions from Table 4.1 into Eq. (2.17), we find (1 - 0.6904) 1.8129 = -0.9717
u2 (0) =
Finally, using the two boundary conditions u2 (0)
= - 0.9717
Eqs. (2.7) and (2.8) can be integrated as an initial value problem. The results are shown in Table 4.2. Also shown in Table 4.2 are numerical TABLE 4.1
Solutions of XI and x 2 from Step 1 (for M = 2 and P = 4)
1.00 0.90 0.80 0.70 0.60 0.50 0.40 0.30 0.20 0.10 0.00
1.0000 1.0200 1.0810 1.1853 1.3372 1.5428 1.8103 2.1505 2.5769 3.1067 3.7612
0.0000 0.1007 0.2054 0.3183 0.4440 0.5875 0.7546 0.9520 1.1875 1.4707 1.8129
TABLE 4.2
Solutions of Eqs. (2.7) and (2.8) (for M = 2 and P = 4) Exact solution
By adjoint u1
'1/
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
-
0.0000 0.0778 0.1185 0.1238 0.0940 0.0279 0.0773 0.2257 0.4233 0.6781 1.0000
u2 - 0.9717 - 0.5885 - 0.2289 0.1214 0.4767 0.8511 1.2596 1.7186 2.2466 2.8648 3.5979
u. -
0.0000 0.0777 0.1185 0.1239 0.0941 0.0279 0.0772 0.2256 0.4232 0.6779 1.0000
59
4.2 Second-Order Differential Equations
values of
U1
U
based on the exact solution of Eqs. (2.7) and (2.8), I
=
P [2 sinh t MYJ sinh t M (YJ - I) ] sinh MYJ + -2 sinhM M coshtM
The agreement is seen to be excellent.
4.2.2 Bending of a Beam
A beam of length L is simply supported at both ends, as shown in the figure below. It is desired to find the deflection y of the beam as a function of x if the beam has a constant load W per unit length.
r-
x w
Fig. 4.2
Schematic diagram of the beam.
The total weight of the beam is WL. Each end therefore supports half of the weight, i.e., t WL. To find the bending moment M at any location x, let us consider the force to the left of x. The force t WL at A has moment - t(WL)x. The force Wx due to the weight of beam to the left of x has moment (Wx)(1 x). The total bending moment M T at x is therefore the summation of the above, which can be substituted into the equation of motion dy £ 1 -2 = M T dx to give £1 dy = dx 2
1 2
Wx 2
-
1 2
WLx
(2.18)
The boundary conditions are x = 0:
y = 0;
x = tL:
dy(tL)/ dx = 0
The first boundary condition means that the deflection of the beam is zero at the end. The second boundary condition is due to symmetry of the deflection curve.
60
4.
The AdjoInt Operator Method
If we introduce
x=
xl L,
J=YIL
then Eq. (2.18) becomes dy I dx 2 = (3(x 2 - x)
(2.19)
subject to the boundary conditions x= 0: J = 0;
x=t:
dyldx=O
where We shall now solve Eq. (2.19) by the present method. First, the equation has to be written as a system of first-order differential equations as.
= h = (O)y. + (I)h + (0) dhl ds = (3(S2 - s) = (O)Yl + (O)h + (3(S2 -
(2.20)
dYll ds
s)
(2.21)
where the boundary conditions are
s
= 0: Yl(O) = 0;
s
=
t:
h(t ) = 0
The coefficient matrix is
A=[~ ~] Its transpose is therefore
The transposed system of equations is therefore
or
dz.
-=0 ds
dZ 2
d'S =
(2.22) (2.23)
-z.
Next, Eqs. (2.20)-(2.23) are multiplied by z I' the summation of the resulting equations is
Z2'
Y., and h, respectively; (2.24)
61
4.2 Second-Order Differential Equations
Integrating Eq. (2.24) from
°to 1-, we get
[Yl( 1- )Zl( 1-) + Yz( 1- )Z2( 1-)] (1/2
= f3 J
o
- [Yl(O)ZI(O) + Yz(0)Z2(0)]
Z2(S2 - s)ds
(2.25)
Substituting into Eq. (2.25) the known boundary conditions, Yl(O)
YzO) = 0, we get
Yl( 2"I) Zl(I) 2"
-
Yz(0)Z2(0) -_ f3 J(1/2Z2(S 2 - s) ds o
°
= and (2.26)
We therefore choose the boundary conditions for the integration of Eqs. (2.22) and (2.23) to be (2.27) Eq. (2.26) then gives
f3
yiO) = - Z2(0)
(1/2
2
Jo Z2(S -
s)ds
(2.28)
The solution of Eqs. (2.20) and (2.21) can therefore be summarized as follows. First, Eqs. (2.22) and (2.23) are integrated from s = 1- to s = 0, using the boundary conditions in (2.27); next, the missing boundary condition, Yz(O), is calculated from Eq. (2.28); finally, the solutions of Eqs. (2.20) and (2.21) can be found by integrating these two equations subject to the boundary conditions Yl(O) = and YiO) just found. Results for the missing boundary condition Yz(O) are tabulated in Table 4.3 for four values of f3 using this method. With these values of the missing boundary condition, Eqs. (2.20) and (2.21) are integrated, and the results are tabulated in Table 4.4. Physically, these give half the deflection curve of the beam. For beams of the same cross section and made of the same material, a larger value of f3 means either a larger load W or a longer beam, or both.
°
TABLE 4.3
Y2(0) for a Few Values of {3's
0.1 0.5 1.0 5.0
0.00833 0.04167 0.08333 0.41667
4. The AdJoint Operator Method
62 TABLE 4.4
Deflection of Beams Deflection curve, Yl(S)
4.3
S
f3 = 0.1
f3 = 0.5
f3 =
0.0
0.ססOO
0.ססOO
0.ססOO
0.ססOO
0.1 0.2 0.3 0.4 0.5
0.0008 0.0015 0.0021 0.0025 0.0026
0.0041 0.0077 0.0106 0.0124 0.0130
0.0082 0.0155 0.0212 0.0248 0.0260
0.0409 0.0773 0.1059 0.1240 0.1302
1.0
f3 = 5.0
THIRD-ORDER DIFFERENTIAL EQUATIONS
The method developed in the previous section will now be extended to the solution of third-order differential equations. Even though the idea remains the same, there are certain points which need detailed explanation. Accordingly, we shall give full details of the solution of a third-order differential equation. The example chosen is the sandwich beam analysis treated earlier. Sandwich Beam Analysis
The third-order differential equation resulting from an analysis of the sandwich beams can be written as dYI 2 dYI - -3 - k -+a=O dx dx
(3.1)
subject to the boundary conditions dYl(O)
dYl(1)
~ = ~ =0,
Yl(!)=O
(3.2)
The physical explanation of the problem and its formulation was discussed in Section 2.3.2. As in the preceding section, Eq. (3.1) is first written as a system of first-order differential equations: dYI
dt
= Yz,
dYz
dt
= Y3'
dYJ
dt
= kY2 -
a
(3.3a-c)
In matrix notations, Eq. (3.3) can be written as
y = Ay + f
(3.4)
63
4.3 Third-Order Dlnerentlal Equations
where
YI Y= Y2 , [ h
f
~
=[
I
o
e
-a
!]
The adjoint differential equation is therefore, i = -ATx
(3.5)
where AT is the transpose of A, i.e.,
o o I
Eq. (3.5) can be written as
dx, dt
= 0,
dX2 dt
=
dX3 dt
2
-XI - k X3'
=
-X 2
(3.6a-c)
Multiplying Eqs. (3.3a)-(3.3c) and (3.6a)-(3.6c) by XI> X2 ' x 3'YI>Y2, and h, respectively, and adding these six equations, we then get d dt (xly\
+ x 2Y2 + x 3h) =
(3.7)
-ax 3
Integrating Eq. (3.7) from t = 0 to t = I and substituting the given boundary conditions into the resulting equation, we then get [X\(l)y\(I)
+
x 3(I)h(l)] - [xl(O)y\(O)
+
x 3(0)h(0)]
=
-afo\X 3dt
(3.8) Inspection of the first three terms on the left side of Eq. (3.8) shows that if the adjoint equations (3.6) are integrated using the boundary conditions x\(I)
= 0,
(3.9)
Eq. (3.8) becomes
(3.10) This is an algebraic equation in y\(O) and Y3(0), since integration of Eq. (3.6), subject to the boundary conditions (3.9), will yield xl(t), x 2(t), and x 3(t) for the range of t = I to t = O. In particular, xl(O) and x 3(0) are known from these solutions. For the solution of two missing initial conditions, y\(O) and h(O), another algebraic equation relating them will be needed. This equation can
64
°
be obtained by integrating Eq. (3.7) from to condition is specified at t = !. We then get [x 20
4. The Adjoint Operator Method
!
(since the third boundary
)yi!) + x 3( !)Y30)] - [XI(O)YI(O) + X3(0)h (0) ] = - a
L
I/ 2 x 3dt
(3.11) where the given boundary conditions have been substituted into the equation. Inspection of the first three terms of Eq. (3.11) shows that if Eq. (3.6) is integrated backward from t = ! to t = 0, using the boundary conditions
XIO) = I,
X2
( !) = 0,
(3.12)
then Eq. (3.11) becomes (1/ 2
X1(0)Yl(0) + x 3(0)h (0) = a J o
x 3 dt
(3.13)
Since xl(t), xit), and xiI) are now known solutions, Eq. (3.13) gives the second algebraic equation for the solution of YI(O) and h(O). Once YI(O) and Y3(0) are solved, the complete set of boundary conditions at t = is known, since yiO) is given. Equation (3.3) can then be integrated as an initial value problem. As an example, consider the solution for
°
k = 1.0 and a = 1.0 Integration of Eq. (3.6) from t = I to t = 0, using the boundary conditions specified in Eq. (3.9), gives the first set of solutions, which is tabulated in Table 4.5. TABLE 4.5 First Set of Solutions of Eq. (3.6)
1.00 0.80 0.60
0.40 0.20 0.00
0.0000 0.0000 0.0000 0.0000 0.0000 0.0000
1.0000 1.0200 1.0809 1.1852 1.3370 1.5425
-
0.0000 0.2013 0.4107 0.6365 0.8879 1.1749
Carrying out the integration in Eq. (3.10), we get
- 1.1749h(0)
=-
0.54292
(3.14)
Next, Eq. (3.6) is integrated from t =! to t = 0, using the boundary conditions (3.12). The results are summarized in Table 4.6.
65
4.4 Concluding Remarks TABLE 4.6
Second Set of Solutions of Eq. (3.6) x2
XI
0.5 0.4 0.3 0.2 0.1 0.0
i.oooo i.oooo i.oooo i.oooo i.oooo i.oooo
-
x3
0.ססOO
0.ססOO
0.1002 0.2013 0.3045 0.4107 0.5211
0.0050 0.0201 0.0453 0.0811 0.1276
Carrying out the integration in Eq. (3.13), we get y\(O) + 0.127613(0)
= 0.0211
(3.15)
The missing boundary conditions can now be solved from Eqs. (3.14) and (3.15), and the results are YI(O) = -0.0379,
Y3(0) = 0.4621
(3.16)
As a final step, solutions of Eq. (3.3) can be obtained by forward integration, since now it is an initial value problem. Table 4.7 shows the results. Agreement with the data calculated by the two methods discussed in the preceding chapters is excellent. TABLE 4.7 Solutions of Eq. (3.3)
0.0 0.2 0.4 0.6 0.8 1.0
YI
Y2
- 0.0379 - 0.0299 - 0.0112 0.0112 0.0299 0.0379
0.0730 0.1087 0.1087 0.0730
0.ססOO
0.ססOO
Y3 0.4621 0.2701 0.0888 - 0.0888 - 0.2700 - 0.4621
4.4 CONCLUDING REMARKS
The adjoint operator method outlined in this chapter is a very simple numerical scheme for the solution of linear boundary value problems. The examples given were presented in such a way that the reasoning which led to the choice of the initial conditions of the adjoint equations was made clear. In general, the number of backward integrations required is equal to the number of the unknown boundary conditions at the starting point. Therefore, if a third-order differential equation has one boundary condition given at the starting point and two boundary conditions at the end
66
4. The Adjoint Operator Method
point, we should interchange the roles of the two points, i.e., treat the end point as the starting point and vice versa. In this way, the number of backward integrations required is reduced by one. For a discussion of the convergence properties and the error estimate of the method of adjoint, the reader is referred to Roberts and Shipman [4] (see Section 6.7). The methods of superposition, chasing, and adjoint operator treated in the last three chapters provide three alternatives for the solution of linear boundary value problems. Basically, all three methods give a systematic way of finding the set of missing initial conditions by integrating a set of equations in a process of one or several passes. Solutions are obtained without iteration. There is very little difference among the three methods with regard to ease of programming, computational time, accuracy, and stability, with the exception that the equation itself may posses certain special properties that make one of the' methods ineffective. For example, Roberts and Shipman [4] cited the case in which an equation is stable on integrating forward but is unstable on integrating backward; in this example the adjoint method would not be a good choice. As another example, the method of superposition is a clear choice if the interval of integration is from zero to infinity. One particular problem that might sometimes occur in the solution of certain linear boundary value problems is that the columns of the matrix of coefficients of the linear equations developed by any of the above methods may be linearly dependent. Should this occur, it will be very difficult to compute the solution with sufficient accuracy. One effective way to overcome this difficulty is the GramSchmidt orthonormalization scheme [5]. For nonlinear equations, it is necessary first to linearize the nonlinear differential equations. Among the most commonly used methods are quasilinearization and Newton's variation method. Details of these linearization procedures are given in detail in the next two chapters. PROBLEMS
1. It is desired to find the deflection of a simply supported beam loaded by a concentrated load, as shown in Fig. 4.3. The differential equation for y
t
p
a
Ii
I
Cb----tx D.
Fig. 4.3
Diagram of problem I.
I
67
Problems
the solution of the deflection curve is given by £1 dYl dx?
dYz
£1 dx z
= =
Pb 1
X
Pb - I x - P(x - a)
for
x
a
The boundary conditions are
x = 0: Yl = 0 x = a: YI = Yz,
x = I:
dYl dYz dx = dx
Yz = 0
Solve the problem by the adjoint operator method and compare the results with the exact solutions [6].
Hint: First, introduce the following dimensionless variables,
x = xl I, The differential equations will be in dimensionless form with two dimensionless parameters, namely, a II and b I I. Solutions can therefore be sought for a few pairs of values of these two parameters. 2. In an analysis of the hydrodynamic extrusion with controlled follower block clearance [7], the equation for the solution of the velocity w is given by
subject to the boundary conditions w(a) = 0,
w(b) = 0
Find the velocity distribution by the adjoint operator method. The following data are given: Q (flow rate) = 0.24 in. 3/sec, a (outer radius) = 0.513 in., c (clearance) = 0.00025 in., b (inner radius) = a-c. Answer: The missing slope at r = a is dw(a)1 dr = - 2322. 3. Gas A diffuses into a liquid and an irreversible, first-order, homogeneous reaction occurs, A + B = AB. The concentration of A can be
68
4.
The Adjoint Operator Method
solved [8] from the differential equation d 2c A - D - - +kc A =0 dz 2
subject to the boundary conditions
cA(O) = cAo'
dcA(L)1 dz = 0
Solve the problem by the adjoint operator method for kL 2 I D = 10- 2 and 10- 3 • Hint: Introducing the dimensionless quantities CA =
z= zlL
cAl CAo ,
the differential equation becomes d 2cAI dz 2 - (kL 2I D
)cA = 0
subject to the boundary conditions
The exact solution is cosh';kL21 D (1 - z)
cosh';kL 2 I D 4. A Newtonian fluid flows through the space between two concentric cylinders [9], both of which are rotating at different but steady speeds. The velocity distribution of the fluid can be solved from d
2u
dr 2
+ .!!.... ( !!. ) = 0 dr
r
subject to the boundary conditions u(r J ) = rJw l ,
u(r2) = r 2w2
Solve the problem by the adjoint operator method. The constants are specified as follows: r J = 0.75 in., r2 = 1.00 in., WI = 3 rpm, and W 2 = 10 rpm. Answer:
2W2r~ - wl(r~
+ rD
r~ - r~
5.
Solve problems 3 and 4 of Chapter 3 by the adjoint operator method.
References
69
REFERENCES I.
2. 3. 4. 5. 6. 7. 8. 9.
Goodman, T. and Lance, G., The numerical integration of two-point boundary value problems, Math. Comput., 10, 82-86, 1956. Bliss, G. A., "Mathematics for Exterior Ballistics," pp. 63-71, Wiley, New York, 1944. Wright, F. B., Jr., "The Adjoint Method in Analog Computation," Advisory Board on Simulation, Tech. Note 48, Univ. of Chicago, Chicago, Illinois, 1954. Roberts, S. M. and Shipman, J. S., "Two-Point Boundary Value Problems: Shooting Methods," Elsevier, New York, 1972. Todd, J., "Survey of Numerical Analysis," p. 347, McGraw-Hill, New York, 1962. Timoshenko, S., "Strength of Materials," pp. 168-169, Van Nostrand-Reinhold, Princeton, New Jersey, 1956. Kukarni, K. M., and Schey, J. A., ASME paper 74-Lubs-12 (1974). Bird, R. B., Stewart, W. E., and Lightfoot, E. N., "Transport Phenomena," p. 532, Wiley, New York, 1960. Schlichting, H., "Boundary Layer Theory," p. 80, McGraw-Hill, New York, 1968.
CHAPTER
5
ITERATIVE METHODSTHE SHOOTING METHODS
5.1 INTRODUCTION
In Chapters 5 and 6, the solution of boundary value problems (both linear and nonlinear) by iterative methods will be treated. These methods can be classified into two groups, namely shooting methods (Chapter 5) and finite-difference methods (Chapter 6). Even though the treatment in these two chapters is brief, the methods that are included are presented in sufficient detail for the reader to make meaningful application of these techniques to problems arising in sciences and engineering. In a shooting method, the missing (unspecified) initial condition at the initial point of the interval is assumed, and the differential equation is then integrated numerically as an initial value problem to the terminal point. The accuracy of the assumed missing initial condition is then checked by comparing the calculated value of the dependent variable at the terminal point with its given value there. If a difference exists, another value of the missing initial condition must be assumed and the process is repeated. This process is continued until the agreement between the calculated and the given condition at the terminal point is within the specified degree of accuracy. For this type of iterative approach, one naturally inquires whether or not there is a systematic way of finding each succeeding (assumed) value of the missing initial condition. Three such methods will be covered in this chapter: Newton's method (Section 5.2), the parallel shooting method (Section 5.3), and the method of quasi linearization (Section 5.4). All these methods are essentially based on the same principle, Newton's method of solving nonlinear algebraic equations and all therefore possess the same two important properties of monotone convergence and quadratic convergence. For most problems, Newton's method and the quasi-linearization method are equally efficient. However, due to the fact that Newton's method adjusts only the missing 70
5.2 Newton's Method
71
initial condition whereas in the method of quasi linearization the function at every point within the interval of integration is adjusted systematically, the latter is expected to exhibit better convergence. The method of parallel shooting is usually applied to problems where the solution is extremely sensitive to the assumed initial slope. 5.2 NEWTON'S METHOD
In this method, the differential equation is kept in its nonlinear form and the missing slope is found systematically by Newton's method. This method provides quadratic convergence of the iteration and is far better than the usual "cut-and-try" methods. Consider the second-order differential equation
dyjdx 2 = f(x,y,dyjdx)
(2.1)
subject to the boundary conditions
y(O) = 0,
y(L)
=A
(2.2a, b)
First, Eq. (2.1) is written in terms of a system of two first-order differential equations:
dyjdx = u,
duj dx = f(x, y, u)
(2.3)
We denote the missing initial slope by
dy(O)j dx = s
or
u(O)
=
s
(2.4a, b)
The problem is to find s such that the solution of Eq. (2.3), subject to the initial conditions (2.2a) and (2.4), satisfies the boundary condition at the second point, (2.2b). In other words, if the solutions of the initial value problem are denoted by y(x,s) and u(x,s), one searches for the value of s such that
y(L,s) - A = (s) = 0
(2.5)
For Newton's method, the iteration formula for s is given by
or
s(n+ 1) = s(n) _
y(L,sn) - A ay(L,sn)jas
(2.6)
72
5.
Iterative Methods-The Shooting Methods
To find the derivative of y with respect to s, Eqs. (2.3), (2.2a), and (2.4) are differentiated with respect to s, and we get
.
dU dx
and
= _at
YeO) = 0,
where
Y=
aylas,
ay
at U
Y+ _
au
U(O) = 1 U=
(2.7) (2.8)
aulas
(2.9)
The solution of Eq. (2.3), subject to the boundary conditions (2.2a, b), can therefore be obtained by the following steps. 1. Assume a value of s for the missing initial slope, (2.4). Let us denote this approximate value of s by s( I) • 2. Integrate Eq. (2.3), subject to the boundary conditions (2.2a) and (2.4), as an initial value problem from x = to x = L. 3. Integrate Eq. (2.7), subject to the boundary conditions (2.8), as an initial value problem, from x = to x = L. 4. Substituting the values of y(L,s(l» and Y(L,S(I» into Eq. (2.6), we get S(2) = s(l) - [y(L,S(I») - A ]IY(L,s(I»)
°
°
the next approximation of the missing initial slope S(2) is obtained. 5. Repeat steps 2-4 until the value of s is within the specified degree of accuracy. An example will be given in the next section. Unsteady Flow 01 a Gas through a Porous Medium
Consider the unsteady flow of a gas through a semi-infinite porous medium. The medium is assumed to be filled with gas at a uniform pressure Po initially. At time t = 0, the pressure at the surface is suddenly reduced from Po to PI and is thereafter maintained at this pressure. The governing differential equation for the unsteady isothermal flow of a gas can be derived as follows. Consider the infinitesimal volume shown in Fig. 5.1. Conservation of mass requires that (mass flux into the volume)
(mass flux out of the volume)
(rate of accumulation of mass in the volume)
(2.10)
or, in mathematical form [ (puA)] -
a(pu)]} {[pu + ~ dx A
a = at
[p(A dx ep) ]
(2.11 )
73
5.2 Newton's Method
where A and u are the area and the velocity of gas, respectively, and ep is the porosity of the medium, defined as the volume of the pore spaces per unit volume of the medium. Eq. (2.11) can be simplified to give ap
apu
ep at = - ax
(2.12)
x dx
Fig. 5.1 Semi-infinite porous membrane.
For flow in a porous medium, the velocity is related to the pressure gradient through Darcy's law, k ap u= - - (2.13) fL
ax
where the constants k and fL are the permeability of the medium and viscosity of the fluid. In addition, for an isothermal gas the density is related to the pressure through the equation of state, (2.14)
p=pRT
where R is the gas constant. Substitution of Eqs. (2.13) and (2.14) into Eq. (2.12) yields
a(
ax
p
ap)
ax
=
epfL ap
k at
subject to the boundary conditions
p(x,O) = Po,
p(O,t) = PI>
p(oo,t)=po
Kidder [1] introduced the similarity transformation x
z=-
It
and
"" )1/2 't"IL ( -4pok-
(2.15)
74
S. Iterative Methods-The Shooting Methods
where a
= 1 - (PUP5)
Equation (2.15) and its boundary condition become
d\v + 2z dw = 0 dz 2 (1 - aw)I/2 dz and
w(O) = 1,
(2.16)
w(oo) = 0
In order to compare the results with those from [2], a transformation of variables TJ = z/(I - a)I/4 and f(TJ)=w-I is introduced, and Eq. (2.16) and its boundary condition become
d~ +
dTJ2
2TJ df (l-[a/(I-a)]j}1/2 dTJ
=0
(2.17)
and
f(O) = 0,
f( 00) = -1
To apply Newton's method, Eq. (2.17) is written first-order differential equations,
df -=u dTJ '
(2.l8a, b) ill
terms of two
du 2TJu dTJ = - {l - [ a/ (1 - a)] f} 1/2
(2.19)
subject to the boundary conditions
f(O) = 0,
f(oo)
= -1
(2.20a, b)
Let us denote the missing slope by
df(O)/ dTJ = s
or
u(O) = s
(2.21a, b)
Equations (2.19), (2.20a), and (2.2Ib) can be differentiated with respect to s to give
dF = U dTJ dU
2TJ ( auF dTJ = - {l - [ a / (1 - a)] j} 1/2 2( 1 - a){ 1 - [ a / (1 - a)] j} (2.22)
F(O) = 0,
U(O) = 1
(2.23)
75
5.2 Newton's Method
where F=
u = au/as
of/as,
(2.24)
As an example, consider the solution of Eq. (2.19) for a = 0.154. As a first approximation, let us assume the missing initial slope to be
df(O)
~
= u(O) = s(l) = -1.00
(2.25)
where the superscript (1) indicates the number of iteration. Equation (2.19), subject to the boundary conditions (2.20a) and (2.25), can therefore be integrated as an initial value problem. A summary is given in Table 5.1. TABLE 5.1 First Approximation of the Solution"
r»
11
0.0 0.4 0.8 1.2 1.6 2.0
-
u(l)
0.0000 0.3814 0.6655 0.8234 0.8892 0.9096
° Superscripts give
-
j = O. For the nth iteration, this gives
Y; - f(x, Yn' Y~) = 0 For the (n
(4.4)
+ l)th iteration, we get
cf>(x,Yn+l'Y~+I'Y;+l)=cf>(X,Yn'Y~,Y;)+ (:; )n(Yn+l- Yn) + ( :;,
t(Y~+l
-
Y~) + ( a;'1
t
or,
- (
) n(Y;+I - Y;) + ...
=
0 (4.5)
~~) n(Yn+l - Yn) - ( a~ (Y~+I - Y~) + (Y;+I - Y;) = 0
(4.6)
Substituting j f from Eq. (4.4) into Eq. (4.6), we get
" I - (af) Yn+ ay' nYn+ 1 I
(
af) nYn+ 1 ay
af) /n - f(x,Yn,Yn) - (af ay ) /n - ( ay ' _
I
(4.7)
I
The boundary conditions are
Yn+I(O) = 0,
Yn+I(L)
=
A
(4.8)
Equation (4.7), subject to boundary conditions (4.8), is a linear boundary value problem, the solution of which can be obtained by one of the methods treated in Chapters 2-4. 5.4.1 Radiation Fin of Trapezoidal Profllet
Consider the radiation fin shown in Fig. 5.3. The fin is assumed to liberate heat to its surrounding only through radiation. By using the one-dimensional form of the energy equation, the following differential equation is obtained for the solution of the temperature distribution: d
2U
dR 2
+ [1
4
_ 0 t a n a ] dU /3U R+p - (I-R)tana+O dR - (l-R)tana+O-
(4.9) t
See Keller and Holdrege [3].
86
5. Iterative Methods-The Shooting Methods
annular fin of trapezoidal profile
Fig. 5.3 Annular fin of trapezoidal profile. (Reprinted from [3] with permission of the American Society of Mechanical Engineers.)
subject to the boundary conditions
U(O) = 1,
- 0 ( dU) dR R - I -
The dimensionless quantities in the above equation are related to the physical variables through the following definitions: T
U = TB
'
=
f3
(rT
-
rB)mTJ
k cos ex
R= (4.10)
where T B , €, (J, and k are, respectively, the temperature at rB , the emissivity of the fin, Planck's constant, and the heat conductivity. The radius of the base and tip are labeled r B and rT , respectively, and ex is the angle of inclination of the top surface. The linearized equation of Eq. (4.9), corresponding to Eq. (4.7), is then d2U ( dR 2 -
)(i+I)
[1
tan ex
+ R + P - (1 - R )tan ex + ()
l
4f3( u3 ) [ (1- R)tanex + () i
]
.
U(·+I) = -
J( dU)(i+l) dR
3f3(U 4 ) ( i ) (1- R)tanex + ()
(411)
.
87
5.4 Quasi Linearization
The boundary conditions become R
= 0:
= 1;
U(i+I)
R
= 1: ar-:» /dR = 0
To solve Eq. (4.11), the method of superposition, treated in Chapter 2, will now be used. Let us write = V+ sW
U(i+I)
(4.12)
and set s
=
au": 1)(0)/ dR
Equation (4.11) can be separated into two initial value problems: 2V
d + [1 dR 2 R +P
tan a ] dV (1 - R )tana + 0 dR 3{3( u 4f ) V = - (1 - R )tan a + 0
4{3( U 3f ) - [ (1 - R )tan a + 0
]
V(O) = 1,
dV(O)/ dR
(4.13)
=0
and 2W
d dR 2
+ [1
tan a ] dW (I-R)tana+O dR
R+p
-
4{3( u 3 f ) [ (1 - R )tana + 0
W(O)
= 0,
]
(4.14)
W-O -
dW(O)/ dR
=1
As a numerical example, the solutions of Eq. (4.9) are worked out for the following values of the parameters: p = 0.5,
0=0.05,
{3
= 0.1
By assuming an initial approximation of U(I)
=1
higher-order iterates can be obtained by integrating the two initial value problems defined by Eqs. (4.13) and (4.14) from R = 0 to R = 1. The value of s can be computed from the boundary condition at R = 1, i.e., s
= - V'(I)/ W'(I)
Combination of the two solutions, V and W, then gives the second iterate U(2). This process is continued until the desired accuracy is reached. A summary of the solutions is given in Table 5.8.
5. Iterative Methods-The Shooting Methods
88
TABLE 5.8 Sample Solutions of Eq. (4.9) (a = 6°, p = 0.5, () = 0.05, f3 = 0.1)
U U) a
R
i= 1
0.0 0.2 0.4 0.6 0.8 1.0
i.eooo i.oooo t.ocoo t.oooo i.oooo
ai
i.oooo
i= 2
i=3
i=4
i.oooo
i.oooo 0.9049 0.8410 0.7971 0.7692 0.7584
i.oooo
i.oooo
0.9044 0.8400 0.7956 0.7673 0.7564
0.9044 0.8400 0.7956 0.7673 0.7564
0.9185 0.8665 0.8328 0.8127 0.8052
i=5
is the number of iteration.
5.4.2 A Nonlinear Dynamics Problem
We shall now consider another nonlinear boundary value problem which is slightly different from the one treated in the last section. Consider a mass m acted upon by a nonlinear force which equals, say, - xe - X, where x is its position on the x axis. Initially, the mass is located at the origin x = O. We are to find the initial velocity and the duration of motion such that when the particle reaches the point x = x o, the velocity of the mass is exactly zero. From Newton's second law of motion, the problem can be represented by the following boundary value problem: d 2x/dt2= -xe- x
(4.15)
subject to the boundary conditions t=O:
x=O
t= T:
x
= x o,
(4.l6a) dx/ dt
=0
(4.16b)
The unknowns are therefore dx(O)/ dt and T. The quasi-linear form of Eq. (4.15) is . . d 2X (i+ I) + [(1 _ x(i»e-x('l]x(i+I) = _(x 2)(I)e- x(i )
dt?
(4.17)
subject to the boundary conditions
=0
t = 0:
X(i+I)
t = T:
x(i+ I) = x o, dx(i+ I) / dt = 0
Because of the fact that the duration of time T is also unknown, Eq. (4.17) will now be solved by the method of superposition with slight
5.4
Quasi Linearization
89
modification. Let us first separate
x(i+ I)
X(i+I)
into two solutions by
= Y + sZ
(4.18)
By identifying s = dx':" 1)(0)/ dt
Eq. (4.17) can be separated into two initial value problems, as 2
d y
dt 2
+ [(1 _ y(o) d
2Z
x(i»e-x(i)] Y
= 0,
+ [(1 -
dt 2 Z(O) = 0,
=
_(x 2)(i)e- x(I)
dY(O)/ dt
=
° °
x(i»e-x(I)]Z =
(4.19)
(4.20)
dZ(O)/ dt = 1
= T gives Y(T) + sZ(T) =
The boundary conditions at t
X
(4.21)
o
and dY(T) dZ(T) dt +s dt
=
°
(4.22)
Eliminating s from Eqs. (4.21) and (4.22), we get Y(T)
dZ(T) dY(T) dt - Z(T) dt
= Xo
dZ(T) dt
(4.23)
Equation (4.23) and one of (4.21) and (4.22) are the equations needed for the evaluation of the unknown duration T and the parameter s. The solution of Eq. (4.15) therefore consists of the following steps. l.
An initial approximation is assumed. Let us choose x
= xo(l
- e- t )
which gives X~I), for n = 1, ... , N. 2. The initial value problems defined by Eqs. (4.19) and (4.20) are integrated from t = with the increment of t equal to h. During the integration process, the condition (4.23) is checked for each t step. Integration will stop when Eq. (4.23) is satisfied. We have now the unknown time duration T as well as Y(T) and Z(T). 3. The value of s is then formed from Eq. (4.21). 4. Combination of the two solutions through the relation (4.18) then gives X~2), n = 1, ... , N. 5. Steps 2-4 are repeated, until the desired accuracy is reached.
°
90
5. Iterative Methods-The Shooting Methods
A summary of the numerical solutions thus obtained is given in Table
5.9.
TABLE 5.9
Sample Solution of Eq. (4.15) (xQ= 0.5)a First approximation
X (i)
X(I)
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5
0.0000 0.1967 0.3161 0.3884 0.4323 0.4590 0.4751 0.4849 0.4908 0.4945
0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45
;=2
i = 3
;=4
0.0000 0.0589 0.1 175 0.1755 0.2328 0.2890 0.3440 0.3977 0.4497 0.5000
0.0000 0.0586 0.1168 0.1746 0.2316 0.2877 0.3427 0.3965 0.4490 0.5000
0.0000 0.0586 0.1168 0.1746 0.2316 0.2877 0.3427 0.3965 0.4490 0.5000
a After the second iteration, the unknown duration T is found to be T= 0.45.
5.5 CONCLUDING REMARKS
In this chapter we have described two shooting methods, the simple shooting method (Newton's method) and the double-shooting method. The simple shooting method replaces the usual "cut-and-try" searching technique and provides a systematic way of obtaining the missing initial conditions. It generally leads to quadratic convergence of the iteration and decreases computing time. Of course, the rate of convergence depends on how close the initial approximation is to the correct value. In general, there is no universal procedure guiding the initial approximation. In practical engineering problems, however, there are ways to estimate the initial approximation. One such example is the solution of a boundary value problem which contains a physical parameter either in the differential equation or in the boundary condition. If the solution for a certain value of the parameter is known, solutions corresponding to a neighboring value of the solution can be obtained by choosing this solution as the first approximation. One difficulty which arises for certain problems in the simple shooting method is the sensitivity of the solution to the initial guess. This phenomenon of instability arises because the rapidly growing solutions of the initial value problems magnify the truncation and round-off errors. One way to overcome this difficulty is to use parallel shooting. In this method, the interval of integration is divided into a number of subinter-
Problems
91
vals, with the appropriate initial value problems integrated over each subinterval. Adjustment of the initial guess is then made simultaneously to satisfy the boundary conditions and the continuity conditions at the subdivision points. A detailed treatment of the various mathematical aspects of the two shooting methods is given in Chapter 2 of Keller [4]. The quasi-linearization technique outlined in Section 5.4 not only linearizes the nonlinear boundary value problem but also provides a sequence of functions which in general converges quadratically to the solution of the original equation. Starting from a rough first approximation for the dependent variable, the solution of the original nonlinear boundary value problem can be obtained through a sequence of successive iterations of the dependent variable. The idea of quasi linearization is basically a generalization of the well-known Newton-Raphson method. It inherits the two important properties of that method, namely quadratic convergence and monotone convergence. The mathematical problem of existence and convergence for the quasi-linearization technique is beyond the scope of this book. Interested readers should consult the various texts specifically on the method of quasi linearization [5-7]. PROBLEMS
1. In an n analysis of the flow through a uniformly porous channel, Terril [8] found that the dimensionless velocity can be found from the solution of the following boundary value problem:
subject to the boundary conditions
f(O) = 1,
df(O)
-dyt - = 0 ',
f(l) = 0,
where K is an eigenvalue. Find the solution of f for R = 15.014 by (a) Newton's method, (b) parallel shooting, and (c) quasi linearization. In part (c), the linearized equation is solved by all three methods, namely the method of superposition, the method of chasing, and the method of adjoint operator. Note: The problem can be solved by differentiating the differential equation to make it of fourth order. This problem includes all the basic concepts learned in chapters 2-5. Answer: d'1(l)/ dyt2 = -10.162
92
5. Iterative Methods-The Shooting Methods
2. In an analysis of the problem of phase change of solids with temperature dependent thermal conductivity, Cho and Sunderland [9] found that the temperature distribution can be found by solving the following boundary value problem:
.if... dTJ
{(l + {30) dTJdO } + 2TJ dTJdO
=
0(0) = 0, 0(00) = 1
0,
Solve 0 for {3 = 4.00 and 1.441 by (a) Newton's method and (b) the method of quasi linearization. Answer: dO (O)j dTJ = 1.751 and 1.388 for {3 = 4.00 and 1.441, respectively. 3. The stress in the spherical membrane of a spherical cap is found to be governed by the following boundary value problem [10]: d 2F
e
>-..2
de
32 F
8
- + - - 2= ~
= 0:
F= 0;
dF
2d~-(l+/I)F=0
Solve the equation by the method of parallel shooting for /I = 0.3 and = 0.991. Answer: F(l) = 0.2932. 4. Solve the problem treated in Section 4.1 by Newton's method. 5. Solve the problem treated in Section 4.1 by quasi linearization, with the linearized equations solved by the method of chasing. >-..
REFERENCES I.
2. 3. 4. 5. 6. 7. 8. 9. 10.
Kidder, R. E., Unsteady flow of gas through a semi-infinite porous medium, J. Appl. Mech. 79, 329-334 (1957). Na, T. Y., An initial value method for the solution of a class of nonlinear equations in fluid mechanics, J. Basic Eng., Trans. ASME, 503-509 (1970). Keller, H. H., and Holdrege, E. S., Radiation heat transfer for annular fins of trapezoidal profile, J. Heat Transfer, Trans. ASME 92, 113-116 (1970). Keller, H. B., "Numerical Methods for Two-Point Boundary Value Problems," Chapter 2, Ginn-Blaisdell, Waltham, Massachusetts, 1968. Bellman, R. E., and Kalaba, R. E., "Quasilinearization and Nonlinear Boundary Value Problems," Elsevier, New York, 1965. Radbill, J. R., and McCue, G. A., "Quasilinearization and Nonlinear Problems in Fluid and Orbital Mechanics," Elsevier, New York, 1970. Lee, E. S., "Quasi Linearization and Invariant Imbedding," Academic Press, New York, 1968. Terril, R. M., Aeronat. Q. 15,299-310 (August 1964). Cho, S. H., and Sunderland, J. E., J. Heat Transfer, Trans. ASME 96, 214-217 (1974). Perrone, N., and Kao, R., J. Appl. Mech. 38,371-376 (1971).
CHAPTER
6
ITERATIVE METHODS-THE FINITE-DIFFERENCE METHOD
6.1
INTRODUCTION
In this chapter the method of finite differences for the solution of boundary value problems will be treated. In this method, the derivatives in the differential equations are replaced by appropriate finite differences and the differential equation is therefore reduced to a system of algebraic equations. The solution of the algebraic equations then gives the dependent variable at discrete values of the independent variable. The method is preferred over the shooting method for solving numerically sensitive twopoint boundary value problems. For problems which necessitate finding two or more missing initial conditions, this method is more efficient, since the computation in the shooting method is often quite laborious. For the solution of the system of algebraic equations of the finitedifference representation of the differential equation, a very efficient method of factorization will be given in detail. This method is especially suitable for the solution of boundary value problems where the coefficient matrix of the algebraic equations is tridiagonal. Furthermore, the size of the coefficient matrix in actual engineering analyses is in general very large, which necessitates too many computer memory locations and involves too many unnecessary computations if standard methods of matrix inversion, such as Gauss-Seidal's elimination, are used. Details of the derivation of the necessary equations are given. By following through the steps twice in Sections 6.4.1 and 6.5.1, the reader will be able to make meaningful use of the final equations and, if the need arises, derive the corresponding equations for those differential equations not covered in this chapter. 6.2 FINITE DIFFERENCES
To obtain numerical solutions for a differential equation, the continuous variables should be replaced by discrete variables. This is accomplished by 93
94
6. Iterative Methods-The Flnlte·Dlnerence Method
replacing derivatives by finite-difference ratios. The result is a system of algebraic equations, which are then solved on a digital computer. To introduce the concept, consider a continuous function u(x), which is plotted in Fig. 6.1. Let us divide the x axis in finite intervals at a distance ax apart. For three arbitrary adjacent points, namely, xn-I> x n' and x n+ I' the corresponding values of U are un-I> Un' and un+)' respectively. u(x)
I-...._..L-_....L._---I.../\
2
x=O
,.I...-_...l-_....L._---I.._
3
Fig. 6.1
n-l
n
x
n+1
Finite-difference grids.
In terms of un and ax, the values of un+) and un-) can be written in series form as U = U + ( du ) ax n+ 1 n dx n
2U) (ax)2 dx2 n 2!
+( d
+ ...
(2.1)
2U) (ax )2 _ . . . dx 2 n 2!
(2.2)
and U n-)
= U _ ( du ) ax + ( d n
dx n
From Eqs. (2.1) and (2.2), the finite-difference form of the derivatives can be obtained. From Eq. (2.1), we get
(~~ t
=
Un+~: Un
- (
~~~
t ~~ -...
or
(2.3)
95
6.2 Finite Dlnerences
Similarly, from Eq. (2.2), we get 2 du ) = un - un- 1 + ( d U) ~x _ ... ( dx n ~x dx? n 2!
or (
~~ ) n~
un
~=n-l
(2.4)
Equations (2.3) and (2.4) are known as the foward difference and the backward difference, respectively. In both forms, the first term which is truncated is (dluj dx2)n(~xj2!). Since this term contains ~x to its first power, the truncation error is first order. To get the second-order correct finite-difference form of the first-order derivative, we subtract Eq. (2.2) from Eq. (2.1). Upon rearranging, we get du ) un+ 1- un- 1 ( dx n= 2(~x)
_ ( d 3U) (~X)2 + ... dx 3 n
6
or
(2.5) which is called the central difference. Since the first term truncated involves (~X)2, the truncation error is second order. To get the finite difference analog of the second-order derivative, Eq. (2.2) is added to Eq. (2.1) and the resulting equation is solved for the second-order derivative:
or
(2.6) which is again correct to second order. Similarly, the third-order derivative is given by
(2.7) A simple example will be given in the next section to outline the idea of solving boundary value problems by finite-difference methods.
96
6. Iterative Methods-The Finite-Difference Method
6.3 SOLUTION OF BOUNDARY VALUE PROBLEMS BY FINITE DIFFERENCE
In this section, the idea of solving boundary value problems by the finite-difference method will be introduced through a simple example. Consider again the heat transfer through a fin, as shown in Fig. 3.5, Section 3.3.3, with the exception that the surface at x = L is insulated. An energy balance then gives the differential equation for the solution of the dimensionless temperature distribution,
d2() / dX2
= A8
(3.1 )
subject to the boundary conditions
x = 0:
0(0)
= 1;
We will now divide the range of pivot points defined by
x= I:
x
dO(I)/dx=O
(3.2)
(from 0 to 1) into N intervals with
Xo = 0,
n
= 1, ... , N
°
To replace Eq. (3.1) by finite differences, we replace at xn by On and its second-order derivative by the finite-difference representation Eq. (2.6). Equation (3.1) then becomes
(On+l - 20n + 0n_l)/(t:.x)2= AOn or
0n-l For n
[2 + A(t:.X)2]On + 0n+l = 0
= I, Eq. (3.3) becomes 00 -
[2 + A(t:.X)2]01 + 02 = 0
From the first boundary condition, 00
= N,
(3.4)
= 1, Eq. (3.4) therefore gives
- [2 + A(t:.X)2]01 + O2 = -I For n
(3.3)
(3.5)
Eq. (3.3) gives
0N-l -
[2 + A(t:.X)2]ON + 0N+l = 0
(3.6)
The second boundary condition in Eq. (3.2) indicates that a good approximation is
0N-l = 0N+l Equation (3.6) therefore becomes
20N- 1-
[2 + A(t:.X)2]ON = 0
(3.7)
6.3 Solution of Boundary Value Problems by Finite Dlnerence
97
°°
Equations (3.5), (3.7) and Eq. (3.3) for n = 2,3, ... , N - 1 are N equations for the solutions of N unknowns I' 2 , ••. , ON' In matrix-vector form, this system of equations can be written as
[A]8 = s
(3.8)
where
8=
a 1
01
SI
O2
S2
03
s=
s3
(3.9 )
ON-I
SN_I
ON
SN
a 1
a
[A] =
(3.10) a 2
a
with for
n = 2,3, ... , N
(3.11)
and (3.12) The coefficient matrix [A] is known as a tridiagonal matrix due to the fact that all elements of [A] are zero except those three along the diagonal. To find the vector 8, the problem involved is the inversion of the coefficient matrix [A], i.e., 8 =[Arls
Two commonly known methods of matrix inversion are Gauss-Seidel iteration and the relaxation method. While such methods are standard for those problems where the number of intervals N is small, they require a large memory space in the digital computer and too many unnecessary computations when the number N of intervals is large. Such is thecase for most problems in engineering and science where the independent variable
98
6. Iterative Methods-The Finite-Difference Method
has to be divided into a large number of intervals in order to obtain accurate solutions. For this reason, these two methods will not be treated here. Instead, a very effective factorization scheme will be given which makes use of the tridiagonal nature of the coefficient matrix [A]. It requires the minimum number of computer memory spaces and no unnecessary computations. The method will be given in the next two sections with complete details of the derivation included so that the reader can use the final equations meaningfully. It will also enable the reader to derive the necessary sequence of equations for new problems. The method is due to Thomas [1] and Keller [2,3]. 6.4 SECOND·ORDER DIFFERENTIAL EQUATIONS 6.4.1 Linear Differential Equations
Consider the second-order linear differential equation
d~ dx
+A(x) ddY +B(x)y = C(x) x
(4.1)
subject to the boundary conditions
y(O) =
y(L) = 8
lX,
Equation (4.1) will now be written in finite-difference form with the grid points defined by
n = 1,2, ... , N where N is the total number of intervals and X N = L. The variable y and its derivatives at x n of the net are given by y= Yn dy dx
=
Yn+1 - Yn-I 2h
Yn+1 - 2Yn + Yn-I -dy2 = -'--------'----'-2 dx
h
Equation (4.1) and its boundary conditions therefore become 1
h2 (Yn+1 - 2Yn + Yn-I) +
A(~
----v;- (Yn+1 -
Yn-I) + B(X)Yn = C(x)
or
anYn-1 + bnYn + cnYn+ 1= 'n
(4.2)
99
6.4 Second-Order Differential Equations
where an
cn
= I - thA(xn ) ,
b; = h 2B(xn ) -1,
= I + t hA (xn ) ,
rn
= h 2C( x n )
The boundary conditions are written as Yo= a,
YN
=8
(4.3)
In matrix-vector form, Eqs. (4.2) and (4.3) can be written as Ay =
(4.4)
$
where
y=
YI
SI
Y2
S2
$=
rJ -
r N- J -
SN-J
YN-J
aa J r2
8cN -
J
and bJ
C1
az
b2
c2
.A= a N- 2
bN -
2
CN- 2
aN-J
bN _ 1
The matrix A whose elements are nonzero only on the diagonal of the two adjacent codiagonals is known as a tridiagonal matrix. A very efficient factorization procedure can be used to solve Eq. (4.4). We assume that A is nonsingular and can be factored into A=LU
(4.5)
where
1 a N- 2
f3N-2 a N- J
f3N-J
100
6.
Iterative Methods-The Finite-Difference Method
and
U=
(4.7) YN-2
I
The unknowns (f3n'Y n)' n = I, ... , N - I, are therefore found from Eq. (4.5) to be related through the equations
= b, f3 1YI = c 1 f31
n = 2,3, ... , N - I n
= 2,3,
(4.8)
... , N - 2
In terms of Land U, Eq. (4.4) becomes
LUy= s
(4.9)
Uy= z
(4.10)
Lz= s
(4.11)
Let Equation (4.9) can be written as or
(4.12)
The unknown elements of z are therefore found n=2,3, ... ,N-I
(4.13)
Once z is known, Eq. (4.10) can be solved for y since U is already
101
6.4 Second-Order Dlnerentlal Equations
known. Writing Eq. (4.10) in expanded form,
(4.14) YN-2
YN-2
1
YN-l
we then get
n = N - 2,N - 3, ... ,3,2,1
Yn = zn - YnYn+l'
(4.15)
which are the solutions of Eq. (4.4). As a summary, the solution of Eq. (4.1) involves the following steps.
1. Reduce the given differential equation to its corresponding finitedifference form. 2. Compare with Eq. (4.2) to identify an' bn, en' and Tn' 3. Calculate fin and Yn (for n = 1,2, ... , N - 1) from Eq. (4.8). 4. Calculate Zn (for n = 1,2, ... , N - 1) from Eq. (4.13). 5. Calculate Yn (for n = N - 1 N - 2, ... , 3,2,1) from Eq. (4.15), which are the required solutions. 6.4.2 Conduction through Fins
Consider the fin discussed in Section 6.3. The energy equation and the boundary conditions are (4.16)
and
x=O:
0(0)= 1;
x = 1: dO(l)/dx = 0
In terms of Eq. (4.1), we find
A(x) = C(x) = 0
B(x) = -"A
and
Also, from the boundary conditions, a
= 1,
L
=1
and or
102
6.
Iterative Methods-The Flnlte-DIUerence Method
we therefore have
(2'-; n .-; N - 1) (1 .-; n
«N
- 2)
(2'-; n .-; N - 1) With these quantities identified, the steps discussed earlier can be followed to find the finite-difference solutions of Eq. (4.16) for different values of A's. The results are tabulated in Table 6.1. TABLE 6.1 Solution of Eq. (4.16) for Two A's A 2.0
X
(J
0.0 0.2 0.4 0.6 0.8 1.0
1.0000 0.7175 0.4924 0.3068 0.1457 0.0037
A
x
(J
6.0
0.0 0.2 0.4 0.6 0.8 1.0
1.0000 0.6050 0.3579 0.1984 0.0874 0.0022
6.4.3 Nonlinear DIfferentIal EquatIons
For nonlinear differential equations, one way to obtain the solution is to linearize the differential equation before it is written in finite-difference form. An effective method is the method of quasi linearization outlined in Section 5.4. Starting from a first approximation, higher-order iterates can be obtained by solving the linearized equation. Two examples will be given in the next two sections to illustrate the details of the method. 6.4.4 The Pendulum
Consider the pendulum, shown in Fig. 6.2, which consists of a concentrated mass m suspended by a weightless cord of length I. The force of gravity has two components. The radial component is balanced by the tension in the cord, whereas the tangential component serves as the driving force for the vibrational motion. From Newton's second law of motion, we write (4.17)
6.4 Second-Order Differential Equations
103
I0 I I
I I
I I
I I
I
I s I-- - ...; "\ I
\0
I
I I I Fig. 6.2
mg
Schematic diagram of the pendulum.
Replacing s by I(), Eq. (4.17) becomes:
-d
2()
dt 2
g. + -sm()=O
(4.18)
I
Suppose the positions of the pendulum are known at two instants of time. Consider, for example, the case in which these two positions are t = 0:
() = 0;
t = tt=
() =
()f
The problem is to find () as a function of time t. Let us first introduce the dimensionless time
T=t/~g/I Equation (4.18) and its boundary conditions then become
. () = 0 -dZO2 + SIn dT
(4.19)
subject to the boundary conditions T
= 0: () = 0;
(4.20)
Based on the method of quasi linearization, the iteration equation relating successive iterates can be obtained as follows. Let
f= f(T,(),()")
=()" + sin() = 0
(4.21)
6. Iterative Methods-The Flnlte-DIUerence Method
104
where the notation 0" represents d 20jdr 2 • Differentiating Eq. (4.21) according to
where the superscript i represents the number of iteration, we get (O"f+ I)+ (cos 0 (i»)0 (i+I)
= O(i) cosO(i) - sinO(i)
(4.22)
The boundary conditions are r
= 0: 0(i+1) = 0;
Comparing this with Eq. (4.1) and its boundary conditions, we find
C(r) = O(i) cosO(i) - sinO(i)
B ( r) = cos 0 (i),
A(r) = 0,
IX
(4.23)
= 0,
The solution of Eq. (4.22) therefore follows the same steps as outlined in Section 6.4.1. To start the solution, a first approximation of the solution of Eq. (4.19) is assumed. One natural choice is 0(1) = 1 The solution of the second iteration, 0(2), can be found from Eq. (4.22). For the next iteration, the solutions 0(2) are substituted in Eq. (4.23) for a new set of the coefficients, and the solutions of 0 (3) are then obtained, again from Eq. (4.22). The process can be continued until the desired accuracy is reached. Numerical solutions of Eq. (4.19) are obtained for the case of If = 0.5 sec and Of = 15° and are tabulated in Table 6.2. TABLE 6.2
Angular Displacement of the Pendulum, 9 9 (i) T
i= I
i=2
i=3
i= 4
0.0 0.1 0.2 0.3 0.4 0.5
1.0000 1.0000 1.0000 1.0000 1.0000 1.0000
0.0000 0.0596 0.1159 0.1686 0.2173 0.2618
0.0000 0.0545 0.1085 0.1614 0.2127 0.2618
0.0000 0.0545 0.1085 0.1614 0.2127 0.2618
105
6.4 Second-Order Differential Equations
6.4.5
Natural Convection Flow of Powell-Eyring Fluids between Vertical Flat Plates*
The natural convection behavior of pseudoplastic fluids is of interest to engineers working on the fluid mechanics of non-Newtonian fluids. A pseudoplastic fluid which obeys the Powell-Eyring model flows between two vertical parallel plates as a result of the bouyancy force, as shown in Fig. 6.3.
I
I I
I yl
~x
x=-/
I
x=/
Fig. 6.3 The flow system.
The governing differential equations, which consist of the equations of momentum and energy, can be written as Momentum:
ds / dx
+ peg(T -
Energy:
T m) = 0
(4.24) (4.25)
where p, e, g, T, and T m are, respectively, the density of the fluid, the coefficient of volume expansion, the gravitational acceleration, the temperature of the fluid, and the mean temperature of the fluid. The shearing stress 7' is related to the velocity gradient through the equation 7'
- I -1 dv = fL -dv + -l'nh Sl dx
B
cdx
(4.26)
where fL, B, and c are constants. Equation (4.25) gives T = Tm * See Bruce and Na [4).
-
t( T 2 - T 1) ( x/I)
(4.27)
6. Iterative Methods-The Finite-Difference Method
106
Combining Eqs. (4.24), (4.26), and (4.27) and introducing the dimensionless variables
x* = ~
v* =
/ '
v
aNgrN pr/ /
we finally get
x*
(4.28)
where N gr t:
= aNgrN pr/ el 2 ,
= gp2e/ 3( T 2 ~
= p,Bc,
a
T m)/ p,2
= k/pc p
The boundary conditions are:
°
x* = - I: v* = 0; x* = 0: v* = which refer to the velocities at the points x = -/ and x = 0, respectively. Introducing s = x* + I, Eq. (4.28) and its boundary conditions become
(s - I)
1+[I/~~(t:dv*/ds)2+ with the boundary conditions
v*(O) = 0,
v*(I) =
(4.29)
I]
°
Linearizing Eq. (4.29), we get
t:2~(S - 1)(dv*(I)Ids) ]( dv* cj>(~cj> + 1)2 ds
d2v*(i+I) _ [
ds2
= ~(s - I)cj> _ t:2~(S - I) ( dv*(i) )2 (I + ~cj»
cj>(~cj>
+ 1)2
ds
)(i+I)
(4.30)
subject to the boundary conditions V*(i+
1)(0) = 0,
where
dv*(i»)2 ]1/2 cj>= [( t : - - +1 ds
(4.31)
6.5
107
Third-Order Differential Equations
Comparing Eq. (4.30) with Eq. (4.1), we can identify
A(s) = -
[
E:2~(S - 1) dv *(i) cj>(~cj> + 1)2 ~
]
B(s) = 0 C(s) =
(4.32)
~(s - l)cj> _ E:2~(S - I) ( (I + ~cj» cj>(~cj> + 1)2
dV*(i)
)2
ds
The steps that should be followed in solving Eq. (4.30) are therefore the same as those used in Section 6.4.3. As a numerical example, consider the solution of Eq. (4.30) for E: = 0.01, ~ = 10. By assuming a first approximation, v(l)
= sin ex
the solution, accurate to the fourth digit, is obtained in three iterations. The results are shown in Table 6.3. TABLE 6.3 Solutions of Eq. (4.29) for e = om,
s 0.0 0.2 0.4 0.6 0.8 1.0
i
=I
0.0000 0.5878 0.9511 0.9511 0.5878 0.0000
g = 10
i = 2
i=3
0.0000 0.0436 0.0582 0.0509 0.0291 0.0000
0.0000 0.0437 0.0582 0.0509 0.0291 0.0000
6.5 THIRD-ORDER DIFFERENTIAL EQUATIONS 6.5.1
Linear Differential Equations
Consider the third-order linear differential equation
dy
dx3
dy
dy
+ A (x) dx2 + B(x) dx + C(x)y = D(x)
(5.1)
subject to the boundary conditions
yeO)
= LX,
dy(O)/ dx = E:,
dy(L)/dx
=A
(5.2)
108
6. Iterallve Methods-The Finite-Difference Method
Equation (5.1) will now be written in finite-difference form with the grid points defined by n
Xo= 0,
= 1,2, ... , N
where N is the total number of intervals and X n = L. The variable Y and its derivatives at x n of the net are given by
Y = Yn dy Yn+1 - Yn-l 2h dx ~ dy Yn+1 - 2Yn + Yn-I -=------dx 2 h2
(5.3)
d) Yn+2 - 2Yn+ 1 + 2Yn-1 - Yn-2 2h3 dx 3 ~ Equation (5.1) and its boundary conditions therefore become
+ 2Yn-1 - Yn_2)/2h 3 + A(X)(Yn+1 - 2Yn + Yn_I)/h 2 +B(X)(Yn+1 - Yn_I)/2h + C(x)Yn = D(x)
(Yn+2 - 2Yn+1 or
Yn+2
+ [2M (x) + h2B(x) -
2 ]Yn+ I
+ 2h[ h2C(x) - 2A (x) ]Yn
+ [2 + 2hA(x) - h2B(x) ]Yn-I - Yn-2 = D(x)
(5.4)
The boundary conditions become
Yo
= £X,
(YI - Y _1)/2h
= e,
(YN+ 1 - YN_I)/2h
=A
(5.5)
By putting n = 0, I, ... , N in Eq. (5.4), we get N + I algebraic equations for the solutions of N + I unknowns Yn (n = 0, I, ... , N). However, the finite-difference form of the third-order derivative d) / dx 3 involves five adjacent values of Yn' For n = 0, two "unwanted" values of Yn' namely, Y - I and Y -2' will appear in the equation. Similarly, for n = N, another two "unwanted" values of Yn' namely YN+I and YN+2' will appear in the equation. For the determination of these four additional unknowns, only three equations can be written based on the three boundary conditions. Numerical oscillation will occur if a fourth equation is not properly chosen. Fox [5] suggested that the difficulty can be overcome by replacing Eq. (5.1) by two equations, dy d 2p dp dx = p, dx2 = - A (x) dx - B(x)p - C(x)y + D(x) (5.6)
6.5 Third-Order Differential Equations
109
subject to the boundary conditions
y(O) = a,
p(L) ="A
p(O) = e,
(5.7)
Replacing these equations by the finite difference form, we get
(Yn - Yn-I)/h = t(Pn + Pn-I) (Pn+1 - 2pn + Pn_I)/h 2 = -A(X)(Pn+1 - Pn_I)/2h - B(x)Pn - C(x)Yn + D(x) or
Yn-I + thpn-I - Yn + thpn =
°
a"yn + bnPn-I + cnPn + dnPn+1 = h
(5.8)
2D(x
n)
(5.9)
where
an = h2C(xn),
t hA (x n),
b; = 1 -
cn = h2B(xn) - 2, d; = 1 + thA(xn) Here, the first equation is replaced by the center-difference equation around the point X n - I/ 2• It will be seen later that this will reduce the "unwanted" values to three, instead of four, so that the number of unknowns is equal to the number of equations available. The boundary conditions can be written as Yo=a, For n
=
Po=€,
PN="A
(5.10)
0, Eqs. (5.8) and (5.9) become
Y - I + t hp - I
-
Yo + t hpo = 0
aoYo + bop_I + coPo + doPI = h
2D(x
o)
or, since Yo = a, and Po = e, we get
Y_I + thP_1 = a - th€ bop-I + doPI = -aoa Similarly, for n
(5.11) Co€
+ h2D(xo)
(5.12)
= 1, Eqs. (5.8) and (5.9) give - YI + t hPI = - a alYI
t he
+ ClPI + d l P 2 = - b l € + h 2D (x l )
(5.13) (5.14)
For 2 ,.; n ,.; N - 1, Eqs. (5.8) and (5.9) can be used without any change.
6. Iterative Methods-The Finite-Difference Method
110
For n = N, Eqs. (5.8) and (5.9) give (5.15) (5.16) where the boundary condition PN = A has been taken into consideration. The above steps eliminate Yo' Po' and PN as variables. We therefore have 2N + 2 equations for the solution of 2N + 2 variables, namely n = 1,2,3, ... , N - 1
P-I'
Y-I'
In matrix-vector form, these 2N + 2 equations can be written as (5.17)
A~=t
where
-I]
[Y P-I
[;: ] [;~ ]
~=
[ YN-I ] PN-I
[~:I ]
t=
[;~ ] [:: ] [:~ ] [ rN- 1 ] SN_I
[;: ]
with ro = LX
-
th€,
(5.18) for 2".; n ".; N - 1 (5.19) for
and A is given by Eq. (5.20) on page Ill.
2".; n ".; N - 1
111
6.5 Third-Order Differential Equations
.-------. 0
-s I
00 '-----'
,-------,
-e
-IN
-e
-IN
I
.----------,
..s:::
I
'