QUASILINEARIZATION AND INVARIANT IMBEDDING With Applications to Chemical Engineering and Adaptive Control
E . Stanley Lee PHILLIPS PETROLEUM COMPANY BARTLESVILLE, OKLAHOMA KANSAS STATE UNIVERSITY MANHATTAN, KANSAS
1968
A C A D E M I C P R E S S New York and London
COPYRIGHT
8 1968, BY ACADEMIC PRESS INC.
ALL RIGHTS RESERVED. NO PART OF THIS BOOK MAY BE REPRODUCED IN ANY FORM, BY PHOTOSTAT, MICROFILM, OR ANY OTHER MEANS, WITHOUT WRITTEN PERMISSION FROM THE PUBLISHERS.
ACADEMIC PRESS INC. 11 1 Fifth Avenue, New York, New York 10003
United Kingdom Edition published by ACADEMIC PRESS INC. (LONDON) LTD. Berkeley Square House, London W.l
LIBRARY OF CONGRESS CATALOG CARDNUIVIBW: 68-18674
PRINTED IN THE UNITED STATES OF AMERICA
To Mayanne, Linda, and Margaret
PREFACE
When the complete initial conditions are given, modern digital computers are efficient tools for solving differential equations. But, unfortunately, many problems in engineering and physical sciences are two-point or multipoint nonlinear boundary-value problems, in which the conditions are not all given at one point. Problems of this type are most subtle and difficult and are not well suited for modern digital computers. This book presents a study on the use of two recently developed concepts for obtaining numerical solutions of boundary-value problems. Quasilinearization and invariant imbedding represent two completely different approaches to these problems. T h e invariant imbedding approach reformulates the original boundary-value problem into an initial value problem by introducing new variables or parameters ; while the quasilinearization technique represents an iterative approach combined with linear approximations. Certain problems can be treated more advantageously by quasilinearization, others by invariant imbedding. A combination of these two approaches also is used. Our aim is to produce various efficient algorithms which are suited for various types of boundary-value problems. This is a numerical study of boundary-value problems. Emphasis is placed upon computational instead of analytical aspects. Most of our discussions are concerned with the actual convergence rates and computational requirements. Various numerical experiments are performed and detailed computational procedures are given. No discussion will be given concerning the uniqueness and existence problems unless these topics are concerned directly with our results. T h e quasilinearization technique is introduced in Chapter 2. I n Chapter 3, this technique is applied to some boundary-value problems in ordinary differential equations. Since boundary-value problems are encountered in almost every branch of engineering and physical sciences, ix
X
PREFACE
these examples are necessarily restricted to the areas of interest to the author. Much interest has been shown in the literature on adaptive control. T h e problems in several areas in adaptive control can be treated as boundary-value problems. An important area in adaptive control is the identification or estimation problem. I n Chapter 4, this problem is treated as a two-point or a multipoint boundary-value problem by the quasilinearization technique. Another important area in adaptive control is optimization. T h e boundary-value difficulties severely limit the usefulness of the calculus of variations and the maximum principle in obtaining numerical solutions. I n Chapter 5 , the quasilinearization technique is shown to be a useful tool in overcoming these difficulties encountered in optimization. Another problem treated in Chapter 5 is the simultaneous optimization of parameters and control variables. I n Chapter 6, the invariant imbedding concept is introduced. I n Chapter 7, this concept is combined with quasilinearization to form some useful predictor-corrector formulas. Invariant imbedding also is used to avoid the numerical solution of linear algebraic equations in the quasilinearization procedure. Some interesting comparisons between the combined techniques and quasilinearization are obtained. I n Chapter 8, the estimation problem is treated by the invariant imbedding concept. This approach is compared with the quasilinearization approach treated in Chapter 4. A third area in adaptive control is the problem of stability. T h e dynamic equations used to study the stability of fixed bed chemical reactors are treated by quasilinearization in Chapter 9. Emphasis is placed upon the comparison between the present approach and those found in the literature. No detailed calculations are given for the study of the stability of fixed bed reactors. Except for the last few sections of Chapter 2, we have avoided all the theoretical aspects of the problems treated in this work. Those who wish to learn more about these theoretical aspects should consult the references listed at the end of the various chapters. For those who are interested mainly in obtaining numerical solutions, Sections 10 to 15 of Chapter 2 can be omitted during the first reading. This book is written in sufficient detail that it can be used as an introductory text on the subjects of quasilinearization and invariant imbedding, and every effort has been made to maintain an elementary level of mathematics throughout the book. T h e approach is formal and no attempt has been made to give a rigorous mathematical treatment. T h e numerical examples discussed in this book are of direct interest to
PREFACE
xi
chemical and control engineers. However, the basic principles illustrated by the various examples and the materials in Chapters 2 and 6 , where quasilinearization and invariant imbedding are introduced, should be useful to all scientists and engineers who are interested in obtaining numerical solutions of boundary-value problems in their particular fields. Except for the last chapter on parabolic partial differential equations, this work is primarily concerned with the numerical solution of boundary value problems in ordinary differential equations. Although the basic equations in invariant imbedding are partial differential equations, we have discussed only those problems whose invariant imbedding equations can be reduced to ordinary differential equations. T h e numerical aspects of partial differential equations are much more complex. We wish to treat these equations together with differential-difference and functional differential equations in another volume. Many important topics related to invariant imbedding, quasilinearization, and boundary value problems are not included. Some of these topics are the use of invariant imbedding in the analytical formulation of physical problems such as neutron transport and wave propagation, and analytical techniques for treating boundary value problems such as the method of Blasius. Furthermore, we have restricted our discussion to deterministic processes. Although the estimation problems are essentially stochastic in nature, we have avoided any discussion on the statistics of these problems. Most of the computational work has been done at Phillips Petroleum Company. I am grateful for its support of my research work in the fields of applied mathematics and optimization theory. I also wish to thank Dr. Richard Bellman of the University of Southern California and Dr. Robert Kalaba of the RAND Corporation for their encouragement. Their books and papers furnished a large fraction of the source material for this book. Finally I wish to express my gratitude to my wife who not only provides a constant source of inspiration and encouragement but also typed the complete manuscript-a difficult task considering the fact that she has never had any training in typing. E. S . LEE Manhattan, Kansas November, 1967
CONTENTS
PREFACE.
...............................
ix
Chapter 1 . Introductory Concepts 1 . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Quasilinearization . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Invariant Imbedding ........................ 4. Invariant Imbedding versus the Classical Approach . . . . . . . . . . . 5 . Numerical Solution of Ordinary Differential Equations . . . . . . . . . 6 Numerical Solution Terminologies . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
. . .
1 2 2 3 4 7 8
Chapter 2. Quasilinearization 1 . Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Nonlinear Boundary-Value Problems . . . . . . . . . . . . . . . . . 3 Linear Boundary-Value Problems . . . . . . . . . . . . . . . . . . 4 Finite-Difference Method for Linear Differential Equations . . . . . . . 5 . Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6. Newton-Raphson Method . . . . . . . . . . . . . . . . . . . . . . . 7. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8. Quasilinearization . . . . . . . . . . . . . . . . . . . . . . . . . . 9. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10. Existence and Convergence . . . . . . . . . . . . . . . . . . . . . . 11 . Existence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12. Convergence . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Maximum Operation and Differential Inequalities . . . . . . . . . . . 14. Construction of a Monotone Sequence . . . . . . . . . . . . . . . . 15 . Approximation inpolicy Space and DynamicProgramming 16. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17. Systems of Differential Equations . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .
. . .
.
.
.
........
xiii
.
9 10 11 14 16 17 20 21 23 24 25 26 28 31 32 34 35 38
XiV
CONTENTS
Chapter 3. Ordinary Differential Equations 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. A Second-Order Nonlinear Differential Equation . . . . . . . . . . . . . 3. Recurrence Relation . . . . . . . . . . . . . . . . . . . . . . . . . 4. Computational Procedure . . . . . . . . . . . . . . . . . . . . . . . 5 . Numerical Results ......................... 6. Stability Problem in Numerical Solution-The Fixed Bed Reactor . . . . . 7. Finite-Difference Method . . . . . . . . . . . . . . . . . . . . . . . 8. Systems of Algebraic Equations Involving Tridiagonal Matrices . . . . . . 9. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 10. Stability Problem with High Peclet Number . . . . . . . . . . . . . . . 11. Adiabatic Tubular Reactor with Axial Mixing . . . . . . . . . . . . . . 12. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 13. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14. Unstable Initial-Value Problems . . . . . . . . . . . . . . . . . . . . 15. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16. Systems of Differential Equations . . . . . . . . . . . . . . . . . . . 17. Computational Considerations . . . . . . . . . . . . . . . . . . . . . 18. Simultaneous Solution of Different Iterations . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
40 41 42 43 46 51 53 56 58 61 62 67 71 72 73 73 78 79 81
Chapter 4 . Parameter Estimation 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Parameter Estimation and the “Black Box” Problem . . . . . . . . . . . 3. Parameter Estimation and the Experimental Determination of Physical Constants . . . . . . . . . . . . . . . . . . . . . . . . . . 4. A Multipoint Boundary-Value Problem . . . . . . . . . . . . . . . . . 5. The Least Squares Approach . . . . . . . . . . . . . . . . . . . . . 6. Computational Procedure for a Simpler Problem . . . . . . . . . . . . . 7. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 8. Nonlinear Boundary Condition . . . . . . . . . . . . . . . . . . . . 9. Random Search Technique . . . . . . . . . . . . . . . . . . . . . . 10. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 11. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12. Parameter Up-dating . . . . . . . . . . . . . . . . . . . . . . . . . 13. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14. Estimation of Chemical Reaction Rate Constants . . . . . . . . . . . . . 15. Differential Equations with Variable Coefficients . . . . . . . . . . . . . 16. An Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17. Ill-Conditioned Systems . . . . . . . . . . . . . . . . . . . . . . . 18. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 19. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20. An Empirical Approximation . . . . . . . . . . . . . . . . . . . . . 21. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 22. A Second Approximation . . . . . . . . . . . . . . . . . . . . . . . 23. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . .
83 83 84 85 86 86 90 92 95 97 99 100 102 103 105 106 109 111 115 116 118 119 120
xv
CONTENTS
. .
24 Differential Approximation . . . . . . . . . . . . . . . . . . . . . . 25. A Second Formulation . . . . . . . . . . . . . . . . . . . . . . . . 26 Computational Aspects . . . . . . . . . . . . . . . . . . . . . . . . 27.Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
122 123 125 126 126
Chapter 5. Optimization 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Optimum Temperature Profiles in Tubular Reactors . . . . . . . . . . 3. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 4. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Back and Forth Integration . . . . . . . . . . . . . . . . . . . . . . . 6. Two Consecutive Gaseous Reactions . . . . . . . . . . . . . . . . . 7 Optimum Pressure Profile in Tubular Reactor . . . . . . . . . . . . . 8. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 9. Optimum Temperature Profile with Pressure as Parameter . . . . . . . . 10. Numerical Results and Procedures . . . . . . . . . . . . . . . . . . 11. Calculus of Variations with Control Variable Inequality Constraint . . . . 12. Calculus of Variations with Pressure Drop in the Reactor . . . . . . . . 13. Pontryagin’s Maximum Principle . . . . . . . . . . . . . . . . . . 14. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15. Optimum Feed Conditions . . . . . . . . . . . . . . . . . . . . . . 16. Partial Derivative Evaluation . . . . . . . . . . . . . . . . . . . . . 17.Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .
. .
.
. . . .
.
129 130 135 144 146 147 149 151 153 160 170 171 174 175 175 176 176 177
Chapter 6. Invariant Imbedding 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. The Invariant Imbedding Approach . . . . . . . . . . . . . . . . . . 3. AnExample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. The Missing Final Condition . . . . . . . . . . . . . . . . . . . . . 5 . Determination of x and y in Terms of r and s . . . . . . . . . . . . . . 6. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .; . . . . . 7. Alternate Formulations-I 8. Linear and Nonlinear Systems . . . . . . . . . . . . . . . . . . . . . 9. The Riccati Equation . . . . . . . . . . . . . . . . . . . . . . . . 10. Alternate Formulations-I1 . . . . . . . . . . . . . . . . . . . . . . 11. The Reflection and Transmission Functions . . . . . . . . . . . . . . . 12. Systems of Differential Equations . . . . . . . . . . . . . . . . . . . 13. Large Linear Systems . . . . . . . . . . . . . . . . . . . . . . . . 14. Computational Considerations . . . . . . . . . . . . . . . . . . . . . 15. Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . . . 16 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
179 180 182 188 189 191 192 195 196 197 201 203 205 206 208 211 21 3
xvi
CONTENTS
.
Chapter 7
Quasilinearization and Invariant Imbedding
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. The Predictor-Corrector Formula . . . . . . . . . . . . . . . . . . 3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. Linear Boundary-Value Problems . . . . . . . . . . . . . . . . . . 5. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 6. Optimum Temperature Profiles in Tubular Reactors . . . . . . . . . . 7. Numerical Results . . . . . . . . . . . . . . . . . . . . . . . . . . 8. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9. Dynamic Programming and Quasilinearization-I . . . . . . . . . . . 10. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11. Linear Differential Equations . . . . . . . . . . . . . . . . . . . . . 12. Dynamic Programming and Quasilinearization-I1 . . . . . . . . . . . 13. Further Reduction in Dimensionality . . . . . . . . . . . . . . . . . 14. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
. . . .
. .
217 218 223 224 226 229 232 235 236 238 238 239 243 244 244
Chapter 8 . Invariant Imbedding. Nonlinear Filtering. and the
Estimation of Variables and Parameters
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . 2. An Estimation Problem . . . . . . . . . . . . . . . . . . . . . . 3. Sequential and Nonsequential Estimates . . . . . . . . . . . . . . 4. The Invariant Imbedding Approach . . . . . . . . . . . . . . . . 5. The Optimal Estimates . . . . . . . . . . . . . . . . . . . . . . 6. Equation for the Weighting Function . . . . . . . . . . . . . . . . 7. A Numerical Example . . . . . . . . . . . . . . . . . . . . . . 8. Systems of Differential Equations . . . . . . . . . . . . . . . . . 9. Estimation of State and Parameter-An Example . . . . . . . . . . . 10. A More General Criterion . . . . . . . . . . . . . . . . . . . . . 11. An Estimation Problem with Observational Noise and Disturbance Input 12. The Optimal Estimate-A Two-Point Boundary-Value Problem . . . . 13. Invariant Imbedding ...................... 14. A Numerical Example . . . . . . . . . . . . . . . . . . . . . . 15. Systems of Equations with Observational Noises and Disturbance Inputs 16. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . ..
.. . .
246 247 248 249 250 252 254 257 261 265 266 267 268 270 272 276 276
............ . . . . . . . . . . . . . . . . . . . . . . . . . . ............ . . . . . . . . . . . . .
278 279 280 283 283
.. .. .. ..
. . . .
. . . .
Chapter 9. Parabolic Partial Differential Equations-
Fixed Bed Reactors with Axial Mixing
1. 2. 3. 4 5.
.
Introduction . . . . . . . . . . . . . . . . Isothermal Reactor with Axial Mixing . . . . An Implicit Difference Approximation . . . . Computational Procedure . . . . . . . . . . . Numerical Results-Isothermal Reactor . . . .
xvii
CONTENTS 6. Adiabatic Reactor with Axial Mixing . . . . . . . . . . . . . . . . . . 7. Numerical Results-Adiabatic Reactor . . . . . . . . . . . . . . . . . 8. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Influence of the Packing Particles . . . . . . . . . . . . . . . . . . . 10. The Linearized Equations . . . . . . . . . . . . . . . . . . . . . . 11. The Difference Equations . . . . . . . . . . . . . . . . . . . . . . 12. Computational Procedure-Fixed Bed Reactor . . . . . . . . . . . . . . 13. Numerical Results-Fixed Bed Reactor . . . . . . . . . . . . . . . . . 14 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.
.
285 289 292 292 294 296 300 301 304 305
Appendix I . Variational Problems with Parameters 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Variational Equations with Parameters . . . . . . . . . . . . . . . . 3. Simpler End Conditions . . . . . . . . . . . . . . . . . . . . . . . 4. Calculus of Variations with Control Variable Inequality Constraint . . . . 5 . Pontryagin’s Maximum Principle . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . .
306 306 309 310 312 313
Appendix I1. The Functional Gradient Technique 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. The Recurrence Relations . . . . . . . . . . . . . . . . . . . . . . 3. Numerical Example . . . . . . . . . . . . . . . . . . . . . . . . . 4. Discussion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . References . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
315 315 320 321 322
.............................
323
AUTHOR INDEX
SUBJECT INDEX.
............................
326
Chapter
1
INTRODUCTORY CONCEPTS
1. Introduction
In engineering and physical sciences there occur many two-point or multipoint boundary-value problems. Since these problems usually are nonlinear, they are accompanied by various analytical and numerical difficulties. Analytically, there is no general proof for the existence and uniqueness of the solutions. Numerically, we possess no convenient technique for obtaining the numerical solutions on modern digital computers. These numerical difficulties are caused by the fact that not all the conditions are given at one point. T o obtain the missing condition, a trial-and-error procedure is generally used. Not only does this procedure have a relatively slow convergence rate; but also, owing to its trialand-error nature, it is not suited to modern digital computers. Furthermore, for a large number of problems, the starting or guessed missing condition must be very close to the correct and yet unknown condition before the procedure will converge. Quasilinearization and invariant imbedding are two useful techniques for obtaining numerical solutions for this type of problem. These two techniques present two systematic approaches to the boundary-value problems. It should be emphasized that quasilinearization and invariant imbedding are two completely different concepts. Quasilinearization is a numerical technique while invariant imbedding represents a completely different formulation of the original problem. The purpose of this chapter is twofold. First the basic concepts used throughout the book will be introduced. Some of these introductions are necessarily abstract. More detailed explanations and applications appear in later chapters. Second, some of the formulas for the numerical integration of ordinary differential equations of the initial value type will be reviewed briefly. Derivations of these formulas will not be given. 1
1.
2
INTRODUCTORY CONCEPTS
2. Quasilinearization
I n the quasilinearization technique, instead of being solved directly, the nonlinear differential equation is solved recursively by a series of linear differential equations. The main advantage of this technique is that if the procedure converges, it converges quadratically to the solution of the original equation. Quadratic convergence means that the error in the (n 1)st iteration tends to be proportional to the square of the error in the nth iteration. The advantage of quadratic convergence, of course, lies in the rapidity of convergence. The linear equation is obtained by using the first and second terms in the Taylor’s series expansion of the original nonlinear equation. This technique is a generalized Newton-Raphson formula for functional equations. Since linear differential equations of the boundary-value type with variable coefficients can be solved fairly routinely on modern computers by the superposition principle, an efficient recursive formula has been developed. However, this technique also has its difficulties. The main difficulty arises from the fact that in using the superposition principle, a set of algebraic equations must be solved. Thus, the ill-conditioning phenomenon in solving a set of linear algebraic equations can make the superposition principle useless.
+
3. Invariant Imbedding
T o illustrate the invariant imbedding approach, let us consider the simple second-order differential equation d2x _ -0 dta
with boundary conditions
< < .
(1)
x(0) = xo
with 0 t tf Equations (1) and (2) form a two-point boundary-value problem. In order to integrate Eq. (1) numerically, we must know the missing initial condition, which is the slope of x at t = 0. It is not easy to obtain this missing initial condition for most applicational problems. Invariant imbedding involves a completely different approach to formulating the problem. Instead of only considering a single problem
4.
INVARIANT IMBEDDING VERSUS THE CLASSICAL APPROACH
3
with duration tf , the invariant imbedding approach is to consider a family of problems, with duration of the process ranging from zero to the value of tf . Then, these problems are imbedded to obtain the particular original problem. Since if the process represented by Eq. (1) had a zero duration we would know the missing initial condition, the original two-point boundary-value problem becomes an initial-value problem in the invariant imbedding formulation. Since we are solving a family of problems instead of one original problem, more computation may be needed to obtain the solution. This is the price we have to pay for avoiding the two-point boundary-value difficulty. However, for some problems, the invariant imbedding approach has been found to be much superior to the usual approach. Furthermore, since generally we are not computing the solutions of the whole family of problems one by one, the computational requirements are not as formidable as they seem. Frequently we are interested in investigating the behavior of the solution of the neighboring processes of the original problem. Thus, the need of solving a family of problems in the invariant imbedding approach may constitute an advantage for certain applicational problems. Furthermore, this generality of solutions overcomes, at least partly, one serious criticism of numerical solution: namely, the lack of generality. Invariant imbedding is only a concept; it is not a technique or method. This concept can be applied to a variety of different physical problems. Because of its completely different approach, it frequently gives some different insights to the same physical problem which has been treated by the usual or classical method. 4. Invariant Imbedding versus the Classical Approach
For the ease of reference, the techniques and concepts usually used in treating a boundary-value problem will be referred to as the usual or classical approach. This is in contrast to the invariant imbedding approach, which requires a completely different concept. We shall use the term “classical approach’’ loosely throughout the book. I n general, it means that a problem is formulated and solved as a boundary-value problem, not in terms of the invariant imbedding concept. Thus, the quasilinearization technique can be considered as a classical approach. Note the difference between the computational philosophies of quasilinearization and invariant imbedding. Quasilinearization represents an iterative computational procedure while invariant imbedding solves the original problem by expanding it into a family of problems.
4
1.
INTRODUCTORY CONCEPTS
5. Numerical Solution of Ordinary Differential Equations Since most of this work will be based on numerical methods of obtaining solutions of ordinary differential equations of the initial-value type, it is helpful to review briefly the general methods. Consider the first-order ordinary differential equation dx _ - x'
dt
=f(x, t )
with the initial condition
In numerical approaches the value of the dependent variable x is calculated at discrete values of the independent variable t. I n other words, x is calculated at t, , t, ,..., with tk+, - t k = d t , where d t is called the integration step, interval, or grid spacing; and t , , t, ,... are called the grid points. Generally the size of d t is controlled by the accuracy desired in the numerical results. Computer limitations and the stability problem involved in solving a particular problem also control the value of A t . With the initial value xo at t = 0 known, Eq. (1) can be integrated and the values of x at t, , t, ,... can be obtained. There are various methods for obtaining these values of x;only some of those most frequently used will be mentioned [l-81. These can be separated into single-step and multiple-step methods.
A. SINGLE-STEP METHODS The formulas of this type of method can be represented by
with to = 0. This method starts with the known value of xo and uses A t andf(x(t,), to) to calculate x(tl). Once x(tl) is obtained, the process can be repeated by using d t andf(x(t,), t,) to calculate x(t,). This process is continued until t = tf , where tt is the final value of the independent variable t. Since the calculation is performed from one point to the next in a direct and orderly sequence, these methods are also known as marching techniques. Among the various single-step integration formulas the Runge-Kutta scheme is perhaps the best known and most frequently used. For Eq. (I),
5.
NUMERICAL SOLUTION OF ORDINARY DIFFERENTIAL EQUATIONS
5
the fourth-order Runge-Kutta formula, which is known simply as the Runge-Kutta formula, is m1 = M t k ) , t k )
At
+ +ml , t k + + A t ) A t + &n2 , t k + + A t ) A t + m3 , t k + A t ) A t + Q(m, + 2m2 + 2m, + m4) + O ( 4
m2 = f ( x ( t k ) m3 = f(x(tk)
(4)
m4 = f ( ~ ( t k ) ~ ( t k , , ) = x(tk)
with k = 0, 1, 2, ... . T h e last term in the last equation indicates that the local truncation error for this formula is in the order of O ( A 6 ) . This term is not used directly in the application of the formula, but only as an indicator of the accuracy of the results. Starting at x = x(to) = xo, t = t o , and the specified A t , the values of m, , m 2 , m 3 , and m4 are calculated successively. T h e value of x(tk+lkl) is then obtained from the last equation. Because of its low truncation error, the Runge-Kutta forrnula will be used in most of the calculations of this work. For some types of single-step formulas, the unknown x(tk+l) also can be present implicitly on the right-hand side of Eq. (3). A good example would be the modified Euler's method. Obviously, iteration must be used when x(t,+,) is present implicitly in the function h. One of the difficulties in using the single-step methods is that they are unstable under certain conditions. That is to say, if an error is committed in calculating x(tk+l), the error will propagate with increasing magnitude through the remainder of the calculation and thus render an unstable solution.
B. MULTIPLE-STEP METHODS T h e formulas of this type of method for Eq. (1) can be roughly represented by X(tk,l)
-4tk-T)
= h(A t , f ( X ( t k ) , tk),f(X(tk-l),
tk-l>,"',f(X(tk-IE>,
tk-n))
r , n = positive integers
(5) In order to evaluate ~ ( t ~ +the ~ )values , of x ( t k ) , x(tk-l),..., x ( t k J , and x(tkPr) must be known. Thus, it is not possible to calculate x(tk+l) directly from the initial value xo. T o start the calculation, the points x(tkVl),x ( tkP2),... must be obtained by another integration method. T o increase the accuracy, generally two integration formulas are used in the multiple-step methods. T h e first formula, which is known as the open-end integration formula and is in the same form as Eq. ( 5 ) , is used to predict the approximate value of x(tk+l). Then the second
1.
6
INTRODUCTORY CONCEPTS
formula, which is known as the closed-end formula, is used to generate a more accurate ~ ( t , + ~This ) . closed-end formula may be iterated to obtain as accurate an answer as desired. The closed-end formula is in ~ ) on the same form as Eq. ( 5 ) except that the unknown ~ ( t ~is+present the right-hand side also. These two formulas form a predictor-corrector scheme which is a powerful numerical tool. Other predictor-corrector schemes will be formulated by the use of quasilinearization and invariant imbedding in later chapters. Milne’s method is probably the best known multiple-step integration formula. The predictor for this method is X(tk,,)
= x(tt-3)
+ 4Wf(x(t,),
t k ) -f(X(tk-l),
tk-1)
+2f(X(tk--2),
t7C-211
(6)
and the corrector is X(h+,)
= X(tk-1)
+ S4f(x(tk+l),
+O ( 4
bfl)
+ 4f(X(?d,
tk)
-tf(4k-l),
tk-J
+ W5)
(7) T o begin the integration, the starting values at the three grid points t , , tk--l , and tk--2can be obtained by a single-step integration formula or by using Taylor’s series. Note that Eq. (7) is Simpson’s rule. In addition to the stability problem, which is common to both the single-step and multiple-step methods, the convergence rate of the iterating corrector equation must be considered. The stability and the convergence rate problems are discussed in various numerical analysis texts listed at the end of the chapter. The single-step methods have a number of advantages in terms of the use of digital computers. First, in using the multiple-step methods the starting values must be calculated by some other methods, but no such calculations or predictions of the starting values are necessary for the single-step methods. Second, during the integration process, several different values of the integration step d t may be necessary in solving the same equations. It is not easy to reduce the integration step A t for the multiple-step methods as the integration proceeds. Some kind of interpolation formula must be used to reduce this step size.
C. SYSTEMS OF EQUATIONS The above equations can be generalized to the treatment of a set of simultaneous equations. This generalization involves relatively little that is new. T o illustrate this, consider the two simultaneous differential equations
6.
NUMERICAL SOLUTION TERMINOLOGIES
7
with initial conditions x(0)
= xo
y ( 0 ) =yo
(9)
6. Numerical Solution Terminologies
The present work is primarily concerned with obtaining numerical solutions of differential equations by digital computer. Owing to the discrete nature of the computer, the solutions are always obtained at discrete points of the independent variable. These discrete points have been called the grid points in the previous section. Thus, by numerical solution we mean a numerical table in which the values of the dependent variable are tabulated at the grid points of the independent variable. For convenience, some of the terminologies frequently used in connection with obtaining numerical solutions will be summarized in the rest of this section.
A. ACCURACY OF
THE
SOLUTION
Various errors are involved in obtaining numerical solutions. For example, errors are introduced when we.change the original continuous problem into a discrete one. Errors also are introduced by the numerical
8
1.
INTRODUCTORY CONCEPTS
integration formulas discussed in the preceding section. I n the present work, no effort will be made to estimate these errors. However, in order to describe the numerical results, the word accuracy will be used frequently. T h e accuracy at nth iteration for x, , e x , will be defined as foIlows:
I Xn+l(t,)
- Xn(t7c)i
<
€2
(1)
with k = 0, 1, 2,..., N ; and tN = tt . Thus, the accuracy for x, e x , does not mean correctness. It only means that the maximum improvement in the value of x between this and the next iteration cannot be over the value of e x . B. INTERVAL OF CONVERGENCE I n order to start the quasilinearization iteration, some starting or initial approximation must be used. If this initial approximation is too far removed from the.correct solution of the problem, the iteration procedure may not converge. Thus, there exists an interval for the values of the initial approximation. I n order for the iteration to converge, these values must be within this interval, which is referred to as the interval of convergence. C. COMPUTATION TIME For comparison purposes, the computation time used in obtaining a certain numerical result will be quoted frequently. Since the time needed to obtain a certain result depends on the computer program, the amount of printout, and many other factors, the time quoted is very approximate. An IBM 7094 computer was used throughout this work. REFERENCES
1. Scarborough, J. B., “Numerical Mathematical Analysis.” Johns Hopkins Press, Baltimore, Maryland, 1962. 2. Hildebrand, F. B., “Introduction to Numerical Analysis.” McGraw-Hill, New York, 1956. 3. Milne, W. E., “Numerical Solution of Differential Equations.” Wiley, New York, 1953. 4. Lapidus, L., “Digital Computation for Chemical Engineers.” McGraw-Hill, New York, 1962. 5. Hamming, R. W., “Numerical Methods for Scientists and Engineers.” McGraw-Hill, New York, 1962. 6. Todd, John, ed., “Survey of Numerical Analysis.” McGraw-Hill, New York, 1962. 7. Fox, L., “Numerical Solution of Ordinary and Partial Differential Equations.” Addison-Wesley, Reading, Massachusetts, 1962. 8. Ralston, A., and Wilf, H., eds., “Mathematical Methods for Digital Computers.” Wiley, New York, 1960.
Chapter
2
QUASILINEARIZATION
1. Introduction
The quasilinearization technique will be introduced in this chapter. Emphasis will be placed on the numerical aspects of this technique rather than theoretical derivations. More rigorous derivations can be found in the references listed at the end of the chapter [la]. In many aspects the quasilinearization technique is essentially a generalized Newton-Raphson method for functional equations. However, since the unknowns which we are trying to obtain are functions and not fixed values or roots as in the Newton-Raphson method, both the computational and theoretical aspects are much more complicated. The quasilinearization technique not only linearizes the nonlinear equation but also provides a sequence of functions which in general converges rather rapidly to the solution of the original nonlinear equation. I n practice, the latter is much more important. Now a rough initial approximation for the unknown function can lead to the solution of the original equation through a sequence of functions. I n general, for most practical problems, this rough initial approximation can be obtained from engineering experiences and intuitions. Since most of this work will be concerned with the numerical solution of nonlinear boundary-value problems, a brief review of the difficulties connected with these problems is presented in Section 2. It is shown that there is no effective approach for the computational solution of nonlinear boundary-value problems. However, this is not the case for linear boundary-value problems which in general can be treated easily and effectively on modern computers. Two approaches for the computational solution of linear boundary-value problems are discussed in Sections 3 and 4. T h e convergence aspects of the Newton-Raphson method are discussed in Section 6 . It is shown that under certain restrictions the Newton-Raphson method possesses two important properties: quadratic 9
10
2.
QUASILINEARIZATION
convergence and monotone convergence. This method is then generalized to functional equations in Section 8. This generalization is done without any consideration of rigor. The existence and convergence problems are discussed briefly in Sections 10-12. It is shown that convergence and existence can be expected for the quasilinearization technique if the interval of interest of the independent variable is sufficiently small. Owing to the use of the Newton-Raphson type of linearization formula, the convergence is quadratic if there is Convergence at all. The proof of monotone convergence for the quasilinearization technique requires more sophisticated concepts. This is discussed in Sections 13-1 5. The connections between dynamic programming, differential inequalities, and quasilinearization technique are discussed also. It is shown how dynamic programming and approximation in policy space have played an important role in the origin of quasilinearization. Finally, the quasilinearization technique is generalized to systems of differential equations in Section 17. Since the questions concerning convergence and existence are much more involved for these general systems, no discussions are given for these questions. 2. Nonlinear Boundary-Value Problems Since most of this work will be concerned with the computational solution of nonlinear boundary-value problems, let us review briefly the difficulties connected with this problem [5, 61. For illustrative purposes, consider the nonlinear second-order differential equation
sax = x" = f ( x ' ,
x, t )
dt2
with the boundary conditions x(0) = c,
x(t,) = c2
0
< t < t,
(2)
Since the initial condition x'(0) is unknown, the numerical method discussed in the previous chapter cannot be used directly. This is known as the boundary-value problem. It is much more difficult to handle both theoretically and computationally as compared to initial-value problems. Theoretically, there is no general proof of the existence and uniqueness of the solutions to problems of this type. Computationally, there exists no general effective approach to obtain the numerical solutions. But, unfortunately, a large portion of the problems encountered in physical and engineering sciences are of this type. Most of the discussions in this
3.
LINEAR BOUNDARY-VALUE PROBLEMS
11
work will be concerned with a systematic approach to obtaining numerical solutions for the boundary-value problems. Since most nonlinear differential equations cannot be solved analytically, let us examine briefly how a numerical solution can be obtained with the given boundary conditions, Eq. (2). T h e most obvious approach would be to try to use one of the initial value integration procedures. Suppose that an initial approximation x’(0) is obtained; then Eq. (1) can be integrated by the procedures discussed in the previous chapter. This value of x‘(0) could be obtained from the physical knowledge of the process, or it could be a best guess. T h e value of x(tr) obtained by the use of the assumed value for x’(0) must agree with the given value of x(tr), which is c2 in the present example. If it does not agree with the given value, some trial-and-error or iterative procedure must be devised to obtain the correct initial condition x’(0). But since Eq. (1) is nonlinear, there exists no systematic way to predict the unknown value of x’ at t = 0 from a knowledge of the value of x at t = tf . Actual experience has shown that this type of problem is very sensitive to the error of the unknown or guessed initial condition and is unstable. Very frequently, the guessed value for the missing initial condition must be almost the same as the correct value before the problem will converge. This difficulty becomes more severe if Eq. (1) represents a higher-order or a large system of first-order differential equations where a large number of the initial conditions are missing. Because of this trial-and-error aspect, the computational procedure is not very suitable for modern high-speed computers. This is due to the fact that human interference is needed to obtain the missing initial value so that the problem will converge. Obviously, the integration process could be started at the end point, t r . However, this does not help the situation either, because now the value of x’(tr) is missing. 3. Linear Boundary-Value Problems
All the discusbions in the previous section are based on the fact that Eq. (2. 1) is nonlinear. Let us examine the situation if the differential equation is linear and can be represented as follows: with boundary conditions x(0)
= c1
4%)= c2
12
2. QUASILINEARIZATION
with O
The situation now is completely different and in general Eq. (1) can be solved in a fairly routine fashion numerically. This is due to the fact that the superposition principle can be used for linear systems. If x,!t) is any solution of Eq. (I), and xhl(t) and xh2(t) are any two nontrivial and distinct solutions of the equation X"
+
q1(t) x'
+ q&> x
=0
(3)
then according to the theory of linear differential equations [7, 81 every solution of Eq. (1) can be represented by the following linear combination provided that ql(t), q2(t), and p ( t ) are continuous in the interval [0, $1:
44 =
xP(f)
+ a,x*,(t) +
Wh&)
(4)
where a, and a2 are integration constants determined by the boundary conditions, Eq. (2). Furthermore, if a solution cannot be determined by Eqs. (2) and (4),then no solution exists for Eqs. (1) and (2). The form of solution represented by Eq. (4)will be used extensively in this work. For the ease of reference, x,(t) will be called the particular solution and xhl(t) and x,,(t) will be called the homogeneous solutions of Eq. (1). Notice that xhl(t) and xhz(t) are obtained from the homogeneous form, Eq. (3), of the original Eq. (1). Now, let us examine how the two homogeneous solutions and one particular solution can be obtained. Since the coefficients are not constant, in general Eq. (1) cannot be solved analytically. Thus some numerical integration method must be used. Any two sets of initial conditions, as long as they are distinct and are not all zero, can be used to obtain the homogeneous solutions. For example, the following two sets can be used: Xhl(0)
=0
&(O)
=1
(54
1
&(O)
=0
(5b)
Xh2(0) =
Thus, by the use of Eqs. (3) and (5), two homogeneous solutions can be obtained numerically. Since x,(t) can be any solution of Eq. (l),almost any initial values can be used to obtain xp(t) numerically. However, as we shall see later, the following set of initial conditions which satisfies the known initial condition, Eq. (2a), is preferred: XJO)
= c1
XL(0) = 0
(6)
3.
LINEAR BOUNDARY-VALUE PROBLEMS
13
The particular solution x,(t) can now be obtained by solving Eq. (1) with Eq. (6) as the initial condition. Notice that Eqs. (3) and ( 5 ) , and (1) and (6) are all initial-value problems. They can be solved by any of the numerical techniques discussed in Chapter 1. Once the two homogeneous and one particular solution are known numerically as a function of t , two algebraic equations can be obtained by the use of the boundary conditions. Eq. (4) can be written as follows at t = 0 and t = tf : x(0) = x,(O)
4tr)
= x,(b>
+ a,x,,(O) + %x,z(O) +
Vhl(tl)
+ azx,,(tr)
(74 (7b)
Substituting Eqs. (2a), (5), and (6) into Eq. (7a), we obtain c, = c,
+ u2
or
u2 = 0
(8)
Similarly, from Eqs. (2b), (7b), and (8), c2
= XPPl)
+ %%l(tf)
(9)
Since x,(tf) and xhl(tf) are known values, a, can be obtained from Eq. (9). The desired solution is thus obtained by.substituting the values of ax and u2 into Eq. (4). Since u2 = 0, the second set of homogeneous solutions, which is obtained by the use of initial condition (5b), is not needed. This is due to the fact that the initial conditions for the particular solution have been chosen in such a way that they satisfy the given initial condition (2a). Alternately, the following procedure can be used to obtain the particular and homogeneous solutions. Find any particular solution, x,(t), which satisfies the initial condition (2a) and any nontrivial homogeneous solution, xh(t), which satisfies the initial condition x(0) = 0
(10)
Then the general solution of Eqs. (1) and (2) is x(t> = X P ( t )
+W d t )
(11)
Thus, the solution of a linear boundary-value problem can be obtained in essentially two steps. First, the problem is changed into initial-value problems and these initial-value problems are solved numerically. Then, the integration constants are obtained by solving a set of linear algebraic equations. This approach can be generalized easily to higher-order equations.
14
2. QUASILINEARIZATION 4. Finite-Difference Method for Linear Differential Equations
Obviously, there are other ways to solve the boundary-value problem in linear differential equations. Since the differential equation is linear, even the trial-and-error procedure discussed in Section 2 can be applied systematically. However, we shall discuss a completely different approach which does not have the stability problem associated with the initialvalue integration method discussed in Chapter 1. This method will be referred t o as the finite-difference method. Equation (3.1) can be changed into difference equations. Let the interval t = 0 to t = t j be divided into N equally spaced intervals of d t width. This leads to ( N - 1) internal points: t , , t, ,..., tNPl . A difference equation may then be used to represent the differential equation at each of the internal points. This leads to ( N - 1) difference equations with ( N - 1) unknowns: x ( t l ) , x(t,), ..., ~ ( t ~ -Solution ~ ) . of these simultaneous difference equations yields the desired results. Various difference expressions can be used to replace the derivatives in Eq. (3.1). T h e following simple difference expressions will be used:
Substituting Eqs. (1) and (2) into Eq. (3.1), for K = 1, 2,..., ( N - l), the following ( N - 1) simultaneous algebraic equations can be obtained: a14t1)
+ blX(t2)
=P(4)
k
=
1
-
p 4to)
1, 2,..., ( N - 1)
4.
15
FINITE-DIFFERENCE METHOD
It is convenient to write Eq. (3) in the following matrix form:
AX = c where A represents the tridiagonal matrix 0
A= bN-2
1
0
dt2
‘N-1
and x and c represent the following column vectors:
c=
From the boundary condition (3.2), it follows that x(to) = c 1
Thus, the vector c becomes
c=
X(tN)
= c2
16
2.
QUASILINEARIZATION
Since the matrix A and the vector c are completely known, Eq. (6) can be solved as follows, provided that the matrix A is nonsingular: x
= A-'C
Thus the problem of solving the linear differential equation of the boundary-value type is reduced to finding the inverse of the matrix A ~91. Since Eq. (3.1) is linear, the resulting difference equations are also linear. Thus, Eq. (6) can be solved easily. However, if the original differential equation were nonlinear, the resulting difference equations would also be nonlinear, and in general cannot be solved easily. Thus the finite-difference approach cannot be used effectively. The finite-difference method is essentially an implicit method, while the numerical integration methods discussed in Chapter 1 are generally explicit. Since the differential equation is not solved in a grid point-togrid point fashion as the initial-value integration method, there is no stability problem connected with the finite-diffzrence method. Thus it can be used to solve boundary-value problems which are unstable when the initial-value integration formulas are used. However, since the difference expressions, Eqs. (1) and (2), are very approximate representations of the originaI derivatives, the initial-value integration formulas are much more accurate.
5. Discussion
We have seen that both initial-value and linear boundary-value problems in ordinary differential equations can be solved numerically in a fairly routine fashion on modern digital computers. But, unfortunately, most engineering problems are nonlinear boundary-value problems whose numerical solution cannot be obtained easily. Evidently, there is a need for a method to solve nonlinear boundary-value problems effectively. Since linear boundary-value problems can be solved easily, there is a natural temptation to try to linearize the nonlinear problem. There are various ways to accomplish this. However, the linearized equation is often so approximate to the original nonlinear equation that it is unsatisfactory for many application purposes. We shall see that the quasilinearization technique not only linearizes the original nonlinear equation, but even more important, it provides a sequence of functions which converge to the solution of the nonlinear equation.
6.
NEWTON-RAPHSON
17
METHOD
6 . Newton-Raphson Method
Since the quasilinearization technique is essentially a generalized Newton-Raphson method for functional equations, it is useful to review briefly the Newton-Raphson technique and its special features which make it a powerful numerical tool [ 5 ] . Let us consider the single algebraic equation
f ( 4= 0
(1)
We wish to obtain the root r of this equation. We shall assume that f ( u ) is a convex function and the root r is simple. Further assume that f’(u) < 0. Let the functionf(u) be represented by Fig. 2.1. f tu)
U
FIG.2.1. Newton-Raphson method.
Suppose we have an initial approximation uoto the root r (see Fig. 2.1); expandf(u) around uo :
f(4=f(uo)
+ (u - uo>f’(uo>+
.*’
(2)
Equation (2) is obtained by the use of Taylor series with the second- and higher-order terms neglected. A second approximation to r can now be obtained by solving the linear equation for u :
f ( 4 + (U - U o ) f ’ ( U o ) = 0 (3) Call this approximation u1 . By the use of u l ,a third approximation u2 can be obtained by solving the following equation for u2 :
f ( 4 + (% - U d f ’ ( U 1 )
=
0
(4)
This process is continued and the general recurrence relation is
f(4+ (%+I
- %Jf’(Un)
=
0
(5)
2. QUASILINEARIZATION
18
where u, is always known and is obtained from the previous calculation and u , + ~is the unknown. It should be noted that Eq. ( 5 ) is a linear equation in the unknown Geometrically, Eq. ( 5 ) represents a tangent line to the functionf(u) at u, , and u , + ~represents the intersection of this tangent line with the u axis, This is shown in Fig. 2.1. If we solve for u % + ~Eq. , ( 5 ) becomes
We see that Eq. (6) is the familiar Newton-Raphson equation. Now we wish to examine some of the important properties of the Newton-Raphson method. First, observe that Eq. (6) does not hold if f'(un) = 0. Second, from Fig. 2.1 it is clear that
< u1 < ue * * * < r
(7) The property expressed by Eq. (7) is known as monotone convergence. The values of the sequence {urn}*increase monotonically to the root r . This is an important property computationally and is especially suited for modern computers, because it provides an upper or lower bound for the convergent interval and ensures automatic improvement of the initial approximation at each iteration. This monotone increasing property follows directly from the inequalities. 110
f(%) > 0
fY%) < 0
(8)
If the initial approximation uo is such that f(uo) < 0 as shown in Fig. 2.2, then the initial approximation uo no longer has the monotone
FIG.2.2.
Newton-Raphson method withf(u,)
< 0.
* The symbol {un} will be used throughout this book to denote a sequence of values ,
u1 up
,....
6.
NEWTON-RAPHSON METHOD
19
property. However, the sequence {un}, for n = 1, 2, ..., is still monotone convergent. By simple geometric constructions, it can be shown that this monotone convergence property also exists if the functions f’(u) > 0 and f(u) are concave functions. T h e other two cases-namely thatf(u) is convex and f’(u) > 0, and that f ( u ) is concave and f’(u) < 0-produce a sequence u1 , u2 ,..., which has a monotone decreasing property. If the functionf(u) is not a monotone increasing or monotone decreasing function, or if f ( u ) is not a strictly convex or concave function, this monotone convergence property may not exist. I n fact, the calculation may never converge to the desired root. Whether Eq. (6) converges or not depends on the initial estimate uo and the particular shape of f ( u ) . Fig. 2.3 illustrates one case in which the functionf(u) has turning points and inflections and in which Eq. ( 6 ) may not converge to the root r .
---FIG. 2.3. A function with points of inflection.
For computational purposes, the rate of convergence is another important property. T h e Newton-Raphson method is a second-order process. Most of the other methods generally used for solving algebraic equations numerically are first-order processes. This second-order process is also known as quadratic convergence. If the iteration converges, the error in (n 1)st iteration tends to be proportional to the square of the error in the nth iteration, or
+
u , , ~ - r a~ (u, - r)2
(9)
whereas for first-order iteration processes the two successive errors generally tend to be in a constant ratio. T o derive Eq. (9), rewrite Eq. ( 6 ) :
2. QUASILINEARIZATION
20 sincef(r)
=
0. By the use of the mean value theorem, we obtain
where v lies between r and u, . Substituting Eq. (1 I) into Eq. (lo), we obtain the following expression:
Iff"(.) andf'(u,) exist and iff'(u,) # 0, Eq. (12) reduces to Eq. (9). Computationally, this quadratic convergence means that after a large number of iterations, the number of correct digits for the root Y is approximately doubled for each iteration. Suppose u, has an accuracy of 0.1; then the quadratic convergence means that u,+~ has an accuracy of 0.01 for large n. Tt follows that as u, approaches 7 , there is an enormous acceleration in the convergence rate. 7. Discussion
From the computational standpoint, the Newton-Raphson technique has two important properties, namely monotone convergence and quadratic convergence. Whether Eq. (6.6) possesses the monotone convergence property depends on the property of the function f ( u ) . The monotone convergence property exists for the Newton-Raphson formula only if f ( u ) is a monotone decreasing or a monotone increasing function and, in addition, the function must be strictly convex or concave. However, in general, the Newton-Raphson formula always has the quadratic convergence property provided that it converges. This quadratic convergence is a consequence of using the first and second terms in the Taylor series expansion. It is important to note that the Newton-Raphson equation (6.6) is always linear even if the original function f ( u ) is nonlinear. We have pointed out before that linear boundary-value problems can be solved fairly routinely on modern digital computers. It is a natural question to ask whether we can generalize the Newton-Raphson method to differential equations. If so, does the resulting linear equation possess the important property, namely quadratic convergence ? As we shall see in the next few sections, the answers to all these questions are positive. I n fact the generalized Newton-Raphson technique for functional equations, which is known as the quasilinearization technique, is almost equivalent, at least abstractly, to the NewtonRaphson method for algebraic equations.
8. QUASILINEARIZATION
21
8. Quasilinearization
For concrete illustration, let us consider the nonlinear second-order differential equation:
-d2x _dt2
with the boundary conditions
The functionf now is a function of the function x(t). Choose a reasonable initial approximation of the function x(t); call it xo(t). Notice that we are now choosing a function, not just a single value as in Section 6. This approximate function can be obtained in a variety of ways. For an engineering problem, this approximation can be obtained from the physical situation and by exercising engineering judgment. For problems where convergence requires better initial approximations, this approximation can be obtained by some mathematical devices such as the invariant imbedding technique. However, for a number of problems, a very rough initial approximation is enough for the procedure to converge. I n this case, any intelligent guess can be used to obtain x,(t). T h e most obvious t tf . I n other words, we assume a one would be x,(t) = c l , for 0 constant function for xo(t). As we shall see later, the given boundary value will frequently be used as the initial approximation for the function. T h e function f can now be expanded around the function xo(t)by the use of the Taylor series
< <
f(W,t ) = f(xo(t), t ) + ( 4 t ) - xo(t)).fz,(xo(t), t )
(3)
with second- and higher-order terms omitted, We have written out t explicitly to emphasize the fact that x is a function o f t and is completely different from Eq. (6.2). T h e expression represents partial differentiation of the function f with respect to xo . Combining Eqs. (1) and (3) and rearranging terms, we obtain
f..
X ” ( t ) = fz,(xo(t), t ) x ( t )
+ [f(xo(t), t )
-fa.,(Xo(t),
t ) xo(t)l
(4)
Since x,(t) are known functions of t, Eq. (4)is a linear differential equation with variable coefficients. T h e boundary conditions of Eq. (4)are given by Eq. (2). T h e recurrence relation can now be constructed in the same way as we
22
2.
QUASILINEARIZATION
have done for algebraic equations. Equation (4) can be solved for x ( t ) . Call this xl(t). With xl(t) known, Eq. (1) can be expanded around xl(t): x ” ( t ) = f(x,(t), t )
+( 4 t )-
Xl(t))facl(Xl(t),
t)
(5)
Solving Eq. ( 5 ) , we again obtain a third approximation for x(t). Call this third function x 2 ( t ) . Assume that the problem converges. This procedure can be continued until the desired accuracy is obtained. T h e recurrence relation can now be written as where x, is always considered known and is obtained from the previous iteration. T h e function x,+~ is the unknown function. Notice that Eq. ( 6 ) is always a linear differential equation. T h e boundary condition for Eq. ( 6 ) is the original boundary condition Eq. (2). Although Eq. ( 6 ) is linear, its coefficients are not constants and change with the independent variable t. I n general, Eq. ( 6 ) cannot be solved analytically. However, since it is linear, it can be solved in a fairly routine fashion by the schemes discussed in Sections 3 and.4. It should be emphasized, again, that modern computers can handle most differential equations of the initial-value type in a routine fashion, whether the equation is linear or nonlinear. I n fact, the numerical solution of a nonlinear equation is usually no more involved than a linear one. However, as we have discussed previously, this is not so for boundary-value problems. Nonlinear boundary-value problems are very difficult to solve. With the recurrence relation, Eq. ( 6 ) ,we have reduced the original nonlinear boundary-value problem to a sequence of initial-value problems or to a sequence of linear boundary-value problems depending on whether the method in Section 3 or the method in Section 4 was used. If the solution of Eq. ( 6 ) converges to the solution of the original nonlinear equation within a reasonable number of iterations, a technique for solving nonlinear boundary-value problems has been devised. T h e nonlinear second-order differential equation x”(4 = f(x’(9,
4th 4
(7)
with Eq. (2) as its boundary condition can be treated in essentially the same way. T h e first derivative x ’ ( t ) can be considered as another function and Eq. (7) can be expanded by the use of Taylor series
9.
DISCUSSION
23
and the following recurrence relation can be obtained:
where x(t) has been written as x for simplicity. From now on, this simplified expression will always be used. However, it should always be kept in mind that the expressions x,x’,and x” are always functions of the independent variable t unless otherwise specified. Thus, when we talk about the value of x, we mean a series of values or a continuous range of values of x. Obviously, for equations of higher than the second order, the same device used to obtain Eq. (9) can be used to obtain the recurrence relation. However, since an nth-order ordinary differential equation is equivalent to a system of n simultaneous first-order ordinary differential equations, we shall seldom deal with equations higher than the second order.
9. Discussion
Let us pause for a moment and see what we have done in the last section. We have obtained, intuitively, a sequence of linear equations which we hope will converge to the original nonlinear equation. We have used a Newton-Raphson type of approximation which leads us to expect that the resulting sequence of linear equations should also possess the quadratic convergence property, provided that it converges. If it does converge, this quadratic convergence, also known as a second-order process, should generally exist as long as the Newton-Raphson-type approximation x;+1
= f W + (%+l
- x,)f,,(x,)
(1)
with boundary conditions
is used and as long as the approximation exists and is unique. I n contrast, the Picard approximation procedure can be written as
24
2. QUASILINEARIZATION
+
which is a first-order process. That is, if it converges the (n 1)st iteration will only be proportional to the error in the nth iteration or, approximately, Xn+l
- Xn
Xn - Xn-1
(3)
Of course the advantage of quadratic convergence lies in its rapidity. We shall see in later chapters that it is this quadratic convergence which makes this technique so powerful. I n passing let us note that Kantorovich made the important original contribution to extend the Newton-Raphson technique to functional equations [lo, 111. Thus, this approximation scheme is also known as the general Newton-Raphson-Kantorovich technique. We shall see later, the most important development for this technique is the use of the maximum operation to prove the representation of the original nonlinear equations by the sequence of linear equations, as has been done by Bellman [11 and Kalaba [2]. T h e quasilinearization technique obtained its name from this maximum operation. 10. Existence and Convergence
No mention has been made concerning the important question of convergence of the sequence of functions {xn(t)} to the desired solution of the original nonlinear equation, assuming that this desired solution exists. Since each member of the sequence is determined by a two-point boundary condition, it is not evident a priori that this sequence as defined by Eq. (8.6) actually exists. I n the next few sections, some of these questions will be discussed briefly. No rigorous proof will be attempted. For those who are interested in the details of this important area, Bellman [l] and Kalaba [2] can be consulted. T h e problem of existence will be demonstrated in the next section. This discussion will be brief and without any attention to rigor. T h e problem of convergence, which is very important computationally, will be discussed in more detail. First, it is shown that the sequence of functions { x n ( t ) } converges to the solution of the original equation if the value of tf or the value of the interval [0, tr] is sufficiently small. It is further shown that, as expected, the convergence is quadratic if there is convergence at all. For the purpose of simplicity and also for concrete illustration, the sequence defined by the following system will be considered: (14 x:+1 I ,&= @,+I - X,)f,,(.,)
+
Xn+l(O)
= xn+l(t,) =
0
( lb)
11.
25
EXISTENCE
Our proof will follow that of Kalaba [2] and further details can be obtained from this reference. A more sophisticated level of approach is required to prove monotone convergence. However, this monotonicity of the sequence does not .always exists. It exists only if the differential operator possesses a certain positivity property. These concepts will be discussed in Sections 13 through 15.
11. Existence
T o prove the existence of the sequence defined by the system (lO.l), we shall need an integral representation of the solution of this system. This can be done easily by the use of Green's function. T h e Green's function G(t, 5) for the homogeneous system
can be obtained easily [7, 121:
If we consider system (10.1) as
=f(t)
(3)
then Eq. (10.1) can be represented by the linear integral equation
Now, we wish to estimate the bound on x,+~ the absolute values in Eq. (4) and obtain
I Xn+1 I
< jifI 0
Ell
[If(Xn)I
+ 1 xn I
. T o do this, let us consider
If3pn(Xn)I
+I
&+l
I If3pn(Xn)ll
dE ( 5 )
Let us represent the larger value of maxi f(x,)l and maxi fZ,(xn)I by nz and write
2.
26 Choose I xo I
QUASILINEARIZATION
< 1; for n = 0, Eq. (6) becomes ”t.
From Eq. (2), it can be seen that maxi G(t, ()I t.E
tf
=-
4
Thus
Integrate Eq. (9) and solve for 1 x1 1:
If we choose a sufficiently small t j , it can be seen from Eq. (10) that I x1I is always bounded. I n fact, if t2 f
4 <3m
then
I x1 I
<1
We can apply the same procedure inductively to x 2 , x3 ..., and obtain the result Ixn(t)l 1 for 0 t t j , provided that t; 4 / ( 3 m ) . We thus can conclude that the sequence {xn} is meaningful and is bounded for sufficiently small [0, t j ] .
<
< <
<
12. Convergence
where (x,+~ - xn) can be considered as one quantity and is considered as the unknown. By the use of the mean value theorem, we can show that
12.
27
CONVERGENCE
where u lies between and x, . Substituting Eq. (3) into Eq. (2) and converting it into an integral equation, as we have done in the last section, we find that Eq. (2) becomes
j ~ ( tt)[B(xn , tf
xn+l-
xn
=
xn-1)2.Lv(v)
0
+
(xn+l-
xn)fz,,(xn)l
dt
(4)
Consider the absolute values, and let m, = maxlfvv(u)I:
Equation (5) can be rearranged:
Equation (6) shows that the convergence is quadratic if there is convergence at all. Rewrite Eq. (6) as
I xn+l - xn I < k(l xn - xn-1 I xn - xn-1 I < k(I xn-1 - xn-2 I)2 I xn-1 - xn-2 i < k(l xn-2 - xn-3 IY
If the quantity [K(.J x1 - x, I)] < 1, the right-hand side of Eq. (7) will approach zero as n increases. Consequently, x n ( t ) will approach a function x ( t ) and Eq. (1 1.4) is reduced to
Thus, the function x ( t ) satisfies the original equation. Observe that if the value of t, or the value of the interval [0, t,] is sufficiently small, the quantity k(l x1 - xo 1) will be less than one. I t is
2.
28
QUASILINEARIZATION
interesting to further observe that this quantity also depends on the maximum value of I x1 - x,, I. Thus, if the interval [0, tr] is too large, we can always, at least theoretically, choose a better initial approximation x,,(t) so that the maximum difference between the absolute values of x1 and x, will be small enough to make [k(I x1 - xo I)] less than one. 13. Maximum Operation and Differential Inequalities
I n this and the next two sections we turn to the theoretical aspects from which the quasilinearization concept has been developed. We shall demonstrate why monotonicity of convergence is expected under certain restrictive conditions for the quasilinearization technique and show the connection between dynamic programming and quasilinearization. We do not intend to go into details of these theoretical aspects. However, it would be very useful for our numerical experiments in later chapters to summarize some of the useful concepts and to show how approximation in policy space plays an important role in the origin of quasilinearization. Instead of considering a particular differential equation as we have done in the preceding pages of this chapter, let us consider nonlinear differential equations of the general form [13] L[Xl =@, t )
(1)
with appropriate given boundary conditions which, for simplicity, will not be listed. T h e operator L is a linear ordinary or partial differential operator. Some typical forms of L[x] are dx
dt
d2x dt2
a2x -
at: +
Px
etc.
(2)
T h e independent variable t is multidimensional for partial differential equations and x is the unknown function whose value as a function of t is to be determined. T h e functionf(x, t ) is continuous in x and t. It has a bounded second partial derivative with respect to x and t, and is a strictly convex or concave function of x for all values of x and t within the domain of interest. By the use of maximum operation we wish to represent the function x(t), which is defined by the nonlinear equation (l), by another function ~ ( t )which , can be defined by a linear differential equation. To do this, let us first consider one important property of convex or concave func-
13.
MAXIMUM OPERATION AND DIFFERENTIAL INEQUALITIES
29
tions. A strictly convex and twice differentiable function, f ( u ) , can be expanded by the use of the mean value theorem
f ( 4=f(4 + .(
-
4 f ’ ( 4+ $(u
-
.)””(E)
(3)
where ‘g lies between v and u. Sincef(u) is a strictly convex function of u, f ” ( u )> 0
(4)
so that
f(4 - [f(4 +f‘(.)(u with the equality holding for Eq. ( 5 ) can be written as
z1
= u.
- 741
20
(5)
Using the maximum operation,
+ (u - v)f’(41
f ( 4= m,.x[f(.)
The maximum is actually attained for v = u. Iff(.) function, the same arguments lead to the results
(6)
is a strictly concave
f ( 4= mjn[f(v)+ (u - 4f’(41
(7)
Again, the minimum is attained for v = u. Now return to the original functionf(x(t), t ) , which is assumed to be a strictly convex function of x(t). By using the same arguments we have used for the function f ( u ) , the following expression can be obtained: L[x(t)l = f ( x ( t ) , t ) = m $ f ( y ( t ) , t )
+ ( ~ ( t- )~ ( t ) ) f d ~ ( tt))],
(8)
where the independent variable t has been explicitly written out to indicate the difference between Eqs. (6) and (8). Introduce the function z = z(y, t ) and let
u-4= f ( y , t ) + ( z -Y)fAYr
t>
(9)
. As usual, we have omitted the independent variable t in Eq. (9). T h e function z is subject to the same boundary conditions as the original function x. With z defined by Eq. (9), we wish to find out under what conditions the following representation exists: x
max z(y, t ) Y
(10)
Both the solution of Eq. (9) and the solution of the original Eq. (1) with their appropriate boundary conditions are assumed to exist and to be unique.
30
2.
QUASILINEARIZATION
T h e proof of Eq. (10) essentially consists of two parts. First we must show that x
2 .(y, t )
(11)
Second, we must show that if y = x, then z = x. T h e second part is generally trivial. T o prove the first part, observe that Eq. (8) can be written as
where q is a nonnegative function. From Eqs. (9) and (12) we get
Thus the following differential inequality holds:
T h e problem is now reduced to how we could deduce condition (11) from the known condition (14). This can be done by the use of the positivity property of the linear differential operator [2]. If the existence of the differential inequality (14) implies X-.>O
(15)
then we say that the operator
or, more properly, the inverse of the operator (16), [L -fJy, t)]-l, possesses the positivity property. Thus, when the operator which operates on the quantity (x - z ) possesses the positivity property, the existence of the inequality (11) is a consequence of the differential inequality (14). Unless the linear differential expression (14) with the equality symbol can be solved explicitly for (x - z ) , the proof of this positivity property is not always straightforward. Since very few linear differential equations with variable coefficients can be solved analytically, this proof can be quite involved. I n some cases it corresponds to the nonnegativity of Green's function. T h e reader is referred to the paper by Kalaba [2] for more details. It is sufficient to say that many of the most important differential operators possess this positivity property.
14.
CONSTRUCTION OF A MONOTONE SEQUENCE
31
14. Construction of a Monotone Sequence
Once the representation (13.10) is proved, a sequence of functions which converge to the function x monotonically can be constructed. As we shall see, the resulting sequence is exactly the same as the one obtained by the use of the Newton-Raphson type of equation. However, now we can understand when and why the monotonicity of convergence can be expected. The sequence can be constructed by the use of Eqs. (13.8) and (13.9). Choose an initial approximation for y ( t ) . Call this approximation y ( t ) = yo(t)and use it to determine the function x(t) from Eq. (13.9). Call this function z(t) = xo(t). Thus Eq. (13.9) can be written as LL0.1
=f(Yo
Y
t)
+ (xo
-
(1)
Y0)fdYo t ) ?
The function xo is subject to the same boundary conditions as the function x. Then use this newly obtained function xo(t) to determine an improved y l ( t ) as the function which maximizes the expression
throughout the whole range of t. Since the function f is strictly convex, this maximization can be obtained if y = y1 = xo . Now use y1 = xo as the known function and compute an improved function xl(t) from the equation L[x,l
=
f@o,t ) + (x1 - xo>f&o,
(3)
t)
Again, the original boundary conditions for Eq. (13.1) are used in this computation. An improved function y z ( t )is, again, determined as the function which maximizes the expression
Obviously, this function is y ( t ) = y z ( t )= xl(t). Continuing in this manner, we obtain the sequence of functions {xn(t)}. It is defined by the following equations:
Uxol L[xn+,l
= f(Y0 7 t ) =f(xn
9
t)
+ (xo
+
(%+l
-
(54
Yo)fv(Yo t ) Y
- xn)fv(xn, t )
n
=
with appropriate original given boundary conditions.
0, 1,2,*..,
(5b)
2.
32
Q UASILINEARIZATION
Now let us see how we can prove that the sequence {xn(t)} as defined by Eq. (5) is a sequence with monotonicity of convergence. Consider the equation q x n 1 =f(xn-1
>
t)
+
(Xn -
Xn-l)fV(%-l
!
t)
(6)
where x, is the maximum value of y in the expression [f(y, t ) (x, - y)fJy, t ) ] . Since the maximum is obtained when Y =x,,
+
L[xnl
>
t)
+
(xn
-q.nl
>
t)
+
( x n - Xn)fy(Xn
or = f(Xn
- Xn)fy(Xn
9
9
t) t)
(7)
-4
(8)
where q is a nonnegative function. We deliberately do not simplify Eqs. ( 7 ) and (8). From Eqs. (5b) and (8) we obtain the following inequality: U X n + 1 - xn1
- (%+I - Xn)fv(Xn
9
t)30
(9)
From the positivity property of the operator as discussed in Eqs. (13.15) and (13.16), we see that the following inequality holds: Xn+1
This same inequality for n fashion. Hence %+l
=
2 xn
( 10)
0, 1, 2,... can be obtained in the same
3 x?l 2
**.
2 31 >, xo
(11)
Thus we have proved that the-sequence is a monotone sequence. From this monotonicity, the convergence for the sequence can be easily obtained if a unique solution exists for the original equation. Notice that the first member, y o , of the sequence is not necessarily monotone convergent. This furnishes an interesting comparison between this and the monotone property of the Newton-Raphson formula, which has been discussed in Section 6. According to Figs. 2.1 and 2.2, the first member uo of the sequence uo , u1 ,..., where the u’s are fixed values and are not functions, may or may not be monotone convergent. We shall discuss other similarities between the two techniques in later sections.
15. Approximation in Policy Space and Dynamic Programming T h e use of the maximum operation and the resulting monotone sequence is not accidental. Originally quasilinearization is conceived
15.
APPROXIMATION IN POLICY SPACE
33
within the theory of dynamic programming [1416]. T h e concept of approximation in policy space, which is a special feature of the functional equations of dynamic programming, plays an important guiding role in the development of quasilinearization. In fact, the name “quasilinearization” comes from the maximum operation. Notice that were it not for the maximization, Eq. (13.8) would be linear. As it is, the equation is no longer linear but still possesses certain important properties ordinarily associated with linear equations. It is for these reasons that the term “quasilinearization” is used [3]. Without delving too deeply into the functional equations of dynamic programming which will be discussed in connection with invariant imbedding, let us sketch briefly the concept of approximation in policy space. By applying the principle of optimality, a multistage optimization problem can be represented abstractly by the following functional equation [ 151:
where generally all the quantities in Eq. (1) are multidimensional. However, this abstract representation will serve our present purpose. The symbol x represents the state variable, and z the control variable. The function f represents the transformation taking place in the stages. The function g is the optimum return, and the function h represents single-stage return. If Eq. (1) cannot be solved analytically, some approximation combined with iteration can be used to obtain the solution. Observe that there are really two unknown functions in Eq. (1): the return function g(x), and the policy function z(x). We could start our iteration by first assuming an approximation to either the return function or the policy function. The former is known as approximation in function space, and the latter as approximation in policy space. T h e approximation in policy space, which does not exist in classical analysis, not only is a more natural way to approach the problem, but also possesses analytical advantages. On the practical side, we generally know much more about the policy function than the return function. In addition, approximation in policy space resembles the way in which an experiment is conducted. Analytically, the approximation in policy space generally leads to a monotone sequence of approximations [16]. T o see this, let us guess an initial policy zo(x) and determine the corresponding return function go(.). This can be done by the use of the functional equation
34
2.
QUASILINEARIZATION
Then use this newly obtained return function go(x) to determine an improved policy function zl(x) as the function which maximizes the expression
4% + go(f(x3 4)
(3)
Now use this improved policy zl(x) to compute the return function g, by solving the equation g1(4 = 4 x 9 4
+
(4)
z1))
Continuing in this manner, we have generated two sequences of functions, the policies (zn(x))and the returns {gn(x)). T o prove that the sequence {gn(x)} is a monotone sequence, let us examine Eqs. (2) and (3). Since zl(x) is obtained by maximizing the expression (3), we have &!ow
G h(% 4
+ go(f(x, 4)
(5)
Comparing this with Eq. (4), we obtain the following: [g1(4 - go(4l - CgMx, 4)- go(f(x7 a 1
>0
(6)
possesses the positivity property, then we can obtain the monotone sequence inductively:
GglW G
--.
(8)
The reader no doubt has noticed the similarity between the above derivation and that used in Section 14. It is this advantage of approximation in policy space that prompted Bellman to convert the descriptive processes into the optimization processes as we have discussed in the previous two sections. 16. Discussion
The quasilinearization technique possesses two important properties: quadratic convergence and monotonicity. The first is an immediate consequence of the use of the Newton-Raphson type of approximation. The second, although abstractly similar to the monotonicity possessed by the Newton-Raphson method, is actually obtained through the
17.
SYSTEMS OF DIFFERENTIAL EQUATIONS
35
concept of approximation in policy space and only holds for special classes of operators which have the positivity and the required convexity properties. Note that if the differential operator does not have these properties, theoretically we can always make this differential operator possess these properties by making the interval [0, tr]sufficiently small. It seems that the required positivity and convexity properties would put a severe limitation on the usefulness of the quasilinearization technique. But, as we shall see in later chapters, this technique works out much better in practice. It converges very rapidly to the correct answer even with very rough initial approximations. This is especially surprising in view of the fact that some of the boundary-value problems resulting from optimization have been solved by other methods and are known to be very unstable. Although the convexity and positivity properties played an important role in the derivation of the quasilinearization technique, these properties will not be considered in applications. For practical problems it is seldom possible to obtain these properties. With the easy availability of modern computers, it is much easier to actually solve the problem and see if it converges than to try to find the convergence properties. For problems in physical and engineering sciences, the correctness of the results can almost always be judged from the physical situation of the problem, provided that high accuracy is not desired. Thus, throughout the rest of this book, we shall seldom mention these convergence properties. Although this technique is most effective for nonlinear boundary-value problems, it appears that it can also be used to overcome certain numerical difficulties in nonlinear initial-value problems.
17. Systems of Differential Equations
The method can obviously be extended to a system of nonlinear firstorder ordinary differential equations. An Mth-order ordinary differential equation is equivalent to M first-order ordinary differential equations. To illustrate this, let us consider the following Mth-order differential equation: x(M) = f(t, x, x',
...,x(M-1))
(1)
where the superscript ( M ) represents the M t h differential. Eq. (1) can be replaced by an equivalent system of M first-order equations by the substitutions XI =
x x2 = x' xg = x",..., xM
= $(M-l)
(2)
2. QUASILINEARIZATION
36
Then we have the following system of M equations:
L .
, ,...,x),
= f ( t , x1 xz
(3) x; = x3
Conversely, from a system of M equations such as Eq. (3), it is possible, at least theoretically, to obtain a single differential equation of an order not exceeding M and containing only one dependent variable. However, it is often too complicated to perform the actual eliminations, and hence this transformation is of theoretical rather than practical interest. Let us consider the general system of nonlinear ordinary first-order differential equations
with boundary conditions
4
j
=
I , 2,...,m
~ ~ (=0x i)
k
=
m
xj(tr) =
+ 1, m + 2, ...,M
<
where m M and tt represents the final value of the independent variable t . Obviously, Eq. (3) is in the general form of Eq. (4).In vector form, Eq. (4)becomes
_ ax - f(x, t ) dt where x and f a r e M-dimensionalvectors with components x1 , x2 ,..., xM and f i , f a ,..., f M , respectively. Choose a reasonable set of initial approximations for the functions xl(t), x 2 ( t ) ,..., x M ( t ) . Call these initial approximations ~ , , ~ ( tx~,~(*,..., ), ~ ~ , ~ Obviously, ( t ) . these initial approximations can be obtained in the same way as we have discussed in Section 8 for a single function. The
17.
SYSTEMS OF DIFFERENTIAL EQUATIONS
37
functions fl ,f2 ,...,fM can now be expanded around these initial approximations by the use of the following vector equation: dx
dt--
f(x,t ) = f(xo t ) 7
+ J(xo)(x
-
xo)
(7)
where xo is an M-dimensional vector with components x ~ , x~ ,~,..., , ~ x ~ , T~h e. Jacobi matrix J(xo)is defined by
Notice that since x ~ , x~ ~,,..., , ~ x M , o are known functions, Eq. (7) is a linear differential equation. T h e boundary conditions for Eq. (7) are represented by Eq. (5). T he recurrence relation can now be constructed in the same way as we have done for a single equation. Eqs. (7) and (8) can be solved for x. Call this x l . With x, known, the functions fl ,f2 ,..., f M can now be expanded around x l . This procedure is continued and the following recurrence relation can be obtained:
dx,+l dt
= f ( x n ,t )
+ J(x,)(xn+l
-
x,)
(9)
where J(xn)represents the following Jacobi matrix:
The vectors x , + ~and xn are M-dimensional vectors with components Notice > X2,n ?*..,XM,n , X l , n + l > X2,n+l ) . . . I XM,n+l and that the first subscript in the double subscript notation represents the particular variable and the second subscript represents the iteration
38
2.
QUASILINEARIZATION
number. T h e functions in the vector x, are known functions and are obtained from the previous iteration. T h e functions in x,+, are the unknown functions. T h e boundary conditions for Eq. (9) are ~ ~ , ~ = + x~: ( t j~ = ) 1, 2 ,...,m
x ~ , ~ + ~ (=O )XI K
=m
+ 1, m + 2 ,..., M
(11)
Instead of Eq. ( 5 ) , a more general boundary condition which will be used in the problems of parameter estimation is as follows: xi(tk) = xf
<M k = 1, 2,..., m 2 < M i
=
1, 2,..., m,
(12)
m,m, = M
where t, are the discrete values of t within the interval [0, tr].If m, = M , and in addition t, equals 0 or tf only, then the boundary condition (12) is reduced to (5). I n this case, k must equal one because of the relation m1m2= M . Equations (4) and (12) form a multipoint boundary-value problem which is very important in parameter estimation. Obviously this problem is within the framework of the problem we have just discussed and it can be treated fairly easily by the quasilinearization technique. We shall see that the problem with too many boundary conditions, that is, m1m2> M , can also be treated by the use of least squares combined with quasilinearization. REFERENCES 1. Bellman, R., Functional equations in the theory of dynamic programming. V. Positivity and quasi-linearity. Proc. Natl. Acad. Sci. U S . 41, 743 (1955). 2. Kalaba, R., On nonlinear differential equations, the maximum operation, and monotone convergence. J. Math. Mech. 8 , 519 (1959). 3. Bellman, R., and Kalaba, R., “Quasilinearization and Nonlinear Boundary-Value Problems.” American Elsevier, New York, 1965. 4. Beckenbach, E. F., and Bellman, R., “Inequalities.” Springer, Berlin, 1961. 5. Hildebrand, F. B., “Introduction to Numerical Analysis.” McGraw-Hill, New York, 1956. 6. Milne, W. E., “Numerical Solution of Differential Equations.” Wiley, New York, 1953. 7. Coddington, E., and Levinson, N., “Theory of Ordinary Differential Equations.” McGraw-Hill, New York, 1955. 8. Ince, E. L., “Ordinary Differential Equations.” Dover, New York, 1956. 9. Lanczos, C., “Applied Analysis.” Prentice-Hall, Englewood Cliffs, New Jersey, 1956. 10. Kantorovich, L. V., Functional analysis and applied mathematics. Usp. Mat. Nauk 3, 89 (1948).
REFERENCES
39
1 1 . Kantorovich, L. V., and Krylov, V. I., “Approximate Methods of Higher Analysis.” Wiley (Interscience), New York, 1958. 12. Courant, R., and Hilbert, D., “Methods of Mathematical Physics,” Vol. 1 . Wiley (Interscience), New York, 1953.
13. Lee, E. S., Quasilinearization, nonlinear boundary-value problems, and optimization. Chem. Eng. Sci. 21, 183 (1966). 14. Bellman, R., Functional equations in the theory of dynamic programming. 11. Nonlinear differential equations. Proc. Natl. Acad. Sci. U.S. 41, 482 (1955). 15. Bellman, R., “Dynamic Programming.” Princeton Univ. Press, Princeton, New Jersey, 1957. 16. Bellman, R., “Adaptive Control Processes: A Guided Tour.” Princeton Univ. Press, Princeton, New Jersey, 1961.
Chapter 3
ORDINARY DIFFERENTIAL EQUATIONS
1. Introduction
In order to illustrate how the quasilinearization technique actually works, some simple numerical examples will be presented in the first part of this chapter. This allows us to give a fairly detailed description of .thenumerical procedures used. However, even for these simple examples, a stability problem will be encountered. It is shown that this stability problem can be overcome by the use of the finite-difference method discussed in Section 4 of Chapter 2. Most of the numerical experiments will be based on the differential equations resulting from tubular flow chemical reactors with axial diffusion. Not only do these equations have practical value, but they also form an interesting mathematical problem in that none of the initial boundary conditions are known explicitly for numerical calculations. In addition, they are known to be very difficult to solve computationally under certain conditions. This difficulty is generally caused by the presence of the Arrhenius reaction rate term, whose nonlinearity is of exponential type. It is shown in Sections 11 and 12 that this Arrhenius type of exponential nonlinearity can be handled easily by the present procedure. I n fact, the interval of convergence for equations with this type of nonlinearity is almost as large as those for equations with wellbehaved solutions if the dependent variable in the exponential term is restricted to within reasonable range by the use of upper and lower restrictions during the iterations. After these simple numerical experiments are discussed, the computational procedures are generated to large systems of simultaneous differential equations in the last few sections. Some of the computational aspects for large systems are also discussed.
2.
A SECOND-ORDER NONLINEAR DIFFERENTIAL EQUATION
41
2. A Second-Order Nonlinear Differential Equation
Consider the chemical reaction (1)
A+A+B
which is taking place in a homogeneous tubular flow chemical reactor with axial mixing. Assume that the change of volume in the reactor is negligible, the following equation can be established easily by the use of material balance on reactant A [l]: 1 d2x Npe dt2
dx dt
Rx'
=0
where NPeis the dimensionless Peclet group LvlD, R is the reaction rate group kL/v, x is the concentration of reactant A, and t is the dimensionless reactor length which varies between 0 and 1. T h e variable t is obtained by dividing the actual position along the axial direction of the reactor by the total reactor lengthL. ZI is the flow velocity of the reaction mixture, assumed constant throughout the reactor; D the mean mass axial dispersion coefficient, assumed constant; and k the specific chemical reaction rate, assumed constant. The assumption of constant chemical reaction rate implies that the temperature along the tubular reactor is constant. I n the later part of this chapter, the case of variable temperature along the reactor will also be considered. The boundary conditions, according to Wehner and Wilhelm [2], are x,
1 dx(0)
= x(0)- --
NPe
dt
at
t=O
at
t = l
where x, represents the concentration of reactant A before it enters the reactor and is a known quantity; and x(0) represents the concentration of A just after it enters the reactor. Notice that there is a discontinuity of the concentration x of the reactant A at the entrance to the tubular reactor. This discontinuity is caused by axial mixing. T h e Peclet group characterizes the amount of axial mixing and is inversely proportional to the effective axial diffusivity D. As D approaches infinity, Np,-+O, the axial mixing becomes so large that a perfectly mixed reactor is obtained. On the other hand as D approaches zero, NPe---t co,the axial mixing disappears and a plug-flow reactor is obtained.
42
3.
ORDINARY DIFFERENTIAL EQUATIONS
Mathematically, we are dealing with a second-order nonlinear differential equation of the boundary-value type with NPeand R as constants, and these constants are known and fixed values. As usual, x is the dependent variable and t is the independent variable. We wish to obtain an explicit expression for the function x(t). T o obtain the numerical solution is not a simple matter even for such a simple boundary-value problem before the quasilinearization technique is available. This is especially true for simulation or control purposes where the equation must be solved a large number of times within a reasonably short time interval. Since Eq. (2) is second order, the numerical integration cannot be started until the values of x and x' is specified at the same point. If the value of x is assumed at t = 1, the integration can be performed in a backward direction and the boundary condition at t = 0, or Eq. (3a), is checked. T h e entire process would be repeated until the desired check at t = 0 is obtained. However, since the system is nonlinear, this commonly used trial-and-error procedure is quite time consuming. Furthermore, as has been pointed out in the previous chapter, the trial-and-error procedure is not suitable for modern computers. This is especially true if we want to solve this equation a large number of times automatically by the computer. Since none of the initial conditions are known explicitly, integration in the forward direction is even more difficult. I n addition to all these problems, it has been found that Eq. (2) is unstable for certain values of the parameter. As we shall see shortly, Eqs. (2) and (3) can be solved easily and routinely on modern computers by the use of the quasilinearization technique. T h e convergence rate is surprisingly fast even with a very rough initial approximation. 3. Recurrence Relation
I n order to obtain the recurrence relation, Eq. (2.2) can be written as 1 d2x Npe dt2
- X'
+ Rx2
X)
= ~ ( X I ,
T h e linear recurrence relation can be obtained easily from Eq. (8.9) of Chapter 2:
-
x:+,
+ 2Rxnxn+, - R x ~
(2)
4.
COMPUTATIONAL PROCEDURE
43
with boundary conditions
wheren = 0, 1, 2,... . Notice that the linear term x’ is unchanged by applying the linearization technique. This should be expected. Equation (2) can be reduced to a set of first-order equations. Let dXn+l -
dt
-
yn+n+l
n = 0,1,2,-*.
(4 4
Equations (2) and (3) become
Yn+l(l) = 0 (5b) with n = 0, 1, 2,... . The same results would have been obtained if Eq. (1) were first reduced to two first-order equations and recurrence relations were obtained from these first-order equations.
4. Computational Procedure
Equations (3.4) and (3.5) are two first-order simultaneous linear differential equations. Since the coefficients are not constant and are functions of t , generally equations of this type cannot be solved analytically. However, since they are linear, the superposition principle can be used, and thus this problem can be solved numerically by the commonly used marching techniques. Since none of the initial conditions are known, two sets of distinct and nontrivial homogeneous solutions are needed for a second-order differential equation or a set of two first-order simultaneous equations. Call these two sets of homogeneous solutions ~ ~ ~ ( ~and + ~ylh(n+l) ) ( t ()t ) , and ~ ~ ~ ( % +and ~)~ ( t ~) ~ ( ~ +As~ has ) ( tbeen ) . mentioned before in the previous chapter, almost any initial conditions can be used to obtain
3.
44
ORDINARY DIFFERENTIAL EQUATIONS
these homogeneous solutions as long as they are not all zero. The following initial conditions are assumed: Xlhh+l)(O)
=1
Ylhh+l)(O)
=0
(14
Xi?h(n+1)(0)
=0
Y*h(n+lAo)
=1
(W
The homogeneous form of Eq. (3.4) is
One set of particular solutions, ~ ~ ( , + ~ ) ( tand ) ypb+,)(t),can also be obtained with any set of arbitrary initial conditions. Let us assume the following set of initial values:
Thus, one set of homogeneous solutions can be obtained by solving
Eqs. (la) and (2), and another set by solving Eqs. (lb) and (2). The set of particular solutions is obtained by solving Eqs. (3.4) and (3). Notice that all of these problems are initial-value problems: they can be solved by any of the numerical procedures discussed in Chapter 1. The solutions are generally listed in tabular form at discrete values of t, for 0 t 6 1. Now the complete or general solution of Eq. (3.4) can be represented by
<
X(n+l)(t) = X,(,+l)W Y(n+dt)
=Y s ( n + d t )
+
Ql(n+l)Xlh(n+l)(t)
+
%(n+l)Ylh(n+l)(t)
+ +
Qz(n+l)~m(n+l)(t)
(44
~2(?Z+1)Yzh(n+d~)
(4b)
where a,(,+,) and a2(n+l)are integration constants which can be obtained by the use of the given boundary conditions and the newly obtained particular and homogeneous solutions. Set t = 0 in Eq. (4) and combine it with Eqs. (1) and (3):
Substitute Eq. (5) into the boundary condition (3.5a):
4.
45
COMPUTATIONAL PROCEDURE
Set t = 1 in Eq. (4b) and combine it with Eq. (3.5b): Ys(n+1)(1)
+
%+l)Ylh(n+l)(l)
+
%+l)Y!Zhh+l)U)
Equations (6) and (7) can be solved for a,(,+,)
al(n+I)
=0
(7)
and
(8b)
= az(n+i)/NPe
Since all the quantities on the right-hand side of Eq. (8a) are known, aZ(,+,) and a,(,+,) can thus be obtained from the above equations. Once a,(,+,) and u ~ ( , + ~are ) known, the general solution of Eq. (3.4) can be obtained by the use of Eq. (4). All of the above discussions are based on the assumption that the values of the nth iteration are known and the solution for the (n 1)st iteration is being sought. However, to start the calculation, some initial approximation must be used. We have discussed how this initial approximation may be obtained in Section 8 of the previous chapter. T h e most obvious one would be to use the known initial condition as the initial approximation. For the present problem, the following constant value is used:
+
Xn=o(t)
(9)
X,
< <
for 0 t 1. Notice that y,(t) does not appear in Eq. (3.4) and thus the initial approximation yo(t) is not needed. Once the initial approximation, x,(t), is known; an improved function x l ( t ) can be obtained by solving the simultaneous equations Rxi
with boundary conditions
Y l ( l >= 0
(11b)
Equations (10) and (11) can be solved by the procedure discussed earlier in this section by obtaining two sets of homogeneous and one set of particular solutions, Equations (1) to (8) with the subscript n = 0 can be used to solve the above equations. Once xl(t) is obtained, another
3.
46
ORDINARY DIFFERENTIAL EQUATIONS
improved function x 2 ( t ) can be obtained by solving the following equations: 1 -yh = yz + ~Rx,x,- Rx: ( 124 NPe
4 =Yz xe = XAO)
(12b) 1 - -Yz(O) NPe
(134
YzU) = 0 (13b) These equations can, again, be solved by the use of Eqs. (1) to (8) with the subscript n = 1. This procedure is continued until the desired result is obtained. As has been discussed previously, the value of ex defined by Eq. (6.1) of Chapter 1 will be used to describe the change in x between iterations. It should be emphasized again that ex is not the accuracy of x. T h e computational procedure is shown in Fig. 3.1 by the use of a block diagram. Any of the numerical techniques for initial-value problems discussed in Chapter 1 can be used for SUBROUTINE I N T to solve Eq. (3.4). I n the present work, the Runge-Kutta method is used. In order to solve the systems (3.4) and (3.5), three sets of simultaneous differential equations must be solved numerically as initial-value problems. These three sets can be solved all at once or one by one. T h e latter approach is used in Fig. 3.1. However, when the systems have a large number of differential equations, they can be solved all at once in order to avoid the computer storage problem. This storage problem will be discussed in the last few sections of this chapter. T h e constant multiplier A is used to change Eq. (3.4) to its homogeneous form, Eq. (2). Thus A is set equal to one for the particular solution and equal to zero for the homogeneous solutions. T h e symbol A t represents the integration interval and ( N 1) is the total number of integration or grid points.
+
5. Numerical Results
T h e following numerical values are used [3]: Npe
=
6 R
=
2
X, =
1 At
=
0.01 xo(t,)
=
1 k = 0, 1, 2 ,..., N
(1)
T h e other numerical values used are listed in Eqs. (4.1) and (4.3). T h e results listed in Table 3.1 are obtained by using these values on an IBM 7094 computer. It can be seen that ex is reduced to less than 0.3 x in three iterations with approximately 3 seconds’ computation time. No effort has been made to streamline the program. This computation time
5.
NUMERICAL RESULTS
47
PARTICULAR SOLUTION Xn*+0)= x@,Yn,((o).o
SUBROUTINE INT.
HOMOGENEOUS SOLUTION
HOMOGENEOUS SOLUTION FROM EQUATlON(48)
t
t
I+ FIG. 3.1.
Block diagram of the axial diffusion example.
can no doubt be further reduced by a better computer program. T o illustrate the rate of convergence, the results are also shown in Fig. 3.2. It should be noted that the initial approximation xo(tk) = 1 is very poor. This initial approximation can be improved by applying physical and engineering experience and intuitions for most practical problems.
3.
48
ORDINARY DIFFERENTIAL EQUATIONS
TABLE 3.1" CONVERGENCE RATESWITH xO(tL)= 1.0 Iteration 1
Iteration 2
Iteration 3
Iteration 4
tk
4 t k )
Y(td
4 t L )
Y(t!J
4t.d
Y(tL)
x(t3
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0
0.84307 0.76073 0.69816 0.65061 0.61448 0.58707 0.56631 0.55074 0.53938 0.53190 0.52898
-0.94157 -0.71556 -0.54378 -0.41317 -0.31379 -0.23795 -0.17959 -0.13348 -0.094246 -0.054382 -0.00000
0.83148 0.74047 0.66623 0.60482 0.55352 0.51039 0.47412 0.44397 0.41985 0.40278 0.39582
-1.0111 -0.81851 -0.67288 -0.55975 -0.46950 -0.39523 -0.33134 -0.27197 -0.20891 -0.12772 0.00000
0.83130 0.74012 0.66559 0.60372 0.55173 0.50765 0.47018 0.43863 0.41307 0.39479 0.38729
-1.0122 -0.82065 -0.67653 -0.56546 -0.47767 -0.40603 -0.34448 -0.28647 -0.22275 -0.13741 0.00000
0.83129 0.74012 0.66559 0.60372 0.55172 0.50764 0.47017 0.43862 0.41305 0.39476 0.38727
a
Y(t3
-1.0122 -0.82066 -0.67655 -0.56547 -0.47770 -0.40607 -0.34453 -0.28652 -0.2228 1 -0.13744 0.00000
From Lee [3].
INITIAL
1.0
a
Y
THIRD ITERATION
8 o.2 '0
t 0.2
0.4
t
0.6
0.8
1.0
FIG. 3.2. Concentration profiles with axial diffusion [3].
It is interesting to see the influence of the initial approximation on the convergence rate. This is shown in Tables 3.2 and 3.3. Only the convergence rates of the missing initial condition, ym+l(0),and the missing final condition, ~ ~ + ~ are ( l )tabulated. , Except for the difference in the initial approximation, all other numerical values used are the same as
1 2 3 4 5 6 7
Iteration
16.332 3.8534 -0.06825 -0.92460 -1.0100 -1.0122
1 2 3 4 5 6
5.0
=
10.0
2.oooo 2.0703 1.1494 0.60388 0.40709 0.38743 0.38727
xO(tk)
5.0
2.5039 1.2459 0.62835 0.41080 0.38749 0.38727 0.38727
xO(tb) =
THE
5.2390 0.18750 -0.89816 - 1.0092 -1.0122 -1.0122
xO(tk) =
CONVERGENCE RATEOF
xo(tk) = 10.0
Iteration
~~
-0.94157 -1.0111 -1.0122 -1.0122 -1.0122 -1.0122
0.0 -0.94157 -1.0111 -1.0122 -1.0122 -1.0122 -0.33607 -0.98064 -1.0120 - 1.0122 -1.0122 - 1.0122
xo(tk) = 0.1
0.01
-0.03918 -0.94685 -1.0113 -1.0122 -1.0122 -1.0122
xO(tk) =
-0.00398 -0.94211 - 1.0111 -1.0122 -1.0122 -1.0122
=
2.0
1.oooo 0.52898 0.39582 0.38729 0.38727 0.38727 0.3 8727
xo(tk)
=
1.0
0.52898 0.39582 0.38729 0.38727 0.38727 0.38727 0.38727
xo(tk)
0.69975 0.43835 0.38859 0.38727 0.38727 0.38727 0.38727
xo(tk) = 0.1
41)
0.01 0.96120 0.51593 0.39444 0.38729 0.38727 0.38727 0.38727
xO(tk) =
0.001 0.99601 0.52763 0.39567 0.38730 0.38727 0.38727 0.38727
xO(tk) =
1.oooo 0.52898 0.39582 0.38729 0.38727 0.38727 0.38727
xo(tk) = 0.0
0.0 -0.94157 -1.0111 -1.0122 -1.0122 -1.0122
xo(tk) = 0.001 xo(tk) = 0.0
MISSING FINALCONDITION AS A FUNCTION OF THE INITIAL APPROXIMATION
TABLE 3.3
xO(tk)= 1.0
xo(tk) = 2.0
~
CONVERGENCE RATEOF THE MISSINGINITIAL CONDITION AS A FUNCTION OF THE INITIAL APPROXIMATION
TABLE 3.2
A
+I r n
;
F 5
0
m
2
Z
VI
3.
50
ORDINARY DIFFERENTIAL EQUATIONS
those used in obtaining Table 3.1. It can be seen that the convergence rate is only a mild function of the initial approximation for the present problem. I n fact, the convergence rate for problems with such extreme initial approximations as xo(t,) = 10 and xo(tk) = 0.0, K = 0, 1, 2,..., N , is almost the same as that of the problem with xo(t,) = 1 as the initial approximation. Notice that the convergence for the missing initial and final conditions is monotone except for the case xo(t,) = 10. It should also be noted that the missing initial condition converges faster than the missing final condition. I n general, the final point at t = 1 has the slowest convergence rate. No convergence has been obtained in ten iterations for xo(t,) = 15. Obviously any intelligent guess would not pick up the extreme values shown in Tables 3.2 and 3.3 as the initial approximations. It should be emphasized that this problem with the given numerical values is fairly stable in comparison with the usual practical problem. Obviously, we cannot expect such a big interval of convergence for most practical problems. However, experience has indicated that convergence can be obtained for a large number of problems if the given boundary conditions are used as the initial approximation, and this convergence is generally quadratic. Figure 3.3 shows the influence of axial mixing on the concentration profile of a tubular reactor. All the numerical values are the same as those used to obtain Table 3.1 except for NPe. T h e convergence rates are very 1.0
x
1 -
0.
i
e
Z O I-
z ~
W V
Z O .4
-
FIG. 3.3. Concentration profiles as a function of Peclet group.
6.
THE FIXED BED REACTOR
51
fast for NPe= 1, 0.01. A value of E , less than 0.3 x has been obtained in three iterations. However, for NPe= 10, this small value of E, cannot be obtained. T h e difference between the third and fourth iterations for NPe= 10 is reduced to I x4(t,) - x3(t,) I < 0.2 x 10-3, 12 = 0, 1, 2,..., N . However, more iterations indicate that the last few integration or grid points near t, = t, = 1 oscillate irregularly. T h e maximum and minimum values of this oscillation during the fourth to tenth iterations are 0.37097 and 0.37036, respectively, for the last grid point, x,+~(1). This instability increases rather fast with the increase of N P e . At N P e = 12, these maximum and minimum values of X ~ + ~ ( I ) due to the irregular oscillation are 0.36816 and 0.36523, respectively, during the fourth to tenth iterations. T h e value of Y,+~(1) also oscillates irregularly between approximately zero and 0.01 56 during these iterations. Thus the final boundary condition, ~ ~ + ~=( 0,l is ) not always fulfilled. No convergence is obtained for NPe= 15, 20. T h e value of X~+~(I) is still reasonable for NPe= 15 and is approximately between 0.3 and 0.5 during the first ten iterations. However, for NPe= 20, the 1) is always unreasonable and is larger than one or smaller value of than zero during the first ten iterations. For NPe= 50, x,+~(1) reaches -lo3' in the second iteration. Except for the Peclet group, all these numerical experiments are carried out with the same numerical values as those used in obtaining Table 3.1, and the Runge-Kutta integration scheme has been used. It will be shown in the next few sections that linearization is not the primary cause of this instability. This instability can be overcome by the use of the finite-difference integration scheme discussed in Section 4 of Chapter 2 instead of the Runge-Kutta integration scheme. T h e profile for NPe= 100 in Fig. 3.3 is obtained by the use of the finite-difference integration method, which will be discussed in the next few sections. 6. Stability Problem in Numerical Solution-The
Fixed Bed Reactor
Instead of the empty tubular chemical reactor considered in the previous sections, let us consider a reactor which is filled with packing material. This is known as a fixed bed reactor. For the purpose of simplicity, we shall first consider the isothermal reactor. T h e effect of diffusion and reaction inside the packing material will be neglected. These effects will be considered in the chapter dealing with partial differential equations. Thus for the present purpose, the only effect of the packing material is its contribution to axial diffusion. At steady state, with essentially the same assumptions as have been used in obtaining Eq. (2.2),
52
3.
ORDINARY DIFFERENTIAL EQUATIONS
the following equation is obtained for the reaction represented by Eq. (2.1):
where M.=
D v D
= Peclet
group
Tk z D -2 reaction -
rate group
V
t D, t,
=
tJD,
=
average diameter of packing particle
= reactor
length variable
T h e other symbols have the same meaning as in Eq. (2.2). Notice that Eq. (1) is essentially the same equation as Eq. (2.2). T h e only difference between these two equations is that Eq. (1) uses the diameter of the packing particle D, as the reference length while Eq. (2.2) uses the length of the reactor L as the reference length. Thus, the independent variable t now varies between 0 and t, , where t, is the dimensionless length LID, . T h e flow velocity a is now the interstitial velocity between the packing particles. T h e boundary conditions are x, = x(0)
-
1 dx(0) dt
-M
at
t=O
at
t
=
t,
T h e equation linearized by the application of the Newton-Raphsontype formula is
with the boundary conditions
T h e Peclet number M for axial dispersion in a fixed bed reactor has been investigated by various authors [4,5]. It has been found to be
7.
53
FINITE-DIFFERENCE METHOD
practically constant and is equal to 2 for gaseous reaction mixtures at high Reynolds numbers where turbulent diffusion occurs. T h e size of the packing particle must be much smaller than the diameter and length of the tubular reactor. A reactor length of 48 packing particle diameters is assumed. T o summarize this, the following numerical values are used: t,
= 48
Y
= 0.04
xo(t,)
=
1, k
= 0,
1,2,..., N
(5)
M = 2
At=0.1
x,
=
1
A numerical experiment is carried out by using these values and the same procedure outlined in the previous sections. It has been found that this problem will not converge. T h e numerical values of the particular and homogeneous solutions increase or decrease very rapidly as t increases. Extremely large numbers have been obtained for these solutions at the last part of the concentration profile in the first iteration. A reduction in step size or integration interval, A t , does not help the situation. Stability difficulties have been encountered by. various authors [6,7] for fixed bed reactors. T h e present stability problem appears to have been caused by the explicit marching integration technique.
7. Finite-Difference Method
In order to avoid these stability difficulties, the finite-difference integration method discussed in Section 4 of the previous chapter will be used to solve the linear differential equation (6.3). Since the finitedifference method is an implicit method, it does not have the stability problem connected with the marching technique. It should be possible to obtain a solution for the problem outlined in the previous section by combination of this method and the quasilinearization technique. Suppose the reactor length ti has been divided into N equal increments of width A t ; let x(tk) denote the value of x at position 12 A t . By applying the difference expressions [8]
54
3.
ORDINARY DIFFERENTIAL EQUATIONS
where
b = - - + -M At
1 At2
Equation 2 is obtained in exactly the same way as that used to obtain Eq. (4.3) in Chapter 2. From the boundary condition, Eq. (6.4a), and the difference expression, Eq. (lb), the following equation can be obtained:
Solving for x,+~( to), one has
I n the same manner the following expression is obtained from the boundary condition, Eq. (6.4b): xn+l(tN)
= x?%+l(tN-I)
(6)
I n obtaining Eqs. (4)and (6), the relationships X,+~(O) = ~ ~ + ~ (and t,,) x,+~( tr) = x,+l( tN) are used. After substituting Eqs. (5) and (6) into the first and last of Eqs. (2), we can represent the system (2) by the matrix equation =
c
(7)
7.
55
FINITE-DIFFERENCE METHOD
where A represents the tridiagonal matrix
1 -
b
At2
A=
.. .. . .
with 1
l/(MAt)
=
1
+ 1/(MAt)dt2
(9)
and x , + ~and c represent the column vectors
-Mrx2(t,)
-
1
x,
1
+ 1/(MAt ) dt”
-Mrx:( t2) c=
-Mr$(t3)
If we assume that the values of x,(tk), k = 1, 2, ..., ( N - l), are known and are obtained from previous iterations, both A and c are known quantities. T h e unknown vector x , + ~can thus be obtained by solving Eq. (7). This unknown vector is obviously the solution of the linear differential equation (6.3). Once the vector x , + ~is obtained an improved vector x , + ~can be obtained by setting n = n 1 in Eq. (7) and by solving for x , + ~ .T h e vector x,+~can be obtained in the same way. This iteration is continued until the desired result is obtained.
+
3.
56
ORDINARY DIFFERENTIAL EQUATIONS
Notice that in the present procedure the linear differential Eq. (6.3) is solved by solving the matrix Eq. (7). Since the given boundary conditions, Eq. (6.4), have already been used in deriving Eq. (7), no integration constants and hence no solution of another set of algebraic equations are necessary. In the procedure outlined in Section 4, a particular and two homogeneous solutions must be obtained first and then a set of algebraic equations must be solved in order to obtain the integration constants. The computer diagram is shown in Fig. 3.4 for the finite-difference method. It is interesting to compare Fig. 3.4 with Fig. 3.1. Except for the solution of the matrix Eq. (7) the computational procedure is particularly simple for the present approach.
[
CALCULATE ELEMENTS OF A ]
1
FIG. 3.4. Block diagram of the finite-difference method.
8. Systems of Algebraic Equations Involving Tridiagonal Matrices
A system of linear algebraic equations can be solved by the use of matrix inversion. It has been shown in Eq. (4.12) of Chapter 2 how the inverse of A can be used to obtain the solution of the linear algebraic
8.
SYSTEMS OF ALGEBRAIC EQUATIONS
57
systems. A discussion of matrix inversion can be found in most numerical analysis books [9, 101. In the present work, the matrix A frequently will be tridiagonal. T h e solution of a linear algebraic system involving a tridiagonal matrix is much simpler than that of algebraic systems involving dense matrix. A special method has been developed by Thomas for the tridiagonal matrix. For completeness, the Thomas method will be outlined briefly. T h e derivation of the method will be omitted [ 113. Consider a system of N linear algebraic equations of the following form: dzx1 d3x2
+ +
a p 1 ‘2x2 ‘3x3
+ + +
’1x2 = c1 ’2x3
= ~2
b3x4 = c 3
(1)
In matrix form, the above system becomes
AX = c where A represents the tridiagonal matrix ‘1
bl
A=
(3) dN-l
I:[ [“I
‘N-1
’N-1
and x and c represent the column vectors
x=
XN
c=
CN
(4)
58
3.
ORDINARY DIFFERENTIAL EQUATIONS
where, as usual, the column vector x is unknown and all other quantities in Eq. (2) are known. T o solve Eq. (2), the following substitutions can be made: Pl = a 1
P z = a2 P3
4%
= a 3 - d3q2
where (7)
and
T h e unknown column vector x can now be obtained by xN =EN xN-l
= gN-1
- qN-lXN
xN-2
= gN-2
- qN-2'N-1
31
=g 1
(9)
- 41x2
T h e algorithm represented by Eqs. (6) to (9) will be used frequently in this work. 9. Numerical Results
Using the numerical values given in Eq. (6.5),we solve Eq. (6.3) by the finite-difference method outlined in Section 7 with boundary conditions (6.4).We solve Eq. (7.7) by the Thomas method, without encountering
9.
59
NUMERICAL RESULTS
any stability problem. This confirms the early statement that the instability encountered in Section 6 is caused by the marching integration technique. Fig. 3.5 shows the convergence rate of this calculation. T h e fourth iteration cannot be distinguished from the third iteration on the figure. The value of E~ is reduced to less than 0.3 x lo-* after three iterations. The computation time required for each iteration is approximately in the same order of magnitude as that required by the procedures outlined in Section 4 where the principle of superposition has been used.
---
-
r = 0.04 r = 2.0
i P
2 0. 3 V z
s 0. INITIAL, x o (t)
7 ,
I
0
10
20 30 40 REACTOR LENGTH, t
tf50
FIG. 3.5. Isothermal tubular reactor with axial diffusion.
A more severe reaction condition with Y = 2.0 and the initial approximation xo(t,) = 0.2, k = 0, 1, 2,..., N , has also been solved and the results are shown by the solid line in Fig. 3.5. All other numerical values used are the same as those listed in Eq. (6.5). It should be noted that in spite of the steepness of the first part of the concentration profile and the very poor initial approximation, only four iterations are needed. More iterations do not change the profile shown in Fig. 3.5. T h e influence of the initial approximation on the convergence rate is also studied. T h e convergence rates of the missing final condition, ~ , + ~ ( tare ~ )summarized , in Table 3.4. T h e more severe reaction condition, r = 2.0, is used. T h e initial approximations used are shown in the
6 7 8 9 10 11 12 13 14 15
5
1 2 3 4
Iteration
25.000 12.500 6.2500 3.1250 1.5625 0.78125 0.39062 0.1953 1 0.097656 0.048828 0.024453 0.013424 0.011122 0.01 1064
50.000
x O ( t K )= 100.0
CONVERGENCE RATEOF
5.0000 2.5000 1.2500 0.62500 0.31250 0.15625 0.078 125 0.039063 0.0 19689 0.012032 0.011072 0.01 1064 0.011064 0.01 1064 -
-
2.5000 1.2500 0.62500 0.31250 0.15625 0.078125 0.039063 0.019689 0.0 12032 0.01 1072 0.011064 0.011064 -
xo(tK)= 5.0
0.25000 0.12500 0.06250 0.031255 0.016104 0.011371 O.Oll065 0.011064 0.01 1064 -
0.5oooO
xO(tL)= 1.0
X(tN)
-
-
-
0.1ooOo 0.05000 0.025033 0.01 3627 0.011134 0.011064 0.01 1064 0.01 1064 0.01 1064 0.011064 -
xo(tk) = 0.2
-
-
0.15579 0.082742 0.045973 0.027236 0.0 17439 0.012467 0.011119 0.011064 0.01 1064 0.01 1064 -
xo(tk) = 0.01
-
-
=
0.0
0.99998 0.49999 0.24999 0.12500 0.062499 0.031255 0.016104 0.011371 0.01 1065 0.01 1064
x&)
MISSING CONDITION AS A FUNCTION OF THE INITIAL APPROXIMATION, FINITE-DIFFERENCE METHOD
xo(tk) = 10.0
THE
TABLE 3.4
3
0
2
5
0
m
r
2
zz
v
; m
4
*(
5
2
*(
0
w
0
QI
10.
STABILITY PROBLEM WITH HIGH PECLET NUMBER
61
first row. Except for the value of Y and the initial approximation, all other values are the same as those listed in Eq. (6.5). It is interesting to compare this table with Table 3.3, where the combination of the marching technique and the superposition principle has been used. I n spite of the fact that the present concentration profile is much steeper than that of Table 3.3, the present procedure has much wider interval of convergence. It converges at a value as large as X o ( t k ) = 100, while in the marching technique the procedure does not converge very well even at xo(t,) = 15. I n general, the missing final condition has the slowest convergence rate. I n order to compare these two procedures, the problem solved in Section 5 , listed in Table 3.1, is solved by the finite-difference approach. T h e convergence rate of the missing final condition is listed in Table 3.5. It can be seen that the convergence rates are approximately the same for the two different integration methods. However, the Runge-Kutta integration formula is more accurate than the finite-difference approach. This is obvious, since the latter uses the very approximate difference expressions (7.1). TABLE 3.5 CONVERGENCE RATE MISSINGFINALCONDITION, FINITE-DIFFERENCE METHOD
OF THE
Iteration
0
1 2 3 4 5
41) 1 .o 0.52876 0.39531 0.38686 0.38683 0.38683
10. Stability Problem with High Peclet Number
T h e stability problem encountered in Section 5 when N P e is larger than 10 for empty tubular reactors can also be overcome by the use of the finite-difference method. T h e results for N p e = 100 are shown in Fig. 3.3. T h e convergence rate for this case is quite fast. With the initial approximation, x o ( t k ) = 1, k = 0, 1, 2, ..., N , the value of E~ is reduced to 0.3 x in three iterations.
62
3.
ORDINARY DIFFERENTIAL EQUATIONS
11. Adiabatic Tubular Chemical Reactor with Axial Mixing
Nonlinear differential equations involving the following Arrhenius reaction rate expression occur frequently in chemical engineering appliactions
k
=
Gexp
(-
where G is the frequency-factor constant, E is the activation energy of reaction, and R, is the gas constant. T h e reaction temperature T is generally the unknown variable. A nonlinear exponential expression such as Eq. (1) is very difficult to handle and very frequently causes instability problems in numerically solving differential equations in which it occurs. T o test the effectiveness of the quasilinearization technique in overcoming this difficulty, the equations resulting from mass and energy balances on an adiabatic reactor are solved simultaneously. For a nonisothermal reactor, Eq. (6.1) can be written as follows:
-1- d2x - _ - dx M dt2
dt
px2
exp
E (- -)R,T
=
o
where /3 = D,G/v and the other symbols have been defined previously. Eq. (2) is obtained by substituting Eq. (1) into Eq. (6.1). If the mean thermal axial dispersion coefficient is assumed to be equal to the mean mass axial dispersion coefficient D and the packing particles play the same role as they have played in obtaining Eq. (6.1), the energy balance for an adiabatic reactor in which the chemical reaction (2.1) is occurring can be established easily:
where Q = -AH/(cfp), c j is the specific heat of the material inside the reactor, A H is the heat of reaction, p is the density of the material inside the reactor, and T is the temperature of the reaction mixture. Equations (2) and (3) are the nonlinear simultaneous equations to be solved by the quasilinearization technique. T h e boundary conditions for Eq. (2) are given by Eq. (6.2). For Eq. (3) the boundary conditions are T,
=
1 dT(0) T ( 0 )- -M dt
at
t=O
at
t = t,
11.
ADIABATIC TUBULAR REACTOR
63
where T, represents the temperature of the reaction mixture before it enters the reactor, and is a known quantity. Equations (2) and (3) can be written as d2x_ _ d x_1 _
M dt2 1 d2T
M dt2
dT dt
E
dt
E
(5b)
T h e right-hand sides of (5) can be linearized by the use of Eqs. (17.9) and (17.10) of Chapter 2. T h e linearized equations are
(6b)
+
where El = E/R, . T h e variables with subscript (n 1) are the unknown variables. T h e variables with subscript n are considered known and are obtained from the previous iteration. It should be noted that the equations in (6) are linear differential equations. T h e boundary conditions for Eq. (6a) are Eqs. (6.4). For Eq. (6b), the boundary conditions are
T h e two second-order simultaneous linear differential equations can be solved by the finite-difference method. Using difference Eqs. (7.1) for (6a) and a similar set of difference equations for (6b), we can reduce the above two equations into a set of simultaneous difference equations. T h e boundary conditions (7) become
64
3.
ORDINARY DIFFERENTIAL EQUATIONS
Using the same procedure as that used in obtaining Eq. (7.7), we obtain the following 2(N - 1) simultaneous algebraic equations from Eqs. (7. I), (7.4), (7.6), (6), and (8):
where A, and A, are the tridiagonal matrices b d a2
-a1
A,
b
d
=
a3 b
.. .. . .
d
aN-2 b
-0 ‘el
aN-l
b
d
A,
d
=
0 -
e2 b
.
e3 b
.... . .
d
eN-2 b
d
0 and B, and B, are the diagonal matrices
0
S1
”
B,=[ 0
-. ’N-I
eN-l.
1 1.
ADIABATIC TUBULAR REACTOR
with
, , cl,and c, are The column vectors x , + ~ T,+l
65
66
3.
ORDINARY DIFFERENTIAL EQUATIONS
Equations (9) and (10) are coupled and they must be solved simultaneously. I n order to simplify the calculations, the vectors T,+l and x , + ~in the second terms of Eqs. (9) and (10) are approximated by the vectors T , and x, , respectively. Equations (9) and (10) now become
where
Since the vectors T , and x, are known vectors and are obtained from the previous iteration, Eqs. (29) and (30) can be solved independently for the unknown vectors x , + ~and T,+l . Thus, the computational procedure is essentially the same as that discussed in Section 7. T h e Thomas method can be used to solve Eqs. (29) and (30).
12.
67
NUMERICAL RESULTS
12. Numerical Results
The numerical values used are t,
= 48
El
M=2 T , = 1250"R x, = 0.07 mole/liter
= E/R, = 22,000"R
18 = 0.5
x lo* liter/mole Q = 1000 liter-"F/mole d t = 0.1
(1)
T o start the calculation, the following initial approximations are assumed: Tn-o(tJ = 1250
~ ~ = = ~ 0.01 ( t ~ )k
=
0, 1,..., N
(2)
The linear equations in (11.6) are solved by the finite-difference method on an IBM 7094 computer. T h e results are shown in Figs. 3.6 and 3.7. With the very poor initial approximation, Eq. (2), the value of zz is reduced to 0.3 x in 12 iterations. Each iteration requires approximately a little over one second of computation time. T h e convergence rate of the missing final conditions are tabulated in Table 3.6.
I
x6(t' I
0
10
I
I
20 30 REACTOR LENGTH, t
I
40
I
'I LI tf50
FIG. 3.6. Adiabatic tubular reactor with axial diffusion, concentration profile.
3.
68
ORDINARY DIFFERENTIAL EQUATIONS r
I
I
I
0
10
I
I
30 REACTOR LENGTH, t 20
40
tf5O
FIG. 3.7. Adiabatic tubular reactor with axial diffusion, temperature profile.
AS
TABLE 3.6 CONVERGENCE RATES OF THE MISSINGFINALCONDITIONS FUNCTIONS OF INITIAL APPROXIMATIONS, ADIABATIC REACTOR xo(tr) = 0.01,
TO(tJ
=
0.01, To(te) = 1400 x,(t*) =
1250
Iteration
T(tN)
X(tN)
TON)
1 2 3 4 5 6 7 8 9 10 11 12 13
1255.7 1562.1 609.71 1299.8 1311.0 1313.2 1311.7 1311.2 1311.3 1311.3 1311.3 1311.3 1311.3
0.27079 x 10-l 0.17808 x 10-l 0.90130 x 0.12439 x 10-l 0.94372 x 0.87898 x 0.85752 x 0.86433 x 0.86648 x 0.86600 x 0.86589 x 0.86592 x 0.86591 x
1219.6 1275.0 1411.8 1323.2 1306.6 1309.9 1311.8 1311.4 1311.3 1311.3 1311.3 1311.3 1311.3
x(thT)
0.50752 x 0.26525 x 0.14992 x 0.79554 x 0.80006 x 0.89360 x 0.87246 x 0.86382 x 0.86549 x 0.86602 x 0.86593 x 0.86591 x 0.86591 x
10-l 10-l 10P 10P 10W
lo-*
12.
NUMERICAL RESULTS
69
The results derived by using a different initial approximation TO(tk)= 1400, k = 0, 1, 2, ..., N , with all other values remaining the same are also shown in Table 3.6. However, no convergence has been obtained with the initial approximations: TO(tk)= 1250
To(t,)
5
1250
xo(t,)
= 0.0
xo(t,) .= 1.0
0.01
To(t,) = 500
xo(t,)
TO(tk) 5 1500
xo(tk) = 0.01
=
(3)
with k = 0, 1, 2,..., N . An examination of the results shown in Fig. 3.7 and Table 3.6 reveals that the temperature profile fluctuates widely during the iterations. Thus, if Eqs. (2) are used as the initial approximations, the maximum value of Tn+l(tN) is 1562.1 and the minimum is 609.71. These are also the maximum and minimum grid point temperatures reached. Since the reaction rate depends on the temperature exponentially, these widely fluctuating temperature profiles cause an instability problem. When the values listed in Eqs. (3) are used as the initial approximations, extremely high temperatures in the order of lo5 to loz2 have been reached. I n order to avoid these difficulties, the grid point temperatures from the previous iteration, Tn(tk),k = 0, 1, 2, ..., N , are changed to within the following range before they are used in the next iteration to obtain T n + d t k ) and X n + l ( t k ) : 500
< Tn(tk)< 1500
K
= 0, 1, 2,..., N
(4)
Thus, although the temperature from the previous iteration may be outside of the range of Eq. (4), the temperature used to obtain the next iteration is always within the range of Eq. (4). By the use of these restrictions on the temperatures, no convergence problem has been encountered for the numerical experiments with Eq. (3) as the initial approximations. T h e results shown in Table 3.7 are obtained by the use of the above restrictions on the temperatures and the numerical values listed in Eqs. (1). It can be seen that as long as the temperature is restricted to within a reasonable range, the convergence rate is fairly independent of the initial approximations. T h e temperatures shown in Table 3.7 are temperatures before they are changed to within the range of Eq. (4). In general, the final condition x,+~( t N ) has the slowest convergence rate. Only the convergence rates for the first 13 iterations are shown for xo(tk) = 1.0 and TO(tk)= 1500. T h e convergence rates for the next few
6 7 8 9 10 11 12 13
5
1 2 3 4
Iteration
1250.0 4702.7 -0.187 x lo' 1290.2 1345.7 1316.7 1311.0 1311.1 1311.1 1311.3 1311.3 1311.3 1311.3
T(tN)
0.69999 x 0.35027 x 0.17515 x 0.24251 x 0.12833 x 0.82267 x 0.84757 x 0.86641 x 0.86681 x 0.86597 x 0.86587 x 0.86592 x 0.86591 x
X0(tk) = 1.0, T o ( t , ) = 500
lo-*
lo-* lo-'
lo-*
1397.7 -0.567 X 1369.2 0.236 x -0.105 X 1250.3 4683.7 -0.176 x 1290.3 1345.5 1316.6 1310.0 1311.1
lo7
10"
10'O
10''
TON)
1.0,
4tN)
0.25000 0.12500 0.62500 x 0.31250 x 0.69848 x 0.34951 x 0.17477 x 0.24201 x 0.12812 x 0.82271 x 0.84771 x 0.86642 x
0.5oooO
TO&) = 1500
Xo(t*) =
lo-*
10-l 10-l 10-l 10-l lo-' 10-l lo-'
1250.0 4699.2 -0.2 x 107 1290.2 1345.7 1316.7 1311.0 1311.1 1311.3 1311.3 1311.3 1311.3 1311.3
T(tN)
x x x x x x x x x x x x x
4tN)
0.69999 0.35027 0.17515 0.24250 0.12833 0.82269 0.84758 0.86641 0.86681 0.86597 0.86586 0.86590 0.86591
FINAL CONDITIONS, ADIABATIC REACTOR WITH TEMPERATURE RFSTRICTIONS
10-l 10-l 10-l 10-l 10-1
CONVERGENCE RATESO F THE MISSING
TABLE 3.7
10-l 10-l lo-' 10-l 10-'
13.
DISCUSSION
71
iterations are similar to the convergence rates of iterations 9 to 13 of the other two cases in Table 3.7. A numerical experiment with xo(t,) = 0.0 and TO(tk) = 500 also has been carried out. T h e convergence rate for this case is essentially the same as that with xo(t,) = 0.0 and TO(tk)= 1500. Because the equation depends on the temperature exponentially in the Arrhenius rate expression, this device of putting restrictions on the allowable range of the temperature will be used frequently in later chapters. Since the only purpose of this device is to put the temperature within a reasonable range, this reasonable range can be estimated easily from the given boundary conditions.
13. Discussion
Obviously, Eqs. (1 1.9) and (1 1.10) could have been combined into one vector-matrix equation of the following form:
AY,+l = c (1) where yn+lis the 2(N - 1)-dimensional column vector with components Xn+l(tl), Xn+l(tz),..., Xn+l(tN-l), Tn+l(tl), Tn+1(t2),..*, T,+l(tN-l). However, now the matrix A is no longer tridiagonal and, in addition, the number of rows and columns of A is doubled. T o get some idea of the size of A, suppose N = 480, then the matrix A has 958 columns and the same number of rows. Thus Eq. (1) is much more difficult to solve computationally. I n fact, if A were a general dense matrix with no zero elements, no computer would have large enough rapid-access memory to store an 958 x 958 matrix at the present time. Instead of only two simultaneous second-order equations, the procedures discussed in Section 11 can be extended to M simultaneous differential equations of the boundary-value type. I n general, no particular difficulty should be encountered if the equations are fairly well behaved and if M is a small number. However, if M is large, the simplified assumptions in obtaining equations (1 1.29) and (1 1.30) from Eqs. (11.9) and (1 1.10) may cause convergence problems. This difficulty can be overcome if a set of good initial approximations can be obtained. A second and more formidable difficulty is the limited rapid-access memory of current computers. This is especially true in view of the fact that the difference representation of the original derivatives, Eq. (7.1), is very approximate in nature. Consequently, a very small integration interval may be needed for some problems. This storage or memory problem will be discussed in detail in a later section.
3.
72
ORDINARY DIFFERENTIAL EQUATIONS
Instead of Eq. (7.1) higher-order difference expressions which can represent the derivatives more accurately can be used. The interested reader is referred to the book by Fox [12] for details. It should be pointed out that a second-order linear equation of the form of X”
+ 41(t) + q d t ) x X’
=p ( t )
(2)
Thus, in considering second-order linear differential equations, we need not consider the first derivative. This can simplify the manipulations in using higher-order difference expressions for the finite-difference method.
14. Unstable Initid-Value Problems
Since there are no stability problems connected with the finite-difference approach for boundary-value problems, this approach can be used to solve unstable initial-value problems. Consider the following single nonlinear differential equation: x(0) =
x’ = f ( x , t )
xo
(1)
This equation can be linearized by the Newton-Raphson type of formula: x;+1
=f@,
9
t>
+
@,+I
- X,)fJX,
,t )
(2)
Differentiating Eq. (2) yields =f ’ ( X ,
3
t)
+ (x;+1
- Qf&,7 t )
+
@,+I
- Xn)f:,(Xn
t)
(3)
16.
SYSTEMS OF DIFFERENTIAL EQUATIONS
73
Equations (3) and (4)can be solved by the finite-difference method. Fox [I21 has given a detailed computational comparison between the finitedifference approach for linear equations and the initial-value integration techniques. 15. Discussion
For illustrative purposes, some fairly simple problems have been solved and discussed in the previous sections. Obviously the quasilinearization technique can be applied to more complex equations. It is not difficult to see the wide range of applicability of the quasilinearization technique to various boundary-value problems occurring in physical and engineering sciences. T h e application of this technique to parameter estimation, optimization, and partial differential equations will be discussed in the next few chapters. Some other applications can be found in the references listed at the end of the chapter [13-17, 201. 16. Systems of Differential Equations
In this and the remaining sections of this chapter, the numerical procedure discussed in the previous sections will be generalized to higher-order differential equations or systems of daerential equations subject to two-point and multipoint boundary-value problems. This generalization will be applied in later chapters. Since an nth-order ordinary differential equation is in general equivalent to n first-order differential equations and since the latter is usually more convenient to handle, the discussion will be concentrated on a system of first-order differential equations. Large systems of ordinary differential equations of the two-point or multipoint boundary-value type arise very naturally in practice. As we shall see in the next two chapters, both the optimization and parameter estimation processes are problems of this type. We have seen in the previous sections how problems are solved by the quasilinearization technique. Since all the problems discussed are fairly simple, no serious computational difficulties have been encountered. However, we shall see that for large systems of differential equations the situation is different and various difficulties may be present. Consider the system of nonlinear equations which have been discussed in Section 17 of Chapter 2:
3.
14
ORDINARY DIFFERENTIAL EQUATIONS
with boundary conditions
<
M. with m It is more convenient to write Eq. (1) in vector form:
where x is an M-dimensional vector which will be referred as the state vector. The recurrence relations have been obtained previously as
where J(xn)is the Jacobi matrix and is defined by Eq. (17.10) of the previous chapter. The vectors x,+~ and x, are M-dimensional vectors +1 x M , ~ + and ~ ~ 1 , ,~ ~2 ,..., , x~ M , ~ , with components ~ l , ~ ,+ ~l 2 , ~ ,..., respectively. It should be emphasized again that the first subscript in the double subscript notations represents the particular variable and the second subscript represents the number of the iteration. The vector x, is always considered known and is obtained from the previous iteration and the vector x,,~ is the unknown vector. The boundary conditions for Eq. (4) are 1,2,...,m
xi,n+l(tr)= 4
j
=
X~,~+~(= O ) x:
k
=m
+ 1, m + 2, ...,M
(54
(5b)
We now wish to consider how the system of Eqs. (4) and (5) can be solved. Although Eq. (4) is linear, generally it cannot be solved analytically. This is due to the fact that the coefficients are functions of the independent variable t . However, as has been discussed in various places, a system of linear ordinary differential equations of the boundaryvalue type, such as Eq. (4), can be solved numerically by the use of the principle of superposition and a numerical integration technique for initial-value problems. The idea is to find one set of particular solutions and m sets of homogeneous solutions, where m is the number of missing initial conditions. Then, the general solution can be obtained by the use of the principle of superposition. Thus, if the vector ~ ~ ( ~ + ~ )is( any t) solution of the equation
16.
75
SYSTEMS OF DIFFERENTIAL EQUATIONS
which satisfies the conditions
k
X ~ ~ , ~ + , (= O )xi
=
m
+ 1, m + 2,..., M
(7)
and the m vectors xhj(,+,),j = 1, 2)..., m, are any m sets of nontrivial and distinct solutions of the m vector equations
which satisfy the conditions
then the general solution of Eq. (4) which satisfies the initial conditions (5b) is m
xn+i(t)
~s(n+i)(t)
+C
ai,n+iXhi(n+i)(t)
0
t
tf
(10)
j=1
where xp(,+l,(t) and xhj(,+,)(t)are M-dimensional column vectors with components X,p,n+&), X 2 p ,,+&)>.**, XlMp ,,+lP) and X l h j , n + l ( t ) , X,hj,n+l(t),..., xMhi,,+,(t), respectively. T h e symbol aj,,+,, j = 1, 2, ...) m, represents the m scalar integration constants. T h e set of algebraic equations (10) can be represented by the following matrix equation: xn+,(t)
= xD(n+l)(t)
+
Xh(n+1)(4 an+1
(11)
where a , is the m-dimensional integration constant vector with components a,,,,, , a,,,+, ,..., a,,, . T h e symbol Xh(,+,)(t) represents the homogeneous solution matrix
Notice that in obtaining Eq. (10) or ( I l ) , only the initial boundary conditions, Eq. (5b)) have been used. Thus, in Eq. (11) there are m integration constants, u ~ , , + ~ a,,,,, , ,..., a,,,,, , which will be determined by the use of the m final conditions, Eq. (5a). T h e vector ~ ~ ( , + ~ ) ( t ) will be called the particular solution vector and the m vectors xhj(,+,)(t), j = 1, 2, ..., m, will be called the m sets of homogeneous solutions.
76
3.
ORDINARY DIFFERENTIAL EQUATIONS
Let us illustrate how the particular and homogeneous solutions can be obtained numerically. The one set of particular solutions, xp(n+l)(t), which satisfies the initial conditions, Eq. (7),can be obtained by integrating Eq. (6) numerically with the following initial values: xj,*n+l(o) = 0
x ~ ~ , ~ + ~= ( OX! )
j = 1, 2I . . . , m K = m 1, m
+
(134
+ 2,...,M
(13b)
The m sets of nontrivial and distinct homogeneous solutions, ~ ~ ~ ( ~ + j = 1, 2, ..., m,which satisfy the initial conditions, Eq. (9), can be obtained by integrating Eq. (8) by the use of the following m sets of initial values:
1:
1 0 0 0 1 0 0 0 1
I0
0
.**
0'
". 0 *
. .
.'.
0
*
where for the purpose of simplicity, the m sets of initial values have been represented by the homogeneous solution matrix, Eq. (12). Each set of initial values has one nonzero element and unity has been assigned to this nonzero element. Thus, for the first set of initial values which is represented by the first column, the nonzero element is x ~ ~ ~ , ~ + ~T(hOe )second . + nonzero ~ ( 0 ) element. Instead of set of initial values has ~ ~ ~ ~ ,as~the Eq. (14), these m sets of initial values can also be represented as follows: x ~ ~ ~ , ~ += ~ (1O ) for i = j
(15) x ~ ~ ~ , ~ += ~ (0O ) for i # j
with i = 1, 2,..., M and j = 1, 2,..., m. The subscript i in Eq. (15) represents the particular variable and the subscript j represents the particular set of homogeneous solutions. Instead of Eqs. (13) and ( 1 9 , any other initial values could have been used to obtain the particular and homogeneous solutions as long as they satisfy the given conditions, Eqs. (7) and (9), and as long as the homogeneous solutions are nontrivial and distinct. The above values
~ ) ( t ) ,
16.
77
SYSTEMS OF DIFFERENTIAL EQUATIONS
have been chosen for convenience and simplicity. Notice that if the initial values (13) and (15) are substituted into Eq. (11) for t = 0, the following relationships at the initial point can be obtained: ~i.~+~ =( ~o )i . ~ +j = ~ ~k,n+1(0) =
4
k
1, 2,..., m
=m
+ 1, rn + 2,...,M
Once the particular and homogeneous solutions are obtained, the integration constants represented by the vector a,, can be obtained from Eq. (1l), the given final conditions (5a), and the newly obtained particular and homogeneous solutions. At the final end, t = tf , the first m equations of (1 1) become m
~ l . n + l ( t f )= X l p . n t l ( t f )
+C
ai.n+lXlhi,n+l(tf)
i=l
m
Xm.n+l(tf) = ~ m , . n + l ( t f )
+c
aiSn+1Xrnhi,n+l(tf)
i=1
Substituting the given final conditions (5a) into (16), we obtain the following set of simultaneous algebraic equations:
where the subscript m has been used to emphasize that the m x m square matrix
and c,+, is the following m-dimensional vector:
Xmh(n+l)(tf)
is
78
3.
ORDINARY DIFFERENTIAL EQUATIONS
Notice that matrix (18) is a submatrix of the homogeneous solution matrix (12) and represents the first m rows of matrix (12). Since the matrix Xrnh(%+,)(tf) and the vector c,+, are known quantities, the algebraic equation (17) can be solved for the unknown vector a,+, . If m is small, Eq. (17) can be solved easily. For a large m,matrix inversion can be used. Thus an,,
= [Xnh(n+db)l-l
(20)
cn+1
With a,, known, the general solution x,+,(t) of Eq. (4) can finally be obtained by substituting the numerical values of the homogeneous and particular solutions into Eq. (10) or (11). Once ~ , + ~ ( t0) , t tt , is obtained, a further improved vector ~ , + ~ ( can t ) be obtained from Eqs. (6)-(20) by substituting the subscript n 1 for the subscript n in these equations. This procedure can be continued in the same way as has been described for a single function. T h e homogeneous solution matrix defined by Eq. (12) will be used frequently in later chapters. Notice that if none of the initial conditions (5b) were given, then the number of sets of homogeneous solutions needed would be equal to the number of the original equations. This number is M in the present case. Consequently, the homogeneous solution matrix would be an M x M square matrix and would be the same matrix as that defined by (18) at t = tf . Furthermore, notice that if the homogeneous solution matrix is a square matrix, then the initial values chosen for obtaining the homogeneous solutions form a unit matrix at t = 0.
< <
+
17. Computational Considerations
Assuming that a solution exists, the linear differential equation (16.4) can be solved in two steps. First, one set of particular and m sets of homogeneous solutions are obtained numerically by the use of the arbitrarily assumed initial values which satisfy the given ( M - m) initial conditions. Then, a set of m simultaneous algebraic equations must be solved to find the m integration constants, where m represents the number of missing initial conditions. For the problem discussed in Section 16, the number m is also equal to the number of the given final conditions. However, for multipoint boundary-value problems, this is not generally true. Let us now inquire into the storage requirements for solving the linear differential equations (16.4). I n order to obtain x,+, from the known vector x, , the grid point values x,(tk), k = 0, 1, 2, ..., N , must be stored
18.
79
SIMULTANEOUS SOLUTION OF DIFFERENT ITERATIONS
+
in the rapid-access memory of the computer. I t means that M ( N 1) values must be stored. If M is fairly large, say 20 or 50, and in addition, a fairly small integration step or interval must be used, it may mean that N is equal to 1000; then the storage requirements for the above procedure can easily exceed the available rapid-access memory of current computers. Bellman [181 has proposed the use of simultaneous calculations to overcome this problem. This aspect will be discussed briefly in the next section. The numerical solution of a system of linear algebraic equations is not an easy matter. Serious problems of inaccuracy and instability can arise [lo, 131. We shall see in later chapters that the numerical solution of algebraic equations can be avoided by the use of invariant imbedding. Various methods have also been proposed to overcome the ill-conditioning problem in solving algebraic equations [lo, 13, 211.
18. Simultaneous Solution of Different Iterations
T o overcome the storage problem, Bellman [13, 18, 191 has proposed to solve all the differential equations including the previous iterations simultaneously. This approach is based on two points. First, the initial approximation x,(t), 0 t tf , is assumed to be simple and thus does not require a large amount of storage space. From the examples in the previous sections where a constant function or functions have been used as the initial approximations, this assumption can be fulfilled easily. Even if the initial approximations depend on the independent variable t and are not a constant function, they probably still can be represented in a fairly simple fashion in the computer memory. Second, instead of storing every grid point of the previous iteration, xn(tk),k = 0, 1,2,...,N , as has been done in previous sections, the initial values for all the previous iterations, x,(O), n = 1, 2, ..., n, will be stored in the computer. T h e grid points for the previous iteration, xn(tk),k = 1, 2, ..., N , can always be obtained when needed by integrating the following differential equations with x,(t) as the known initial approximation:
< <
dxn--
dt
f(x,-l , t ) 4J(x,-l>(x, - ~
~ - 1 )
(1)
with n = 1, 2, ..., n. T h e initial conditions for Eq. (1) are x,(O), n = 1, 2, ..., n, which have been obtained from previous iterations and have been stored in the computer. Thus, we have replaced the storage of ( N + 1) M grid point values of the previous iteration by the simultaneous solution of nM linear differential equations of the initial-value
3.
80
ORDINARY DIFFERENTIAL EQUATIONS
type and also by the storage of nM initial values of all previous iterations. Since the integration of the simultaneous differential equations (1) is more time consuming, we are essentially trading computer time for computer memory. Let us examine how this procedure can be carried out. For n = 0, Eq. (16.4) can be solved exactly as before by the use of the initial approximation xo(t), except that only the initial grid values x,(O) will be retained in the computer. For n = 1, Eqs. (16.4) and (1) must be solved simultaneously with the initial approximation xo(t ) and the initial grid values x,(O) as the initial values of Eq. (1). Equation (16.4) is solved by first obtaining one set of particular and m sets of homogeneous solutions. Thus, we must obtain simultaneously one set of particular solutions, m sets of homogeneous solutions, and one set of solutions for Eq. (1) with n = 1. This requires the simultaneous integration of M(m + 1) M equations of the initial-value type. These equations are
+
j = 1, 2,..., m
with i
=
1, 2,..., M and j
=
dX1-
dt
-
1, 2,..., m, and
f(xo , t )
+ J(xo)(xi - xo)
(4)
with x,(O) known. T h e particular solutions are obtained from Eq. (2), while the homogeneous solutions are obtained from Eq. (3). Equation (4) is used to obtain the results of the previous iteration. Once the above equations are solved simultaneously, we must solve the m simultaneous algebraic equationi represented by Eq. (16.17) with n = 1. For n = 2, we must solve M (m 1) 2M simultaneous differential equations and m simultaneous algebraic equations. T h e differential equations are dx (5) dt = f(x, , t ) J(xz)(xD(a)- XZ)
+ +
+
j
=
1, 2,
...,m
REFERENCES
81
and
This process can be continued. For n = n, we must solve M(m 1) nM simultaneous differential equations and m simultaneous algebraic equations. These simultaneous differential equations are Eqs. (16.6), (16.8), and (1). Since the convergence is quadratic, the number of iterations n will seldom exceed 10 for most problems. For M = 10 and m = 5 , we must integrate M ( m + 1) + nM = 160 differential equations simultaneously. These can be handled by current computers. If M is much larger, we can further reduce the computer requirements in two different ways. First, observe that the one set of particular solutions and m sets of homogeneous solutions do not have to be obtained simultaneously. Equations (16.6) and (1) can be integrated first simultaneously to obtain the one set of particular solutions. Then, Eq. (16.8) with j = 1 and Eq. (1) can be solved simultaneously for the first set of homogeneous solutions. The second set of homogeneous solutions can be obtained by solving Eq. (16.8) with j = 2, and Eq. (1) simultaneously. This can be continued till the mth set of homogeneous solutions. Thus, instead of solving M(m 1) nM equations simultaneously, we are now solving M + nM simultaneous equations (m + 1) times. Again, we are trading computer time, which is available, for computer memory, which is not always available. T h e second way is to reduce the number of simultaneous equations in Eq. (1). This approach may also reduce the computer time requirements and it is especially useful if high accuracy is not required. Instead of storing the initial approximation x,(t), the results of one of the intermediate iteration, say n = 5, could be correlated and stored in the computer: Then Eq. (1) only represents n = 6, 7, ..., n simultaneous differential equations instead of the previous n simultaneous equations. Various methods are available to correlate these intermediate results. Some of them will be discussed in connection with parameter estimation in the next chapter.
+ +
+ +
REFERENCES 1. Danckwerts, P. V., Continuous flow systems-distribution of residence times. Chem. Eng. Sci. 2, l(1953).
82
3.
ORDINARY DIFFERENTIAL EQUATIONS
2. Wehner, J. F., and Wilhelm, R. H., Boundary conditions of flow reactor. Chem. Eng. Sci. 6 , 89 (1956). 3. Lee, E. S. Quasilinearization, nonlinear boundary-value problems, and optimization. Chem. Eng. Sci. 21, 183 (1966). 4. Wilhelm, R. H., Progress towards the a priori design of chemical reactors. Pure Appl. Chem. 5, 403 (1962). 5. McHenry, K. W., and Wilhelm, R. H., Axial mixing of binary gas mixtures flowing in a random bed of spheres. A.1.Ch.E. J. 3, 83(1957). 6. Coste, J., Rudd, D., and Amundson, N. R., Taylor diffusion in tubular reactors. Can. J. Chem. Eng. 39, 149 (1961). 7. Carberrv, J. J., and Wendel, M. M., A computer model of the fixed bed catalytic reactor: The adiabatic and quasi-adiabatic cases. A.1.Ch.E. J. 9, 129 (1963). 8. Lee, E. S., A generalized Newton-Raphson method for nonlinear partial differential equation-packed-bed reactors with axial mixing, Chem. Eng. Sci. 21, 143 (1966). 9. Lapidus, L., “Digital Computation for Chemical Engineers.” McGraw-Hill, New York, 1962. 10. Lanczos, C., “Applied Analysis.” Prentice Hall, Englewood Cliffs, New Jersey, 1956. 11. Bruce, G. H., Peaceman, D. W., Rachford, H. H., and Rice, J. D., Calculations of unsteady-state gas flow through porous media. Trans. A I M E 198, 79 (1953). 12. Fox, L., “The Numerical Solution of Two-Point Boundary Problems.” Oxford Univ. Press, London and New York, 1957. 13. Bellman, R., and Kalaba, R., “Quasilinearization and Nonlinear Boundary-Value Problems.” American Elsevier, New York, 1965. 14. Kalaba, R., On nonlinear differential equations, the maximum operation, and monotone convergence. J . Muth. Mech. 8, 519 (1959). 15. Bellman, R. Kagiwada, H., and Kalaba, R., Orbit determination as a multi-point boundary-value problem and quasilinearization. Proc. Natl. Acad. Sci. U.S. 48, 1327 (1962). 16. Bellman, R., On the computational solution of differential-difference equations. J . Muth. Anal. Appl. 2, 108 (1961). 17. Radbill, U. R., Application of quasilinearization to boundary-layer equations. AIAA J . 2, 1860 (1964). 18. Bellman, R., Successive approximations and computer storage problems in ordinary differential equations. Commun. ACM 4 , 222 (1961). 19. Bellman, R., Kalaba, R., and Kotkin, B., Some numerical results using quasilinearization for nonlinear two-point boundary-value problems. RM-3113-PR. RAND Corp., Santa Monica, California, April, 1962. 20. Sylvester, R. J., and Meyer, F., Two point boundary problem by quasilinearization. J. SOC.Ind. Appl. Math. 13, 586 (1965). 21. Conte, S. D., The numerical solution of linear boundary value problems. S I A M Rew. 8, 309 (1966).
Chapter
4
PARAMETER ESTIMATION
1. Introduction
In this and the next chapters we are going to discuss the application of quasilinearization technique to two important problems which are essential components of the adaptive or optimizing control systems: the parameter estimation problem, more generally known as process or parameter identification [l]; and the optimization problem. Both of these can be considered as boundary-value problems and thus both can be solved computationally by the use of the quasilinearization technique. Parameter estimation is a combination of experimental work with mathematical analysis. T h e present work will be concerned primarily with the mathematical aspects. A better and more effective mathematical technique can often reduce the requirements for the experimental work. Basically, three different problems are treated in this chapter: the estimation of constant parameters, time-varying parameters, and finally the general concept of differential approximation. There are various numerical difficulties connected with the present approach. T h e most severe one is the problem of ill-conditioning. This problem not only arises in difficult problems such as estimations of the frequency-factor constant and activation energy in the Arrhenius reaction rate expression, but also in very simple problems such as the numerical solution of the simple linear boundary-value problem represented by Eqs. (17.1) and (17.3). Although all the numerical experiments are performed from data which do not contain any noise, obviously the numerical procedures can be extended to experimental data with noise and measurement errors. 2. Parameter Estimation and the “Black BOX”Problem
Depending on the initial knowledge of the process, the identification problem can be interpreted in the following two ways: 83
84
4.
PARAMETER ESTIMATION
IdentiJication: T h e process is considered as a “black box’’ about which nothing is known except the number of inputs and outputs. Parameter estimation: T h e structural configuration is known but the model parameters are unknown. For example, the model is known to be accurately represented by a certain system of differential equations, but the coefficients or parameters in these equations are unknown. Although the first interpretation provides the most general viewpoint from which a completely universal theory can be developed, the second interpretation is much more realistic. Very little has been done in the area of parameter estimation. Since generally the parameters or coefficients cannot be measured directly and the measurable variables are generally the dependent variables of the differential equations, it is not a simple matter to identify these parameters. For many control processes, especially for on-line computer control, frequently only the up-dating of the parameter values of the model is necessary. Notice that the term up-dating implies the existence not only of the structural configuration of the model, but also of an approximate set of values for the parameters. This parameter estimation problem is quite critical for on-line computer control where owing to economic considerations the computer is often small and limited in capacity. It would be ideal if a technique which uses the approximate values of the parameters in the up-dating process could be developed to reduce the computational requirements. I n this way, not only the known structural configuration of the model but also the approximate values of the parameters are utilized. As will be seen later the quasilinearization technique fulfills such a role.
3. Parameter Estimation and the Experimental Determination of Physical Constants
We have seen how parameter estimation problems arise naturally in the various control processes. T h e estimation problem also arises in the performance of various physical and engineering experiments. For illustrative purposes, let us consider again the equation resulting from the tubular flow chemical reactor with axial mixing (see Chapter 3), 1_ d2x_ _ dx _ _ Rx’
=0 P dt2 dt P represents the Peclet group and is equivalent to the symbol NPeused in Chapter 3. T h e other symbols have been defined in the previous
4.
A MULTIPOINT BOUNDARY-VALUE PROBLEM
85
chapter. Let us further assume that although Eq. (1) represents the tubular reactor model, the two constant parameters, P and R, are unknown quantities and must be determined experimentally by measuring the concentration of the reactant, x, at various positions of t. Or, in other words, by using the following measured or experimental values x(ex~)(t= s ) bs
S
= 1, 2,
..., m,
< <
with m, 2 and 0 ts tf , we wish to determine the two unknown parameters. T h e quantities b, are known values and are obtained by measuring x experimentally at various positions of ts . Notice that the number of the experimental values, m, , must be larger than or equal to the number of the unknown constant parameters. T h e superscript (exp) denotes that the values of x are experimental values. Since these parameters form part of the differential equation (l), their values cannot be obtained easily from experimental data unless Eq. (1) can be solved analytically. Mathematical restrictions of this kind frequently limit the manner in which an experiment can be performed. This parameter estimation problem is exactly the same mathematical problem which appears in various control processes. 4. A Multipoint Boundary-Value Problem
First, the case in which m, = 2 will be considered. It is assumed that the experimental errors introduced from obtaining b, and b, are small, and thus b, and b, represent the true values of x at t, and t, . Equation (3.1) can be rewritten as dx z = Y
3 = Py + PRx2 dt It is convenient to consider the unknown parameters, P and R , as dependent variables parallel to x and as functions of the independent variable t. Thus, in addition to the above two equations, the two constant unknown parameters can be represented by the following differential equations [2]: _ _
-dR =o dt dP _ -0 dt
4.
86
PARAMETER ESTIMATION
The boundary conditions for Eqs. (1) are 1
x, = x(0) - p y ( 0 )
at t
=0
(24
Y ( t f )= 0
at
t = tf
(2b)
b,
at
t = t,
(2c)
4tl)
=
(24 T h e systems (1) and (2) form a multipoint boundary-value problem. T h e quantities t, and t, are two discrete values of t within the interval [0, tr]. Obviously, this system can be solved by the procedures discussed in the two preceding chapters. x(t2) =
b,
at
t
=
t,
5. The Least Squares Approach
For m, > 2, the classical least squares criterion can be used. T h e object is to determine the constant system parameters so that the sum of the squares of the deviations is minimized. Instead of the boundary conditions ( 4 . 2 ~ )and (4.2d), one can obtain these two conditions by minimizing the following expression [2, 31:
where the minimization is over the parameters P and R, and x(ts) is obtained by solving the system (4.1). I t is interesting to note that the above problem is equivalent to the optimization problem of minimizing the expression (l), subject to the conditions (4.1), (4.2a), and (4.2b). T h e minimization is over the two unknown initial values R(0) and P(0). This concept will be used in the next chapter for the simultaneous optimization of the control variables and the unknown parameters. 6. Computational Procedure for a Simpler Problem
The above parameter estimation problem can now be approached by the quasilinearization technique. However, for the purpose of simplicity, first a simpler form of this problem will be considered. Instead of the boundary condition (4.2a), the following boundary condition will be used: x(0)
=c
at
t =0
(1)
6.
COMPUTATIONAL PROCEDURE FOR A SIMPLER PROBLEM
87
where c is a known value. Now the problem is composed of Eqs. (4.1), (4.2b), and (1). T h e other two boundary conditions can be obtained from either Eqs. ( 4 . 2 ~ )and (4.2d), or Eq. (5.1). T h e systems of differential equations (4.1) can be linearized easily by the recurrence relations obtained in Section 17 of Chapter 2. xA+1 = Yn+1 yk+1 = P n y n + l +
2PnRnXnXn+1
-(3PnRn4
+
+
PnXZz+l
+ + (Yn
R n x 3 Pn+l
PnYn)
RA+l = 0 =0
The two given boundary conditions are Xn+l(O) = c Yn+l(tf) =
0
The other two boundary conditions can be obtained either from
or by minimizing
T h e systems of equations (2) can now be solved by the use of the principle of superposition. Since one initial condition (3a) is given, only three sets of homogeneous solutions are needed for the four equations in (2). Thus, the general solutions of Eq. (2) are 3
xn+l(t)
= Xa,n+l(t)
+C
j=1
aj.n+lXhj.n+l(t)
4.
88
PARAMETER ESTIMATION
where the subscript p is used to indicate particular solutions and the subscripts h, , h, , and h, denote the first, second, and third sets of , a2,%+,, homogeneous solutions, respectively. The quantities a,,, and a,,,+, are integration constants to be determined from the three boundary conditions. Following the treatment in Section 16 of Chapter 3, Eq. (6) can be written in matrix form: x n + l ( t ) = xp(n+l)(t)
+ Xh(n+l)(t)
(7) The state vector x,+,(t) and the particular solution vector xp(,+,)(t)are .. _ . . defined as an+,
,
and a,+, represents the integration constant vector with components , a2,,+,, and u ~ , , + ~. The homogeneous solution matrix is defined in the same way as in the previous chapter:
The particular and homogeneous solutions will be chosen in such a way that they satisfy the fourth boundary condition (3a). The set of particular solutions can be obtained by integrating Eq. (2) with the following initial values: xs,n+1(0) = c
yv,n+1(0)
0
1
Rs,.n+l(O) = 0
f's,n+l(O)
=0
(9)
The homogeneous forms of Eqs. (2) are xA+l
(104
= Yn+1
Y A + ~ = Pnyn+l+
2PnRnxnxn+l+
PnX:Rn+l+
+
( ~ n R n x 3 Pn+l (lob)
RA+l = 0
(104
=0
(104
The homogeneous solutions can be 3btained by integrating (10) with the following initial values: '0 0 0 0 1 0
.0I O0 OI 1
6.
89
COMPUTATIONAL PROCEDURE FOR A SIMPLER PROBLEM
Notice that the initial values, (9) and (1 l), are chosen in such a way that at t = 0 the first equation of (6) satisfies condition (3a). Notice also that at t = 0 the following two relationships can be obtained from the third and fourth equations of (6), and the initial values (9) and (1 1):
Since both R,+,(t) and P,+,(t) are constant functions, it is evident that the relationships (12) are true not only for t = 0, but also for 0 t tr .
< <
R n + l ( t ) = ‘2,nfl
= ‘3.n+l
PTL+l(t)
(13)
The particular and homogeneous solutions will be considered known and are determined computationally by the use of the initial values (9) and (11). T h e integration constant a,,,+, can be expressed as a function of and a 3 , n + P . At t = t j , the following equation can be obtained by substituting equation (3b) into the second equation of (6):
If only two experimental values, b, and b, , are given, the integration constants, u2,,+, and a 3 , , + , , can be obtained from (4).Substituting (4) into the first equation of (6), we obtain two algebraic equations. Combining these two equations with (14), we can obtain the numerical values of the three integration constants. If more than two experimental values are given, which is usually the case, Eq. ( 5 ) can be used to obtain a2,,+, and a 3 , n + l . By using the particular and homogeneous solutions at the various positions of ts , S = 1, 2, ..., m, , the following m, equations can be obtained from the first equation of (6): 3
xn+,(ts)
= %*n+l(tS)
+c
‘i.n+1Xhj,n+d?S)
s = 1,2,...,m,
(15)
j=1
First the integration constant a,,,,, is eliminated from (15) by using (14). T h e results from this elimination can then be substituted into Eq. ( 5 ) : ”1
Qn+i
=
2
-
[ ~ s . n + i ( t ~ > An+i~s.n+i(tr)
S=l +a3.n+l(XhS.n+l(tS)
+
a z . n + i ( ~ h z . a + i ( l ~) An+i~m.lz+i(tr))
- An+lYh3.n+l(tf))
- bS12
(16)
4.
90
PARAMETER ESTIMATION
where
Since all the particular and homogeneous solutions are known quantities, Eq. (16) can be represented by
T h e only unknown quantities on the right-hand side of (18) are the two integration constants u2,,+, and ~ 3 , , + 1 . It can be shown by Eqs. (6) and (13) that the minimization of the expression (18) with respect to R,+,(t) and P,+,(t) is equivalent to the minimization of (18) with respect to u2,,+, and a3,,+, . This minimum can be obtained by various analytical or numerical methods. Some of these methods will be discussed in later sections. At present, the extreme value will be obtained by partial , these differentiation of (18) with respect to u2,n+l and u ~ , ~ + ,By differentiations and by setting the results equal to zero, the following two equations can be obtained: "1
q2.n+l(ts)[41.n+l(t~)
f
%.n+142.n+1('s)
+
u3.n+lq3,n+l(tS)
-'s] =0
(19a)
93.n+l(ts)[q1.n+l(tS)
+
u2,n+1q2,n+1(tS)
+
%.n+lq3.n+l(ts)
- bs] = 0
(19b)
S=l "1
S=l
These two expressions are the other two boundary conditions. From Eq. (19), the numerical values of u2,,+, and ~3,,+1 can be obtained. T h e value of can then be obtained from Eq. (14). Once the integration constants are known, the general solution of (2) can be obtained from (6). With x,+~, yn+,, R,+l, and P,+l known, now an improved set of values can be obtained by making n = n 1 in (2). Again, this iterative procedure can be continued in the same way as discussed in the previous chapter.
+
7. Numerical Results
I n order to test the effectiveness of this approach, some numerical experiments have been performed by using the results obtained in Chapter 3, listed in Table 3.1. T h e problem now is to find the unknown constant parameters P and R by using the boundary conditions (6.3) and the observations of ~ ( ~ ~ p ) S ( t= ~ ) 1, , 2, ..., m, , which are listed in
7.
91
'NUMERICAL RESULTS
Table 3.1. I n other words, we are using the actual numerical solutions as the observations. T h e numerical values used are A t = 0.01
tf, = 1
m, = 10
(1) c = 0.83129
xo(t,) = 0.83129
yO(tk) = -0.5
with 12 = 0, 1, 2, ..., N . Notice that the known solutions of x and y listed in Table 3.1 are not used as the initial approximations. T h e ten observations for the variable x are dexpqt,) = b,
t = 0.1,0.2
)...,1.0
(2)
where the values of b, are obtained from the eighth column of Table 3.1. Using the Runge-Kutta integration method and the numerical values listed in (1) and (2), it has been found that the solutions will not converge to the correct values even if the exact values of P and R, which are 6 and 2, respectively, are used as their initial approximations. An examination of the results of this numerical experiment reveals that unreasonable values of P and R are obtained during the first few iterations. T h e unreasonable values include P(tk)= 0 and R(tk)= -1, or quite large values for both P and R. Since the original nonlinear equations (4.1) are very sensitive to these two parameters, extremely large positive or negative values are obtained for x ( t k ) and y(tk). From Eq. (3.1) it may be seen that P cannot be equal to zero. I n order to avoid these difficulties, first the values of u2 and a 3 , which are equal to R and P, respectively, according to Eq. (6.13), are changed to within the following range before they are used in Eq. (6.7) to obtain the general solutions:
The purpose of these restrictions is to limit the values of a2 and u3 , and hence R and P, to within reasonable ranges. When these restrictions are used, the above convergence problems are not encountered. T h e influence of the initial approximations, R,,(tk) and Po(tk), K = 0, 1,..., N , upon the convergence rate of the constant parameters is shown in Table 4.1. Except for the different initial approximations, all other values used are the same as those given by (1)-(3). Only the convergence rates for the two constant parameters are shown. I n general, the variables x and y have approximately the same convergence rates as the two constant parameters.
4.
92
PARAMETER ESTIMATION
TABLE 4.1 CONVERGENCE RATESWITH x,+,(O)
2.5923 1.oOOo 2.7723 2.2235 2.0077 2.0000 2.0000 2.0000
.oooo
1 5.1481 8.5792 6.0997 5.9817 5.9998 6.0000 6.0004
1.oooo 1.9317 2.0855 1.9308 1.9981 1.9999 1.9999 2.oooo
= c
10.000 8.8433 3.9649 6.1562 5.9945 6.0010 6.0014 5.9996
1.oooo
10.000 1 .om0
10.000
2.6417 1.8564 1.9600 1.9995 1.9999 2.0001
7.3938 7.6309 6.2228 5.9836 6.0006 5.9987
For experimental purposes, the known numerical solutions for x and y are not used as the initial approximations in the above computations. If these known solutions, which are given in Table 3.1, were used, the number of iterations needed would no doubt be reduced. The problem of using only two observations, or ml = 2, is also solved. Since this case is only a special case of the problem solved above, no additional discussions are necessary. 8. Nonlinear Boundary Condition
Let us now consider the original problem without simplifying the boundary condition (4.2a). The system of equations is still represented by (6.2). However, the two given boundary conditions are
0
(1b) Since none of the initial conditions is given explicitly, four sers of homogeneous solutions are needed. The general solutions for (6.2) can be represented by the following matrix equation: Yn+l(%)
xn+l(t) = x s ( n + d t )
+
&n+dt)
an+l
(2)
where ~ ~ + and ~ ( ~t ~ ) ( ~ +are ~ the ) ( state t ) and particular solution vectors, respectively, and are defined in Section 6. The integration constant vector
8.
93
NONLINEAR BOUNDARY CONDITION
is now four dimensional. T h e homogeneous solution matrix X h ( n + l ) ( t ) is defined as
Xh(n+l)(t) =
[
xhl.n+l(t)
XhZ.n+l(t)
Xh3.n+l(t)
Xh4,n+l(t)
~ h l . n + l ( t ) ~ h z . n + l ( t ) Y h 3 , ~ % + 1 ( ~Y) u . n + l ( t )
t,
R h l , n+l(
RhZ, n+l(
'h3, n+l('
Rh41 *+I(
Phl.n+l(t)
PhZ,n+l(t)
PhB,n+l(t)
Ph4,n+l(t)
]
(3)
T o obtain the one set of particular and four sets of homogeneous solutions, the following initial values will be used:
ri
o o
"1 0
Lo
=I
(5)
0 0 1
where I respresents a unit matrix. Since the number of sets of homogeneous solutions required is equal to the number of equations, the homogeneous solution matrix (3) is a square matrix. Consequently the initial values chosen for obtaining the homogeneous solutions form a unit matrix at t = 0. This is shown in Eq. (5). By using the above initial values and the'third and fourth equations of (2), again it can be shown that Rnfl = a3,n+land Pn+l = a4,n+l. With the particular and homogeneous solutions known numerically, the integration constants can be obtained in the following manner. At t = 0, substituting the initial values of (4) and ( 5 ) into the first, second, and fourth equations of (2), the following relationships can be obtained:
Combining Eqs. (la) and ( 6 ) we get:
At t
=
tf , the second equation of (2) becomes
94
4.
PARAMETER ESTIMATION
Combining Eqs. (lb), (7), and (8), we obtain
Besides Eq. (l), which has been used to obtain Eqs. (7) and (9), two more boundary conditions are needed. These two conditions can be obtained by minimizing the expression (6.5). T h e computational results of the particular and homogeneous solutions at various tS , S = 1, 2, ..., m, , can be substituted into the first equation of (2).
+c 4
x n + d t s ) = X,,n+dtS)
s = 1,2,..., m1
aj,n+lXhj,n+l(tS)
(10)
3 =1
By using Eqs. (7) and (9), the integration constants a,,,,, be eliminated from (10):
=fS(u3, u4)
and a2,,+, can
S = 1, 2 ,..., m,
where 1
A= YhZ(tf)
$- Yhl(tf)/a4
+
For simplicity, the second subscript (n 1) has been omitted from the particular and homogeneous solutions, and the integration constants in the above two equations. By substituting (11) and (12) into Eq. (6.5), the desired expression is obtained. Symbolically, this desired expression can be written as m1
Qn+l
=
C [f~(a,,n+l?
a4,n+l)
S=l
2I,'
-
(13)
T h e two integration constants, a3,n+l and a 4 , n + l , can be obtained by minimizing the expression (13). However, since Pn+l(0)appears nonlinearly in the boundary condition (la), the functionf, is also nonlinear in u4,,+, . If the differentiation approach, which has been used in Section 6, were used to obtain the extreme of (13), we should find that a4,n+lis no longer single rooted. I n the present case, it is not too difficult to find
9.
RANDOM SEARCH TECHNIQUE
95
out which root of a4,n+l minimizes (13). However, if a large number of the unknown constant parameters appears nonlinearly in the boundary condition, the problem of finding which set of roots is the desired one can be very time consuming. T o avoid this difficulty and also to test some other approaches, a random search technique has been used to find the minimum of (13). 9. Random Search Technique
There are various single-stage search or optimization techniques which can be used to obtain the minimum of (8.13). Since only two variables need to be searched, any technique such as the various versions of the gradient method, search techniques, or even a straightforward enumeration could be used. However, as the number of variables increases, the difficulty of carrying out this search increases exponentially. For more detailed discussion, consult the references listed at the end of the chapter
[4-131. For the present work, the random search technique is used on an IBM 7094 computer. An attractive feature of the random search technique is its simplicity in programming for the computer. A random number subroutine is provided for most current computers. By the use of this subroutine, a set of random numbers with Gaussian or normal distribution is generated easily. Basically the method is very simple and consists of specifying each of the variables to be investigated in a random manner within the region of interest. Each variable is assumed to be completely independent of all others. T o illustrate the procedure, consider the problem of finding the values of u i , i = 1, 2, ..., M , so that the following expression is minimized:
Q with ~
i
,
= f ( u i , uz
,..., U M )
< < ui,max ~~i i
~
i
= 1,2,..., M
(1)
(2)
Let us assume that we have a set of rough approximations for the variables ui , i = 1, 2,..., M . Call these approximations u i , o l d i, = 1, 2,..., M . Notice that the variables ui are not functions. An initial value, Qold, can be obtained with Eq. (1) and the values of ui,old . Using the random number subroutine, M random numbers can be generated. Call them Ri, i = 1, 2,..., M . Then the following equations can be used to obtain a new set of values for the variable ui : (3) %,new = %.old
+
96
4. PARAMETER
ESTIMATION
where
with i = 1, 2, ..., M . T h e symbol w represents a weighting factor. First ~ ~ for ~ any , violations of Eq. (2) and the new set of values, u ~ ,is tested then it is substituted into Eq. (1) to obtain a new value, Qnew. This newly obtained Qnew is compared with the value of Qold. If Qnewis
OBTAIN M RANDOM NUMBERS BY SUBROUTINE RANNO
y Qnrw
FROM EQUATION (9.3)
+] FIG.4.1. Block diagram for random search minimization.
10.
NUMERICAL RESULTS
97
smaller than Q o l d ,Qnew is stored and becomes the new Qold. At the ~ is stored , ~and becomes ~ ~ the new u ~ , T h~e original ~ ~ . same time u Qoldand ui,oldarethen discarded. Another new set of valuesui,,,,can now ~. This , process ~ ~ be obtained by using Eq. (3) and the newly obtained u is continued until Qnewis equal to or larger thanQ,,, . Then, another set of M random numbers is produced and the above procedure is repeated. T he detailed computational procedure is shown in Fig. 4.1. T h e number r2 is the maximum number of successful trials allowed with the same dui . This number is used to prevent situations such as when only a very small improvement is made on Q in each successful trial and thus the minimum of Q cannot be reached within a reasonable number of successful trials. T h e number r1 is used to define the minimum of Q computationally. Thus, after r1 successive unsuccessful trials, the minimum of Q is assumed to have been obtained and the computation is stopped. T h e number r3 is the total number of trials allowed whether they are successful or not. This is used to prevent unreasonable results or mistakes. A very large number, usually 1000, is assumed for r3 . T h e S U BROUTINE RANNO is available with the IBM 7094 computer. By the use of this subroutine, a set of random numbers with Gaussian distribution can be generated. T h e average or expected value of this Gaussian distribution is zero and the standard deviation is one. Since the standard deviation is fixed, the weighting factor, w , is used to change the amount of improvement in each trial and its value controls the magnitude of d u i . Thus, a smaller value of w should be used when Q is far removed from the minimum. A larger value of w must be used when Q is fairly near to the minimum and when a high accuracy is desired for this minimum. T h e single-stage minimization problem is not simple [4, 6-12]. Various difficulties may be present. One of these difficulties is the presence of several relative minima of Q and thus a local minimum instead of the true minimum may be obtained. This difficulty can be overcome by two approaches. Different starting values or rough approximations for u ~can ,be used ~ ~so that ~ the entire region of interest can be searched. The second approach is to use a smaller w so that a larger region can be searched. 10. Numerical Results
T h e numerical values used are summarized as follows: At
= 0.01
X, =
1.0
t,
=1
~o(t,)=
1.0
m1 = 10 yO(tk) = -0.5
~
4.
98
PARAMETER ESTIMATION
with k = 0, 1, 2, ..., N . The ten observed data points, d e x p ) ( t S ) = b, , 5' = 1 , 2,..., m, = 10, and ts = 0.1, 0.2 ,..., 1.0 are, again, obtained from Table 3.1. I n order to ensure convergence, the following restrictions on the allowable values of R and P, and hence of a3 and a 4 , are used: 1
1
(2)
The minimum of Eq. (8.13) is obtained by using the random search technique discussed in the previous section. The integration constants a3,n+land a4,n+lcorrespond to u, and u 2 , respectively, in the nomenclature of the previous section, and Eq. (2) corresponds to Eq. (9.2). T o start the random search procedure, the following starting values for the integration constants are used: (a3,nii)old = %.old =
5.0
(%.n+l)old
= uz.old = 5.0
(3)
The maximum numbers for unsuccessful, successful, and the total trials allowed are r1 = 50
r2 = 50
r3 = 1000
(4)
With a constant weighting factor w = 15, the results listed in Table 4.2 are obtained for the problem discussed in Section 8 with different values for Ro(tk)and PO(tk),k = 0, 1, 2, ..., N . Except for the use of random search to obtain the values of a3,n+land a4,n+l, all other procedures are the same as those discussed previously. Since we know that R = 2 and P = 6 , one can see that a poor accuracy has been obtained by the random search technique with w = 15. However, this accuracy can be improved tremendously by using larger values for w . Some numerTABLE 4.2 CONVERGENCE RATE WITH w R,(t,) P,(t,J Iteration
R(tJ
1 2 3 4 5 6
1.0000 2.6080 1.9246 1.9751 1.9751 1.9751
= =
1.0, 1.0 p(tk)
3.0181 5.0238 5.9472 5.9411 5.9411 5.9411
=
15.0
RO(tk)= 5.0, PO(tk) = 5.0
R,(t,) = 10.0, Po(tk) = 10.0
R(tJ
P(td
R(tk)
1.0000 1.8946 1.9437 1.9667 1.9755 1.9755
9.9477 7.6725 5.9228 5.9201 5.9200 5.9200
10.000 7.6284 1.0000 1.9929 1.9929 1.9929
p(tk)
9.4734 6.7392 6.6785 5.9687 5.9687 5.9687
11.
99
DISCUSSION
ical experiments with different values for w and with Ro(tk)= Po(tk)= 5 are shown in Table 4.3. It can be seen that fairly accurate values have been obtained for R and P with w = 500. TABLE 4.3 CONVERGENCE RATESAS -
FUNCTION OF w
A
~~
~~
w
=
15.0
w
=
Iteration
R(tk)
P(tJ
R(tk)
1 2 3 4 5
1.0000 1.8946 1.9437 1.9667 1.9755
9.9477 7.6725 5.9228 5.9201 5.9200
1.5147 1.9916 1.9929 2.0011 2.0011
100.0
P(t!€) 9.3898 7.5708 6.0475 5.9573 5.9573
w = 500.0
R(tk)
1.OOOO 1.8837 1.9705 1.9997 1.9997
p(tk)
9.9552 7.4656 6.0440 6.0056 6.0056
The computation time per iteration is a function of w. When w = 15, each iteration needs approximately one-half to one second’s computation time, which is in about the same order of magnitude as that needed for the problem solved in Section 7. T h e total number of trials, 1 3 , is generally about 100 to 200 for the first two to three iterations. However, when w = 500, the computation time for each iteration is approximately doubled for the first two to three iterations and the total number of trials, 1 3 , is increased to 300 to 600 for the first three iterations. Obviously, this computation time can be reduced by using a small variable w at the start of the search and gradually increasing it during the search. 11. Discussion
As has been shown in the above simple examples, the quasilinearization approach is a very useful tool for estimating the unknown system parameters. T h e advantage of this approach is that the parameters and the solution of the differential equations representing the system are obtained simultaneously. Furthermore, any known information about the parameters can also be utilized in estimating the initial approximations or stating values for the parameters. T h e latter aspect is especially important for the up-dating process in on-line computer control. For simplicity, the exact solution of the concentration x has been used as the experimental data. Obviously, the above procedure can also be used when the experimental data contain noise and measurement
4.
100
PARAMETER ESTIMATION
errors, provided that enough data are available. Furthermore, instead of the least squares criterion, any other criterion can be used for this estimation. If statistical data concerning noise and measurement errors were available, it might be possible to obtain a criterion better than the least squares. 12. Parameter Up-dating
Consider a process which is controlled by an on-line computer. The dynamic equations for this process are known and can be represented by
with initial conditions Y(0)
=
c
where y ( t ) and c are the M-dimensional vectors with components
yl(t),y 2 ( t,..., ) y M ( t ) and c1 , c2 ,..., c, , respectively; and P is the m-dimensional vector with components P I ,P, ,..., P, . T h e vector y ( t ) represents the state variables and the vector P represents the constant parameters of the process. Owing to uncontrollable disturbances, the constant parameters P and the initial conditions c change constantly with time. For example, if the process represents a chemical reactor, this change in the value of the constant parameters may be caused by the change of catalyst activity, which is frequently uncontrollable. Thus, in order to obtain a better control over the process, the values of P and c must be up-dated frequently. I n most situations, only some of the state variables can be measured and the parameters P cannot be measured directly. We shall assume that this is the case and only the first m2 variables of y ( t )can be measured. T h e following observations or measurements for the first m2 variables of y ( t ) are given: yj'""D'(ts)= b$)
s = 1 , 2,..., m,
j
1
1 , 2,..., m,
(3)
+
with m1m2 > M m. We wish to obtain improved or up-dated values of P and c. Since the measured data always have measurement and other errors, the number of measured data has to be more than the number of missing conditions. T o solve this problem, the following m differential equations can be formed first:
-dP =o dt
(4)
12.
101
PARAMETER UP-DATING
+
Then let the vector x ( t ) represent the ( M m)-dimensional state vector , y M ( t ) Pl(t), , Pz(t),..., Pm(t).Notice that with components y,(t), y z ( t )..., now the constant parameters P are considered as functions of t. T h u s Eqs. (1) and (4)can be represented by the vector equation x'
(5)
= f(x)
with initial conditions x(0) = c
+
where the vector function f represents the ( M m)-dimensional vector fl ,fz ,... fM ,f M + l ,f M + 2,...,f M + m; and c is an ( M m)-dimensional initial vector. According to Eq. (4),the values of the functions f M + , , fM+z ,...,f M t m are constant and are equal to zero. T he problem can now be stated as follows: Given a total of mlmz observations on the first m2variables, find the ( M + m) initial conditions c for Eq. ( 5 ) . T h e least squares criterion can again be used and the problem becomes one of finding the initial conditions so that the following expression can be minimized:
+
mz mi
Q=
C
[ x j ( t s ) - b:']'
(7)
3=1 S=l
I n Eq. (7), it has been assumed that each of the m2 variables is equally important and has a statistically equal amount of measurement errors. If the measurement errors are different for different variables, a weighting factor can be assigned to each variable and the minimization can be performed according to the reliability of the data of each individual variable. T h e above problem is obviously the same problem solved in the previous sections. First Eq. ( 5 ) can be linearized by the Newton-Raphson formula. Then the solutions of these linearized equations can be represented by xn+,(t) xs(n+l)(t) X h ( n + l ) ( t )an+, (8) where the vectors x,+, , x ~ ( ~, and + ~an+, ) and the homogeneous solution matrix X h ( n + l )are defined in the same way as in Eq. (16.11) in the previous chapter. T h e particular and homogeneous solutions xp fTL+,)(t) and X h ( n + l ) ( tcan ) be obtained by using the initial conditions 1
+
4.
102
PARAMETER ESTIMATION
Once the homogeneous and particular solutions are obtained, Eq. (8) can be substituted into Eq. (7) at various positions of ts , S = 1,2, ..., m,, and an equation containing only a,, as the unknown quantities can be obtained. By differentiating this equation with respect to a , and setting the results to equal to zero, ( M + m) algebraic equations which represent the missing initial conditions are obtained. Thus, this problem can be solved in exactly the same way as we have discussed in the previous sections. T o obtain the results of the first iteration, the old values for y ( t ) and P can be used as the initial approximations. 13. Discussion
For simplicity, an equal number of observed data has been assumed for each of the m 2variables. Obviously a more general case with a different number of observed data for each variable can be treated in essentially the same manner. I n industrial applications, frequently certain important and measurable properties can be expressed as functions of several well-defined variables. Thus, observations involving the linear combinations M
1 a i y F ) ( t s )= bs
S
=
1,2,...,m1 >, M
+m
i=l
or the general expression g(y(exp)(ts)) = bs
S
=
1, 2 ,..., m, >, M
+m
(2)
also can be treated by minimizing
respectively, where the values of ai are given and 6 represents the experimental value of the measurable property. T h e function g represents this measurable property in terms of well-defined variables. If 6 represents a certain linear combination of the variables, the expression (2) is reduced to (1). I n general, the minimization of Eq. (4) leads to the solution of a set of nonlinear algebraic equations if differentiation has been used.
14.
ESTIMATION OF CHEMICAL REACTION RATE CONSTANTS
103
Instead of the least squares criterion, Bellman and co-workers [I41 have obtained the estimates of the unknown parameters by minimizing the maximum difference of the absolute values between the calculated values xi(ts) and the observed values b y ) . Since the criterion is now the linear expressions
linear programming has been used. These authors have found that generally the method of least squares is preferable if the observational errors are Gaussian. However, if the errors are all- about the same magnitude or all have about the same percentage of deviation, then criterion ( 5 ) leads to superior estimates. Some exceptions to this conclusion have also been observed. 14. Estimation of Chemical Reaction Rate Constants Since chemical reaction is essentially the differential change in concentration with respect to time or space, ax at
r = C-
the procedure discussed in the previous sections can be used to obtain the best estimates of the rate constants from raw kinetic data with a certain assumed or known mechanism of reaction. I n Eq. (I), r denotes the reaction rate, x represents the concentration of certain reactant, and C is a normalization or conversion factor. T h e independent variable t can be considered either as time in a batch reactor or as volume of reactor divided by the feed rate for a flow reactor. I n the case of a catalytic reactor with solid catalysts, t is the mass of catalyst divided by the feed rate. Bellman and co-workers have applied quasilinearization technique to obtain a least squares estimate of a simple homogeneous gaseous reaction [151. T h e quasilinearization approach is especially useful when the reaction is complex and the differential reaction rates cannot be obtained by direct measurements [161. Several studies have been published concerning nonlinear least squares analysis of catalytic reaction rates based on the Hougen-Watson-Langmuir-Hinshelwood models [17, 181. I n these studies, the sum of squares of reaction rates r is minimized instead of the measured concentrations x being directly minimized. There are two disadvantages for this approach if only the integral-conversion data are
104
4.
PARAMETER ESTIMATION
available. First, since the rate r is obtained by numerical differentiation from the measured concentrations or conversions, large errors may be involved in obtaining the values of r . I t is generally known that numerical differentiation is a very inaccurate process. Since in general the measured data involve various experimental errors, the data are fairly scattered. This makes the numerical differentiation even more prone to error. Second, since we are minimizing the sum of squares of Y, the results obtained are not the best estimate in the least squares sense of the original experimental errors. Part of this original experimental error already has been discarded when r is obtained by numerical differentiation. Even if differential reaction rates can be obtained by direct measurements and thus numerical differentiation is not needed, the present approach still may have advantages over the nonlinear least squares approach. Nonlinear least squares estimation is a fairly slow convergent process. Very frequently the starting values or initial approximations for the unknown parameters must be almost the same as the correct values before the procedure will converge. I n contrast, the present technique converges quadratically and has a reasonably large interval of convergence for a number of problems. For illustrative purposes, consider the following irreversible gaseous catalytic reaction: A + B 4 C + D
(2)
Assume that the reaction is conducted over a solid catalyst and the composition of the reactor effluent is measured as a function of feed rate. T h e reactor is operated at constant pressure and substantially constant temperature. From previous experiments it has been decided that the mechanism is the reaction between one adsorbed A molecule and one gas phase B molecule. Thus, the kinetic model is [16] r =
~KAPAPB
(1
+ KAPA+ K B P B )
(3)
where the partial pressures p A and p , have been used to represent concentrations. The, symbol k is the reaction rate constant of the surface reaction and K represents the adsorption equilibrium constants. T h e subscripts A and B denote components A and B, respectively. Combining Eqs. (1) and (3) with appropriate unit changes and normalizations, we can obtain the following differential equation:
15.
DIFFERENTIAL EQUATIONS WITH VARIABLE COEFFICIENTS
105
The experimental data for p , and p , which have been obtained as a function of feed rate can be expressed easily as functions of t. If we establish the differential equations dk dt
- -0
dKi3 -
-0
dt
then the three constants k, K A , and KB can be obtained by the same procedure discussed in the previous sections. 15. Differential Equations with Variable Coefficients The procedures discussed in the previous sections can also be applied to estimate parameters or coefficients whose values are not constants but are functions of the independent variable t. T o illustrate this, consider the linear first-order ordinary differential equation d x(t) -
dt
a ( t )x ( t )
+P
x(0)
=c
with the experimental values given by Eq. (3.2). We wish to obtain the best estimates of the constant parameter P, the variable parameter a(t), and the initial condition c from the experimental data b, . T h e best estimates for these can again be defined in the least squares sense by minimizing the expression (5.1) with respect to P, c, and e(t). I n order to use the quasilinearization procedure, more information concerning a ( t ) is needed. Very frequently a ( t ) is known to be a certain given function of the independent variable t. Some examples of this given function are
If the exact form of this given function is unknown or if the exact form is too complicated, we still can approximate the variable parameter by means of a polynomial m
a(t) =
c Pjtj
j=u
(3)
4.
106
PARAMETER ESTIMATION
Equation (1) can be written as
If we form the following differential equations for the constants P and Pj , dPj _ -0
j=O,1,2
dt
,..., m
(54
-ddt=P o then the systems (4) and (5) are in exactly the same form as that of Eq. (12.5). If m, 3 m 3, the procedure discussed there can be used to obtain the best estimates for P,c, and Pj .
+
16. An Example
I n chemical engineering applications, frequently it is necessary to determine the frequency-factor constant and the activation energy of reaction in the Arrhenius rate expression from measured values of concentration and temperature. Generally these measured values are given as functions of the independent variable t, which is time for a batch reactor or length for a tubular reactor. T o test the numerical procedure in this application and also to save space, let us again consider the adiabatic tubular reactor with axial mixing. Equation (1 1.2) of Chapter 3 can be written as
-1- -d2x -_ M dt2
dx dt
a ( t )x2 = 0
where a ( t ) is the Arrhenius expression
where E represents the activation energy divided by the gas constant. The boundary conditions for Eq. (1) are given by Eq. (6.2)of Chapter 3. Equation (1) can be written as dx x = Y
9 = MY + dt
(34 ~
3
exp2
i--1ET ~
16.
AN EXAMPLE
107
Th e problem is: Given the observations b, for x(t,) and T(exp)(ts)for T(t,), S = 1, 2, ..., m, 3 2, find the constant parameters p and E so that the values of x obtained from Eq. (3) with the experimental values F e x P ) ( t s ) will minimize (5.1). Notice that the observed values are not a ( t ) but are the variables x ( t ) and T(t).Consider /3 and E as functions of t and form the differential equations
-dt= o
(34
-dE= o
(34
dt
Th e system (3) can be linearized by the generalized Newton-Raphson formula
Th e two given boundary conditions are Yn+l(O)
M
Let ~ ~ + represent ~ ( t ) the state vector with components ~ ~ + ~~ ,( +t ~) (, t ) , En+l(t).Th en the solution of the linear systems (4) can again be represented by
/3n+l(t),and
+ Xh(n+l)(t)an+l
xn+l(t) = Xp(n+l)(t)
(6)
4.
108
PARAMETER ESTIMATION
T h e particular and homogeneous solutions can be obtained by integrating Eq. (4) and its homogeneous form, respectively, with the following initial values:
(8)
Xhh+l)(O)= 1
T h e integration constants a , can be obtained in essentially the same way as illustrated .in Sections 6 and 8. Thus, from boundary condition (5a) and the first two equations of (6) at t = 0, we obtain al.n+l
At t
= tf
= az,n+,/M
, combining (5b), (9), and the second equation of (6),
Using the same procedure as that used to obtain Eq. (6.19), we can obtain the following two equations: a3.n+142.n+l(tS)
+
a4.n+143.n+l(tS)
43.n+l(tS>[41.n+l(tS) f u3,n+l%,?t+l(tS)
+
a4.n+143.n+l(tS) - bS1
42.n+l(tS)[41.n+l(tS> S=l
+
S=l
- bS1 =
(l la)
=
and 1
A = Yh&)
+
+
Yhl(tr)/M
with the subscript (n 1) omitted. Equations (9)-(11) can be used to obtain the four integration constants.
17.
ILL-CONDITIONED SYSTEMS
109
17. Ill-Conditioned Systems
Before we discuss the numerical results for the above problem, let us pause a moment and consider some of the problems connected with obtaining numerical solutions of linear algebraic systems. T o illustrate the difficulties, consider the fourth-order linear differential equation d3x d2x dx _d4x_ 40 - 7 - + 286 - - 240x = 0 dt4 dt dt2 dt It can be shown that the following is a particular solution of (1): x(t) = et - +ezt - +-3t
(2)
At t = 0 and t = 1, from (2) and its derivatives one can obtain the following values: x(0) = 0 x'(0) = 0 (34 ~ ( 1 )= -3.20292
~ ' ( 1 )= -9.07433
(3b)
Now, let us assume that solution (2) is unknown and we wish to obtain this solution numerically from Eq. (1) with boundary conditions (3a) and (3b). Rewrite Eq. (1) as dX1-- x2
dt
with boundary conditions Xl(0)
=
0
X,(O)
x,(l)
=
-3.20292
xZ(1) = -9.07433
=0
(54 (5b)
The systems (4)and ( 5 ) can be solved by the principle of superposition. Let x(t) represent the state vector with components x l ( t ) , x2(t), x 3 ( t ) , and x p ( t ) ;then the solution of (4)and ( 5 ) can be represented by x(t) = X,(t)a
(6)
4. PARAMETER
110
ESTIMATION
T h e four sets of homogeneous solutions can be obtained with the initial conditions X,(O) = I (7) With the initial conditions given by (7), it can be shown that the first two integration constants are zero. Thus only two sets of homogeneous solutions are needed. Using the Runge-Kutta scheme with A t = 0.01, we get the third and fourth sets of homogeneous solutions. T h e results at t = 1 are x lo4
xlh3(1) = -0.978575 xzhS(1) =
-0.391460 x 10'
xlh4(l) = 0.3671 I5 x lOI3 xZh4(l)= 0.146846 x 1015
Substituting (5b) and (8) into the first two equations of (6), we obtain (-0.978575
+ (0.367115 x lo6)u3 + (0.146846 x
x 104) u3
(-0.391460 x
u4 =
-3.20292
(9a)
u4 =
-9.07433
(9b)
Theoretically, the two integration constants, u3 and u 4 , can be obtained by solving the system (9). However, if the left hand side of (9a) is multiplied by 40, we have (-0.391430 x lo6)u3
+ (0.146846 x
u4 = -12.81168
(10)
which is the same as the left-hand side of (9b). Thus the system (9) is self-contradictory and cannot be solved. T o find out where the difficulty lies, let us examine Eq. (1) more closely. T h e general solution of (1) is in the form of x ( t ) = x l ( t ) = blet
+ b,eZt + b3e-3t + b4eMt
(11)
differentiating gives ~ ' ( t= ) x z ( t ) = blet
+ 2b,P
-
3b3e-3t
+ 40b4e40t
( 12)
The last terms in both Eq. (11) and Eq. (12) dominate the values of 40 used in obtaining (10). If (9) were a large linear system and if matrix inversion were used to obtain the values of the integration constants, we would have found that the matrix is nearly singular and thus it is an ill-conditioned matrix. This phenomenon of ill-conditioning occurs frequently in physical and x,(t) and x z(t). This explains the multiplier
18.
111
NUMERICAL RESULTS
engineering problems. It is caused by the characteristic values associated with the differential operator (1). Those characteristic values differ greatly and thus one term or complementary function in (11) may dominate the others. Some techniques have been proposed to solve ill-conditioned linear systems. One of them is the use of invariant imbedding and dynamic programming. Those interested can refer to the references listed at the end of the chapter for details [3, 19-22]. 18. Numerical Results
T o solve the problem formulated in Section 16, some numerical experiments are performed. First Eqs. ( I 1.2) and (1 1.3) of Chapter 3 are solved by the finite-difference method described in the previous chapter. The numerical values used are E
= 22000" R
M=2
/3
= 0.5
T,
Q
t,
=
=
1.0
1250" R
x, = 0.2
mole/liter
At
=
x lo8 liter/mole
1000 liter-"F/mole
(1)
= 0.01
where E is the activation energy divided by the gas constant. Some of the results are listed in Table 4.4.Then, considering x ( t ) and T ( t ) listed in Table 4.4 as the observations or measurements, we can obtain the constant parameters ,8 and E by the procedures discussed in Section 16 with the following numerical values: x, = 0.2
M=2
A t = 0.01 t , = 1.0
(2)
m, = 11
In order to ensure convergence, the values listed in Table 4.4 have been used as xo(t,), K = 0, 1, 2, ..., N. T h e grid points between those listed in the table are obtained by linear interpolation. Using the Runge-Kutta integration scheme, it has been found that the procedures discussed in Section 16 do not converge even if the correct values of the unknown parameters were used as their initial approximations: P0(tk) = 0.5 x lo8
Eo(tk)= 0.22 X lo5
k
= 0,
1,2,..., N
4.
112
PARAMETER ESTIMATION
TABLE 4.4 CONCENTRATION AND TEMPERATURE PROFILES t
x(t)
T(t)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.o
0.17848 0.17423 0.17014 0.16624 0.16258 0.15922 0.15624 0.15372 0.15176 0.15048 0.15005
1271.6 1275.8 1279.9 1283.8 1287.5 1290.9 1293.8 1296.4 1298.3 1299.6 1300.0
T h e results for this experiment are listed in Table 4.5. It can be seen that the values of /3 and E fluctuate or oscillate constantly during the first ten iterations and no definite values can be assumed for these parameters. However, these oscillations do not appear to influence the calculated values of ~ ~ + significantly. ~ ( t ~ ) T h e differences between these calculated values and those listed in Table 4.4 for x ( t ) never exceed 0.5 x during the ten iterations. T h e calculated values for a(t) obtained by using the values listed in Table 4.5 and Eq. (16.2) are also reasonably good, and in general agree with the actual values for the first one or two significant digits. T h e sums of the squares of the deviations for the calt ~ ) , , are also listed in Table 4.5. culated ~ , + ~ ( Qn+l
CONVERGENCE RATESOF p
AND
E
TABLE 4.5 ARRHENIUS EXPRESSION m(t)
I N THE
Iteration
0 1 2 3 4 5
6 7 8 9 10
=
/3 exp( - E / T )
Q
W b )
0.5 x lo8 0.30553 x 0.32130 x 0.35692 x 0.37123 x 0.35768 x 0.27049 x 0.34305 x 0.33372 x 0.37656 x 0.32029 x
lo8 lo8 lo8 lo8
lo8 lo8 lo8 lo8 lo8 lo8
0.22 x 105 0.21499 x lo6 0.21425 x lo5 0.21574 x lo5 0.21618 x lo5 0.21570 x lo5 0.21255 x lo5 0.21554 x lo6 0.21480 x lo5 0.21645 x lo5 0.21443 x lo5
0.391 0.397 0.395 0.404 0.394 0.470 0.392 0.391 0.412 0.396
x x
x
x x x x
x lo-@ x
x
18.
113
NUMERICAL RESULTS
It appears that these oscillations are caused by the inaccuracies of the calculations. These inaccuracies in turn may be caused by mild illconditioning. T h e large differences between the actual values of the unknown parameters p and E and of the state variables x and y certainly do not help the situation. T o overcome these difficulties, double-precision arithmetic is used and the above problem is repeated. No oscillatory difficulty has been encountered. T h e results are tabulated in Table 4.6. Since single-precision arithmetic carries eight significant figures, 16 significant figures are obtained by the double-precision operations. Another numerical experiment with different initial approximations for pO(tk)and Eo(tk)is also listed in Table 4.6. I n spite of the sensitive nature of the Arrhenius expression, the convergence rate is quite fast. However, the obtained values of ,8 and E are different from the actual values. Since the values of both /3 and E in the exponential expression are very large, while the magnitude of a ( t ) is only in the order of unity, accurate values for the frequency-factor constant and activation energy are very difficult to obtain. A small decrease in the value of E can be compensated by a corresponding decrease in the value of p. These decreases in the values of E and /3 result in a very small or negligible change in the value of a(t). If smaller values for E and p were used, we would have avoided these difficulties. However, in order to test the present approach under these highly unstable conditions, smaller values for E and p were not used. As can be seen from the sums of the squares of the deviations, Q n + l , the differences between the calculated values and the actual values of ~ ~ + have ~ ( never t ~ ) exceeded 0.5 x lop4. T h e differences between the values of a ( t ) obtained by (16.2) using the correlated values of p and E, and its actual values are smaller than 0.9 x T o illustrate the convergence rate of ~ ( t the ) , results are also shown in Fig. 4.2. I n order to obtain some explanation for the fluctuations of the values l and E when single-precision arithmetic is used,. the homogeneous of j solutions of the fifth iteration are examined. It has been found that
-
This constant value is approximately 0.372 x 0.375 x For example, at t = tr , the following values are obtained:
X~~,~= ( I 0.3578 ) x
X~~ =,-0.9553 ~ ( I )x
~ ~ ~= ~0.1130 ~ (x 1lo-')
~ h ~ , ~= ( l )
-0.3013
x lop3
X
X
9-01 X
8-01
06E'O 06E'O 06E'O
9-01
sz 2 8-01 X 88E'O 9-01 x PEE'O -
a
5 3
b
w E
P O I x ZISIZ'O P O I x ZISIZ'O POI X 9 L P l Z ' O P O I X 66012'0 x IEPOZ'O so1 x Z'O
POI
(V3
801 x P'O
X
801 x IZZPE'O 601 x LOZPE'O 801 X 808ZE'O a01 X 61ZLZ'O 086EZ'O
SOT
(")a'
8-01 8-01
X X
06E'O 06E'O
-
s-O1 x O ~ E ' O 8-01 X 06E'O 8-01 X 06E'O
a
so1 x Z I S I Z ' O P O I x ZISIZ'O POI x ZTSIZ'O
so1 x ZZ'O
so1 x llslz'o x zlslz'o POI
w3
0
Z I
S P E
801 x IZZPE'O S O T x IZZPE'O 8 0 1 x IZZPE'O 8 0 1 x OIZPE'O x IPOIE'O so1 x S'O
uo!lo.IalI
SOT
(Wa'
19. 3.8
115
DISCUSSION
I E o ( t k ) = 0.2 x l o 5
I .4' 0
I
0.2
0.6
0.4 t
FIG.4.2.
I
I
0.8
1.0
Convergence rate of m ( t ) .
Thus, if the calculated results were accurate only for the first rhree significant figures, the matrix formed by the coefficients of the integration constants in Eq. (16.1 1) would be badly ill-conditioned. T he convergence intervals for ,6? and E appear to be quite small. Thus, with all other values remaining the same as above, no convergence has been obtained with the following initial approximations: Po(tk) = 0.4 x los
EO(tk)= 0.24 x lo5
19. Discussion
As can be seen from the previous section, it is not easy to obtain the values of activation energy and the frequency-factor constant by the quasilinearization procedure. Since it is well known that the Arrhenius rate expression is not well behaved, these difficulties are not surprising. The values used for ,6? and E in the above example are not very large. If larger values had been used, say /3 was in the order of 10l6,the ill-conditioning phenomenon combined with high inaccuracies could have made the above procedure inapplicable. Even with the moderate values of 5,? and E, the usefulness of the present procedure is still quite limited. This is due to the very narrow range of the convergence interval. No convergence can
4.
116
PARAMETER ESTIMATION
be obtained unless the initial approximations used are almost the same as the correct but yet unknown values of the constant parameters. One way to overcome these difficulties is to first correlate the values of a ( t ) into some known polynomials o f t . Then a good initial approximation can be obtained from this correlated a(t) by using the observed temperature and Eq. (16.2). If high accuracy is not desired, this correlated ~ ( tcan ) be used directly to obtain the final values of 4, and E .
20. An Empirical Approximation
Instead of using Eq. (16.2) we shall use the expression (15.3) for and Eq. (16.1) can be written as
a(t),
dx z = Y dY == M y dt
m
+ Mx' C Pjtj j=O
The problem is: Given the observations b, , 5' = 1, 2, ..., m, , on x(ts), find the constant parameters Pi,j = 0,1, 2,..., m (ml l), so that the values of x obtained from Eq. (1) will minimize (5.1). Consider Pias functions o f t and form the differential equations
<
d pj - ~
dt
j=0,1,2
+
,..., m
T h e system (1) can again be linearized
-dpj*n+l -
dt
o
j
= 0,
I, 2,..., m
(2c)
The two given boundary conditions are represented by (16.5). Let ~ ~ + ~ ( represent t ) the (m 3)-dimensional state vector with components X,+l(t), yn+l(t), Po,n+l(t), Pl,n+l(~),*.*, Pm,n+l(t). Then the solution of the linear system (2) can again be represented by an equation in the form of (16.6). However, now the particular solution vector ~ ~ ( ~ + ~ )is( (t m) 3)-dimensional and the homogeneous solution matrix
+
+
20.
+
AN EMPIRICAL APPROXIMATION
117
+
is an ( m 3) x ( m 3) matrix. T h e particular and homogeneous solutions can be obtained with the following initial conditions:
Xh(n+,,(O)
=1
(4)
The first two integration constants can be obtained from the following equations: (5)
a,,n+1 = % l + l / M
The remaining ( m
+ 1) integration constants can be obtained from
where
+
and the subscript (n 1) from the variables in Eqs. (6), (8), and (9) has been omitted. Equation (7) can be represented by the matrix equation A n + l a m ( n + l ) = cn+1
+
(10)
where a,(,+,) represents the ( m 1)-dimensional vector with components a3,,+,, a4,,+, ,..., u ~ + ~ , , +T~h.e column vector c , + ~is represented as follows
4.
118
and An+1is an ( m
PARAMETER ESTIMATION
+ 1) x ( m + 1) matrix with elements "L1
c 4i,n+d?S)
4Ln+d?S)
S=l
i
=
j
=
3, 4, ...,( m 3, 4, ...,( m
+ 3) + 3)
where i denotes the row and j denotes the column numbers. T h e integration constants a3,n+l, a4,n+l,..., um+3,n+lcan be obtained from Eq. (10) by matrix inversion
21. Numerical Results
T o solve the above problem, the values of x ( t ) listed in column 2 of Table 4.4 are used as the observations or measurements on x. T h e following numerical values are used: x, = 0.2 M=2 xo(t,) = 0.2
At
= 0.01
tf = 1.0
P j , o ( t k= ) 1.0, j
=
(1)
0, 1 , 2 ,..., m
m, = 10
with k
=
0, 1, 2, ..., N . T h e ten observed data used for the variable x are ~ ( ~ ~ p ) (1 t , b) s
t
0.1,0.2,..., 1.0
(2)
Using the Runge-Kutta integration scheme, the results listed in Table = 2. Notice the rapid rate of convergence. T h e values of eZ and ey are reduced to less than 0.1 x lo-* and 0.3 x loF4, respectively, in one iteration. T h e convergence rate for a(t) is shown in
4.7 are obtained for m
TABLE 4.7 CONVERGENCE RATESBY EMPIRICAL APPROXIMATION
~
0 1 2 3 4
1.o 1.4107 1.4857 1.4861 1.4861
1 .o 0.9392 1.3113 1.3105 1.3105
1 .o 0.4062 -0.5752 -0.5751 -0.5751
~
~~
0.2 0.15002 0.15002 0.15002 0.15002
-0.04302 -0.04301 -0.04301 -0.04301
0.188 X 0.199 X 0.198 X 0.198 X
lo-' lo-' lo-' lo-'
22.
A SECOND APPROXIMATION
119
t
FIG.4.3. Convergence rate by empirical approximation.
Fig. 4.3. T h e true values of a ( t ) which are obtained by solving Eqs. (1 1.2) and (1 1.3) of Chapter 3 are also shown in this figure. No more improvements are obtained after the second iteration. This problem is also solved with m = 3. However, the same results as listed in Table 4.7 are obtained; and the value of the fourth coefficient, P, , is equal to zero. 22. A Second Approximation
Instead of the polynomial (15.3), other forms of approximations can also be used. T h e variable parameter a ( t ) can be represented by the expression m
4t)=
c Pj%(t)
(1)
j=O
where q(t) may be another known polynomial or it may be some known function of t which can be calculated easily. Besides being a function of t, q(t) can also be a function of another set of unknown constants. As an example q(t) could be the exponential function
where both P and X are unknown constants whose values are to be determined from the given observations on the state variables.
120
4. PARAMETER
ESTIMATION
One important criterion for choosing 4(t) is the amount of calculations involved in obtaining numerical values of q(t). T h e least amount of calculation would be needed if some known functions of the original problem were used as p(t). T h e dependent variables and their derivatives are some of these known functions. T o illustrate this, consider the problem discussed in Section 20 and let a ( t ) = Po
+ Pp%+ Pzdx dt
(3)
Now, the system (20.1) can be represented by dx X'Y
-ddtP=.o
j=O,1,2
The equations represented by (4)can again be linearized.
T h e two given boundary conditions are represented by (16.5). T h e equations represented by (5) can be solved by using Eqs. (20.3)-(20.11) with m = 2. 23. Numerical Results
T h e problem discussed in the above section is solved by using the same numerical values as those listed in (21.1) with the exception that m, = 11. T h e eleven observed data for the variable x are obtained from
23.
121
NUMERICAL RESULTS
TABLE 4.8 CONVERGENCE RATES WITH APPROXIMATION (22.3)
~~
~
0
1 2 3 4 5
6
~~
1 .o 1.997 -13.32 -9.694 -10.67 -10.41 -10.48
1 .o -0.3498 4.328 3.643 3.815 3.770 3.780
1 .o -2.500 9.117 6.252 7.063 6.844 6.897
0.2 0.1494 0.1500 0.1500 0.1500
-0.5 -0.04364 -0.04300 -0.04297 -0.04297
-
-
-
-
-
0.974 X 0.602 X lo-' 0.151 X lo-' 0.161 x 0.162 x lo-' 0.162 x lOW
Table 4.4.T h e convergence rates of the constant parameters are shown in Table 4.8 and the convergence rate of a ( t ) is plotted in Fig. 4.4.No change in the values of a ( t ) can be seen in Fig. 4.4 after the fourth iteration. T h e final estimated value and the true value are compared by Fig. 4.5. As can be seen, the estimated a ( t ) is not as good as that obtained in Section 21.
0.4
0
0.2
0.4
0.6
0.8
I .o
t
FIG. 4.4. Convergence rate with approximation (22.3).
4.
122
PARAMETER ESTIMATION
2.3I
I
- 2.1 -
d c
8 ESTIMATED VALUE
I .5i
FIG. 4.5.
I
I
I
1
0.2
0.4
0.6
0.8
t
I.o
Estimated and true values of a(t).
24. Differential Approximation
All the problems discussed in this chapter can be considered as particular cases of the more general situation of determining the vectors Pi and the initial vector c of the given system of nonlinear differential equations X; =
fi(x,Pi)
i
=
1, 2,...,M
(1)
where x is the M-dimensional state vector and the vectors Pi represent the unknown constant parameters which generally are different for different equations. T h e given observations or measurements are some of the state variables at different values of t for 0 t tf . This problem has been called “differential approximation’’ by Bellman and co-workers [3, 23-27]. Although we have used differential approximation to find the unknown parameters or coefficients in a given differential equation, the differential equation can also be used to approximate a given function. T h e polynomial
< <
Po
+ P1t + -.* + Pmt”
(2)
is probably the one most frequently used to approximate a given function of t. However, this polynomial is a solution of the linear differential equation &“+l’X --
&cm+l) - 0
(3)
25.
123
A SECOND FORMULATION
Similarly, the exponential polynomial m
c p , exp(4t)
(4)
j=1
is a solution of the differential equation dn'x
dni-lx
dt" + 41 dt"-l+
**-
+
QmX =
0
where the coefficients q are constants. Thus, the use of the solutions of differential equations to approximate a given function is equivalent to the use of certain polynomials. At first glance, it seems rather audacious to use differential equations rather than polynomials. Furthermore, it seems to be much simpler, for example, to use polynomial (4)than the differential equation (5). I n reality this is not the case. T h e problem of approximating a given function by the exponential polynomial (4)is ' not a simple matter. Serious stability problems have been encountered [3, 191. Differential approximation can be used to overcome these difficulties. In many computational problems such as the problem discussed in Section 18 of Chapter 3, frequently we are limited by the rapid-access memory of the current computers. Obviously, the memory requirements can be reduced if polynomials or differential approximations are used to approximate the numerical functions first. Instead of storing each grid point of the numerical function, which generally is given in tabular form, the coefficients of the polynomial or the differential equation can be stored. We shall not go into details here about this important area of storage and approximation. Those interested can consult the references [3, 5, 28, 291.
25. A Second Formulation In the previous sections we have shown how the quasilinearization technique with the aid of the superposition principle can be used to solve problems in differential approximation. These problems can also be solved without using quasilinearization. Suppose that we wish to approximate the given function x(t) by the solution of the linear differential equation with constant coefficients y(m) + qly(m-l) +
+ qmy = 0
(1) where the superscript (m)denotes the mth differential and the p's are constants. For simplicity, we shall assume that the derivatives dm), dm-l), ..., x' can be obtained without too much difficulty from the given function x(t).
4.
124
PARAMETER ESTIMATION
I n order to represent x ( t ) by (l), we must determine two different kinds of constants: the constant coefficients and the initial conditions of Eq. (1). T h e coefficients can be determined by specifying that they be chosen to minimize the quadratic expression [23]
Jy
+
(dm) qldm-l)
+ + qrnx)2dt
(2)
T h e minimum of (2) can be obtained by solving the following system of m linear simultaneous algebraic equations
which are obtained by differentiation. These equations can be solved without too much difficulties if the coefficients which appear as integrals have been evaluated. Once the coefficients of (1) are obtained the initial conditions can be determined in the following fashion. Let y1 , y z ,..., ym be m solutions of (1) obtained by integrating (1) with the following m sets of initial values: y1(0) = 1, yi(0) y,(O)
= 0,
0 ,...,
y:”-”(O)
=
0
y;,(O)= 1,..., y y ’ ( 0 ) = 0
yrn(0)= 0 , yA(0) = 0 ,..., y$-1’(0)
=
(4)
1
Then every solution of (1) can be represented by
where ai are the integration constants. Because of the condition (4),it can be shown that y ( 0 ) = a,, y’(0) = u2 ,..., y(rn-l)(O)= urn
(6)
Thus the integration constants are also the required initial conditions. These integration constants can be determined by the requirements that they minimize the quadratic expression
26.
125
COMPUTATIONAL ASPECTS
The minimum of (7) can be obtained by solving the following m linear algebraic equations:
Again these linear equations can be solved without too much difficulty if the integrals have been evaluated. 26, Computational Aspects
The main disadvantage of the above approach is that the differentials of x ( t ) must be known in order to evaluate the integrals in Eqs. (25.3) and (25.8). If x(t) is given in the form of numerical data, accurate derivatives of x(t) could be fairly difficult to obtain. This is due to the inherent inaccuracy in numerical differentiations. However, the above approach can be used in situations where the known model of the process is represented by a nonlinear complicated differential and integral equation. We wish to represent this equation by a simple linear differential equation. This situation occurs frequently in on-line computer control where owing to economic considerations the model must be simple and easily computable. Suppose the given function x ( t ) satisfies the nonlinear equation x(") =f(x,
X')
..., x(rn-1)
t
(1)
and we wish to approximate x ( t ) by (25.1), then the integrals appearing in (25.3) and (25.8) can be evaluated easily by establishing the following differential equations: Wij(0) =
Zj(0)
0
=0
Uij(0) = 0 dvj dt
- = xyj
Vj(0)
=0
with i , j = 1, 2, ..., m. Equations (1) and (2) can be integrated simultaneously to obtain wij and zj. From Eqs. (1) and (3) we obtain uij and vj . Obviously, the values of wij , zj, uij , vj at tf are the coefficients for Eqs. (25.3) and (25.8).
126
4.
PARAMETER ESTIMATION
27. Discussion
There are two fundamental problems in engineering and physical sciences. One is to predict the behavior of the process with a given mathematical representation of the process. Most of the mathematical analysis in the literature is devoted to problems of this type. T h e other is to determine the mathematical representation of the process from various given observations. T h e latter, which is essentially the inverse problem of the former, is much more complex. Owing to computational difficulties, very little has been done toward a systematic treatment of this problem. T h e quasilinearization procedure appears to be a promising approach to this identification or model building problem. For illustrative purposes, some fairly simple problems have been solved in this chapter. Obviously, the procedure can be applied to more complex equations such as differential-difference and integrodifferential equations. Some of these and other applications can be found in the references cited at the end of the chapter [30-381. REFERENCES
1. Mishkin, E., and Braun, L., eds., “Adaptive Control Systems.” McGraw-Hill, New York, 1961. 2. Bellman, R., Kagiwada, H., and Kalaba, R., Quasilinearization, system identification, and prediction. RM-3812-PR. RAND Corp., Santa Monica, California, August, 1963. 3. Bellman, R., and Kalaba, R., “Quasilinearization and Nonlinear Boundary-Value Problems.” American Elsevier, New York, 1965. 4. Wilde, D. J., “Optimum Seeking Methods.” Prentice-Hall, Englewood Cliffs, New Jersey, 1964. 5. Bellman, R., and Dreyfus, S., “Applied Dynamic Programming.” Princeton Univ. Press, Princeton, New Jersey, 1962. 6. Shah, B. V., Buehler, R. J., and Kempthorne, O., Some algorithms for minimizing a function of several variables. J. SOC. Ind. Appl. Math. 12, 74 (1964). 7. Box, G. E. P., and Wilson, K. B., On the experimental attainment of optimum conditions. J . Roy. Statist. SOC.B13, 1 (1951). 8. Brooks, S. H., A discussion of random methods for seeking maxima. Operations Res. 6 , 244 (1958). 9. Fletcher, R., and Reeves, C. M., Function minimization by conjugate gradients. Comput. J. 7, 149 (1964). 10. Powell, M. J. D., An efficient method for finding the minimum of a function of several variables without calculating derivatives. Comput. J . 7, 155 (1964). 1 1. Fletcher, R., Function minimization without evaluating derivatives-a review. Comput. J. 8, 33 (1965). 12. Rosenbrock, H. H., An automatic method for finding the greatest or least value of a function. Comput. J. 3, 175 (1960). 13. Lee, E. S., Optimization by Pontryagin’s maximum principle on the analog computer. A.1.Ch.E. J. 10, 309 (1964).
REFERENCES
127
14. Bellman, R., Kagiwada, H. H., and Kalaba, R., Quasilinearization, boundary-value problems and linear programming. I E E E Trans. Auto. Control AC-10, 199 (1965). 15. Bellman, R., Jacquez, J., Kalaba, R., and Schwimmer, S., Quasilinearization and the estimation of chemical rate constants from raw kinetic data. RM-4721-NIH. RAND Corp., Santa Monica, California, August, 1965. 16. Hougen, 0. A., and Watson, K. M., “Chemical Process Principles,” Pt. 111. Wiley, New York, 1947. 17. Kittrell, J. R., Hunter, W. G., and Watson, C. C., Nonlinear least squares analysis of catalytic rate models. A.I.Ch.E. J. 11, 1051 (1965). 18. Kittrell, J. R., Hunter, W. G., and Watson, C. C . , Obtaining precise parameter estimates for nonlinear catalytic rate models. A.I.Ch.E. J. 12, 5 (1966). 19. Lanczos, C., “Applied Analysis.” Prentice-Hall, Englewood Cliffs, New Jersey, 1956. 20. Bellman, R., Kalaba, R., and Lockett, J., Dynamic programming and ill-conditioned linear systems. J. Math. Anal. Appl. 10, 206 (1965). 21. Phillips, D. L., A technique for the numerical solution of certain integral equation of the first kind. J. Assoc. Comput. Machinery 9, 84 (1962). 22. Twomey, S., On the numerical solution of Fredholm integral equations of the first kind by the inversion of the linear system produced by quadrature. J. Assoc. Comput. Machinery 10, 97 (1963). 23. Bellman, R., Kalaba, R., and Kotkin, B., Differential approximation applied to the solution of convolution equations. Math. Comput. 18, 487 (1964). 24. Bellman, R., Gluss, B., and Roth, R., On the identification of systems and the unscrambling of data: Some problems suggested by neurophysiology. Proc. Natl. Acad. Sci. U.S. 52, 1239 (1964). 25. Bellman, R., Kagiwada, H., and Kalaba, R., On the identification of systems and the unscrambling of data. I. Hidden periodicities. Proc. Natl. Acad. Sci. U.S. 53, 907 (1965). 26. Bellman, R., Kagiwada, H., Kalaba, R., and Ueno, S., On the identification of systems and the unscrambling of data. 11. An inverse problem in radiative transfer. Proc. Natl. Acad. Sci. U.S. 53, 910 (1965). 27. Bellman, R., Kalaba, R., and Sridhar, R., Adaptive control via quasilinearization and differential approximation. RM-3928-PR. RAND Corp., Santa Monica, California, November, 1963. 28. Bellman, R., and Dreyfus, S., Functional approximations and dynamic programming. Math. Tables and Other Aids to Computat. 13, 247 (1959). 29. Leitmann, G., ed., “Optimization Techniques with Applications to Aerospace Systems.” Academic Press, New York, 1962. 30. Bellman, R., Kalaba, R., and Kotkin, B., Polynomial approximation-A new computational technique in dynamic programming: Allocation processes. Math. Comput. 17, 155 (1963). 31. Bellman, R., Kagiwada, H., and Kalaba, R., Orbit determination as a multi-point boundary-value problem and quasilinearization. Proc. Natl. Acad. Sci. U.S. 48, 1327 (1962). 32. Bellman, R., Collier, C., Kagiwada, H., Kalaba, R., and Selvester, R., Estimation of heart parameters using skin potential measurements. Commun A C M 7, 666 (1964). 33. Bellman, R., Kagiwada, H., Kalaba, R., and Ueno, S., Inverse problems in radiative transfer: Layered media. Icarus 4, 119 (1965). 34. Sage, A. P., and Eisenberg, B. R., Experiments in nonlinear and nonstationary system identification via quasilinearization and differential approximation. Presented at Joint Autom. Control Conf., Seattle, Washington, August 17-19, 1966.
128
4.
PARAMETER ESTIMATION
35. Bellman, R., Kagiwada, H., and Kalaba, R., Dynamic programming and an inverse problem in neutron transport theory. RM-4495-PR. RAND Corp., Santa Monica, California, March, 1965. 36. Bellman, R., Gluss, B., and Roth, R., Identification of differential systems with time-varying coefficients. RM-4288-PR. RAND Corp., Santa Monica, California, November, 1964. 37. Kumar, K. S. P., and Sridhar, R., On the identification of control systems by the quasilinearization method. IEEE Trans. Auto. Control AC-9, 151 (1964). 38. Detchmendy, D. M., and Sridhar, R., On experimental determination of the dynamics of physical systems. Proc. N a t l . Electron. Conf. 21, 575 (1965).
Chapter
J
OPTIMIZATION
1. Introduction
T he two-point boundary-value difficulties limit the use of both the calculus of variations and the maximum principle in obtaining numerical solutions for optimization problems. T h e quasilinearization technique will be shown to be a promising tool for overcoming these difficulties. There are other ways to avoid these boundary-value obstacles. Dynamic programming [I] avoids them by employing a completely different concept. It is formulated with the idea of invariant imbedding and it is based on the principle of optimality. It will be shown in the next chapter that although dynamic programming avoids almost all the difficulties associated with the classical method, it has dimensionality difficulties, which effectively limit the use of the dynamic programming technique to problems with only a small number of state variables. T he functional gradient technique, which is discussed briefly in Appendix 11, also can be used to avoid boundary-value difficulties. However, this technique has a fairly slow convergence rate for continuous problems. Recently, the second variations have been used to increase the convergence rate. Besides the boundary-value difficulties, there are other obstacles to the classical approach. T h e most severe ones are associated with handling various types of inequality constraints and the inability of the method to guarantee a true optimum. I n addition, the classical method is not suited for linear optimization problems. T h e maximum principle is very useful in this respect. It affords a very elegant method for obtaining analytical solutions of linear optimization problems with control variable inequality constraints. However, in obtaining numerical solutions of complex nonlinear problems, it appears debatable whether any substantial advantages are gained by using the maximum principle. I n addition to the usual forms of optimization problems, problems with parameters will also be solved. I n various applications, frequently 129
130
5.
OPTIMIZATION
it is necessary to optimize the process with respect to not only the control variables, but also the system parameters. By system parameters we mean a set of constant values which must be chosen before the process begins. T h e usual procedure for designing such a system is to pick several choices of the parameters, optimize the system under these different choices, and then select the most promising combination. T h e present procedure considers these parameters as additional state variables. T h e unknown initial conditions for these additional state variables can be obtained by applying the free boundary conditions or the transversality conditions. T h e optimum temperature profile in a tubular reactor with pressure as a parameter is obtained by this approach. Essentially, two numerical procedures are used in this chapter. T h e first one is the usual approach in which the control variable is eliminated from the differential equations first. Then these equations are linearized and the usual quasilinearization procedure is applied. T h e convergence rate is quite fast once the initial approximations which are within the interval of convergence are obtained. However, when the control variable is temperature, which appears in the Arrhenius exponential expression, the convergence interval may be fairly small. I n order to enlarge this interval, the second procedure, in which the control variable is not eliminated from the differential equations, is used. Restrictions can be applied to the control variable during the iterations in the second procedure and thus a wider interval of convergence can be obtained. This procedure also can be used for an initial estimation of the control variable. But, the convergence rate of the second procedure is much dower than that of the first.
2. Optimum Temperature Profiles in Tubular Reactors
T o illustrate the use of the quasilinearization procedure, the optimum temperature profile in a tubular reactor will be obtained for a particular set of numerical conditions. This problem or its slightly revised form has been discussed by various authors [2-81. T h u s a comparison can be made between the present procedure and various other approaches. Consider the system of two consecutive reactions A+B+C
(1)
which are being carried out in a tubular chemical reactor. T h e component B is the desired product, the yield of which is to be maximized by the choice of the temperature profile. Both reactions are first order and C is a waste product. If x1 and x2 are the state variables which
2.
TEMPERATURE PROFILES IN TUBULAR REACTORS
131
represent concentrations of A and B , the kinetics of the reactions are given by dx2 _ - k'X1
-
dt
where k, and k, are the rate constants of the reactions, k, = G, exp
(-
&)
k,
=
G, exp
(- +)
(3)
where GI and G, are the frequency-factor constants for the first and second reactions, respectively; and El and E, are similarly defined activation energies of the reactions. T h e gas constant is represented by R, . T h e independent variable t represents the holding time of the reactor up to a given point and T ( t ) the temperature there. Plug flow has been assumed in obtaining the above equations. Although the equations have been obtained for a tubular reactor, the equations for a batch reactor assume essentially the same form. T h e initial conditions for Eq. (2) are X ' ( 0 ) = x; x,(O) = x," (4) T h e problem is to determine the temperature profile T ( t ) such that at the final time t f the value of x, is a maximum. Except for the absence of parameters, this problem is in the same form as that discussed in Section 3 of Appendix I. T h e control variable z(t) is represented by T(t) in the above problem and the only end conditions are the given initial conditions for x1 and x, . T h e function to be maximized is
J
(5)
= xz(tf)
Upon introduction of the Lagrange multipliers A, and A,, Eqs. (2.9) and (3.3) of Appendix I become F
= A,(-x;
-
k,~,) + ha(-%;
+ k,~,
-
k,~,)
(6)
G =Xdtf) (7) The Euler-Lagrange equations can be obtained from Eqs. (2.11) and (2.12) of Appendix I: "' -- k,A, - k,A, (84 dt dA2 _ at k2Az -
~,k,E,(h, - A,)
+ xzk,E,X,
=0
5.
132
OPTIMIZATION
Equations (2) and (8) represent four differential equations. Only two boundary conditions are given by (4), the other two conditions can be obtained by the transversality condition listed in Appendix I. Since t o , tf , xl(0), and x,(O) are given and thus are fixed values, Eq. (2.13) of Appendix I is reduced to Eq. (3.5) of Appendix I. Applying this transversality condition at tf , we obtain A,(t,) = 0
A,(t,)
=
1
(10)
Equations (2)-(4), and (8)-( 10) represent the desired equations. The control variable can be eliminated from these equations. Solving (9) for T , we obtain
Substituting T into (3), we get
k,
=
G , exp
E,
(El
-
E, ln(u))
=
G, exp(A, 1n(u))
(12b)
For simplicity of notations, the constants A , and A, and the variable u have been introduced into Eq. (12). T h e equations in (12) can be further simplified into the following forms: k,
=
G,UA1
k,
=
G,u~
Now Eqs. (2) and (8) become
dA 2 = A2G2uAz dt
2.
133
TEMPERATURE PROFILES IN TUBULAR REACTORS
with
The equations in (14) with boundary conditions (4)and (10) constitute the set of nonlinear equations. T h e solution of these equations will lead to the stationary point of the problem. Note that the Euler-Lagrange equation only guarantees a stationary point. Whether this stationary point is maximum, minimum, or stationary must be determined by more calculations or from physical considerations. Equations (4), (lo), and (14) represent a nonlinear two-point boundaryvalue problem. T o obtain the numerical solution of this nonlinear boundary-value problem is not simple [2]. However, it can be solved easily by the quasilinearization technique. The equations in (14) can be linearized by the recurrence relations listed in Section 17 of Chapter 2. -dxlml-
dt
-dX*,,+l
dt
-
-x,G,uAi
+ (x,,,+~
-
+ (A,,,+,
-
x,)[(Al - I) G,uA1]
xl) [G,uA1(l
x,G,uAi -
+ (A,,,+,
-
4) [
xlGIAluAi - x2GzAzuA2
1
A, - A,
(A,
- A,) GIA,uA1
1
-
Al)
+
X2G2A2UA2 x1
1
5.
134
OPTIMIZATION
T h e second subscript n has been omitted from x, , x 2 , A,, and A, in the above equations for simplicity. It is understood that the unknown variables are the variables with the second subscript ( n 1). All other variables are known and are calculated from the previous nth iteration. The boundary conditions for Eq. (17) are
+
Xl,n+l(O) =
4
Xz,n+1(0) =
4
(W
Al*n+l(tf) =
0
Az,n+db) =
1
(18b)
T h e equations in (17) are linear differential equations with variable coefficients. T h e general solution for this system, again, can be represented by the following matrix equation: xn+,(t)
= xscn+dt)
+
X h ( n + l d t ) an+,
(19)
T h e vector ~ , + ~ ( trepresents ) the state vector with components ~ , , ~ + , ( t ) , A,,n+l(t), and A2,n+l(t). T h e particular solution vector x~(~+,) and the integration constant vector a , are defined similarly. The homogeneous solution matrix is ~ ~ , ~ + ~ ( t ) ,
If the following initial values are used in obtaining the particular and homogeneous solutions,
3.
NUMERICAL RESULTS
135
then the first two integration constants, al,n+l and are equal to zero. Thus, only two sets of homogeneous solutions are needed. Since only two initial conditions are missing, this should be expected. Equations (17) and (18) can be solved by the same numerical procedure discussed in Section 16 of Chapter 3. Once the values of x,+,(t) are obtained, the temperature profile T,+,(t) can be obtained by Eq. (11).
3. Numerical Results
T he numerical values used for the constants in the Arrhenius expressions are GI G,
x loll per minute = 0.461 x lo1* per minute = 0.535
El E,
18,000 cal/mole = 30,000 cal/mole =
(1)
R, = 2 cal/mole-"K The other numerical values used are tf = 8 minutes
xy
= 0.53
mole/liter
x;
= 0.43
mole/liter
dt
= 0.025
At
=
0.1
< 1.0 for 1.0 < t < 8.0 for 0 < t
With the given boundary conditions as the initial approximations,
and with k = 0, 1, 2,..., N , A t = tk+l - t, , the results listed in Table 5.1 are obtained. Note the extremely large values obtained during the first seven iterations. However, in spite of these unreasonable values the values of e y , for y = xl, x 2 , A,, and A,, are reduced to less than 0.1 x in 14 iterations. T h e large oscillations during the first seven iterations are caused by the Arrhenius expressions and by the very approximate initial approximations. Because of the presence of Arrhenius expressions, the solutions
5.
136
OPTIMIZATION
TABLE 5.1 CONVERGENCE RATESWITH t f
=
8 AND WITH INITIALAPPROXIMATIONS (3.3)
Iteration 1 0 1.0 5.0 8.0
0.53 0.169 -0.328 0.8 x 104
0.43 -0.250 0.389 -0.536 -0.359 0.250 0.5 x 103 -0.2 x 105 Iteration 2
0 1.o 5.0 8.0
0.53 -0.465 -0.1 x 10'8 -0.8 x 1038
0.43 0.661 -0.2 x 1015 -0.5 x 1038
0.0 -6.76 -0.2 x 1017 0.1 x 1031
-0.107 -0.360 -1.68 -0.2 x 106
1.05
375.28 332.84 365.12 405.24
-1.59 0.1 x 1017 0.6 x
368.75 383.37 0.0 0.0
-0.53 -0.1 x 10'8 0.3 x lozo 0.3 x loz0
368.75 0.0 0.0 0.0
Iteration 3 0 1.o 5.0 8.0
0.53 0.4 x 10l6 0.5 x lo1# 0.5 x 10l8
0.43 0.0 -0.4 x 1017 -0.3 x 10l8 -0.3 X 10" 0.0 -0.3 X 10" 0.3 x 10'" Iteration 4
0 1.o 5.0 8.0
0.53 -0.5 x 105 -0.5 x 105 -0.5 x 105
0.43 0.7 x 105 0.7 X lo5 0.7 x lo5
0 1.o 5.0 8.0
0.53 -0.1 x 1 0 3 7 -0.2 x 1038 -0.6 x 1038
0.43 0.2 x 1037 0.8 x 1038 0.1 x 1039
0.1 x 105 -0.7 x 103 -4.0 -4.0
0.6 0.3 0.3 0.3
x 104 x 10'
x 10' x 10'
370.47 439.81 359.11 359.1 1
Iteration 5 0.0 0.4 x 1037 -0.7 x 1038 0.0
-1.0 -0.9 x 1036 0.3 x 1038 0.0
368.75 0.0 0.0 0.0
Iteration 6
0 1.o 5.0 8.0
0.53 0.4 x 107 0.4 x 107 0.4 x 107
0 1.o 5.0 8.0
0.53 -0.7 x 1037 0.0 0.0
0
1.o 5.0 8.0
0.53 0.0658 0.0658 0.0658
0.43 -0.1 -0.4 -0.1 x 107 -0.1 x 107 -0.4 -0.4 -0.1 x 107 Iteration 7 0.43 0.0 0.7 x 1037 -0.2 0.0 0.0 0.0 0.0 Iteration 8 0.43 -16.7 0.429 -0.2 0.429 -0.2 0.429 -0.2
x 109 x 10-2 x 10-2 x 10-2
x
1038
x 10-6 x 10-6 x 10-6
-0.8 x 107 -2.2 -2.2 -2.2 1.o 0.1 x 0.0 0.0 2.61 1.oo 1.oo 1.oo
1038
438.84 396.39 396.39 396.39 368.75 0.0 0.0 0.0 420.42 326.87 326.87 326.87
3.
137
NUMERICAL RESULTS
TABLE 5.1 (Continued)
Iteration 9
0 1.o 5.0 8.0
0.53 0.55099 0.4 1003 0.34406
0.43 2.3523 2.4124 2.4393
0 1.o 5.0 8.0
0.53 0.60165 0.4478 1 0.33703
0.43 0.93364 1.0332 I .0847
0 1.o 5.0 8.0
0.53 0.44138 0.27091 0.18750
0.43 0.50555 0.64370 0.69088
- 3.2666
0.72943 0.16004 0.4 x 10-5
1.427 1 0.89630 0.98457 0.99999
397.87 305.93 325.56 325.40
1.9260 0.94069 0.96800 1.ooooo
372.65 342.13 340.47 339.96
0.85781 0.85317 0.93247 1 .00000
346.48 339.46 337.33 337.38
0.82837 0.85517 0.94233 1.00000
340.79 339.37 336.76 335.94
0.82823 0.85536 0.94274 1.ooooo
340.82 339.43 336.80 335.89
0.82823 0.85537 0.94214 1.00000
340.82 339.43 336.80 335.89
Iteration 10
-0.35755 0.43353 0.25543 -0.1 x 10-7 Iteration 11
0.55646 0.55738 0.33267 0.2 X 10-6 Iteration 12
0 1.o 5.0 8.0
0.53 0.44662 0.25040 0.17086
0.43 0.49855 0.63878 0.67913
0.61036 0.56755 0.31070 0.6 x 10-7 Iteration 13
0 1.o 5.0 8.0
0.53 0.44634 0.24997 0.17042
0.43 0.49866 0.63890 0.67944
0.53 0.44635 0.24998 0.17043
0.43 0.49866 0.63889 0.67943
0.60999 0.56661 0.30852 0.6 x lo-’ Iteration 14
0
.o
1 5.0 8.0
0.61000 0.56661 0.30852 0.6 x 10-7
of (2.14) are very sensitive to temperature. However, in choosing the initial approximations (3), the temperature has not been considered at all. I n order to overcome these difficulties, the values of the control variable T(t,), not the initial approximations, are chosen arbitrarily. Let T D ( t k )= 335°K
k
= 0,1, 2
,...,N
(4) Now the desired initial approximations can be obtained by using (4). Note that once the values of T ( t ) are known, Eqs. (2.2) and (2.8) can be solved as two initial-value problems. Equation (2.2) can be integrated
5.
138
OPTIMIZATION
first with the initial condition (2.4). Then, (2.8) can be integrated in a backward fashion with (2.10) as the initial condition. T h e solutions of these two initial-value problems will be used as the initial approximations. T h e results shown in Table 5.2 are obtained by using this procedure TABLE 5.2
CONVERGENCE RATESWITH t, Iteration
X,(tf)
0 1 2 3 4
0.21 120 0.17948 0.17074 0.17043 0.17043
=
8
AND
T,(tk)= 335°K
XZ(tf)
XdO)
MO)
T(0)
TO,)
0.67248 0.67780 0.67931 0.67943 0.67943
0.55788 0.60387 0.60978 0.61000 0.61000
0.87629 0.84758 0.82877 0.82823 0.82823
335.00 342.52 340.87 340.82 340.82
335.00 336.91 335.93 335.89 335.89
and the values listed in (1) and (2). T h e Runge-Kutta integration scheme is used. Besides the missing initial and missing final conditions, the values of the control variables at t = 0 and t = tr are also listed in the table. T h e optimum temperature profile is listed in the second column of Table 5.3 and the optimum values of concentrations and Lagrange TABLE 5.3 OPTIMUM TEMPERATURE PROFILES T(tk),"K tk
0 0.05 0.1 0.15 0.2 0.4 0.6 0.8 1.o 1.5 2.0 3.0 4.0 5.0 6.0 8.0 10.0
tf = 8
t, = 10
340.82 340.73 340.65 340.57 340.49 340.19 339.91 339.66 339.43 338.91 338.48 337.78 337.23 336.80 336.44 335.89
360.00 355.97 353.77 352.26 351.11 348.19 346.44 345.20 344.25 342.57 341.41 339.86 338.83 338.08 337.51 336.68 336.11
3.
139
NUMERICAL RESULTS
1, MINUTES
FIG. 5.1.
Optimum profiles with tt = 8.
multipliers are shown in Fig. 5.1. T o illustrate the rate of convergence, the convergence rate of T ( t )is shown in Fig. 5.2. Note the very approximate value used for the initial temperature. Some numerical experiments also are performed with a more severe
INITIAL
335 0
FIG. 5.2.
2
4 t, MINUTES
6
0
Convergence rate of temperature for tt = 8.
5.
140
OPTIMIZATION
TABLE 5.4 CONVERGENCE RATESWITH t f xl(zk)
x,(tl;)
0 0.25 0.50 1.o 2.0 4.0 6.0 8.0 10.0
0.95 0.91030 0.87227 0.80089 0.675 19 0.47987 0.34106 0.24240 0.17228
0.05 0.08914 0.12632 0.19512 0.31266 0.48222 0.58666 0.64582 0.67372
0 0.25 0.50 1 .O 2.0 4.0 6.0 8.0 19.0
0.95 0.84871 0.80642 0.72701 0.59 106 0.40402 0.29233 0.22038 0.17023
0.05 0.14228 0.18071 0.25324 0.37320 0.52548 0.60474 0.64767 0.67 137
tk
=
10 AND TO(&)= 340°K hl(tk)
W k )
0.67092 0.66835 0.66541 0.65837 0.63903 0.57407 0.46127 0.27974 0.00000
0.72695 0.73277 0.73863 0.75051 0.77483 0.82585 0.88024 0.93821 1.ooooo
340.0 340.0 340.0 340.0 340.0 340.0 340.0 340.0 340.0
0.74604 0.75919 0.75547 0.76736 0.80263 0.86636 0.91739 0.96074 0.99999
371.59 354.47 349.28 345.14 342.07 339.08 337.54 336.66 336.09
0.72083 0.74531 0.75948 0.78347 0.82034 0.87505 0.98005 0.96102 1.ooooo
366.49 350.05 346.99 344.13 341.38 338.85 337.53 336.70 336.12
0.71204 0.74208 0.75987 0.78511 0.82 140 0.87537 0.92019 0.96109 1.ooooo
361.66 350.21 347.24 344.26 341.41 338.83 337.51 336.68 336.11
T(tk)
Initial
Iteration 1 0.69124 0.67775 0.67126 0.65914 0.62712 0.53 190 0.39804 0.22308 0.6 x 10-4
Iteration 2 0 0.25 0.50 1.0 2.0 4.0 6.0 8.0 10.0
0.95 0.83821 0.77790 0.68505 0.55454 0.39361 0.29293 0.22325 0.17264
0.05 0.15750 0.21384 0.29841 0.41233 0.542 14 0.61371 0.65568 0.67971
0 0.25 0.50 1 .O 2.0 4.0 6.0 8.0 10.0
0.95 0.84381 0.77742 0.68188 0.55264 0.39311 0.29276 0.22319 0.17263
0.05 0.15184 0.21390 0.30 103 0.41405 0.54291 0.61426 0.65615 0.68015
0.67853 0.67295 0.66676 0.652 18 0.61641 0.52171 0.39278 0.2221 1 0.2 x 10-3
Iteration 3 0.67848 0.67254 0.66584 0.65090 0.61534 0.52124 0.39251 0.22194 0.9 x
3.
141
NUMERICAL RESULTS
TABLE 5.4 (Continued)
Iteration 4 0 0.25 0.50 1.o 2.0 4.0 6.0 8.0 10.0
0.05 0.15200 0.21400 0.30106 0.41400 0.54285 0.6 1420 0.65608 0.68008
0.95 0.84354 0.77722 0.68175 0.5 5261 0.39309 0.29274 0.223 18 0.17262
0.67862 0.67253 0.66583 0.65089 0.61534 0.52124 0.39252 0.22194 0.9 x
0.70988 0.74215 0.75992 0.78515 0.82 140 0.87536 0.92019 0.96108 1.ooooo
360.18 350.20 347.24 344.26 341.41 338.83 337.51 336.68 336.11
Iteration 5 0 0.25 0.50 1.o 2.0 4.0 6.0 8.0 10.0
0 0.25 0.50 1.0 2.0 4.0 6.0 8.0 10.0
0.95 0.84335 0.77708 0.68165 0.55256 0.39307 0.29273 0.22317 0.17261
0.05 0.15218 0.21413 0.301 14 0.41404 0.54287 0.6 1421 0.65609 0.68009
0.67862 0.67252 0.66582 0.65087 0.61532 0.52123 0.39250 0.22194 0.9 x
0.70963 0.74220 0.75996 0.78517 0.82141 0.87537 0.92019 0.96109 1.ooooo
360.02 350.19 347.23 344.25 341.41 338.83 337.51 336.68 336.11
0.95 0.84332 0.77706 0.68 164 0.55255 0.39306 0.29273 0.223 17 0.17261
Iteration 6 0.05 0.67862 0.15221 0.67252 0.21415 0.66581 0.301 16 0.65087 0.41405 0.61532 0.54288 0.52123 0.6 1422 0.39250 0.65609 0.22193 0.68009 0.9 x
0.70961 0.74221 0.75997 0.785 18 0.82142 0.87538 0.92019 0.96109 1.ooooo
360.00 350.19 347.23 344.25 341.41 338.83 337.51 336.68 336.11
reaction condition. Instead of (2), the following numerical values are used: t, = 10 minutes xy = 0.95
mole/liter
x! = 0.05
mole/liter
At
= 0.025
At
= 0.1
< t < 1.0 for 1.0 < t < 10.0 for 0
5.
142
OPTIMIZATION
If the given boundary conditions are used as the initial approximations, no convergence can be obtained for this problem. I n fact, even if the initial approximations are obtained from the following assumed values for T TO(tk)= 335°K
To(tk)= 345°K
k
= 0,
1,2 ,...,N
(6)
by integrating Eqs. (2.2) and (2.8) numerically, the problem still does not converge. However, convergence is obtained using the following values of the control variable to obtain the initial approximations: T O ( t k ) = 340°K
k
= 0, 1, 2
,...,N
(7)
Part of the results for this experiment are shown in Table 5.4 and the convergence rate of the temperature is shown in Fig. 5.3. I n spite of
ljor-
365
FIRST ITERATION
335;
2
4
6
8
0
t ,MINUTES
FIG. 5.3. Convergence rate of temperature for t,
=
10.
the steepness of the temperature profile and the very approximate initial temperature profile used, the value of eT is reduced to less than 0.02 in five iterations.
3.
143
NUMERICAL RESULTS
Table 5.5. shows another numerical experiment with the following better initial temperature profile: To(0) = 345°K
To(tf)= 335°K
(8)
The values of TO(tk) for k = 0, 1, 2, ..., N are obtained by the recurrence relation
with To(to)= To(0).Since a smaller value of d t for 0 < t < 1.0 is used, the initial temperature profile decreases faster in this part of the reactor (see Fig. 5.4). T h e initial approximations are obtained by integrating Eqs. (2.2) and (2.8) with this temperature profile. T h e convergence rate of temperature is shown in Fig. 5.4.
IrOr-----l
FIRST ITERATION
t , MINUTES FIG. 5.4.
Convergence rate of temperature, tf
=
10.
From Tables 5.4 and 5.5, it can be seen that the convergence rate is only a mild function of the initial temperatures used. T h e optimum temperature profile is shown in the third column of Table 5.3. and the optimum profiles of concentrations and Lagrange multipliers are shown
5.
144
OPTIMIZATION
TABLE 5.5 CONVERGENCE RATESWITH t, = 10 AND WITH INITIAL TEMPERATURE OBTAINED FROM (3.8) AND (3.9) Iteration
Xl(tf)
0.19061 0.17517 0.17305 0.17266 0.17263 0.17262 0.17261 0.17261
x&)
0.67745 0.669 16 0.67990 0.68046 0.6801 1 0.68008 0.68009 0.68009
h(O)
MO)
T(O)
T(tf)
0.67351 0.69944 0.67792 0.67793 0.67854 0.67862 0.67862 0.67862
0.74738 0.77207 0.73511 0.71911 0.71147 0.70980 0.70963 0.70961
345.00 377.37 372.92 365.85 361.26 360.12 360.01 360.00
335.00 336.68 336.16 336.11 336.11 336.11 336.11 336.11
in Fig. 5.5. T h e numerical values listed in ( I ) and (5) have been used for these numerical experiments.
FIG.5.5. Optimum profiles with t,
=
10.
4. Discussion
It is interesting that the convergence rate of the quasilinearization procedure is fairly independent of the initial approximations, as long as these approximations are within the convergence interval, and as long as they are not very close to the correct solutions. This interval of
4. DISCUSSION
145
convergence is reasonably large even for the problems solved in the preceding section. Table 5.1 is interesting in that although nothing is accomplished during the first seven iterations, the convergence rate is quite fast once the approximation is within the interval of convergence. Owing to the steepness of the temperature profile in the first part of the reactor, the problem solved in the preceding section is fairly unstable numerically. It should be emphasized that the initial approximations used in the preceding section are very poor. T h e same problem has been solved by using Pontryagin’s maximum principle and the generally used trial-and-error procedure for two-point boundary-value problems on an analog computer [2]. Even for the problem with tt = 8, which has a much less severe reaction condition, a much better guess for the missing initial conditions is needed in order for the problem to converge to the correct answer. I n fact, the guessed missing initial conditions have to be very near to the correct answer. Even then, over 20 to 50 iterations are needed to obtain the solution. Owing to the low accuracy of the analog computers, the problem with tt = 10 has not been solved by Lee [2]. This problem also has been solved by the functional gradient technique [8] and the results are summarized briefly in Appendix 11. Figures 5.3 and 5.4 should be compared with Fig. A 11.1. I n spite of the fact that a much better initial approximation is used in Fig. A 11.1, 45 iterations still are needed to obtain the optimum temperature profile. Furthermore, after 45 iterations, only two significant figures for the optimum values of x,(tf) and xz(tt) can be used with confidence. I n other words, the accuracy probably is 0.01 only. I n contrast, a probable accuracy of five significant figures has been obtained in Table 5.4. I n other words, the As has been values of eZ. and eZ2 are reduced to less than 0.1 x discussed in Chapter 1, eZ does not represent the accuracy of the results. It only represents the fact that no further improvement can be obtained with more iterations for the specified number of significant figures. I n previous chapters, restrictions have been used to confine the variables within reasonable range during the iteratiotls. This also has been tried for the previous numerical experiments by restricting x1 , x, , A, , and A, within reasonable ranges. However, this scheme does not work for the present problem. Since the reaction rate depends on temperature exponentially, the variable whose range should be restricted is temperature, not the concentrations or Lagrange multipliers. But, unfortunately, the temperature has been eliminated from the differential equations. T h e numerical procedure with the control variable T remaining in the differential equations will be discussed in Section 10. We shall see that a much larger interval of convergence can be obtained when the temperature is restricted to within a reasonable range.
5.
146
OPTIMIZATION
5. Back and Forth Integration
For many optimization problems such as those discussed in the past few sections, back and forth integration combined with a scheme for obtaining the value of the control variable can be used to obtain the numerical solutions. One advantage of this approach is that the numerical solution of algebraic equations is avoided. T o illustrate the procedure, consider the following system
i -h =jfi(x,z,t) dt
i = l , 2 ,...,M
(1)
with initial conditions Xi($)
=
i = 1, 2,...,M
q
(2)
The problem is to maximize a linear combination of the final values of the state variables of the system, that is, to maximize the quantity M
This problem will be solved by the maximum principle. The Hamiltonian function becomes
From the second equation of (5.7) of Appendix I, we get
The boundary conditions for Eq. ( 5 ) can be obtained from the transversality conditions. From (5.3) of Appendix I, we see that
Equation (3.3) of Appendix I becomes
6.
TWO CONSECUTIVE GASEOUS REACTIONS
147
Substituting ( 6 ) and (7) into (3.5) of Appendix I, we obtain the desired final conditions X i ( t f ) = -ci i = 1, 2, ...,M (8) With an assumed value for the control variable z(t), Eqs. (I), (2), (5), and (8) constitute a two-point boundary-value problem. However, since Eq. (1) is independent of the Lagrange multipliers, it can be solved with (2) as its initial condition, provided that the value of z ( t )is known. Thus, the following iterative procedure can be used to solve this optimization problem: (a) Assume a numerical function for the control variable z(t), t tt. (b) Equation (1) can now be integrated starting with the initial condition, Eq. (2). (c) Using the results in (b), Eq. ( 5 ) can be integrated backward starting with the final condition, Eq. (8). (d) With the newly obtained state variables and Lagrange multipliers, an improved numerical function for the control variable can be obtained by minimizing Eq. (4)with respect to z(t) for all t, to t t, . (e) Using this improved numerical function for the control variable, steps (b) to (d) can be repeated until no more improvement can be obtained. to
< <
< <
Equation (4)can be minimized by various search techniques. T h e Fibonacci search technique has been shown to be the optimal search routine for the search of one variable [9, lo]. However, if Eq. (4)has more than one minimum, Fibonacci search cannot be applied directly. The search techniques discussed in Chapter 4 can be used. For concrete illustration, the problem represented by Eqs. (1)-(3) has been considered. Obviously, this procedure can be applied to any optimization problem in which the conditions for the given set of differential equations are completely known at one terminal point. Instead of the maximum principle, the calculus of variations can be used. In that case, the minimization of Eq. (4)would be replaced by the solution of an algebraic equation. 6. Two Consecutive Gaseous Reactions
Consider the consecutive gaseous reactions [2] A+2B+C
148
5.
OPTIMIZATION
which are taking place in a tubular chemical reactor. T h e component B is the desired product. T h e first reaction is first order, and the desired product B transforms into C by a second-order reaction. T h e equations for the reactions are
where M is the mass flow rate (gm/min); z is the length parameter of the reactor (liters);?, ,p , are partial pressures of A and B, respectively (atm); x1 , x2 are the concentrations of A and B, respectively; and k, and k, are the rate constants of the first and second reactions, respectively. These rate constants are functions of temperature and are represented by Eq. (2.3). T h e equations in (2) can be expressed in terms of concentrations only. For ideal gases where Dalton's law is obeyed,
where P is total pressure (atm); N is the total number of moles; n, , n2 are the number of moles of A and B, respectively; and x3 is the concentration of C. Assuming that only components A and B are present at the entrance of the reactor, a material balance at position z along the reactor gives (x; - x,) 21( x 02 - x,) = x3 (5)
+
where xy and xi are the concentrations of components A and B , respectively, at the entrance of the reactor. Using Eqs. (3) to (5),the equations in (2) become
where A
=
2.9 + x:
(7)
t
=
z/M
(8)
7.
PRESSURE PROFILE IN TUBULAR REACTOR
149
The initial conditions are = x;
X,(O)
This problem will be considered in the remainder of this chapter under various assumptions. First, the optimum pressure profile will be obtained and then the optimum temperature profile with pressure as a parameter will be considered.
7. Optimum Pressure Profile in Tubular Reactor
As a second example, the optimum pressure profile for the system represented by Eqs. (6.6)-(6.9) will be obtained [ I l l . T h e same problem has been solved by a different technique [2]. The problem is to find a function P(t) such that the two functions, x l ( t ) and x2(t), given by Eqs. (6.6)-(6.9) maximize the final value x2(tf). The function x2at the final time, tf , obviously is the yield of component B over the total holding time t = tf of the reactor. T h e Euler-Lagrange equations, again, can be obtained by the equations given in Appendix I. The function to be maximized is
Equation (2.9) of Appendix I becomes F
A,
1
(-x;
-
+ 1
2k,PA x1 x2
The Euler-Lagrange equations are
P
= k , ~ ~ ( 2h ,XI)
~
A +x2 4k2X2xi
150
5. OPTIMIZATION
Substituting (4)into (6.6) and (3), we obtain the following differential equations:
These are four equations, but only two boundary conditions represented by (6.9). T h e other two boundary conditions can be obtained from the transversality condition. For the present problem, Eq. (3.3) of Appendix I becomes G
= %(tf)
(6)
Using Eq. (3.5) of Appendix I, we obtain U t f )= 0
(74
U t f )= 1
(7b)
Equations (6.9), ( 5 ) ) and (7) are to be solved by the quasilinearization procedure. These equations are nonlinear and are of the two-point boundary-value type. Using the recurrence relations listed in Section 17 of Chapter 2, the following linear differential equations can be obtained from Eq. ( 5 ) :
8.
NUMERICAL RESULTS
151
The second subscript n, which appears in all the variables xl, x, , A , , and A,, has been omitted in the above equations for simplicity. The variables with the second subscript n 1 are the unknown functions. The boundary conditions for Eq. (8) are
+
Xl.%+l(O)= d h,n+l(tf) = 0
Xz*n+1(0)= 4 h.n+l(tf)= 1
(9a) (9b)
Let ~ , + ~ (represent t) the four-dimensional state vector with components ~ ~ , , + ~ (~t ~) ,, , + ~ Al,,+l(t), (t), and A2,,+l(t). The general solution for the linear system represented by Eqs. (8) and (9), again, can be represented by the matrix equation (2.19). T h e solution of the original nonlinear system can be obtained by the procedure discussed in Chapter 3. 8. Numerical Results
The following numerical values are used [I 11: k, = 0.01035 gm-moles/liter-min-atm k2 = 0.04530 gm-moles/liter-min-atm2 R, = 2 cal/mole-"K t, = 8 liter-min/gm x: = 0.01 gm-moles/gm x i = 0.002 gm-moles/gm
A t = 0.01 A t = 0.1
for 0 < t < 1.0 for 1.0 < t < 8.0
5.
152
OPTIMIZATION
T h e initial approximations used are xl,o(t,)
= 0.01
xz,o(t,) = 0.01
Xl,o(t,) = 0.0
Xz*o(t,)
(2)
= 1.0
with k = 0,1, 2, ..., N . T h e following initial values are used in obtaining the particular and homogeneous solutions:
0.01I 0.010
z
0.007-
9
t
s 0.006z V W
8 0.005-
"""'0
1
17, 2 nd
2
4
3
I T E R A T I O N 7
5
6
7
t
FIG. 5.6. Approach
to optimum concentration profiles.
8
9.
TEMPERATURE PROFILE WITH PRESSURE AS PARAMETER
153
Instead of the above values, Eqs. (2.21) and (2.22) also can be used as the initial values for the particular and homogeneous solutions. It can be shown that the integration constants for the last two sets of homogeneous solutions are zero. Thus, only the first two sets of homogeneous solutions are needed in actual calculations. This problem is solved with the Runge-Kutta integration scheme. The convergence rates of concentrations x1 and x2 are shown in Fig. 5.6. The values of ey , for y = x1 , x2 , are reduced to less than 0.1 x in four iterations. The final values of xl(tt) and x2(tt) are 0.38643 x and 0.11320 x IO-l, respectively. T h e optimum pressure profile is listed in Table 5.6. The values of the two missing initial conditions, hl(0) and h,(O), are 0.82020 and 0.45619, respectively. TABLE 5.6 OPTIMUM PRESSURE PROFILE tk
0 0.05 0.1 0.2 0.4 0.6 0.8 1 .o 2.0 3.0 4.0 5.0 6.0
7.0 8.0
Pressure, atm
0.69268 0.56006 0.48650 0.40310 0.32245 0.28030 0.25327 0.23400 0.18326 0.15925 0.14440 0.13400 0.12614 0.11992 0.1 1483
This problem has been solved by using Pontryag-*i’s maximum principle and the generally used trail-and-error procedure for two-point boundary-value problems [2]. A much better guess for the initial values of hl,o(0) and h2,0(0)is needed in order for the problem to converge to the correct answer. I n fact, the guesses for Xl,o(0)and X2,0(0)have to be near to the correct answers. 9. Optimum Temperature Profile with Pressure as Parameter
Various generalizations can be mad6 for the optimization problem discussed in Sections 6-8. I n practical applications, frequently it is
5.
154
OPTIMIZATION
necessary to optimize the process with respect to not only the control variables, but also system parameters. Since the total pressure cannot be changed easily along the tubular reactor, we can take the total pressure as a system parameter and keep it constant throughout the chemical reactor. It is true that the pressure cannot be kept constant throughout the tubular reactor because of the pressure drop. We shall see later, however, that the pressure drop can be taken into account easily with essentially the same procedure. In order to optimize the profit with respect to the total pressure and at the same time keep this pressure constant, let us introduce the differential equation dP _ -0 dt
and consider P(t) as the third state variable together with x l ( t ) and x2(t). Now the problem is to find the optimum temperature profile T ( t ) and the optimum constant parameter value P. Obviously, this optimization problem can be solved in the same way as before, except for the presence of an additional equation (1). The unknown initial condition P(0) for Eq. (1) can be expressed in terms of other variables by using the transversality or free boundary condition, and its value will be determined in the course of the numerical solution. To illustrate the use of the quasilinearization procedure, let us consider a more general problem. Suppose the cost of providing a certain initial pressure P(0) is a function of this initial pressure and can be expressed as gdP(0)) (2) which is composed of, say, the power requirements and the materials needed for the reaction vessel to withstand such a pressure. The cost functions of components A, B, and C are A(xl(tt)), B(x2(tt)),and C(x3(tf)), respectively. For simplicity, we shall neglect all other operating costs. Our problem is to find the temperature T(t)as a function of t and the initial pressure P(0) such that the functions xl(t), x2(t), and P(t) given by Eqs. (6.6),(6.9), and (1) maximize the following return function:
J
= A(-&))
+ W Z ( t f ) ) + C(X3(tf>>- gdP(0))
(3)
For concrete illustration, let us assume the following forms for the cost functions in Eq. (3): &(tf))
= bl%(tf)
B(xz(tf))= b Z X Z ( t f )
g,(P(O)) = b3 eXP(Pa - p(0)Y
C(Mf)) = 0 P(0) < p a
(4) (5)
9.
TEMPERATURE PROFILE W I T H PRESSURE AS PARAMETER
155
The constants b, and b, can be considered as the values of x1 and x, , respectively; and b, is the minimum cost for providing the pressure to produce (b, + b,) dollars worth of x1 and x, . T h e minimum cost, b,, of the pressure is obtained when P(0) = Pa.T h e pressure Pais known and can be considered as the atmospheric pressure plus pressure drop through the reactor. Now Eq. (3) becomes
J
=
blXl(tf)
+ bzxz(t,)
- b3
exp(Pu - p(o))z
(6)
The variational equations for the above problem can be obtained from the equations listed in Appendix I. Equations (2.9) and (3.3) of Appendix I become F
= A1
i-x;
-
2k1P
+ 1
A
x1 x2
+ A, (-x; + 4k1P A +xZ 4kzP2 ( A +x1xz)z ) -A3P' blXl(tf) + bzxz(tf) - exp(Pu - P(0))' X1
~
-
(7)
(8) Note that T ( t )is the control variable and P ( t ) is considered as the third state variable. T h e Euler-Lagrange equations are G
b3
dA1--
dt
A A 2 k 1 P 2 -4 k 1 P A A +xz A x2
_ 'A' - -2k1P dt
+
A,Xl
( A I- X 2 Y
(94
+ 4k1P ( A"" + x2)2
T h e unknown boundary conditions can be obtained by using the transversality condition. From Eqs. (3.4) and (3.5) of Appendix I we see that the unknown end conditions are A3(0) = -2b,(Pu - P(0))exp(Pu - P(0))z
(11)
(124 (12b) A3(tf) = 0 (124 T h e problem is to find the seven unknowns, xl,x 2 , P,A,, A,, A,, and T , by solving the seven equations represented by Eqs. (6.6), (I), (9), Al(tf) = bl
U t f ) = b,
5.
156
OPTIMIZATION
and (10). Six of these equations are differential equations with six boundary conditions represented by Eqs. (6.9),(1 l), and (12). They are nonlinear differential equations of the boundary-value type. Using the recurrence relations of the quasilinearization technique, we can obtain the following sequence of linear differential equations: dxl.n+l - 2-K
dt
1 -
l A + X 2
(PXl
- P-
XIX,
A
+
x2
9.
TEMPERATURE PROFILE WITH PRESSURE AS PARAMETER
+ 2 (-klxl + 2k2P A 4 ) +x2
157
h2..+1]
Following our usual practice, we have omitted the subscript n in xl, x2,
A1 ,A, , A, ,and P in the above equations for simplicity. It is understood 1. that the unknown variables are the variables with subscript n All other variables are known and are calculated from the previous
+
nth iteration. The boundary conditions for (13) are Xl,n+l(O)
=
x2,n+1(0)
=
4 4
x3.n+1(0)
=
-2b3(PU
hl,n+l(tf)
= bl
hz*n+l(td
= b2
x3.n+l(tf)
=0
- ‘?&+l(O))
exp(PU
- Pa+1(o))2
(14)
The control variable T(t) can be obtained from Eq. (10):
Although the control variable T could have been eliminated from Eqs. (6.6) and (9) by using Eq. (15), we have not done so. As discussed in Section 4, it is often advantageous to leave the temperature in the differential equations so that the temperature profile can be kept within a reasonable range during iterations. The equations in (13) are linear equations. Their general solution must consist of one set of particular and six sets of homogeneous solutions. This general solution can be represented by the matrix equation &a+&) = Xdn+ldt) Xh(n+l)(t) %+l (16)
+
5.
158
OPTIMIZATION
T h e vector x,+,(t) represents the state vector with components ~ ~ , , + ~ ( t ) . %,,+1(t), P,+1(t),4,,+1(t), 4,,+1(t), and &,,+1(t). T h e particular solution vector xrp(,+,)and the integration constant vector a, are defined similarly. T h e homogeneous solution matrix is
+
T h e second subscript n 1 has been omitted from all the elements of the above matrix. T h e following initial values are used in obtaining the particular and homogeneous solutions:
0 0 0 0 0 1
0 0 0 0 1 0
0 0 0 1 0 0
0 0 1 0 0 0
0 1 0 0 0 0
1 0 0 0 0 0
These initial values are chosen arbitrarily, but with the two known initial conditions given by the first two equations of (14) in mind. I t can be shown from these known initial conditions and Eq. (16) that the integration constants and a,,,,, for the last two sets of homogeneous solutions are equal to zero. Thus, only four sets of homogeneous solutions are needed. Once the one set of particular and four sets of homogeneous solutions are obtained by numerical integration, the four integration constants can be obtained from Eq. (16). Since the third boundary condition in (14) is nonlinear, the resulting algebraic equations from (16) are also nonlinear and cannot be solved by matrix inversion. Assuming that all
9.
TEMPERATURE PROFILE WITH PRESSURE AS PARAMETER
159
the particular and homogeneous solutions are known, we can obtain these four integration constants in the following manner. Substituting Eqs. (18) and (19) into the third and last equations of (16) at t = 0, we obtain f'n+I(O)
=
1
+
u4.n+l
'3,n+1(0) = ul,n+l
Substituting these equations into the third boundary condition of (14)) we get
An expression for u4,n+lin terms of ul,n+l can be obtained from the last three equations of (16) at t = tf . Substituting (20a) into this expression, we obtain the desired expressions.
where
(21)
+
Again, the second subscript n 1 is omitted from the variables on the right-hand sides of Eqs. (20) and (21). T h e only unknowns in the above
5.
160
OPTIMIZATION
equations are the integration constants a,,n+, to l ~ 4 , ~ + 1Note . that u4,n+l appears implicitly in Eq. (20b). Some trial-and-error procedure are used to solve this equation. I n order to ensure convergence, the method of successive substitutions or simple iterations, and the NewtonRaphson method are used alternately to solve Eq. (20b). I n general, five iterations are allowed first for the Newton-Raphson method. If the desired convergence is not reached, five iterations by successive substitutions are allowed next. T h e two methods are used alternately until the improvement in the value of u4,n+l between successive iterations is reduced to the following value:
where the superscript m indicates the mth iteration in solving (20b). T h e Newton-Raphson method has been discussed in Section 6 of Chapter 2. The method of successive substitutions is very simple [12]. Substituting an assumed value for into the right-hand side of (20b), we can obtain an improved value UA;L+~. Substituting this improved value into (20b) again, we get a further improved value. This procedure can be continued. T o start the iterations in solving Eqs. (20) and (21), the following initial value is used: (m=O)
'4.n+l
=
o*l
(23)
With the assumed value (23), it has been found that if the first method, say, successive substitution, does not converge in five iterations, the second method will converge to the desired accuracy in about two to three iterations for the numerical results discussed in this work. 10. Numerical Results and Procedures
The problem formulated in the preceding section is solved with the following numerical values [161: 0.2 x log gm-moles/liter-min-atm = 0.63 x lOla gm-moles/liter-min-atm2 = 0.18 x lo5 cal/mole = 0.3 x lo5 cal/mole = 2 cal/mole-"K t , = 8 liter-min/gm A t = 0.025 0 < t < 1.0
G, G, El E, R,
=
10.
NUMERICAL RESULTS AND PROCEDURES
161
1.0 < t < 8.0 0.1 b, = 0.1 b, = 1.0 b, = 0.001 Pa = 1.5 atm x! = 0.01 gm-moles/gm At
=
Except for P, the given boundary conditions are chosen as the initial approximations:
with k
=
0, 1, 2,..., N a n d A t
A. ESTIMATION OF
THE
=
tk+l
-
tk.
TEMPERATURE
I n order to test a procedure which is different from that used in Section 3, the control variable T has not been eliminated from the differential equations. From previous experiences one learns that the problem most probably will not converge with the above initial approximations unless the temperature is restricted to a certain range during the iterations. Owing to the exponential dependence of the reaction on the temperature, this range is fairly small and cannot be assumed from the initial knowledge concerning the process. This range has been obtained by the following numerical procedure with (2) as the initial approximations. (a) A constant numerical function is assumed arbitrarily for the control variable Tn=o(tk)= T , , k = 0, 1, 2,..., N . (b) A range T,,, 3 Tn(tk)3 Tminis assumed for T , . (c) T h e values for the (n 1)st iteration x,,,+, , x,,,+, , P,+, , A,,+, , and A,,+, are obtained from the known nth iteration as follows: A set of particular and four sets of homogeneous solutions are obtained first with the equations in (9.13) and the initial conditions, (9.18) and (9.19). Then the integration constants a,,,+, to a4,,+, are obtained by
+
162
5. OPTIMIZATION
using Eqs. (9.20), (9.21), and (9.23) with (9.22) as the required accuracy. Finally, these results are combined by Eq. (9.16). (d) Step (c) is repeated m times with the same fixed value Tn(tk). (e) An improved Tn+m(tk)is obtained from Eq. (9.15). (f) This improved Tnfm(tk)is set to within the range specified in step (b). (g) Steps (c) to ( f ) are repeated once more. If the obtained values of T(tk)are always against T,,, , the allowed range is moved to the next higher interval. I n other words, the new Tminis set equal to the old T,,, and the new T,,, equal to the old T,,, plus the allowed range of the control variable. However, the allowed range of T is moved to the next lower interval if the obtained values of T(tk)in steps (c) to (f) are always against T,, . (h) Steps (c) to (g) are repeated until the calculated T(t,) is not always against T,,,,, or Tmin. If the allowed range or interval [T,,, , Tmin]is too large, the above procedure may not work and the calculated T(tk)may oscillate between T,,, and Tmin.Thus, this interval must be reasonably small. A value of 10°K has been used for this allowed interval and no oscillatory problem has been encountered. Since the convergence rate of the quasilinearization procedure is fast, generally, step (c) is repeated only three times, or m = 3. As can be seen from the previous chapters, reasonably accurate results can be obtained in three iterations. Obviously, instead of specifying m, the number of iterations also can be determined by the computer with a specified ey , y = xl,xz , xg , A,, A,, and A , . Here ey represents the improvements between successive iterations and has been defined in Chapter 1. The approximate temperature for the problem with numerical values listed in Eqs. (1) and (2) has been obtained by the above procedure with xt = 0.008. The following constant value has been assumed as the initial approximation of the control variable. To(t,) = 370
k
= 0,1, 2
,...,N
(3)
with T,,, = 375, Tmin= 365, and m = 3. The interval [T,,, , T,,] has been lowered twice by the computer and the final values obtained = 355 and Tmin= 345 with the last part of the temperature are T,, profile against Tmin, The above procedure is essentially a search procedure in which the interval of interest of the temperature is searched in a segment-bysegment fashion. Each segment represents an interval [ T m a x ,Tmin].
10.
163
NUMERICAL RESULTS AND PROCEDURES
B. NUMERICAL PROCEDURE I Now, the temperature can be restricted to within the following range during the iterations: Tmin
< Tn(tlc) < Tmax
= 0,
1, Z..., N
(4)
where Tminand T,,, are estimated from the results obtained in A. With the restrictions (4),the problem can be solved by two different numerical procedures depending on whether the initial temperature To(tk) is calculated explicitly from Eq. (9.15) with assumed initial approximations for the state variables and Lagrange multipliers or is assumed arbitrarily within the range of (4).T h e former or the explicit procedure can be summarized as follows by using the initial approximations (2): (a) T h e control variable TO(tk), k = 0, 1, 2, ..., N , is obtained from Eq. (9.15) with the initial approximations (2). (b) T h e values of TO(tk)are set to within the range listed in (4). (c) Same as step (c) in Section 10,A. (d) An improved Tn+l(tk)is obtained from Eq. (9.15) with the results obtained in (c). (e) This improved Tn+l(tk)is set to within the range listed in (4). (f) Steps (c) to (e) are repeated until the desired accuracies for the control and state variables and Lagrange multipliers are obtained. TABLE 5.7 CONVERGENCE RATESWITH PROCEDURE I AND x i Iteration
P(0)
h,(O)
0 1 2 3 4 5 6 7 8 9 10 11 12
1.o 0.6137 0.5908 0.7704 0.9733 1.080 1.140 1.164 1.177 1.182 1.184 1.185 1.185
0.1 0.5345 0.7138 0.7274 0.7130 0.7044 0.6985 0.6969 0.6959 0.6956 0.6954 0.6953 0.6954
A,(O) 1.o 0.7184 0.4542 0.4628 0.473 1 0.4700 0.4755 0.4761 0.4774 0.4777 0.4779 0.4780 0.4780
=
0.005
UO)
T(O)
T(t,)
0.0 -0.003889 -0.004156 -0.002485 -0.001 390 -0.001000 -0.000819 -0.000752 -0.0007 17 -0.000705 -0.000699 -0.000697 -0.000696
360.0 360.0 360.00 360.00 360.00 358.14 358.24 358.00 358.01 357.98 357.98 357.98 357.98
360.0 360.0 352.67 346.47 344.25 343.18 342.58 342.33 342.21 342.17 342.15 342.14 342.14
J
0.006253 0.009507 0.010383 0.010455 0.010442 0.010448 0.010449 0.010449 0.010449 0.0 10449 0.010449 0.010449
5.
164
OPTIMIZATION
T h e results listed in Table 5.7 are obtained in this manner with the numerical values listed in (1) and (2) and X:
= 0.005
T,,,
=
360
(5)
Tmin= 335
T h e convergence rates of the missing initial conditions and T at t = 0 and t = tf are shown in Table 5.7. T h e values of the profit function J as defined by Eq. (9.6) also are tabulated. T h e convergence rates of the temperature and concentration profiles are shown in Figs. 5.7 and 5.8. Notice that the values of T ( t J are against T,,, for both the initial approximation and the first iteration. T h e missing final conditions obtained are x,(tf) = 0.005344 and x,(tt) = 0.01 102. A numerical experiment with the same numerical values and procedures without restrictions on the temperature also has been carried out. No convergence has been obtained in this case. Since the initial approximations (2) are very poor, this result is expected from the calculations in Section 3. I
I INITIAL, 1 ST ITERATION
354-
352 Y
w-350
s
-
s
5 340 3 I346
-
344 -
342 -
t
FIG. 5.7. Convergence rate of temperature with procedure I.
10.
0.004i
FIG. 5.8.
165
NUMERICAL RESULTS AND PROCEDURES
~
1
2
3
t
4
5
6
7
1
Convergence rates of concentrations with procedure I.
The profiles with different values for the initial concentration xz(0) also are obtained and are shown in Figs. 5.9 and 5.10. For xt = 0.01, 0.008,0.006, and 0.004, the maximum profit functions are J = 0.013326, 0.012085, 0.010965, and 0.009960, respectively; and the optimum constant pressures are P = 1.196,-1.184, 1.182, and 1.191, respectively. The accuracies and convergence rates obtained are approximately the same as that shown in Table 5.7.
C. NUMERICAL PROCEDURE I1 With (2) as the initial approximations, this procedure can be summarized as follows: (a) T h e control variable TO(tk),K = 0, 1, 2,..., N , is assumed arbitrarily within the range given by (4). (b) Same step as (c) in Section 10,A. (c) Step (b) is repeated m times with the same fixed value Tn(tk). (d) An improved T.+%(tk)is obtained from Eq. (9.15) with the results obtained in (c). is set to within the range given by (4). (e) This improved Tn+m(tk)
5.
166
OPTIMIZATION
=@
3400
1
2
3
4
5
0
7
6
t
FIG. 5.9. Optimum temperature profiles.
(f) Steps (b) to (e) are repeated until desired accuracies for the control and state variabIes and Lagrange multipliers are obtained. Since the temperature is evaluated every mth iteration only, this procedure may be more suitable when Eq. (9.10) is complex or when the maximum principle is used. This procedure is essentially the same as that listed in Section 10,A except that T,, or T,, cannot be changed during the iterations. The results listed in Table 5.8 are obtained by this procedure with the numerical values listed in (I), (2), and (9,and TO(tk)= 350
T,
= 365
K
= 0, 1,2,.,., N
(6)
As can be seen from the table, three iterations have 'been allowed, or m = 3, before the temperature is first evaluated. Two iterations have
10.
167
NUMERICAL RESULTS AND PROCEDURES
1
0.0040
1
2
3
4
5
6
7
0
t
FIG. 5.10. Optimum concentration profiles.
TABLE 5.8 CONVERGENCE RATESWITH PROCEDURE I1 AND x:
0 1 2 3 4 5 6 7 8 9 10 11 12
1.o 0.8962 1.001 1.010 1.018 1.008 1.123 1.148 1.172 1.178 1.183 1.184 1.185
0.1 0.6004 0.6998 0.6915 0.7110 0.7113 0.6995 0.6984 0.6961 0.6959 0.6955 0.6954 0.6954
1.o 0.5831 0.4858 0.4836 0.4462 0.4526 0.4794 0.4734 0.4777 0.4773 0.4779 0.4779 0.4780
0.0 -0.001739 -0.001 279 -0.001247 -0.001217 -0.001252 -0.000868 -0.000797 -0.000730 -0.000713 -0.000701 -0.000698 -0.000696
350.0 350.0 350.0 362.40 362.40 356.29 358.78 357.83 358.09 357.97 357.99 357.98 357.98
=
0.005
350.0 350.0 350.0 344.78 344.78 343.96 342.80 342.49 342.27 342.20 342.16 342.15 342.14
0.009431 0.010396 0.010293 0.0 10400 0.010398 0.010431 0.010450 0.010449 0.010449 0.010449 0.010449 0.010449
5.
168
OPTIMIZATION
been allowed, or m = 2, for the second evaluation of temperature. Thereafter, the temperature is evaluated every iteration, or m = 1. From the first three iterations, it can be seen that the convergence rates are very fast with a fixed temperature. It is interesting to compare Table 5.7 with Table 5.8. Approximately the same convergence rates have been obtained for these two procedures. I n general, procedure I is more suitable when fairly good initial approximations for the state variables and Lagrange multipliers are available. T h e convergence rates of the temperature and concentration profiles are shown in Figs. 5.11 and 5.12. These figures should be compared with Figs. 5.7 and 5.8. T h e results shown in Figs. 5.9 and 5.10 also are obtained by procedure 11.
D. MAXIMUM PROFITAS
A
FUNCTION OF PRESSURE
T o prove that the optimum pressure obtained is indeed optimum, the above problem is solved with known and fixed values of pressure.
a=:
362
0.005
360 358
356
. W
9
354 352
I-
< a
INITIAI
350
t
FIG. 5.11.
Convergence rate of temperature with procedure 11.
10. 0.01 2 0.011
z,aoio
169
NUMERICAL RESULTS AND PROCEDURES
t --
= 0.005
x;
XI
x2
INITIAL
a0040
1
2
4
3
5
6
1
8
t
FIG. 5.12. Convergence rates of concentrations with procedure 11.
Now the problem is to find the temperature profile T ( t ) such that the functions xl(t) and x2( t ) given by Eqs. (6.6)-(6.9) maximize the expression in Eq. (9.6). Since P is considered as a constant, Eqs. (9.1) and (9.9~)
1.33 1.32
.
8 - 1.31 -J
b- 1.30 Ir.
0
az
n
1.29 1.28 1 .27
’
0.6
0.8
1.0 1.2 PRESSURE, ATM
1.4
FIG.5.13. Profit as a function of pressure.
5.
170
OPTIMIZATION
are no longer needed. The boundary conditions also are simplified and Eqs. (9.11) and (9.12~)are no longer needed. The four differential equations represented by (6.6), (9.9a), and (9.9b) can be linearized by the generalized Newton-Raphson formula. These linear equations together with the algebraic equation (9.10) can be solved by the same procedures discussed in this section. However, since all the boundary conditions are linear, the integration constants can be obtained by solving a set of linear algebraic equations and Eqs. (20) and (21) do not hold in the present case. T h e results for xi = 0.01 are shown in Fig. 5.13. It can be seen that the optimum pressure, which is 1.196, indeed produces the maximum profit. T h e curve in this figure is constructed by obtaining the optimum temperature profiles at P = 0.6, 0.8, 1.0, 1.1, 1.3, 1.4, and 1.5. T h e Runge-Kutta integration scheme has been used to obtain the particular and homogeneous solutions in all the numerical experiments discussed in this section. 11. Calculus of Variations with Control Variable Inequality Constraint
Let us add the following inequality constraint to the problem treated in the preceding section:
< 350°K
T(tk)
k
= 0,
1, 2 ,..., N
(1)
As discussed in Appendix I, this problem also can be treated by the above procedures numerically. Since Eq. (1) does not involve the state variables, the Euler-Lagrange equations remain the same as that given in (9.9) except that the equation for the control variable, (9.10) or (9.15), does not always hold. Whenever the temperature is higher than 350, Eq. (1) with the equality sign, not Eq. (9.10), is used to obtain T. The optimum temperature profile and the optimum constant pressure are obtained for this problem with the numerical values listed in Eqs. (10.l), (10.2), and (10.5), except that T,,, = 350 instead of the value given in (10.5) has been used. T h e values of T,,, and Tminhave been referred to as restrictions in the previous sections to distinguish them from the constraints used in optimization problems. Note that restrictions are imposed temporarily and they are used to ensure numerical stability during the calculations. I n the present case, the upper restriction T,,, is replaced by the constraint (1). T h e results for xi = 0.005 are shown in Fig. 5.14. T h e results without temperature constraint obtained in Section 10 are also shown.
12.
CALCULUS OF VARIATIONS WITH PRESSURE DROP
CONSTRAINT
--WITH
171
-
-
0
1
2
3
4
5
6
7
1
1
t
FIG. 5.14. Influence of constraint on optimum profiles.
The optimum constant pressure and the maximum profit are 1.185 and 0.010449, respectively, without the constraint; and 1.239 and 0.010431, respectively, with the constraint. Since generally it is impractical to produce the rapid decrease in temperature in the first part of the reactor, these results furnish an interesting comparison. The missing initial conditions obtained for the Lagrange multipliers are h,(O) = 0.6867, h,(O) = 0.4934, and h3(0)= -0.000560; and the missing final conditions are x ,(tj) = 0.005439 and xz( t t ) = 0.01096. The convergence rate of temperature is shown in Fig. 5.15. 12. Calculus of Variations with Pressure Drop in the Reactor
In tubular or packed bed reactors, pressure drop is always present across the reactor. Generally it is impossible to control this pressure
5.
172
OPTIMIZATION
I 350
I INITIAL
1 ST. ITERATION
(CONSTRAINT
348 r
346
342
340
L 2
4
6
0
t
FIG. 5.15. Convergence rate of temperature with procedure I.
drop. However, the initial pressure always can be controlled and optimized. The problem in this section is to find the optimum initial pressure and the optimum temperature profile simultaneously. For simplicity, let us assume a constant pressure drop throughout the reactor:
This problem is the same as the one discussed in Section 9 except that instead of Eq. (9.1), Eq. (I) is used. Since Pd is a constant value and is known, the equations formulated in Section 9 remain the same. With !x = 0.005 and P d = -0.05, the problem solved in Section 10, B is solved here with Eq. (1) replacing Eq. (9.13c), and with the numerical values given by Eqs. (lO.l), (10.2), and (10.5). T h e results are shown in Fig. 5.16 and the convergence rate of temperature is shown in Fig. 5.17. It is interesting to compare Fig. 5.17 with Fig. 5.7 or 5.11. Notice that the temperature profile decreases at first and then increases in the last part of the reactor. T h e maximum profit obtained is 0.0106115 and the optimum initial pressure is P(0) = 1.095. The other missing initial conditions are X,(O) = 0.7145, X,(O) = 0.4815, and h3(0) = -0.000954. The missing final conditions are x , ( t f ) = 0.005201 and x,(tf) = 0.01127. Instead of assuming a constant rate for the pressure drop, the momentum balance and experimental correlations can be used to obtain
12.
CALCULUS OF VARIATIONS W I T H PRESSURE DROP
173
-1.1
x2
// 1
1.o
x~=OM xq-0.005 I
0
1
2
3
4 t
5
6
*0.5
7
FIG. 5.16. Influence of pressure drop on optimum profiles.
the actual pressure drop. For packed bed reactors, it is known that the pressure drop is proportional to the properties of the packing material and the properties of the fluid. Since the fluid properties are functions 1
I 0
I
-
I
I
I
I
2
4
6
8
FIG.5.17. Convergence rate of temperature, procedure I with pressure drop.
5.
174
OPTIMIZATION
of fluid temperature T , fluid pressure P, and fluid composition x1 and x 2 , the pressure drop equation is dP dt
- = f ( P , T , x1 , x 2 , packing)
The procedure for finding the optimum with this equation is essentially the same as that used above except that the equations for the Lagrange multipliers are more complicated. The exact form of Eq. (2) has been discussed by Ergun [13] and in standard textbooks on chemical reactor design. 13. Pontryagin’s Maximum Principle
The same problem which has been solved in Section 10 by the calculus of variations is solved by the maximum principle. The Hamiltonian
function can be obtained by substituting Eqs. (6.6) and (9.1) into (5.6) of Appendix I:
The other equations remain the same. However, the function F as defined in Eq. (9.7) is different from Eq. (2.9) or (5.3) of Appendix I. From Eq. (9.7), the boundary conditions (9.11) and (9.12) are obtained. However, if F were defined the same way as in Appendix I, the following boundary conditions would have been obtained: X,(O)
=
2b,(Pu - P(0))exp(P, - P(0))z Xl(tf) = --b
(2)
(34
Comparing these equations with Eqs. (9.11) and (9.12), we see that if the above equations are multiplied by -1, Eqs. (9.11) and (9.12) are obtained. The Euler-Lagrange equations are not influenced by these differences. I n the calculations of previous sections of this chapter, only a stationary point has been obtained and thus the signs of the boundary conditions, Eqs. (9.11) and (9.12), are not important as long as the function F is defined in the same way for all the state variable equations. However, this sign influences the results of the maximum principle. It can be shown that with F defined by (9.7), the function H must be
15.
OPTIMUM FEED CONDITIONS
175
maximized if a maximum of J is desired. Both definitions of F are used in the literature on maximum principle. The problem is to find a constant pressure P and a temperature profile T ( t ) such that the functions xl, x, , P,A , , A , , and A, given by Eqs. (6.6), (9.1), and (9.9) with boundary conditions (6.9), (9.11), and t 5 t f . The only difference (9.12) maximize Eq. (1) for all t, 0 between the present problem and that in Section 10 is that the algebraic equation (9.10) is replaced by maximizing Eq. (1). As noted in Appendix I, the maximization of Eq. (1) is a much stronger necessary condition than Eq. (9.10). The problem can be solved by the same procedure as that listed in Section 10,C. However, instead of solving an algebraic equation, now we must find the value of T ( t )that maximizes Eq. (1) at each point of t . Thus only step (d) needs to be modified. T h e Fibonacci search procedure has been used to obtain the maximum of (1) [9, 101. The random search technique discussed in Section 9 of Chapter 4 also has been used. The results presented in Figs. 5.9-5.12 also are obtained by the maximum principle. Since the procedures and equations are the same as those discussed in Section 10,C except that the solution of an algebraic equation is replaced by a search routine at each point of the profile, the results and convergence rates are completely the same as those discussed in Section 10. However, the computation time needed for each iteration is approximately doubled owing to the use of the search procedure.
<
14. Discussion
The convergence rates for the numerical experiments in Sections 10-13 are slower than those in earlier sections. This is caused by the presence of the control variable, T ( t ) , in the differential equations. I n order to retain quadratic convergence, this control variable must be eliminated from the equations. It seems advantageous to solve the problem in two steps. First, a set of fairly good initial approximations can be obtained with the procedure discussed in Section I0,A. Then, the control variable is eliminated from the differential equations and the usual quasilinearization procedure is used with the initial approximations obtained in the first step. 15. Optimum Feed Conditions
The idea of obtaining optimum initial pressure and optimum temperature profile simultaneously can be generalized further. The feed
176
5.
OPTIMIZATION
conditions to the reactor, xy and xi, also can be optimized in the same manner. Suppose that the cost of obtaining a certain feed composition is gl(xy, xi), which may be considered as the purification cost. The term (-gl(xy, xi)) can be added to the function, Eq. (9.6), to be maximized. I n this way, the operating cost for obtaining a certain feed purity also is optimized simultaneously.
16. Partial Derivative Evaluation
When the differential equations are complex, there are other problems involved besides the problem of ill-conditioning and that of getting a sufficiently good initial approximation. One of these is the very tedious differentiation procedure of obtaining the partial derivatives in establishing the recurrence relations. I n order to retain the feature of quadratic convergence, the partial derivatives in matrix (17.10) of Chapter 2 must be determined accurately. Consequently, it is preferable to obtain the expressions for the partial derivatives rather than to approximate these partial derivatives by difference expressions. As has been shown in previous sections, even for such fairly simple differential equations as (2.14) or (7.5), the resulting recurrence relations are quite complex. It is not difficult to imagine the work involved in obtaining partial derivatives for a set of more complex differential equations. Recently, Wengert [14, 151 has suggested a technique for computer evaluation of the partial derivatives. This technique requires only the algebraic expressions of the functions to be differentiated. T h e computer will do the differentiation and will give the numerical results of the partial derivatives directly. It is based on the chain rule of differentiation and it uses the elementary formulas of differentiation. This technique has been shown to be both fairly accurate and easy to apply [15]. Wengert’s method appears to be quite useful in eliminating the laborious work of obtaining analytical expressions for the partial derivatives in the quasilinearization procedure.
17. Conclusions
T h e aim of this chapter has been to demonstrate the usefulness of the quasilinearization technique in overcoming the boundary-value difficulties encountered in optimization. T h e advantage of this approach lies in its rapid rate of convergence, provided that the initial approximations are within the interval of convergence of the problem. This interval
REFERENCES
177
is reasonably large for a number of problems. Furthermore, this interval can be enlarged by using various devices or methods. T h e use of restrictions on the most important variable or variables during iterations has been shown to be an effective tool in enlarging this interval. Other useful devices will be discussed in connection with invariant imbedding in Chapter 7. For illustrative purposes, only a few fairly simple optimization problems have been considered. Obviously the quasilinearization technique also can be applied to more complex optimization problems. In addition, it can be combined with other optimization techniques such as dynamic programming or nonlinear programming to optimize various topologically complex processes encountered in the chemical industry. More examples on the application of the quasilinearization technique to optimization problems can be found in the literature [17-211. REFERENCES
1. Bellman, R., “Dynamic Programming.” Princeton Univ. Press, Princeton, New Jersey, 1957. 2. Lee, E. S., Optimization by Pontryagin’s maximum principle on the analog computer. A.1.Ch.E. J . 10, 309 (1964). 3. Bilous, O., and Amundson, N. R., Optimum temperature gradients in tubular reactors. Chem. Eng. Sci. 5 , 81, 115 (1956). 4. Aris, R., Studies in optimization. 11. Optimum temperature gradients in tubular reactors. Chem. Eng. Sci. 13, 18 (1960). 5 . Aris, R., “The Optimal Design of Chemical Reactors.” Academic Press, New York, 1961. 6. Denn, M. M., and Aris, R., Green’s functions and optimal systems. Ind. Eng. Chem. Fundamentals 4, 7, 213, 248 (1965). 7. Fan, L. T., “The Continuous Maximum Principle.” Wiley, New York, 1966. 8. Lee, E. S., Optimization by a gradient technique. Ind. Eng. Chem. Fundamentals 3, 373 (1964). 9. Bellman, R., and Dreyfus, S., “Applied Dynamic Programming.” Princeton Univ. Press, Princeton, New Jersey, 1962. 10. Wilde, D. J., “Optimum Seeking Methods.” Prentice-Hall, Englewood Cliffs, New Jersey, 1964. 11. Lee, E. S., Quasilinearization, nonlinear boundary-value problems, and optimization. Chem. Eng. Sci. 21, 183 (1966). 12. Hildebrand, F. B., “Introduction to Numerical Analysis.” McGraw-Hill, New York, 1956. 13. Ergun, S., Fluid flow through packed column. Chem. Eng. Progr. 48, 89 (1952). 14. Wengert, R. E., A simple automatic derivative evaluation program. Commun. A C M 7, 463 (1964). 15. Wilkins, R. D., Investigation of a new analytical method for numerical derivative evaluation. Commun. ACM 7, 465 (1964). 16. Lee E. S., Quasilinearization in optimization. A numerical study. A.l.Ch.E. 59th Ann. Meeting, Detroit, Michigan, December 4-8, 1966.
178
5.
OPTIMIZATION
17. Bellman, R., Kagiwada, H., and Kalaba, R., A computational procedure for optimal Natl. Acad. Sci. US.48, 1524 (1962). system design and utilization. PYOC. 18. McGill, R., and Kenneth, P., Solution of variational problems by means of a generalized Newton-Raphson operator. A I A A J. 2, 1761 (1964). 19. Kopp, R. E., McGill, R., Moyer, H. G., andpinkham, G., Several trajectoryoptimization techniques, in “Computing Methods in Optimization Problems” (Balakrishnan, A. V., and Neustadt, L. W., eds). Academic Press, New York, 1964. 20. McGill, R., Optimal control, inequality state constraints, and the generalized Newton-Raphson algorithm, J. SOC.Ind. Appl. Math. Control 3, 291 (1965). 21. Schley, C. H., and Lee, I., Optimal control computation by the Newton-Raphson method and the Riccati transformation, presented at Joint Automatic Control Conf., Seattle, Washington, August 17-19, 1966.
Chapter 6
INVARIANT IMBEDDING
1. Introduction
I n previous chapters, the quasilinearization technique has been used to solve nonlinear boundary-value problems arising from various chemical engineering applications. I n this chapter, a completely different approach will be introduced for solving boundary-value problems. The invariance principles, now known as invariant imbedding, have been introduced in the study of transport phenomena by Ambarzumian [I, 21. Chandrasekhar [3] has used this concept to treat problems in radiative transfer. These principles have been studied extensively by Bellman, Kalaba, Wing, and co-workers. These authors have used the invariance principles in the study of neutron transport theory [4-191, radiative transfer [5, 8, 20-241, random walk and scattering [5, 25, 261, and wave propagation [27-291. Recently, rarefied gas dynamics [30, 311 and Hamilton’s equation of motion [32, 331 also have been treated by these principles. Others, notably Preisendorfer, Redheffer, and Ueno, also have made contributions in employing these principles [3442]. These subjects will not be dealt with here. Those interested can consult the above references, especially Wing [4] and Bellman et al. [5], where a more complete bibliography prior to 1962 can be found. This work will concentrate on the numerical aspects of this approach, where it has been proven useful in treating boundary-value problems [43-471, eigenvalue problems [48,49], and nonlinear filtering theory [50, 511. Throughout this discussion, the basic concept of the invariant imbedding approach will be emphasized, for it is the difference between this concept and the usual or classical one that makes the invariant imbedding idea useful, and frequently gives new insights to the same problems treated by the usual approach. T h e discussions will be completely formal. More rigorous derivations can be found in the literature (see, especially, Bailey [34]). Only systems represented by differential 179
6.
180
INVARIANT IMBEDDING
equations will be considered. Problems with integrodifferential equations will not be discussed. Although only the numerical aspects of this approach will be considered, the invariant imbedding equations also possess certain analytic advantages over the usual or classical formulations [5, 52, 531. 2. The Invariant Imbedding Approach
To illustrate the invariant imbedding approach, consider the nonlinear two-point boundary-value problem
with boundary conditions
x(0)
=c
Y(t,)
=0
(2b)
< <
with 0 t tf . In order to avoid the various computational difficulties in solving the above boundary-value problem, we shall convert it into an initial-value problem. I n other words, the missing initial condition y(0) will be obtained by using the invariant imbedding concept. T o do this, consider the problem with the more general boundary conditions =c
(34
Y ( t f )= 0
(3b)
x(u)
< <
where a t tf and a is the starting value of the independent variable t . However, it should be kept in mind that a also controls the duration of the process. If a assumes different values from zero to t i , say a = 0, A , 24,..., then there will be a family of problems. Each member of this family has a different starting value of a and is represented by Eqs. (1) and ( 3 ) . Let us consider obtaining the missing initial conditions y ( a ) for this family of problems. T h e idea is that neighboring processes are related to each other. It may be possible to obtain the missing initial condition for the original problem y ( 0 ) by examining the relationships between the neighboring processes. Notice that the missing initial condition y ( a ) for this family of processes is not only a function of the starting point of the process a,
2.
181
THE INVARIANT IMBEDDING APPROACH
but also a function of the starting state or the given initial condition c. Define T(C,
a) =
the missing initial condition for the system represented by and (3) where the process begins at t = a with x ( a ) = c.
Notice that .(a) and y ( a ) represent the starting state of the process. We shall consider r as the dependent variable, and c and a as the independent variables. An expression for Y in terms of c and a will be obtained. Considering the neighboring process with starting value a A , the missing initial condition of this neighboring process can be related to y(u) by the use of Taylor's series
+
Y("
+4
=y(a)
+ y'(.) + O ( 4
(5)
where O(A) represents higher-order terms or terms involving powers of A higher than the first. At the starting value a, Eq. (1) becomes X'(4 =
Y'(.)
f ( 4 4Y ( 4 , 4 =f(C, Y ( 44
=. ).(.(g
Substituting (6b) and (4)into
d c , a),.)
=d c , y(c,
(64
4,a )
(6b)
(9,we obtain
On the other hand, the following expression can be obtained for this A ) from Eq. (4): missing initial condition y(a
+
Y("
+A)
= +(a
+A), +A ) a
(8)
+
Again, the expression x(a d) can be related to its neighboring process %(a)= c by Taylor's series,
Thus, Eq. (8) becomes
Equating Eqs. (7) and (lo), we obtain the desired relation ~(ca , )
+ g(c,
y(c,
a), a)
= ~ ( +f(c, c y ( c , a), a) A , a
+A)
(11)
182
6.
INVARIANT IMBEDDING
omitting the terms involving powers of d higher than the first. T h e difference Eq. (11) can be used directly to obtain the missing initial conditions Y(C, a). Alternately, a partial differential equation can be obtained from (1 1). Expanding the right-hand side of (1 1) by Taylor's series, we obtain
In the limit as d tends to zero, the following first-order quasilinear partial differential equation is obtained from (11) and (12):
From (3b) and (4), it can be seen that
Thus, the missing initial conditions ~ ( c a, ) for the family of processes, with the starting values of the independent variable a from zero to tf , can be obtained by solving the systems (13) and (14).
3. An Example
Equations (2.13) and (2.14) can be solved by various techniques. Some of them will be discussed briefly in a later section. Meanwhile, consider using the difference Eq. (2.11) before the limit is taken. Often it is advantageous to use the difference equation whose limiting value yields the differential equation rather than constructing finite-difference equations arbitrarily from the differential equation. T h e original difference equation preserves the physical characteristics of the process and thus yields more insight. T o illustrate what is involved in obtaining the missing initial condition from Eq. (2.1 I), consider again the tubular flow chemical reactor with axial mixing. Equation (2.2) of Chapter 3 can be written as
3.
183
A N EXAMPLE
However, instead of the original boundary conditions (2.3) of Chapter 3, the following simpler boundary condition will be used:
x(0)
1
=
Y(1) = 0
< <
with 0 t 1. It will be seen later that if the range of x(0) used is large enough, the solution of Eq. (2.11) for the systems (1) and (2) will also yield the original boundary condition as given by Eq. (2.3) of Chapter 3. Instead of the above one boundary-value problem, consider the family of boundary-value problems with the following family of boundary conditions: x(a) = c (34 Y(1) = 0
(3b)
< <
with a t 1. Now, Eq. (2.1 1) can be used for the systems (1) and (3). Identifying with the nomenclatures of the previous section, we see that f h Y , t ) =Y
Y , t ) = NPey
d.9
+ NpeRx'
and tf
=
1
Thus, Eq. (2.11) becomes
+
Y(C, a )
Solving for
A
+ Np&'
A
= Z(C
+~ ( c ,
A, a
+
Y(C,
a) A , u
+A )
a ) , we get
Y(C,
Y(C,
NpeT(C, U )
a) =
1 1 +NpeA
[~(c
U)
+A )
-
NpeRc2A ]
If d is small, the following approximation can be used Y(C
+
T(C,
4A, a
+ A)
T(C
+ r(c, a + A ) A , + A ) a
and Eq. (5) becomes Y(C,
a) =
1 +NpeA
[Y(C
+ ~ ( c a, + A ) A , a + A ) - Np,Rc2 A ]
with the final condition Y(C,
tf) = r(c, 1) = y(1) = 0
0
6.
184
INVARIANT IMBEDDING
Equation (7) can be solved in a backward recursive fashion starting with the condition, Eq. (S), at tf . Since the term added to the right-hand side of (6) involves only second- and higher-orders of 4, Eq. (7) is justified. Since clearly we cannot evaluate r at all values of c, some discrete values of c can be chosen, say c = 0,6,
26, ...
(9)
and r is evaluated only at these discrete values of c. Thus, there are grid points in both dimensions of the problem. T h e initial state of the system, c, is divided into CIS grid points and the duration of the process, tf , is divided into t r / A grid points. There is very little sophistication involved in choosing the grid values of the independent variables. Experience, computer memory capacity, and accuracy requirements play major roles in the selection of the values of A and 6 used. Since the function r is represented by a set of grid values, frequently some type of interpolation scheme which permits us to recreate a general value from these grid values is necessary during the calculations. As a concrete illustration, let us consider the following numerical values: R
=
2
Npe
==
6
A
=
0.1
6
(10)
= 0.1
At the final point, a = tr = 1, the value of r is known for all values of c. I n the present case, this value is a constant value and is equal to zero. Next, let us obtain r(c, 1 - A ) , or the values of r at a = 1 - 4. Substituting a = 1 - 4 into (7), we obtain r(c, 1 - A )
Since r(c, 1)
=
1
1
+ NPe A
[T(C
+ Y(C, 1) A , 1) - NpeRc' A ]
+ r(c, l)d, 1) = 0,
= ~ ( c
r(c, 1 - A )
=
1
1
+ NPeA
[-
T h e values of r at a = 1 - 4 can be obtained from (12) for c = 0, 6, 26, .... T h e results are listed in Table 6.1. With r at a = 1 - 4 known, the values of r at a = 1 - 2 4 can be obtained. Substituting a = 1 - 24 into (7), we obtain r(c, 1 -
A ) A , 1 - A ) - Np&'
A]
(13)
3.
185
AN EXAMPLE
T A B L E 6.1
r(c, 1
C
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.o
-
4)
0.0 -0.0075 -0.030 -0.0675 -0.120 -0.1875 -0.270 -0.3675 -0.480 -0.6075 -0.75
Since the values of r at a = 1 - 4 are listed in Table 6.1, the right-hand side of (13) is completely known. T h e problem for c = 0.0 is trivial. For c = 0.1, from Table 6.1 we obtain ~(0.1,1 - A )
Then
==
-0.0075
+
~(0.1 r(O.1, 1 - A ) A , 1 - A )
= ~(0.09925,1
-
A)
(14)
This value of Y can be obtained from Table 6.1 by linear interpolation. Once the value of r in (14) is known, the value of r(0.1, 1 - 24) can be obtained from (13). This procedure can be continued for c = 0.2, 0.3,..., 1.O and Table 6.2 is formed. T A B L E 6.2 C
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.o
r(c, 1 - 24) 0.0 -0.012152 -0.048328 -0.1081 1 -0.19106 -0.29678 -0.42483 -0.57479 -0.74625 -0.93878 - 1.1520
6.
186
INVARIANT IMBEDDING
Once the values of r at a = I - 24 are known and tabulated, the values of Y(C, 1 - 3 4 ) can be obtained. From Eq. (7), we get r(c, 1 - 34) =
1 1 +NpeA
[Y(C
+ Y(C, 1 - 24) 4 , 1 - 24)
-
NpeRP A]
(15)
Equation (15) can be solved in the same way as that used in solving (13), by using Table 6.2 with linear interpolation. This procedure can be , are obtained. Note that in calculating continued until the values of ~ ( c 0) ~ ( c 1, - kd), only the values of Y(C, 1 - (k - 1)d) are needed. T h e earlier tables can be printed out. There is a table similar to Tables 6.1 and 6.2 for each Y(C, 1 - kd), k = 1 , 2,..., 10. These tables cover all the grid values of c and a. T h e last table for Y(C, 0) for the above problem is shown in the first two columns of Table 6.3. TABLE 6.3 MISSING INITIAL CONDITIONS r(c, a ) FOR PROCESSES STARTING AT a
C
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 .o
A 8
= =
0.1, 0.1
0.0 -0.019250 -0.073 132 -0.15745 -0.26930 -0.40651 -0.56735 -0.75044 -0.95460 -1.1808 - 1.4274
A
=
6
=
0.01, 0.1
0.0 -0.019334 -0.073308 -0.15768 -0.26956 -0.40678 -0.56762 -0.75071 -0.95487 -1.1791 - 1.4226
A
=
s
=
0.1, 0.01
0.0 -0.018801 -0.07173 1 -0.15503 -0.26605 -0.40277 -0.56362 -0.74726 -0.95262 - 1.1788 - 1.4249
=
0
A
=
s
=
0.01, 0.01
0.0 -0.018865 -0.071875 -0.15508 -0.26569 -0.401 59 -0.56109 -0.74283 -0.94565 -1.1687 - 1.4111
T h e influences of the sizes of the intervals, A and 6, on the accuracy of the obtained missing initial conditions are shown in Table 6.3. T h e results in the last three columns are obtained with different values of d and 6. T h e missing initial condition for the original problem y(0) is given by the last row of Table 6.3, where c = 1.0 and u = 0. T h e calculated values of r(c, u ) with d = 6 = 0.01 are shown in Fig. 6.1. Only a few seconds’ computation time is need to calculate and to print out all the tables for d = 6 = 0.1. However, over half a minute is needed to perform the same calculations when d = 6 = 0.01.
3.
187
AN EXAMPLE
T h e solution of (7) not only gives the missing initial condition of the original system represented by (1) and (2), but also gives the missing initial conditions for all the problems with boundary conditions reprea tr and 0 c c (see Fig. 6.1). Sin?? all sented by (3) with 0 the initial conditions for all the interested values of a and c are obtained,
< <
< <
0
- 0.2
i
g
- 0.6
g - 1.0 Y I
- 1.2 - 1.4 1.0
0.8
0.6 0.4 0.2 STARTING POINT, a
0
FIG.6.1. Missing initial conditions by invariant imbedding.
the missing initial condition for the problem with the given boundary conditions (2.3) of Chapter 3 also can be obtained. Equation (2.3) of Chapter 3 can be written as Ma)
YU) =0
( 16b)
with x, = 1. Now we wish to search the first and last columns of Table 6.3 for values of c and Y(C, 0) so that the right-hand side of (16a) is equal to 1.
6.
188
For x(0)
= c =
INVARIANT IMBEDDING
0.8, we find that X, = 0.8
remembering that y(0) =
--
Y(C,
X, = 0.9
-0.94565 6
= 0.95761
0). For x(0) -
-1.1687
6
=
=
0.9, we find that
1.09478
By linear interpolation, we obtain the following corresponding values for x, = 1: x(0) = 0.83090, y(0) = -1.01458. Compare these values with those in Table 3.1.
4. The Missing Final Condition
The missing final condition x(tl) for systems (2.1) and (2.2) also can be obtained. Instead of the original one boundary-value problem, consider the family of problems represented by (2.1) and (2.3). With the terminal or final value of the independent variable tr fixed, the missing final condition x(tr) for the family of problems with different starting values, a, depends on the given initial condition c and the starting point of the process a. Define s(c, a) =
the missing final condition for the system (2.1) and where the process begins at t = a with x(a) = c
I
We wish to examine the relationships between s(c, a) and its neighboring process with starting value a A . To do this, let us write Eq. (2. la) in difference form:
+
x(t
+4
=
x ( t ) +f(.,Y,
t)0
At the starting value a, Eq. (2) becomes
The function s has the following property:
+ O(0)
(2)
5.
DETERMINATION OF X AND
y
I N TERMS OF
r
AND S
189
Essentially Eq. (4) is saying that T h e missing final condition obtained
T h e missing final condition obtained
from a process which begins at t = a with x ( a ) = c as the one known
from a process which begins at t =a A with c f(c, r(c, a),a)d as the one known starting state variable
starting state variable
~
+
+
with the higher-order terms O(d) omitted. Obviously, the same missing final condition would be obtained if the process which starts at d time later uses the results of the process which starts at d time earlier as its starting state, provided that both processes are governed by the same set of equations and a unique solution exists for these equations. This simple observation will be used frequently in later derivations. This property is known as the semigroup property [54]. Essentially, the invariant imbedding approach is a generalization of this semigroup property. T h e right-hand side of Eq. (4)can be expanded by Taylor's series,
I n the limit as d tends to zero, Eq. (5) becomes
From the definition of s and the original given boundary condition one can see that s(c, tr) = c (7) In other words, the missing final condition would be equal to the given initial condition if the duration of the process is zero or a = tf .
5. Determination of x and y in Terms of r and s Not only can the missing initial or missing final conditions be obtained from the invariant imbedding equations, and the original boundaryvalue problem thus become an initial-value problem, but also the solution of the original equations, x and y , can be obtained in terms of the functions r and s. T h e relationships between r and s, and x and y can be deduced by a consideration of the definitions for the functions r and s.
190
6.
INVARIANT IMBEDDING
Consider a position t within the interval (a, ti), where the original functions are x(t) and y(t). However, we may also consider this as a process which begins at t with x( t ) as the one known starting state variable. Thus, from the definition of Y and (2.4) we obtain (1)
Y ( t ) = M t ) , t)
Another relationship can be obtained from the function s and its semigroup property. Note that now we are considering a family of processes which begins at different values of t with the one known starting state variable x(t), which obeys Eq. (2.1). The difference between this family of processes and those considered in the previous sections is that each member of the family of the present processes has a fixed starting state variable, x ( t ) ; while for the previous processes this starting state variable is not fixed but consists of a series of values of c. From the semigroup property we see that (2)
s ( x ( t ) , t ) = constant
I n other words, the same final missing condition is obtained no matter where the process begins as long as the starting state is x(t) at the starting point t. This constant must be the missing final condition of the original problem represented by (2.1) and (2.2),
4 t f ) = s ( x ( b ) , tf)
=
b
(3)
Thus, Eq. (2) becomes s(x(t), t )
=
b
(4)
The functions x ( t ) and y ( t ) which satisfy Eqs. (2.2a), (l), and (4) are solutions of the original systems (2.1) and (2.2). These observations can be verified in the following manner. Differentiating Eq. (4) with respect to t , we obtain as dx as _ _ + - =atO (5) ax dt Comparing it with (4.6) and remembering the meanings of x and t, we see that (6)
Next, we differentiate (1) with respect to t : dy dt
--
ar -dx _ ax
dt
ar
(7)
6.
DISCUSSION
191
Substituting Eq. (2.la) into (7), we have
Comparing it with (2.13), we obtain
Furthermore, the original boundary conditions (2.2) are satisfied.
6. Discussion
Before proceeding with different formulations of the invariant imbedding equations, let us briefly summarize the results of the previous sections. We have hinged our discussion on the fact that any individual process can be considered as a member of a family of related processes. T h e “sizes” of these individual processes are represented by the duration of the processes or the intervals of interest [a, tl]. T h e basic idea is that although we do not know the value of the missing initial condition of the original process with duration t j , we do know the value of this missing initial condition if the process has zero duration. Thus, starting with a process of zero duration, we gradually increase the duration of the process by imbedding the present unknown process into the previously known process with shorter duration. T he previous formulations are based primarily on the observation that the solutions x and y of the system (2.1) are functions not only of t but also of the duration of the process. This duration is varied by the use of the different starting points, a, of the process. Hence, we should write
Thus, the equations can be formulated at least in two different ways. One is by the variation or perturbation of the position t. This is the usual way of formulating the problem, which leads to ordinary differential equations of the two-point boundary-value type. T h e other is by perturbing the duration or the starting point of the process, which leads to the imbedding equations. These imbedding equations are partial differential equations, but they are the initial-value type.
192
6.
INVARIANT IMBEDDING
T o vary the starting point of the process, a, note that the functions x and y also depend on the values of the given boundary conditions (2.3). Since x and y appear nonlinearly in (2.1), this dependence is quite complicated and must be considered in obtaining the invariant imbedding equations. However, since we only want to vary the starting point, a, not the end point t i , only the given initial condition needs to be considered. Thus, Eq. (1) should be written as
According to the definitions of s and r, Eq. (2) reduces to the following form for the missing final and missing initial conditions: x(t,) = X ( t f , c, a ) = S(C, a )
r(a) = r(a,c, 4
= y(c, a )
(3)
I n obtaining Eq. (3), remember that ti is considered as a constant. Obviously, the final point tf can also be varied in obtaining the imbedding equations. I n this case, r and s would be considered as functions of the given final condition, y(tf), and the final point, tf . 7. Alternate Formulations-I
The invariant imbedding approach is a concept or idea. It is not a technique or method. Thus, the invariant imbedding equations can be obtained by various different formulations or derivations. These equations can be obtained not only from the usual equations representing the process, but also from an analysis of the original physical process without using the usual equations, provided that the physical picture of :he process is fairly simple and clear. I n fact, most of the work that has been done on’the use of invariant imbedding for transport theory, radiative transfer, random walk, diffusion theory, and wave propagation was based on the original physical processes. These approaches have acquired the name “particle counting” technique and are fairly prone to error even for moderately complex processes [18, 341. However, the particle counting technique does provide a clear picture of the invariant imbedding concept. Those interested can consult the references mentioned above for more details. The use of equations representing the physical process to derive the invariant imbedding equations by purely mathematical analysis was not
7.
ALTERNATE FORMULATIONS-I
193
developed until 1960. Since then several schemes have been developed to obtain the invariant imbedding equations without considering the physical process. Generally, the approaches are perturbation schemes in which one or two parameters of the process are perturbed. For the sake of completeness, two different approaches will be presented. Our presentation will be purely formal and will follow the approaches of Bellman and Kalaba [55] and of Bailey and Wing [7, 341. Let us consider the system of linear differential equations [7]
with boundary conditions x(0) = 0 Y ( t f )= 1
< < tt.
with 0 t We wish to obtain the missing final condition x(tf). Instead of considering a family of processes with different starting points as has been done in Section 2, we shall vary the end or final point. Rewrite the boundary conditions as x(0) = 0
(34
Y(4=1
(3b)
< <
with 0 t a. T h e family of processes is now generated by varying the parameter, a. T h e solutions x and y of systems (1) and (3) depend not only on t, but also on the duration of the process, a. Rewrite (1) and (3) to indicate this dependence: xt(4
-Yt(t,
4 = qll(t) x(t, 4 + q12(t)y(t,4 4 = 42dt) 4 + !722(t)Y(4 4
(44 (4b)
x(0, a) = 0 y(a, a) = 1
where the subscript t indicates differentiation with respect to t. T h e missing final condition is x(a, a) = R(a)
(6)
6.
194
INVARIANT IMBEDDING
The missing final condition also depends on the given boundary conditions, Eq. (5). However, since the equations represented by (4) are linear homogeneous differential equations, the missing final condition x(a, u ) depends on ( 5 ) linearly, and thus it is not necessary to indicate this dependency explicitly. Since R(a) = x ( t = a, a), it follows that dR(a) =
da
%,(a,a )
+
Xa(d,
(7)
(I)
Equation (5b) and (6) have been used in obtaining the above equations. Substituting (8a) into (7)
Now, to express x,(a, u ) in terms of known functions, we differentiate (4) and ( 5 ) with respect to a. We obtain X d t , -Ynt(4
4 = %dt)4 4
= !72l(t)
44
Xa(4
4
+
4
(104
+ Qzz(t)Ya(t,4
(lob)
q12(t)ra(4
Considering x, and ya as the dependent variables in (10) and (11) and comparing Eqs. (10) and (11) with Eqs. (4) and (3, we see that x, and yn satisfy the same linear differential equations as x and y, except for the difference in one boundary condition. If we assume that there is a unique solution for the linear systems (4) and (5) in the interval [0, $3, then xu and ya are multiples of x and y, respectively. Thus d t , 4 = -Y&, YUP,
4
= -%(a,
4
(124
a>r(t,a)
(12b)
a) x ( t ,
Att=a %(a, 4 = -Y&,
4 44 4 = -%(a,
a ) R(a)
(13)
8.
LINEAR AND NONLINEAR SYSTEMS
Combining Eqs. (8b), (9), and (13), we obtain
From Eqs. (5a) and (6), the initial condition is obtained. R(0) = 0
Equations (14) and (15 ) are the desired relationships. Now the missing initial condition can be obtained easily. Let Y(O,4 = S(4
Differentiating, we have W-a )= y,(O, a )
da
Substituting (12b) at t
=
0 into (17), we obtain
d S( a ) - -yt(a, a)y(O, a )
da
Combining Eqs. (8b), (16), and (18), we obtain the desired equation
To obtain the initial condition for (19), observe that if the process had zero duration or a = 0, then the missing initial condition would be equal to its given final condition. Thus S(0) = 1
(20)
Equations (14) and (19) are two nonlinear differential equations of the initial-value type. Thus, we have changed the original linear boundaryvalue problem into nonlinear initial-value problems. T h e above method also can be extended to large systems of linear differential equations and to nonlinear difference equations [7]. Since all differential equations can be represented approximately by difference equations, the last extension suggests a way of handling nonlinear differential equations by this method. 8. Linear and Nonlinear Systems
T h e partial differential equations obtained in Sections 2 and 4 will reduce to ordinary differential equations similar to those obtained in the
6.
196
INVARIANT IMBEDDING
preceding section if the original system were linear. T o see this, let us apply Eqs. (2.13) and (4.6) to the linear system represented by Eqs. (2.1) and (2.3) and f(X7
Y7
t ) = !7&
Y ,t )
x
= 42lW x
+ P&)Y
(14
+ 422WY
(lb)
Because of this linearity and also because (1) is homogeneous, we expect that the missing initial condition will be proportional to the starting state c. Thus Y(C, a ) = R(a) c (2) Substituting this into (2. I3), we find
or
with the boundary condition I(C, tr) = R(t,) c = 0
or (5)
R ( t f )= 0
Equations (4) and (5) are different from (7.14) and (7.15). This is due to the fact that these equations have been obtained by imbedding from different terminal or end points. Equations (4) and (5) have been obtained from a family of processes with different starting points, but Eqs. (7.14) and (7.15) have been obtained from a family of processes with different final or end points. In addition, the original Eqs. (2.1) and (1) are different from the original Eqs. (7.1). The equations for the missing final condition S(a) for the system (1) also can be obtained in the same fashion. 9.
T h e Riccati Equation
Both Eqs. (7.14) and (8.4) are special cases of the Riccati equation ax
at
+ !7*l(t)x2 +
P2W
x
+
4 3 w
=0
(1)
One of the characteristics of the invariant imbedding approach is that if the original system is linear, the invariant imbedding equations are
10.
ALTERNATE FORMULATIONS-I1
197
nonlinear Riccati equations of initial-value type. If the original system is a large set of simultaneous linear differential equations of two-point boundary-value type, matrix Riccati equations are obtained. Thus, it is not inappropriate to include a discussion of this important equation here. T h e Riccati equation has been the subject of extensive study in connection with the quasilinearization technique [56-581. In fact, the first derivation of the quasilinearization concept has been based on the Riccati equation. T h e Riccati equation cannot be solved explicitly by quadratures. Those interested may refer to the literature [59-611. However, it should be pointed out that if ql(t) is not zero, Eq. (1) can be transformed into a linear second-order differential equation. Substituting x = X/q,(t) into (l), we obtain
Substituting X
= y'/y
into the above expression, we obtain
which is a second-order linear differential equation with time-varying coefficients. It is interesting to note that we have obtained the Riccati equation from two simultaneous linear differential equations by the invariant imbedding concept. Thus, a more meaningful connection between the Riccati equation and the second-order linear differential equation is obtained. 10. Alternate Formulations-I1
T h e derivation in Section 7 is suitable only for linear systems. I n this section the perturbation technique will be used to derive the invariant imbedding equations for nonlinear systems [55]. T h e uniqueness of the solution of the linear two-point boundary-value problems forms the basic ingredient in the derivations. Consider the nonlinear system
6.
198
INVARIANT IMBEDDING
with boundary conditions x(0)
=0
< <
with 0 t a. As have been discussed in Section 6, the solutions x and y not only are functions of the position t, but also are functions of the terminal point, a, and the given boundary condition at that terminal point, c. Rewrite (1) and (2) to indicate this dependence.
x(0, c, a )
=0
(44
y ( a , c, a)
=c
(4b)
where the subscript t indicates differentiation with respect to t. It is interesting to compare the above equations with (7.4) and (7.5), where the equations are linear and x and y are functions of a and t only. T h e present derivation is essentially the same as that of Section 7. There the derivation is basically the perturbation of the terminal point, a, by differentiation, and then the uniqueness of the solution of the linear differential equation has been used to obtain the desired relation. I n the present derivation, both the terminal point, a , and the given boundary condition at that point, c, will be perturbed. First, let us perturb the terminal point, a, and consider a neighboring process with duration a d. This neighboring process can be written as
+
+0) --y,(t, c, a + 4 x,(4 c, a
f(44c, a + 4,Y ( 4 c, a + '4,t ) = g(44 c, a + 4 , Y ( t , c, a + 4,t )
=
x(0, c , a
Y("
+A ) = 0
+A, +A ) c, a
(54 (5b) (64 (6b)
=c
Instead of using Taylor's series to relate neighboring processes, we shall use the classical perturbation techniques [62]. We introduce the perturbation functions z(t, c, a ) and ~ ( tc,, a ) via the relations
4 4 c, a y(4 c, a
+0 ) +4
< <
=
x(4 c, a)
= y ( t , c, a)
+ z(t, + q(G
c, a ) A
c, a)
+ O(d) +O(4
(74 (7b)
which hold for 0 t a. Let us examine the missing final conditions of the above two neighboring processes and obtain an expression for the
10.
199
ALTERNATE FORMULATIONS-I1
missing final condition of the original process. T h e missing final condition for the process with duration (a A ) is x ( a A , c, a A ) . Using Taylor’s series, we obtain
+
x(a
+ 0 , c, a + 0 )
= %(a,c, a
Substituting (5a) and (7a) at t x(a
+
+ 0 ) + x,(a,
=a
c, a
+
+ 0 )0 + O(0)
into the above equation, one obtains
+ 0 , c, a + 0 ) = x(a, c, a) + z(a, c, a ) 0
+f(.(., c, a + d ) , y ( a ,c, a + A),.)
or x(u
(8)
0
+ 0 , c, a + 0 ) = x(a, c, a) + z(a, c, a) 0 +f(+,c, a),y(a, c, a), 4 0
+ O(0) +O(4
(9)
(10)
Equation (10) is obtained from Eq. (9) in the following manner:
f(+,
c, a
+ 4,y ( a , + 4
4 + x,(a, c, + O ( d ) , y ( a ,c, 4
4 =f(+,
c, a
c,
+Y&, c, 4 0
Q)
0
+ W )a), (11)
Substituting (11) into (9) and combining all terms involving powers of A higher than the first into the term O(A), we obtain Eq. (10). Now the goal is to express the perturbation function z in Eq. (10) in terms of known functions. T o do this, first let us obtain the perturbation equations. These can be obtained by the classical perturbation techniques. Substituting (7) into (5), we obtain x t ( 4 c, 4
+ zdt,
c,
40
-yt(t, c, 4 - 4 4 4 c, 4 0
+ 44 4 + 44
=f(x(t, c, a)
c,
4 d , Y ( t , c, a )
= g(.(t,
c,
4 0 ,Y ( t ,c, a)
c,
+ dt,c, 4 0 , t ) (12a) + dt,c, 4 0 , 4
(12b) with terms involving powers of A higher than the first omitted. Expanding the right-hand side of (12) by Taylor’s series, we obtain 4 4 -yt(t,
c, a)
+4
4 c, a ) 0
=
f + z ( t ,c, a ) ofn+ dt,c, a ) Ofv
C, a ) - pt(t, C, a) 0 = R
+ z(t,
C, a) dg,
+ q(t,
C, a) dg,
(13a) (13b)
where f and g represent f ( x ( t , c, a), y(t, c, a), t ) and g(x(t, c, a), a), t ) , respectively. Equating coefficients of A , we obtain the original system (3) and the following perturbation equations:
y(t, c,
44 c, a ) f n + dt, c, .If, c, 4 = 44 c, 4 g, + d t , c, a ) g,
zt(t,c, --4t(t,
4
=
(144 (14b)
6.
200
INVARIANT IMBEDDING
T o obtain the boundary conditions for (14), we must express Eq. (6b) in terms of the original interval, t = 0 to t = a, first. This can be done by using Taylor’s series, Y(U
+A,
or ~ ( aC,, a
C,
a
+A )
+0)
Y ( a ,C,
+
a
+A ) +
Ya(Ur
+ A ) -Ya(a, c, a + 4 + O(d)
= ~ ( a A , C, a =c
-Y&,
+ A ) + O(d) a + A ) + O(d)
c, a
C,
(15)
(16)
Notice that
We obtain
by collecting all terms involving powers of A higher than the first into the term O(A). Substituting (3b) into (18), we obtain Y(U3
c, a
+4
=c
+ g ( x ( a , c,
U),Y(U,
c, a),
4
+ O(d)
(19)
which is the desired relation. Now the desired boundary conditions can be obtained in the same manner as that used in obtaining (14). Substituting (7) into (6a) and (19), and equating coefficients of A , we have z(0, c, u )
=0
d a , c, a) = g(+,
(204 c,
.),y(a,
c, a),
4
Heretofore, we have perturbed the terminal point, a, of the process only. Let us vary the given final condition c and examine the dependence of the solutions of (1) on c. T o do this, differentiate Eqs. (3) and (4) with respect to c: Xct(C
c, a) = X C ( t , c,
- Y c t ( 4 c,
4fic
4 = X C ( t , c, 4 g,
+ Yc(C c, 4f,
(214
+ Yc(Cc, 4g,
(21b)
with boundary conditions x,(O, c, u ) = 0
Yc(% c,
4=1
11.
20 1
THE REFLECTION AND TRANSMISSION FUNCTIONS
Now the perturbation functions z and q can be related to the known functions. Equations (14) and (20) are linear equations in z and q ; while Eqs. (21) and (22) constitute a linear system in x, and y e . Since x and q satisfy the same linear differential equations as x, and yc except for the difference in one boundary condition, the following relationships must exist z(4 c, a) = &(a, c, a),r(a, c, 4 9 4 xc(4 c, 4 (234 s(t, c, a) = g(.b
c,
4,y ( a , c, 4,4 Y 4 4 c, 4
(23b)
provided that the systems (14) and (20), and (21) and (22) have unique solutions. Now Eq. (10) becomes
+ A , c, a + A)
%(a
= x(a, c, a)
+ &(a,
c, .),y(a, c, a), a) .,(a,
+f(x(a, c, .),Y(.,
c, 4
9 4A
c, a) A
+O(4
(24)
Let r(c, a) =
the missing final condition for the system (1) and (2) where the process ends at t = a with y(a) = c.
1
!
Obviously, x(a) = x(a, c, a) = T ( C , a )
(25)
Thus, Eq. (24) becomes r(c, a
+A )
= .(c, a)
+ g(.(c,
a), c ,
4 rc(c,a) A
+ f ( r ( c , a ) , c, a ) A
+ O(A) (26)
I n the limit as d tends to zero, we obtain the desired relationship -ark, a ) - g(.(c, a), c, a ) aa
7 + f ( r ( c , a ) , c, a )
with the initial condition .(c, 0 )
=0
T h e missing initial condition also can be obtained in a similar manner.
11 + The Reflection and Transmission Functions
T h e functions R and S or r and s are important functions in the invariant imbedding formulations. Depending on the actual situation, they have been called the missing initial or the missing final conditions.
6.
202
INVARIANT IMBEDDING
I n this section, we wish to obtain the invariant imbedding equations by physical considerations, and thus attach some physical meanings to these functions [4, 5, 431. Consider the interval extending from t = a to t = tr as a cylindrical rod within which a particle process is taking place (see Fig. 6.2). At the
r(c,a)
-
1
C
a
a+d
I -
‘f
Q
FIG.6.2. A n abstract physical model.
left end, t = a, a steady stream of c particles per unit time is incident on the rod; and zero or no particle per unit time is incident at the right end, t = tf . Within the rod, the particles can move to the right or left only. T h e rod is assumed to be composed of homogeneous materials with unit cross-sectional area. If we assume that the particles can interact only with the material the rod is constructed of, then R has the physical meaning of expected number of reflected particles per unit time that emerge from the left end of the rod, and S represents the expected number of transmitted particles per unit time that emerge from the right end. Thus, R is called the reflection function and S the transmission function. This model has been used extensively to treat simple neutron transport processes by the invariant imbedding concept. I n more complicated physical situations such as molecular diffusion, interactions between moving particles play an important role. I n this situation, the process becomes nonlinear and r and s are the reflected and transmitted numbers of particles per unit time. Because of these interactions between particles, the reflection and transmission functions depend on the number of particles that are incident at the two ends of the rod in a complicated way. Thus, if the left end, t = a, is perturbed, the number of particles incident on the left end must be considered in formulating the equations. Note that R and S, which are for linear processes, depend on the number of incident particles at the rod linearly. With this abstract physical model in mind, let us consider the system represented by Eqs. (2.1) to (2.3) which can be written in the following nonlinear difference form:
with
12. SYSTEMS
203
OF DIFFERENTIAL EQUATIONS
On the basis of the above physical model, Eqs. (1) and (2) can be interpreted in the following way. T h e function y ( t ) has the physical meaning of the number of particles moving to the left at position t within the rod. Because of the various interactions within the rod, the number of these particles changes by an amount g(x,y, t)d in going from position t to position t d. T h e function x ( t ) can be interpreted in a similar manner as the number of particles moving to the right at t. Now, defining r(c, a) in the same way as has been done in Section 2, we see that Y ( 4 = r(c, 4 (3)
+
and r represents the number of particles leaving the rod at t Equations (lb), (2), and (3) show clearly that r(c, a ) = +(a
+ 4, + 4 a
- g(.,
r(c, a), a)
+O(4
= a.
(4)
It is interesting to compare the above equation with Eq. (2.7), which is obtained by Taylor's series. T h e derivations in this section are equivalent to those in Section 2 with the exception that an abstract model guides our thinking in the present case. Since x ( a + d) represents the number of particles moving to the right at t = a d, the following expression can be obtained from (la):
+
x(.
+4
From (4)and Y(C,
+ f ( x , y , a)
= X(.)
+O(4
=c
+ f ( c , r(c, a), a)
+ O(d)
(5)
(9,we obtain
a) = r(c +f(G
r(c, a), 4
+ O ( 4 , + 4 - g(., a
r(c, a), 4
+ O ( 4 (6)
which is the same as (2.11). T h e rest of the manipulations are the same as those discussed there. 12. Systems of Differential Equations
All previous discussions have been based on two simultaneous firstorder differential equations with fairly specialized boundary conditions. T h e invariant imbedding approach also can be applied to the following general system of nonlinear differential equations
i
=
1, 2, ...,M
6.
204
INVARIANT IMBEDDING
with boundary conditions Xi(0) =
x:
Y i ( t f )= y:
i
=
1, 2,*.., M
(4
< <
with 0 t tt . I n order to obtain expressions for the missing initial and missing final conditions of the above problem, let us consider the problem with the more general boundary conditions
<
t 6 tt . with a T o guide our thinking, let us consider again the physical model shown in Fig. 6.2. However, instead of only one kind of particle, now we have M different kinds of particles. Each kind of particle has its own properties or characteristics that distinguish it from the others. Thus, the functions x i ( t ) and yi(t) represent the numbers of ith kind of particles moving to the right and to the left, respectively. Another difference between the present system and that represented by Fig. 6.2 is that there are y{ particles per unit time of the ith kind incident on the right end of the rod. If we define r i ( c l , c2 ,...,
c M ;U )
the number of reflected particles of the ith kind for systems (1) and (3) where the left end of the rod is at t = a, with ci , = i = 1 , 2,..., M , particles per unit time of the ith kind incident on that end
then y i ( u ) = ri(cl , c2 ,..., c;,
a)
i
=
1, 2,...,M
(4)
T h e definition of ri has been phrased in terms of the physical model. Obviously, it also can be defined without considering the physical model, with ri , i = 1, 2, ..., M , representing the missing initial conditions of the process. An application of the ideas employed in the previous section can be shown easily.
where c represents the given initial vector with components cl, c2 ,..., cM ; and r represents the M-dimensional missing initial vector. From the definition of r and Eqs. (3) and (4),we see that ri(c, tr) = y:
i
=
1, 2 ,..., M
(6)
13.
205
LARGE LINEAR SYSTEMS
Expressions for the missing final conditions or the transmission functions also can be obtained. However, these expressions seldom will be used in the present work. Thus, we shall not go into details about these equations. 13. Large Linear Systems
If the original equations represented by (12.1) are linear, then the equations in (12.5) are reduced to nonlinear ordinary differential equations of the Riccati type. Consider the following linear system dxi _ - C [qii(t)xi -t p i i ( t ) ~ i I+ U t ) = fi dt
3-1
i = 1, 2, ...,M
M
dYi _ - c [wdt) dt
xj
j=1
+ .ij(t>Yjl + % ( t )
(1)
= gi
with boundary conditions .,(a) = ci
y i ( t f )=yl
i
=
1,2,..., M
(2)
< <
with a t tr.. For the equations represented by (l), Eqs. (12.5) become
M
=
c
3=1
[wij(u) ci
+ wij(a)ri(c,a ) ] + ui(a)
i
= 1, 2,
...,M
(3)
Since equations in (1) are linear, the solutions of (3) can be represented by the following linear combinations:
Substituting (4) into (3) and equating terms involving like powers of c l , we arrive at the following M ( M 1) nonlinear ordinary differential equations of the Riccati type:
+
i , 1 = 1,2,..., M
i
=
1, 2, ..., M
6.
206
INVARIANT IMBEDDING
From Eqs. (12.6) and (4),we see that Si,(t,) = 0
Ti(&)
= y:
i, 1 = 1, 2 ,...,M
(64
i = 1, 2,..., M
(6b)
because when t = t j , ri(c, tt) must be yf for any choice of c. Since we know all the conditions at the same boundary, Eqs. (5) and (6) constitute an initial-value problem. If the interval of interest for the original problem is from t = 0 to t = t j , now the missing initial conditions for this problem can be obtained by first integrating Eq. (5) backward with (6) as the known conditions. Thus, the values of &,(O) and ~ ~ (are 0 ) obtained. Then, the initial conditions are Xi(0)
= ci = X:
c M
JJi(0)= T i ( C , 0 ) =
+d o ) = c
(7)
M
C,5il(O)
X % i N
+d o )
z=1
1=1
i
=
1, 2,
...,M
Now, Eq. (1) becomes an initial-value problem. An examination of (5b) will reveal that if ui(u)= hi(^)
i
=0
=
1, 2, ..., M
(8)
and the final condition i
-qi(tf)= JJ: = 0
=
1 , 2,..., M
(9)
then v,(u) = 0
i
= 1, 2,
..., M
(10)
< <
a t j . I n other words, if the equations in (1) are homofor all a, 0 geneous and, in addition, the given conditions at the fixed terminal are zero, then the functions qi(a) are zero for all values of a. We see that under these conditions, and with M = 1, the function ( ( a ) is equivalent to R(a) as defined by Eqs. (7.6) and (8.2).
14. Computational Considerations
T h e equations represented by (12.5) are M simultaneous first-order, quasilinear, partial differential equations. T h e computational solution of these equations is not simple when M is large. I n Section 3, we have
14.
COMPUTATIONAL CONSIDERATIONS
207
shown how these equations can be solved by using the original difference equation before taking the limit. However, this approach cannot be used for large M . This is due to the limited rapid-access memory of current computers. I n order to obtain the missing initial condition r for a process which starts at a from Eq. (3.7), we must store all the missing initial conditions for all the grid values of c of the previous process which starts at a A . If the dimension of c is large, or if M is large in (12.5), the limited memory can block our approach easily. This is the same dimensionality difficulty encountered in dynamic programming [63-681. T h e only difference between the present problem and that of dynamic programming is that dynamic programming has an optimum-seeking method incorporated in the table search routine, while invariant imbedding only needs table search. T o illustrate the storage requirements, consider a problem with three given initial conditions c l , c2 , and c3 , and 100 grid values for each c. = lo6 grid values of r . No This would require the storage of commonly available current computer has such a large rapid-access memory. Polynomial or differential approximations discussed in Chapter 4 can be used to partly overcome this problem. However, this problem is certainly far from being solved. Even if there were no storage problem, as has been shown in Section 3, the accuracy obtained would be far from desirable unless a very large number of grid values for c had been used. Thus, the excessive computation time requirements due to either large dimension or small step intervals, A , for c also can make this approach inapplicable. Various computational schemes also can be developed on the basis of Eq. (12.5). We have seen that if (12.1) is linear, (12.5) reduces to a set of ordinary differential equations. From this idea, a perturbation approach can be developed to approximate the nonlinear equations. There are also various computational techniques available for solving partial differential equations (12.5). T h e two frequently used techniques are the various versions of finite-difference methods and the method of characteristics [67, 69-73]. However, a detailed discussion of these techniques would carry us into the numerical aspects of partial differential equations. For the present work, most of the computational experiments will be based on the nonlinear ordinary differential equations (13.5). For simplicity of notation, the number of missing initial conditions has been assumed to be equal to the number of given initial conditions. Obviously, the invariant imbedding approach also can be applied to cases where these two numbers are not equal. Since generally the degree of difficulty in obtaining numerical solutions of partial differential equations depends much more on the number of independent variables
+
6.
208
INVARIANT IMBEDDING
than on the number of dependent variables, the imbedding equations should be formed by varying the terminal which results in fewer number of independent variables than the other terminal of the problem. However, in many applications of invariant imbedding, such as dynamic programming, there is no such choice and the problem is composed of one dependent variable and several independent variables. 15. Dynamic Programming
T o illustrate the usefulness of the invariant imbedding concept developed in the previous sections and also to show the connection between dynamic programming and invariant imbedding, the functional equations of dynamic programming will be formulated in this section. T h e dynamic programming technique [63-68, 741 probably is better known than invariant imbedding. However, the functional equations of dynamic programming are essentially the invariant imbedding equations with the addition of maximum or minimum operations. T o see this, let us consider the following problem in the calculus of variations: Find that function x ( t ) such that the function x(t) given by the differential equation
and the initial condition x(0)
=c
maximize the integral J(z) =
J;
h(x, z ) dt
(3)
T h e function x(t) represents the state of the system and is known as the state variable and the function z(t) is the control or decision variable. If this problem is treated by the classical calculus of variations, the result will be it two-point boundary-value problem. This problem will be treated by the dynamic programming approach. T o use the invariant imbedding concept, observe that when the maximum of (3) has been obtained, the integral is a function only of the initial condition c and the duration of the process tf . Thus, we wish to imbed the original problem with particular values of c and tf within a family of processes in which c and tf are parameters. Define the maximum value of
J
where the starting state of
the process is c and the total duration is tf .
15.
DYNAMIC PROGRAMMING
209
Thus g(c, t,) = max J ( z ) = max
(4)
The maximization is executed by choosing the proper value of x over the interval [0, tf]. T h e function g will be referred to as the optimum return and J , which in general is not the optimum or maximum value, will be called the return or nominal return. T h e control variable x(t) also is known as a policy. T h e optimum value of x(t) is the optimal policy. Let us perturb the duration of the process and consider the original process with duration from t = 0 to t = t j , and a neighboring process with duration from t = A to t = t j . However, instead of relating these two processes as has been done in the previous sections, we shall employ a different approach of using the property of g(c, tf) and the additive property of the integral. T h e original process can be assumed to be composed of two different processes. T h e first process has a duration of t = 0 to t = A and the second or neighboring process has a duration o f t = A to t = tf . We may write
The second term represents the maximum return from the second process. Obviously, the starting state for this second process is .A
which is obtained from (1). From the definition of g and Eq. (4), we can see that the maximum return from the second process is A
g (c
+ j o f ( x ,z ) d t , t,
-
A)
=
max
ZIA*tfl
jtfh(x, z ) dt A
(7)
Substituting (7) into ( 5 ) , we have
The terms under the integrals may be approximated by
j; h(x, z ) dt = h(c, z(0))d (9)
6.
210
INVARIANT IMBEDDING
with terms involving d 2 and higher orders of d omitted. Equation (8) now becomes g(c, tf) =
gz “ c ,
40))
+&!(c +fh 40))
tY -
41
(10)
It is interesting to compare the above equation with Eq. (2.1 l), correlating the present optimum return function g to the missing initial condition Y of (2.11). Using Taylor’s series, we obtain g(c +f(G 4 0 ) ) d, tj - 4 = g(c, tf) +f(c, 40))
tf)
7 -
ag(c, tf) at,
I O(d) (11)
Equation (10) becomes
Since g(c, tr) is independent of the choice of x, we put it outside of the maximum operation sign. Thus,
I n the limit as d + 0, Eq. (13) becomes
with y = ~(0). The initial condition is g(c, 0) = 0
(15)
Equation (14) is the desired relationship. This equation should be compared with the functional equations of invariant imbedding such as (2.13). Note that expression (2.14) also is for a process with zero duration. Although Eq. (14) has been obtained analytically, it also can be obtained by using a basic property of an optimal policy by purely verbal arguments. This basic property is known as the principle of optimality. This principle forms the cornerstone of dynamic programming and is possessed by most multistage decision processes. For simplicity, we have obtained the dynamic programming equations for a system with only one state variable. Similar equations can be obtained for multidimensional problems.
16.
DISCUSSION
21 1
Notice that the present approach not only avoided the two-point boundary-value difficulties, but also many other difficulties which are usually associated with the calculus-of-variations approach. This is due to the fact that the maximum of (14) not only can be obtained by means of calculus, but also by search techniques incorporated into the numerical solution schemes of (14). With a proper search technique, one can avoid the difficulties in handling inequality constraints and in answering the question whether a true maximum has been obtained. In addition, the dynamic programming approach also can handle unusual functions such as nonanalytical functions. Problems in which the control variable appears linearly also can be treated by dynamic programming, if we remember that constraints must be present in order for a linear problem to have an optimum. As a price in overcoming these difficulties, one encounters other forms of problems. Obviously, Eq. (14) cannot be solved easily if the dimension of c is large. Although Eq. (14) can be solved by using the difference equation before the limit is taken, there still is the dimensionality, difficulty for large dimensions of c. This dimensionality difficulty severely limits the number of state variables that can be handled by this approach. T h e dynamic programming technique has been used to treat various optimization problems. However, detailed discussions will not be given here. Our purpose is to show the connection between dynamic programming and invariant imbedding, and the difficulties we have overcome in using these approaches. T h e reader can consult any of the references cited earlier for more details.
16. Discussion
By using the concept of invariant imbedding, we have obtained expressions for the missing initial or the missing final conditions of a two-point boundary-value problem. Generally these expressions are nonlinear ordinary or partial differential equations of the initial-value type, depending on whether the original equations are linear or nonlinear. T h e ordinary differential equations are the well-known Riccati-type equations which can be solved fairly routinely on current computers. However, the numerical solutions of the partial differential equations are not always routine. This is especially true for large dimensional systems. Perhaps the greatest advantage to be gained from the invariant imbedding approach is its basic concept. Since we are treating a problem
212
6.
INVARIANT IMBEDDING
in a manner different from the usual or classical concept, many new formulations can be obtained for various problems in engineering and physical sciences. These new results often have distinct advantages over the original formulations both computationally and theoretically. As an example, we have shown the functional equation of dynamic programming. Although dynamic programming technique has its own difficulties, it possesses certain distinct advantages over the classical results. This concept will be applied to other problems in later chapters. Invariant imbedding and quasilinearization represent two completely different approaches for the two-point boundary-value problem. The concept of invariant imbedding constitutes an expansion of the original problem, while the quasilinearization technique represents an iterative approach. Quasilinearization is purely numerical, while invariant imbedding constitutes a completely different formulation of the original problem. The invariant imbedding approach also can be applied to systems in which conditions of the dependent variable are stated at both ends. Instead of the boundary conditions in (7.3), consider the following boundary conditions for the system (7.1): x(0) = 0
x(a) =
1
(1)
This type of boundary condition arises often in practice. Now, the missing final condition is
4
= &(a)
(2)
The following expression for R,(a) can be obtained by the same procedure as that discussed in Section 7:
If R,(u) were known at some point, then we could integrate this equation to find the missing final condition. For the present problem, an analytical condition can be obtained [7]. Since .(a) = 1 for all values of a, then owing to the other condition x(0) = 0, the derivative dx/dt must tend to infinity as n -+ 0. It can be seen from Eq. (7.la) that q12(t)y(t) -+ 00. Consequently, from (2) one obtains RIM
=
&a
according to the sign of qI2(a)as a + 0.
(4)
REFERENCES
213
REFERENCES 1. Ambarzumian, V. A., Diffuse reflection of light by a foggy medium. Compt. Rend. Acad. Sci. U.R.S.S. 38, 229 (1943). 2. Ambartsumian (Ambarzumian), V. A., “Theoretical Astrophysics.” Pergamon Press, Oxford, 1958. 3. Chandrasekhar, S., “Radiative Transfer.” Dover, New York, 1960. 4. Wing, G. M., “An Introduction to Transport Theory.” Wiley, New York, 1962. 5. Bellman, R., Kalaba, R., and Wing, G. M., Invariant imbedding and mathematical physics. I. Particle processes. J . Math. Phys. 1, 280 (1960). 6. Wing, G. M., Invariant imbedding and transport theory: A unified approach. J. Math. Anal. Appl. 2, 277 (1961). 7. Bailey, P. B., and Wing, G. M., Some recent developments in invariant imbedding with applications. J. Math. Phys. 6, 453 (1965). 8. Bellman, R. E., Kagiwada, H. H., Kalaba, R. E., and Prestrud, M. C., “Invariant Imbedding and Time-Dependent Transport Processes.” American Elsevier, New York, 1964. 9. Bellman, R., Kalaba, R., and Wing, G. M., On the principle of invariant imbedding and neutron transport theory. I. One-dimensional case. J. Math. Mech. 7, 149 (1958). 10. Bellman, R., Kalaba, R., and Wing, G. M., Invariant imbedding and neutron transport theory. 11. Functional equations. J. Math. Mech. 7, 741 (1958). 11. Bellman, R., Kalaba, R., and Wing, G. M., Invariant imbedding and neutron transport theory. 111. Neutron-neutron collision processes. J. Math. Mech. 8 , 249 (1959). 12. Bellman, R., Kalaba, R., and Wing, G. M., Invariant imbedding and neutron transport theory. IV. Generalized transport theory. J. Math. Mech. 8, 575 (1959). 13. Bellman, R., Kalaba, R., and Wing, G. M., Invariant imbedding and neutron transport theory. V. Diffusion as a limiting case. J. Math. Mech. 9, 933 (1960). 14. Bellman, R., Kalaba, R., and Wing, G. M., On the principle of invariant imbedding and one-dimensional neutron multiplication. Proc. Natl. Acad. Sci. U.S.43,517 (1957). 15. Bellman, R., Kalaba, R., and Wing, G. M., Invariant imbedding and neutron transport in a rod of changing length. Proc. Natl. Acad. Sci. US.46, 128 (1960). 16. Wing, G. M., Solution of a time-dependent, one-dimensional neutron transport problem. J . Math. Mech. 7, 757 (1958). 17. Bellman, R., Kalaba, R., and Prestrud, M., On a new computational solution of time-dependent transport processes. I. One-dimensional case. Proc. Natl. Acad. Sci. U.S. 47, 1072 (1961). 18. Bailey, P. B., and Wing, G. M., A correction to some invariant imbedding equations of transport theory obtained by “particle counting.” J. Math. Anal. Appl. 8,170 (1964). 19. Bellman, R., and Kalaba, R., Transport theory and invariant imbedding. In “Nuclear Reactor Theory” (G. Birkhoff and E. Wigner, eds.), pp. 206-218. Am. Math. SOC., Providence, Rhode Island, 1961. 20. Bellman, R., Kalaba, R., and Prestrud, M. C., “Invariant Imbedding and Radiative Transfer in Slabs of Finite Thickness.” American Elsevier, New York, 1963. 21. Bellman, R., and Kalaba, R., On the principle of invariant imbedding and propagation through inhomogeneous media. Proc. Natl. Acad. Sci. U.S. 42, 629 (1956). 22. Bellman, R., and Kalaba, R., On the principle of invariant imbedding and diffuse reflection from cylindrical regions. Proc. Natl. Acad. Sci. U . S . 43, 514 (1957). 23. Bellman, R., Kagiwada, H. H., and Kalaba, R., Invariant imbedding and a reformulation of the internal intensity problem in transport theory. RM-4539-PR. RAND Corp., Santa Monica, California, April, 1965.
214
6.
INVARIANT IMBEDDING
24. Bellman, R., and Kalaba, R., A note on nonlinear summability techniques in invariant imbedding. J. Math. Anal. Appl. 6 , 465 (1963). 25. Bellman, R., and Kalaba, R., Random walk, scattering, and invariant imbedding. I. One-dimensional discrete case. Proc. Natl. Acad. Sci. US.43, 930 (1957). 26. Bellman, R., and Kalaba, R., Invariant imbedding, random walk, and scattering. 11. Discrete versions. J. Math. Mech. 9, 411 (1960). 27. Bellman, R., and Kalaba, R., Functional equations, wave propagation and invariant imbedding. J. Math. Mech. 8, 683 (1959). 28. Bellman, R., and Kalaba, R., Wave branching processes and invariant imbedding. Proc. Natl. Acad. Sci. U.S. 41, 1507 (1961). 29. Bellman, R., and Kalaba, R., Invariant imbedding, wave propagation, and the WKB approximation. Proc. Natl. Acad. Sci. U.S. 44, 317 (1958). 30. Aroesty, J., Bellman, R., Kalaba, R., and Ueno, S., Invariant imbedding and rarefied gas dynamics. Proc. Natl. Acad. Sci. U.S. 50, 222 (1963). 31. Aroesty, J., Bellman, R., Kalaba, R., and Ueno, S., Alternative techniques for the invariant imbedding of rarefied couette flows. RM-3773-ARPA. RAND Corp., Santa Monica, California, August, 1965. 32. Bellman, R., and Kalaba, R., Invariant imbedding and the integration of Hamilton’s equations. Rend. Circ. Mat. Palermo [11] 12, 172 (1963). 33. Bellman, R., and Kalaba, R., A note on Hamilton’s equations and invariant imbedding. Quart. Appl. Math. 21, 166 (1963). 34. Bailey, P. B., A rigorous derivation of some invariant imbedding equations of transport theory. J . Math. Anal. Appl. 8, 144 (1964). 35. Preisendorfer, R. W., Invariant imbedding relation for the principle of invariance. Proc. Natl. Acad. Sci. U S . 44, 320 (1958). 36. Preisendorfer, R. W., Functional relations for the R and T operators on planeparallel media. Proc. Natl. Acad. Sci. U.S. 44, 323 (1958). 37. Preisendorfer, R. W., Time-dependent principles of invariance. Proc. Natl. Acad. Sci. U . S . 44, 328 (1958). 38. Preisendorfer, R. W., A mathematical foundation for radiative transfer theory. J . Math. Mech. 6 , 685 (1957). 39. Redheffer, R., Novel uses of functional equations. J . Rational Mech. Anal. 3, 271 (1954). 40. Mullikin, T. W., Principles of invariance in transport theory. J. Math. Anal. AppZ. 3, 441 (1961). 41. Rechard, O., Some applications of invariant imbedding to problems of neutron transport. I. Mono-energetic neutrons diffusing in one space dimension. J. Math. Anal. Appl. 4, 85 (1962). 42. Ueno, S., On the principle of invariance in a semi-infinite inhomogeneous atmosphere. Prop. Theoret. Phys. Kyoto 24, 734 (1960). 43. Bellman, R., Kalaba, R., and Wing, G. M., Invariant imbedding and the reduction of two-point boundary-value problems to initial value problems. Proc. Natl. Acad. Sci. U.S. 46, 1646 (1960). 44. Bellman, R., and Kalaba, R., Dynamic programming, invariant imbedding and quasilinearization: Comparison and interconnections. RM-4038-PR. RAND Corp., Santa Monica, California, March, 1964. 45. Bellman, R., Kagiwada, H., and Kalaba, R., Numerical studies of a two-point nonlinear boundary value problem using dynamic programming, invariant imbedding, and quasilinearization. RM-4069-PR. RAND Corp., Santa Monica, California, March, 1964.
REFERENCES
215
46. Sridhar, R., Bellman, R., and Kalaba, R., Sensitivity analysis and invariant imbedding. RM-4039-PR. RAND Corp., Santa Monica, California, March, 1964. 47. Bellman, R., Kagiwada, H., and Kalaba, R., Invariant imbedding and the numerical integration of boundary value problems for unstable linear systems of ordinary differential equations. RM-4800-PR. RAND Corp., Santa Monica, California, October, 1965. 48. Bellman, R., Kagiwada, H., and Kalaba, R., Quasilinearization, invariant imbedding, and the calculation of eigenvalues. RM-4738-PR. Rand Corp., Santa Monica, California, September, 1965. 49. Shoemaker, E. M., Invariant imbedding applied to eigenvalue problems in mechanics. J. Appl. Mech. 32, 47 (1965). 50. Bellman, R., Kagiwada, H., Kalaba, R., and Sridhar, R., Invariant imbedding and nonlinear filtering theory. RM-4374-PR. RAND Corp., Santa Monica, California, December, 1964. 51. Detchmendy, D. M., and Sridhar, R., Sequential estimation of states and parameters in noisy nonlinear dynamical systems. Presented a t Joint Autom. Control Conf., Troy, New York, June 22-25, 1965. 52. Bellman, R., Kalaba, R., and Wing, G. M., Invariant imbedding, conservation relations, and nonlinear equations with two-point boundary values. Proc. Natl. Acad. Sci. U.S. 46, 1258 (1960). 53. Bellman, R., Kalaba, R., and Wing, G. M., Dissipation functions and invariant imbedding. I. Proc. Natl. Acad. Sci. U.S. 46, 1145 (1960). 54. Hille, E., and Phillips, R., “Functional Analysis and Semi-Groups.” Am. Math. SOC.,Providence, Rhode Island, 1957. 55. Bellman, R., and Kalaba, R., On the fundamental equations of invariant imbedding. I. Proc. Natl. Acad. Sci. U S . 41, 336 (1961). 56. Bellman, R., and Kalaba, R., “Quasilinearization and Nonlinear Boundary Value Problems.” American Elsevier, New York, 1965. 57. Bellman, R., Functional equations in the theory of dynamic programming. V. Positivity and quasilinearity. Proc. Natl. Acad. Sci. U.S . 41, 743 (1955). 58. Kalaba, R., On nonlinear differential equations, the maximum operation, and monotone convergence. J. Math. Mech. 8 , 519 (1959). 59. Redheffer, R. M., Inequalities for a matrix Riccati equation. 1.Math. Mech. 8, 349 (1959). 60. Reid, W. T., Properties of solutions of a Riccati matrix differential equation. J. Math. Mech. 9, 749 (1960). 61. Redheffer, R. M., On solutions of Riccati equation as functions of initial values. J. Rational Mech. Anal. 5, 835 (1956). 62. Bellman, R., “Perturbation Techniques in Mathematics, Physics, and Engineering.” Holt, New York, 1964. 63. Bellman, R., “Dynamic Programming.” Princeton Univ. Press, Princeton, New Jersey, 1957. 64. Bellman, R., “Adaptive Control Processes: A Guided Tour.” Princeton Univ. Press, Princeton, New Jersey, 1961. 65. Bellman, R., and Dreyfus, S., “Applied Dynamic Programming.” Princeton Univ. Press, Princeton, New Jersey, 1962. 66. Roberts, S. M., “Dynamic Programming in Chemical Engineering and Process Control.” Academic Press, New York, 1964. 67. Aris, R., “The Optimal Design of Chemical Reactors.” Academic Press, New York, 1961.
216
6.
INVARIANT IMBEDDING
68. Ark, R., “Discrete Dynamic Programming.” Ginn (Blaisdell), Boston, 1964. 69. Forsythe, G. E., and Wasow, W. R., “Finite-Difference Methods for Partial Differential Equations.” Wiley, New York, 1960. 70. Courant, R., and Hilbert, D., “Methods of Mathematical Physics,” Vol. 11. Wiley (Interscience), New York, 1962. 71. Courant, R., and Friedrichs, K. O., “Supersonic Flow and Shock Waves.” Wiley (Interscience), New York, 1948. 72. Abbott, M. B., “An Introduction to the Method of Characteristics.” American Elsevier, New York, 1966. 73. Ames, W. F., “Nonlinear Partial Differential Equations in Engineering.” Academic Press, New York (1965). 74. Dreyfus, S. E., “Dynamic Programming and the Calculus of Variations.” Academic Press, New York, 1965.
Chapter 7
QUASILINEARIZATION AND INVARIANT IMBEDDING
1. Introduction
The quasilinearization and invariant imbedding procedures can be combined in at least two different ways [ l , 21. A predictor-corrector formula can be formulated in which invariant imbedding predicts the missing boundary condition and the quasilinearization procedure corrects this predicted value. As can be seen from Table 6.3, the predicted missing initial condition given by the invariant imbedding equations is not very accurate unless a very small step size d is used. On the other hand, the problem may not converge to the correct solution when the quasilinearization procedure is applied if the guessed initial value is too far removed from the correct value. Thus, invariant imbedding can be used to predict a better initial approximation for the quasilinearization procedure, while quasilinearization can be used to correct the predicted initial condition to obtain a more accurate solution. A second way to combine these two procedures is to use invariant imbedding to avoid the numerical solution of algebraic equations in the quasiliniearization procedure. We have fairly accurate schemes for obtaining the solution of a set of ordinary differential equations. However, as we have seen in the previous chapters, serious difficulties exist in solving a set of linear algebraic equations. T h e invariant imbedding approach can be used to avoid these difficulties. Some computational algorithms by the combined use of dynamic programming and quasilinearization are also discussed. It is shown that by the combined use of these two techniques the dimensionality for a large number of problems can be reduced to one. T h e aim of this chapter is to present a variety of computational algorithms by the use of quasilinearization, invariant imbedding, and 217
218
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
dynamic programming. No effort is made to cover all the combinations. Only some of the more promising ones are discussed. Most of the numerical examples discussed in this chapter have been solved in previous chapters by quasilinearization. Thus, a comparison can be made between the present procedures and those discussed in earlier chapters. 2. The Predictor-Corrector Formula T o illustrate this procedure, consider the tubular flow reactor with axial mixing. This problem has been solved by using the difference equation of invariant imbedding in Section 3, Chapter 6 . Let us see how the predictor-corrector formula can be used to improve the results obtained there. The system is represented by the following equations (see Section 3, Chapter 6): x'=y
(la)
+ NpeRX'
( 1b)
x(u)
=c
(24
Y(1)
=0
(2b)
y' = Npey
By considering a family of processes with different starting points, a, the imbedding equation is obtained. In difference form the equation is
with final condition r(c, t t ) = r(c, 1) = 0
0
(4)
where r(c, a ) represents the missing initial conditions of the different processes with different starting points, a, and with different values of the starting state variable, c. The system represented by Eqs. (1) and (2) also can be solved by the quasilinearization technique. These equations can be linearized by the generalized Newton-Raphson formula 4+1
= Y%+l
2. THE PREDICTOR-CORRECTOR FORMULA
219
with boundary conditions %+l(4 = c Yn+1(1) = 0
(6b)
However, the quasilinearization approach only can solve these different processes with different values of a and c separately. Thus, if the following grid points for a and c are considered
,..., 0
a=1,1-Ad,1-2A c = 0 , 6 , 26 )...,c
+
(7) (8)
+
there are ( l / d 1) (c/S 1) different processes to be solved independently by the quasilinearization technique. However, as shown in the results in Section 3, Chapter 6, the processes with a = 1 for all values of c and the processes with c = 0 for all values of a are trivial. Consequently, there are ( l i d ) (c/S) different processes only. With the numerical values listed in Eqs. ( 3 . 2 ~ and ) (3.10) of Chapter 6 and A t = 0.01 (9) the above equations are solved by the predictor-corrector approach. The Runge-Kutta numerical integration scheme has been used and A t is the integration step or integration interval. T h e missing initial conditions predicted by invariant imbedding for processes with starting point a = 1 - d are listed in Table 6.1. These missing initial conditions can be corrected by the quasilinearization technique. From Table 6.1, the missing initial condition for the process with c = 0.1 is obtained: T(C,
1 - 0) = y(1
-
A)
=
-0.0075
(104
The given initial condition for the process is x(l - 0 ) = c
=
0.1
(lob)
< <
with 1 - A t 1. T h e problem represented by Eqs. (1) and (10) is an initial-value problem that can be integrated easily. Using the results from this integration as the initial approximations for x and y , more accurate solution for the problem represented by Eqs. (l), (2b), and (lob) can be obtained by using the recurrence relations, Eq. (5), with the boundary conditions xn+Jl - 0 ) = c = 0.1 (114 Yn+1(1) = 0
(11b)
220
7.
QUASILINEARIZATION A N D INVARIANT IMBEDDING
Equations ( 5 ) and (1 1) constitute a linear boundary-value problem. If the state vector ~ % + ~is( tdefined ) as the two-dimensional vector with components ~ ~ + ~and ( t~ )% + ~ (the t ) ,general solution for these equations is represented by xn+,(t) = XP(n+l)(t) Xh(n+l)(t)an+l (12) ~ ) (the t ) homogeneous solution The particular solution vector ~ ~ ( ~ + and matrix Xh(n+l)(t)can be obtained by integrating (5) and its homogeneous form, respectively, with the following initial values:
+
Xh(n+1)(1- 4
(14)
=1
with c = 0.1. Since one initial condition is missing, only one set of homogeneous solutions is needed. The iterative procedure discussed in Section 16 of Chapter 3 can be used to obtain the more accurate solutions. More accurate solution for the next process with c = 0.2 can be obtained by the same procedure using T(C,
1 - 0) = ~ ( 1 A)
=
-0.030
(154
as the missing initial condition in obtaining the initial approximations. Obviously, the given initial condition is x(1
A)
= c = 0.2
(154 with 1 - A t 1. This procedure can be continued for all the processes with a = 1 - A and c = 0.3, 0.4,..., 1.0. The correct missing initial conditions from these calculations are shown in Table 7.1. -
< <
TABLE 7.1 MISSING INITIALCONDITIONS v(c, a) FOR a = 1 - A AFTER CORRECTION BY QUASILINEARIZATION C
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 .o
Y(C,
1 - A)
-0.0089706 -0.035674 -0.079805 -0.14107 -0.21919 -0.31388 -0.42489 -0.55195 -0.69483 -0.85328
2. THE
PREDICTOR-CORRECTOR FORMULA
22 1
Only one iteration of the quasilinearization technique is needed to obtain these missing initial conditions starting with the predicted values listed in Table 6.1. Further iterations do not change the values shown in Table 7.1. With r at a = 1 - d known, the values of r at a = 1 - 24 can be predicted approximately by Eq. (3.13) of Chapter 6 and Table 7.1. The computational procedure is the same as that described in Chapter 6. These predicted values are listed in the second column of Table 7.2. TABLE 7.2 MISSING INITIAL CONDITIONS r(c, a) FOR a = 1 - 24
C
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 .o
Predicted r(c, 1 - 24)
Corrected r(c, 1 - 24)
-0.01 3056 -0.05 1701 -0.1 1518 -0.20277 -0.31379 -0.44760 -0.60358 -0.781 14 -0.97972 -1.1988
-0.013735 -0.054027 -0.11962 -0.20938 -0.32228 -0.45741 -0.61392 -0.79104 -0.98806 - 1.2043
More accurate values can be obtained from these predicted values by the same procedure as that used in obtaining Table 7.1 with the exceptions that a = 1 - 24 and that the duration of these processes equals 24. Thus, from the second column of Table 7.2, the missing initial conditions for c = 0.1 is obtained T(C,
1 - 24) = ~ ( 1 24) = -0.013056
(164
and the given initial condition for this process is x(1 - 24) = c = 0.1
< <
(16b)
with 1 - 24 t 1. Initial approximations can be obtained from Eqs. (1) and (16). Then the quasilinearization procedure can be applied to Eq. (5) with the boundary conditions xn+l(l - 24)
= c = 0.1
rn+l(l) = 0
222
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
This procedure, again, can be continued for all the processes with a = 1 - 24 and c = 0.2, 0.3,..., 1.0. These more accurate values are shown in the third column of Table 7.2. These values are obtained from the values listed in the second column of Table 7.2 with only one iteration. Further iterations do not change these values. T h e correct values for r at a = 1 - 3 4 also can be obtained by the same procedure. This procedure can be continued for all the grid points of a. T h e last table for r(c, 0) is shown in Table 7.3. Similar tables exist for a = 1 - 34, 1 - 4d,... . TABLE 7.3 MISSING INITIALCONDITIONS ~ ( c a) , FOR a
C
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 .o
=
0
Predicted 7(c, 0)
Corrected
-0.019028
-0.018822 -0.071737 -0.15482 -0.26529 -0.40104 -0.56040 -0.74199 -0.94464 -1.1674 - 1.4093
-0.072429 -0.15617 -0.26743 -0.40406 -0.56436 -0.74695 -0.95067 -1.1766 - 1.4225
7(c,
0)
I n the above calculations, not only the missing initial conditions for all the processes, but also the complete solutions for Eqs. (1) and (2) for all the values of a and c with 4 = 6 = 0.1 have been obtained. A total of 100 processes have been solved. Approximately over 10 seconds are needed to perform these computations on the IBM 7094 computer. T h e solution for the process with a = 0 and c = 1 is listed in Table 7.4. T h e improved values listed in Table 7.3 should be compared with the values predicted by invariant imbedding, listed in the second column of Table 6.3. T h e initial conditions for the original problem with boundary conditions (3.16) of Chapter 6, again, can be obtained from the third column of Table 7.3 by linear interpolation. With x, = 1, these conditions are ~ ( 0=) 0.83104 y ( 0 ) = -1.01378 T h e actual values from Table 3.1 are ~ ( 0=) 0.83129
y ( 0 ) = -1.0122
3.
223
DISCUSSION
TABLE 7.4 SOLUTION FOR
THE
PROCESS WITH a
=
0 AND
c =
1
tk
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.o
1.o
- 1.4093
0.87490 0.77537 0.69462 0.62807 0.57258 0.52606 0.48733 0.45623 0.43412 0.42508
- 1.1095
-0.89227 -0.73026 -0.60595 -0.5073 1 -0.42500 -0.34988 -0.27006 -0.16582 0.30517 x
Values almost as good as those shown above have been obtained in Chapter 6 with A = 6 = 0.01. However, only the missing initial conditions, not the complete solutions have been obtained there in spite of the fact that more computing time has been used. 3, Discussion
T h e quasilinearization procedure does not have to be applied to every process. Suppose only the process with a = 0 and c = 1 is to be considered; then the missing initial condition can be predicted by invariant imbedding as has been discussed in Section 3 of Chapter 6. From the second column of Table 6.3 at c = 1.0, we obtain the predicted missing initial condition for this particular process: r(1,O)
= y(0) =
-1.4274
Using this value, initial approximations for x and y can be obtained and thus the quasilinearization procedure can be used to obtain a more accurate y(0). At the same time, the complete solution for this process with a = 0 and c = 1 also is obtained. As has been discussed in Section 14 of Chapter 6,-the use of the difference equations of invariant imbedding to obtain the missing initial conditions is limited to problems with small number of variables only. T h e computational procedure to be discussed in the next section has a much wider applicability. This procedure is based on linear differential equations which can be obtained from nonlinear equations by the generalized Newton-Raphson formula.
224
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
4. Linear Boundary-Value Problems
T h e invariant imbedding approach can be used to replace the numerical solution of algebraic equations in the quasilinearization procedure. To illustrate this, consider the nonlinear second-order differential equation d2x + q1(t) -ax& dt2
+42(W
=
O
with boundary conditions x(0) = 1
with 0
< t < tf . Equation (1) can be written as dx
=Y
dY
dt = -4dt)Y
-
Applying the generalized Newton-Raphson formula, we obtain x:+1
= Y,+l
Yh+l = -41WYfi+1
- 2&)XnXn+1
+ 42(t)X:
with boundary conditions
%+do) = 1 Y n + d f f )= 0
Equations (4) and ( 5 ) represent a linear two-point boundary-value problem. Two different approaches have been used to solve this problem in Chapter 3. T h e first one is based on the superposition principle; and the second one is the finite-difference method. Both of these approaches have limitations. Because the rapid-access memory in current computers is limited, the finite-difference method is limited to problems with small number of variables. T h e problem of ill-conditioning in solving the algebraic equations can cause considerable difficulties when the first approach is used. Invariant imbedding can be used to form the third approach. This approach avoids the numerical solution of algebraic
4. LINEAR
225
BOUNDARY-VALUE PROBLEMS
equations. However, both this and the first approaches may have stability problems caused by the marching integration technique. T o use the invariant imbedding approach, consider again the problem with the more general boundary conditions (64
%+,(a) = c
YTZ,l(tf) = 0 (6b) An expression for the missing initial condition for the system represented by (4)and (6) can be obtained by considering a family of processes with different starting points, a. Let Yn+1(4 = rTZ+,(c, 4
(7)
+
where Y,+~ represents the missing initial condition for the (n 1)st quasilinearization iteration. We can obtain the invariant imbedding equation from Eq. (12.5) of Chapter 6
=
-q1(4rn+1(c,
4 - 2qz(a)xn(a)c + 4 2 ( a ) g ( 4
(8)
remembering that the variables with subscript n are known variables. T h e final condition for Eq. (8) is rn+,(c, 5) = 0
(9)
Since Eq. (4)is linear, the function r,+, can be expressed as rn+,(c, 4 = c 5 n + 1 ( 4
+
rln+1(4
(10)
Substituting (10) into (8) and equating terms involving like powers of c, we obtain
Equation (11) could have been obtained directly from Eq. (13.5) of Chapter 6. From Eqs. (9) and (lo), we see that 5n+1(tr) = 0
.ITZ+dtr) = 0
(12)
Equations (11) and (12) constitute a nonlinear initial-value problem. T h e missing initial condition for the original systems (4) and (6) can be obtained by integrating these equations.
226
7.
QUASILINEARIZATION A N D INVARIANT IMBEDDING
Equations (1) and (2), which are now represented by the recurrence relations (4),( 5 ) , (1l), and (12), can be solved in the following iterative manner. With an assumed initial approximation for xnSo(t)= xnz0(u), Eq. (1 1) can be integrated backward starting at the final condition (12). Thus, we have the functions {,+,,,(a) and ~ ~ + , , ~ (for a ) all the processes with different starting points, a. We can then obtain the missing initial condition for the original process with a = 0 from the equation
remembering that the value of c for the original process is x,+,(O) = 1. Now, Eqs. (4),(5a), and (13) with n 1 = 1 become an initial-value problem and the results of the first quasilinearization iteration can be obtained by integrating these equations with the assumed initial approximation xo(t). With xl(t) and yl(t) known, Eq. (1 1) can be integrated with n = 1 to obtain the functions {n+l=2(a) and ~ , + ~ , ~ ( aand ) hence the missing initial condition, ~ , + , = ~ ( 0Thus, ) . the results for the second iteration can be obtained. This procedure can be continued until no more improvements on the values of x and y can be obtained. Notice that there are two independent variables in the above equations. T h e independent variable in systems (4)and (5) is t, while in the invariant imbedding equations (1 1) and (12) it is a. Notice also that the missing initial condition is obtained by integrating (1 1) backward starting with (12), which obeys the given final condition. Then, on the basis of this newly obtained missing initial condition, the solutions of (4)and ( 5 ) are obtained by integrating (4)forward. Thus, the calculated value of the given final condition, y,+,( tr), depends on two integration processes which are performed in series. Consequently, the present procedure is very sensitive to the accuracy of the integration processes. Obviously, this procedure is not suited to problems which are unstable when the marching integration technique is used. However, since no system of algebraic equations is solved, it seems to be more suited to problems with ill-conditioned algebraic systems.
+
5. Numerical Results
T h e problem formulated above is solved with the following numerical values: t , = 1.0 4 d t ) = -6 (1) q z ( t ) = -12 At da = 0.01
5.
227
NUMERICAL RESULTS
where d t and da are the integration step sizes for Eqs. (4.4) and (4.1 l), respectively. With the initial approximation equal to the given initial condition, X,Jtk)
=
1.0
Fz
=
0, 1, 2 ,..., N
(2)
TABLE 7.5
CONVERGENCE RATESWITH INVARIANT IMBEDDING
Iteration 1
0 0.2 0.4 0.6 0.8 1 .O
1 .O 0.78880 0.66685 0.59664 0.55740 0.54222
-1.3723 -0.79251 -0.45732 -0.261 74 -0.13737 -0.1io10 x 10-4
-2.7445 -2.7442 -2.7409 -2.7083 -2.3933 0.0
1.3723 1.3721 1.3705 1.3541 1.1967 0.0
Iteration 2
1 .O
1 .O 0.77547 0.62838 0.52591 0.44961 0.38042
- 1.4091 -0.89141 -0.60511 -0.43401 -0.34280 -0.38498
0 0.2 0.4 0.6 0.8 1.o
1 .O 0.77537 0.62807 0.52608 0.45633 0.42546
- 1.4093
0 0.2 0.4 0.6 0.8 1 .O
1 .O 0.77537 0.62807 0.52608 0.45634 0.42559
- 1.4093
0 0.2 0.4 0.6 0.8
1 .O 0.77537 0.62807 0.52608 0.45634 0.42560
- 1.4093
0 0.2 0.4 0.6 0.8
-2.5155 -2.1346 - 1.9007 - 1.7281 - 1.4025 0.0
1.1064 0.76436 0.59321 0.49566 0.38497 0.0
Iteration 3 -0.89226 -0.60591 -0.42483 -0.26931 -0.17480
-2.5003 -2.0697 -1.7571 - 1.4901 - 1.0994 X
lo-'
0.0
1.0909 0.71251 0.49766 0.35904 0.23208 0.0
Iteration 4 -0.89226
-0.60591 -0.42481 -0.26921 0.38191 x lo-'
-2.5002 -2.0695 -1.7583 - 1.5015 - 1.1418 0.0
1.0908 0.71235 0.49838 0.36489 0.25083 0.0
Iteration 5
1 .O
-0.89226 -0.60590 -0.42481 -0.26919 0.38776 x lo-'
-2.5002 -2.0695 - 1.7583 -1.5016 -1.1419 0.0
1.0908 0.71235 0.49839 0.36490 0.25087 0.0
228
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
with t,,, - t, = A t , the results listed in Table 7.5 are obtained. The Runge-Kutta integration scheme is used for both Eqs. (4.4) and (4.11). Since y,(t) does not appear in Eq. (4.4), the initial approximation yn=O(tk) is not needed. Each iteration takes approximately less than half a second to compute on the IBM 7094 computer. Table 7.5 shows that the functions 5 and 7 at a = 0.8 have the slowest convergence rates. Furthermore, it shows that the accuracy of y ( t ) at t near tf is not very good. T h e value of y(tf) should be zero, but a value of 0.38776 x is obtained. Thus, it seems that the accuracy of the solution for x and y is not as good as the results obtained by the superposition principle. With the numerical values listed in Eq. ( l ) , this problem is the same as that solved in Section 3 of Chapter 6 or Section 2 of Chapter 7 for c = 1 and a = 0. Thus, Table 7.4 can be compared with Table 7.5. T h e accuracy can be improved by a reduction in the step size, A t , used. T h e influence of the initial approximation on the convergence rates is shown in Table 7.6. Only the missing initial and missing final conditions are shown. It can be seen that the convergence rates are almost independent of the initial approximations within the range tested. No convergence has been obtained with xo(t,) = 5, k = 0, 1, 2, ..., N . Except for the differences in the given initial conditions, the present problem is the same as that solved in Section 5 of Chapter 3. Thus, approximate comparisons also can be made with the results obtained there. That convergence has been obtained with xo(t,) = 10 in Chapter 3 seems to suggest that the present approach has a smaller interval of convergence. I n order to avoid interpolations, the two step sizes, A t and d a , should be equal. Equation (4.11) must be integrated backward. It can be TABLE 7.6 AS
CONVERGENCE RATESOF x(1) AND y ( 0 ) FUNCTIONS OF INITIAL APPROXIMATION, INVARIANT IMBEDDING
W0(tk) =
Iteration
x(1)
0.0 y(0)
XO(tk) =
0.01
XO(tk)
=
0.1
XO(tb) =
2.0
41)
Y(0)
41)
Y(0)
41)
Y(0)
0.96751 0.46717 0.38156 0.42560 0.42559
-0.03945 -1.3748 -1.4091 - 1.4093 - 1.4093
0.74046 0.14186 0.41168 0.42561 0.42559
-0.35713 -1.3919 -1.4093 - 1.4093 - 1.493
1.0 0.54222 0.38042 0.42546 0.42559
0.0 -1.3723 -1.4091 - 1.4093 -1.4093
~ _ _ _ _
~
1 2 3 4 5
1.0 0.54222 0.38042 0.42546 0.42559
0.0 -1.3723 -1.4091 -1.4093 -1.4093
6.
OPTIMUM TEMPERATURE PROFILES IN TUBULAR REACTORS
229
shown easily that the same Runge-Kutta formula can be used for backward integration,. provided that the integration step size d a is replaced by --da.
6. Optimum Temperature Profiles in Tubular Reactors
In order to test the combined quasilinearization and invariant imbedding procedure and also to compare it with other approaches, the problem solved in Section 3 of Chapter 5 will be solved by this approach. T h e equations for the state variables and Lagrange multipliers are (see Section 2 of Chapter 5 )
dhl = k,h,
dt
-
k,X,
with boundary conditions X,(O)
= x;
T h e control variable T ( t ) is obtained from the following algebraic equations: XlklEl(h1
-
A,)
+ x,k,E,X,
=0
(3)
and
Equations (1)-(4) represent the system to be solved. T h e above equations have been linearized in Section 2 of Chapter 5, by the generalized
230
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
Newton-Raphson formula. These linearized equations have been listed in (2.17) of Chapter 5 and can be represented symbolically as follows:
d xl.n+l 4 1 i . n ( t ) ~ i . n + i+ qi2.n(t)Xzmn+i + ~ i i . n ( t ) L n + i dt
dxz,n+l
-dt
+ -
qZl,n(t)Xl.n+l
+
+
+ hz,n(t)
+
vlz.n(t)&,n+l
4 .n+l - ~ z l . r r ( t ) ~ l . n + l -dt
+
+
(54
+
q Z ~ . n ( t ) ~ ~ . n + l~ l , n ( t ) h l , n + l
Pzz,n(t)hz,n+1
4 .n+l - Wll.n(t)Xl.n+l -dt
+
+h l M
P1z,n(t)hz.n+1
“zz.n(t)~z,n+l
wlZ.n(t)X*,nil
+
(5b)
+
Vll.n(t)l,.n+l
(5 4
~l,n(t)
Wzz.n(t)Xz,n+i
+ %(t)
+
Wz1,n(t)Ln+1
(54
with boundary conditions xl,n+l(o)= x;
(64
4
(6b)
XZ.,+l(O)
=
hl,n+l(G)
=0
(64
1 (64 The control variable T(t) has been eliminated from the differential equations by using Eqs. (3) and (4) before linearization. The coefficients q, p , w , v , h, and u are functions of the variables x ~ , x~ ~, , Al,n, ~ , A,,n, which are known functions and are obtained from the previous nth iteration. The exact forms of these coefficients can be obtained by comparing Eq. (5) with Eq. (2.17) of Chapter 5. The system represented by Eqs. (5)and(6)has been solved in Chapter 5 by the superposition principle. This system also can be solved by obtaining the missing initial conditions by invariant imbedding. Thus, the original boundary-value problem becomes an initial-value probiem that can be solved by marching integration techniques. T o use the invariant imbedding approach, the more general boundary conditions hz,n+l(tf)
=
Xl.ra+l(4
= c1
(74
Xz,n+1(4
= CZ
(7b)
6.
OPTIMUM TEMPERATURE PROFILES I N TUBULAR REACTORS
23 1
< <
with a t tf again can be considered. Equations ( 5 ) and (7) are essentially the same equations as those listed in (13.1) and (13.2) of Chapter 6 with M = 2. T h e h in Eq. (5) corresponds to y in Eq. (13.1) of Chapter 6. If 4*n+l(a) = T1.n+&1 > c2 > 4 (84 Az*n+1(4 = Tz.n+1(C1
3
c2
9
4
(8b)
the invariant imbedding equations are
Equations (9) and (10) are obtained from Eqs. (13.5) and (13.6) of Chapter 6. T h e functions 5 and 77 are defined by Tl*n+l(Cl
9
CZ >
TZ*n+l(Cl
t
CZ
4 = C1511.n+1(4 4 = C1521.n+1(4
+ +
C251z.n+1(4 C2522.n+1(4
+ +
%,@+1(4
(114
rlz,n+1(4
(Ilb)
With the nth iteration known, the missing initial conditions for the (n 1)st iteration, Al,n+l(0)and A2,n+l(0), can be obtained by integrating (9) backward starting at the final conditions, Eq. (10); and by using Eqs. (8) and (11) at a = 0. Once these two missing initial conditions are obtained, the results for the (n 1)st iteration can be obtained by integrating ( 5 ) numerically. This iterative process can be continued.
+
+
232
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
7. Numerical Results
Using the equations and procedures discussed in the preceding section, some numerical experiments have been performed. This procedure will not converge if the numerical values listed in Eqs. (3.1)-(3.3) of Chapter 5 are used with (1)
da = d t
The values of the functions <(a) and ~ ( a increase ) rapidly during the numerical integration of the first iteration and extremely large values for these functions have been obtained at a = 0. However, convergence can be obtained if the initial approximations are obtained by using the following assumed temperature profile: T,(t,) = 335°K
k
= 0,
1, 2 ,...,N
(2)
These initial approximations have been obtained by first integrating Eqs. (6.la) and (6.lb) with (6.2a) and (6.2b) as the initial conditions and with T(tk)given by (2). T h e values of the Lagrange multipliers are then obtained by integrating Eqs. ( 6 . 1 ~ and ) (6.ld) backward with (6.2~)and (6.2d) as the final conditions. With the initial approximations obtained in this manner and with the numerical values listed in Eqs. (3.1) and (3.2) of Chapter 5 , the results listed in Table 7.7 are obtained. A figure very similar to Fig. 5.2 would be obtained if the convergence rate of the temperature profile were plotted. T h e optimum values for the functions and 77 are shown in Figure 7.1. Table 7.7a should be compared with
<
a
FIG.7.1. Optimum values of 1 and 7 , tt
=
8.
7.
233
NUMERICAL RESULTS
Table 5.2. Notice that the convergence rates for these two approaches are almost the same. However, since no convergence was obtained when the given boundary conditions were used as the initial approximations, the present procedure seems to have a smaller interval of convergence than the procedure used in Section 3 of Chapter 5. TABLE 7.7a CONVERGENCE RATESWITH t, Iteration
0 1 2 3 4
XI@,)
0.21 120 0.17760 0.17058 0.17044 0.17043
X&f)
0.67248 0.67737 0.67935 0.67943 0.67943
=
8
AND
To&) = 335°K
4(O)
UO)
T(O)
T(tf)
0.55788 0.60293 0.60946 0.61000 0.61000
0.87629 0.84683 0.82873 0.82823 0.82823
335.00 342.55 340.90 340.82 340.82
335.00 337.06 335.94 335.89 335.89
TABLE 7.7b
CONVERGENCE RATES
1 2 3 4 5
0.11490 0.12861 0.13607 0.13590 0.13591
WITH
-0.15062 -0.16847 -0.16547 -0.16514 -0.16515
tf
=
8
AND
-0.15062 -0.16847 -0.16547 -0.16514 -0.16515
TO&)= 335°K
0.35652 0.22436 0.20126 0.20072 0.20072
0.60680 0.61374 0.60903 0.60898 0.60898
0.77336 0.82154 0.82939 0.82945 0.82945
Some numerical experiments also have been performed with the more severe reaction conditions listed in (3.5) of Chapter 5. No convergence was obtained when the initial approximations were sbtained from the assumed temperature profile listed in (3.7) of Chapter 5. I n fact, even with the better initial temperature profile obtained from Eqs. (3.8) and (3.9) of Chapter 5, convergence still cannot be obtained. To obtain convergence, a smaller integration step size is needed, and thus a better accuracy in integration is obtained. Instead of Eq. (3.5) of Chapter 5, the following numerical values are used: t,
=
10 minutes
x! = 0.95 mole/liter
x i = 0.05 mole/liter
A t = 0.01
(3)
234
7.
QUASILINEARIZATION A N D INVARIANT IMBEDDING
T h e initially assumed temperature profile is obtained by using Eqs. (3.8) and (3.9) of Chapter 5 ; and the initial approximations are obtained from this initially assumed temperature profile by integration. Use of the reaction rate constant listed in (3.1) of Chapter 5 gives the results shown in Table 7.8. T h e optimum values of the functions 5 and 7 are shown in Figure 7.2. Table 7.8a should be compared with Table 5.5. T h e conver-
0
2
4
6
10
8
a
FIG.7.2. Optimum values of 1 and 7,tt
=
10.
gence rates for these two procedures, again, are quite similar. However, Table 7.8 was obtained with a much smaller integration step size than that used in obtaining Table 5.5. T h e obtained value of A,($), which is Since this value should be zero, not shown in Table 7.8, is 0.23 x an accuracy of 0.23 x only is obtained at this final point. A much TABLE 7.8a
CONVERGENCE RATESWITH t,
0 1 2 3
4 5
0.16542 0.17709 0.17253 0.17265 0.17264 0.17264
0.67805 0.68069 0.68025 0.68012 0.68012 0.68012
0.67630 0.67704 0.67846 0.67859 0.67858 0.67859
=
10
0.71152 0.70862 0.70938 0.70948 0.70948 0.70948
345.00 360.44 359.96 359.94 359.94 359.94
335.00 335.72 336.07 336.11 336.1 1 336.11
8.
235
DISCUSSION
TABLE 7.8b
CONVERGENCE RATESWITH
1 2 3 4 5
0.85653 0.13502 0.11586 0.11549 0.11551
t, = 10
x -0.82157 x -0.82159 X 0.45777 x lo-' -0.20195 x lo-' -0.20195 X lo-' 0.36437 x lo-' -0.20494 x lo-' -0.20494 x lo-' 0.36339 x lo-' -0.20458 x lo-' -0.20458 X 10-l 0.36325 x lo-' -0.20460 x lo-' -0.20460 X lo-' 0.36326
0.66894 0.67819 0.67851 0.67851 0.67851
0.68652 0.71035 0.71078 0.71076 0.71076
higher accuracy has been obtained by using the superposition principle even with a much larger integration step size (see Table 5.4). No convergence can be obtained if the following values are used to replace the values listed in Eq. (3.8) of Chapter 5: To(0)= 360°K
T o ( t f )= 335°K
(4)
The other numerical values used remain the same. Notice that Figs. 7.1 and 7.2 are very similar. In fact, if the right-hand portion of Fig 7.2 for a = 2 to a = 10 is compared with Fig. 7.1, we find that they are almost the same. This is not surprising. T h e initial conditions for the problem with tr = 8 are xIo = 0.53 and x20 = 0.43; while from the problem with tf = 10, we obtain x1 ( t = 2) = 0.55255 and x2 ( t = 2) = 0.41405 (see Table 5.4). Thus, the problem with tf = 8 is almost the same as the problem with tf = 10 except that the former problem starts 2 minutes later. T h e initial temperature profile listed in Eqs. (3.8) and (3.9) of Chapter 5 has been estimated from the optimum temperature profile of the problem with tr = 8. T h e Runge-Kutta integration scheme has been used for all the numerical integrations discussed in this section.
8. Discussion
T h e combined quasilinearization. and invariant imbedding procedure is very sensitive to the numerical errors of the integration procedure. Thus, a much smaller integration step size is needed when this procedure is used. When the difficulties in solving the problem lie in the numerical integration process, this procedure is not suitable. On the other hand, it should be used when the difficulties in solving the problem are connected with the numerical solution of the algebraic equations.
236
7. QUASILINEARIZATION
A N D INVARIANT IMBEDDING
9. Dynamic Programming and Quasilinearization-I
For optimization problems, dynamic programming also can be used to form various combinations of numerical procedures [l, 3, 61. Quasilinearization and dynamic programming can be combined in various ways. In the first place, dynamic programming can be used to replace invariant imbedding in the predictor-corrector formula discussed in Section 2. A search procedure must be added when dynamic programming is used. Second, the original problem can be divided into a series of subprobbms. Quasilinearization can be used to obtain the optima of these subproblems first. Then dynamic programming can be used to obtain an approximate solution of the original problem by combining these subproblems in an optimum manner. To illustrate the procedure, consider the minimization of the integral
J
=
J t ’ f ( x , x’) dt 0
with the terminal conditions x(0) = cg
(24
4 t f ) = Cf
(2b)
Instead of solving the above problem directly, let us consider the problems with the shorter duration
(3) with t, = 0 and tN = tf . In other words, we have divided the original problem into (N - 1) subproblems. Now, let us see what the terminal conditions of these subproblems are. The terminal condition at t, is given by (2a). However, the terminal condition at t, is unknown. A series of terminal conditions will be allowed at this point. Suppose the value of x at t, can be reasonably assumed to be within the range xa
< <
xb
(4)
Then we can assume m terminal conditions at t, with the ith terminal condition as q t * ) = x,
+- i
x b - xa
m-1
i
= 0,1,2,..., ( m - 1)
9.
DYNAMIC PROGRAMMING AND QUASILINEARIZATION-I
237
Thus, in the interval [tl = 0, t,], m optimization problems must be solved by the quasilinearization technique. Each problem is represented by Eq. (3) with k = 1. T h e initial conditions for these problems are given by (2a) and the final conditions are given by ( 5 ) with i = o , 1 , 2 ,..., ( m - 1 ) . T h e next subproblem with the interval [t, , t,] can be treated in the same manner except that now both the initial and final terminal condi) be tions are unknown and all the possible values for x ( t z ) and ~ ( t , must considered. This procedure can be continued until the last subinterval in which the initial terminal is unknown. But, the final terminal is known and is given by Eq. (2b). Once the optima for all the subproblems are obtained, the optimum of the original problem with the interval [0, tr] can be obtained easily by dynamic programming. Consider the first subinterval, From co , we can go to any of the m points at t, . However, only one of these points gives the minimum value of (1). From these points at t , , we can go to any of the points at t, . This process can be continued. T h e problem is to find the best way to go from co to ct . This is a special case of the general routing problem which is especially suited for dynamic programming and has been considered in detail in various publications [4, 51. T h e functional equation of dynamic programming can be established easily. Let hidtk)
=
I
the minimum of
Jk with terminal conditions x t i l ( t k )and ~ ‘ j ) ( t ~ + ~ )
and gi(‘?k)
=
+
1
+ +
the minimum of the sum h,(t,) hil(tk+l) ... h i j ( t ~ - l ) ) where the process begins at tk with the starting terminal diI(tk)j
Note that the subscripts i and j in the definition of g are optimum values at times tk+l , t,,, ,..., t N - , . At time t, , the value o f j is optimum, but the value of i is not. On the other hand, at time t N P l ,the subscript i is optimum, but j must correspond to the given terminal condition ct . T h e principle of optimality yields the functional equation gdtk) = mp[hij(tk)
fg j ( t k + l ) ]
=
2,***,( N - 2,
(6)
T h e optimum of the last subinterval can be obtained by considering a process with duration t = t,-l to t = t , , gi(tN-1)
= hidtN-1) = hicf(tiv-l)
(7)
238
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
Thus, the optimum of the original process can be obtained by minimizing Eq. (6) recursively starting at the last subinterval represented by Eq. (7). This is essentially an optimization problem with N - 1 stages. The optimum obtained is, in general, not the true optimum, but only an approximate one. This approximate result can be used as the initial approximation and the quasilinearization procedure, again, can be used to obtain better results. 10. Discussion
As has been shown in Section 12 of Chapter 2, there are two ways to ensure convergence of the quasilinearization procedure. The first is to obtain an initial approximation which is sufficiently close to the desired solution; and the second is to make the interval of interest of the independent variable [ t o ,tr] sufficiently small. The simplest way to make this interval small is to consider a process with shorter duration first, and then use the results of this process to solve a process with longer duration. As has been discussed in Section 7, this approach has been used to obtain the initial temperature represented by Eqs. (3.8) and (3.9) of Chapter 5 from the results of the process of shorter duration with tf = 8. The procedure discussed in the preceding section constitutes a more sophisticated way to reduce the interval of interest of the variable. It is true that this procedure is fairly time consuming when x is multidimensional. However, if only an approximate initial approximation is needed, fairly small values of N and m can be chosen and hence the time required can be reduced considerably. 11. Linear Differential Equations
We have seen in previous chapters that the quasilinearization procedure is a useful tool for solving nonlinear boundary value problems. In the next section it will be shown that this procedure also can be used to reduce the dimensionality of an optimization problem when dynamic programming is used. However, before we discuss this approach, some well-known results concerning the solution of linear differential equations will be summarized. Consider the linear differential equations with variable coefficients
12.
DYNAMIC PROGRAMMING AND QUASILINEARIZATION-I1
239
I n vector-matrix notation, Eq. (1) becomes
with initial conditions x(0) = xo
(3)
where Q ( t ) is an M x M matrix, and p(t) and x are M-dimensional vectors. T h e solution of (2) is [7, 81
+ 1 X(t)X-'(s)p(s) ds t
x(t) = X(t)xo
0
(4)
where X ( t ) is an M x M matrix and is the solution of the matrix equation dX dt
- = Q(t)X
with initial conditions X(0)
where I is a unit matrix. At t
=
=
I
tr , Eq. (4) becomes
where c
=
X(tf)XO
K(s)
=
X(tt)X-'(s)
(7)
and c is an M-dimensional constant vector and K(s) is an M x M matrix. Equation (6) can be rewritten as
12. Dynamic Programming and Quasilinearization-I1
Now we wish to show that by the combined use of dynamic programming and quasilinearization a reduction in the dimensionality of an optimization problem can be obtained. Consider the problem of maximizing the function +I(b),
XZ(tf)!..., x m ( 5 ) )
(1)
240
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
over the control variables z(t), which are related to the state variables x by means of the nonlinear differential equations dxi -=ffi(x,z) dt
i = 1 , 2,..., M
(2)
1, 2, ..., M
(3)
with initial conditions X i ( 0 ) = x:
i
=
<
where m < M , 0 \< t tf , and x and z are M-dimensional vectors. I n addition, the problem must satisfy the constraints zi.min
< z i ( t ) < zi,max
i
= 1, 2,.-, M
(4)
For simplicity, the number of control variables has been assumed to be equal to the number of state variables. Obviously, the procedure to be discussed can also be applied if this is not the case. If the functional equations of dynamic programming are used, this problem involves the computation and storage of functions of M variables. However, Bellman and Kalaba [9, 101 have shown that if Eq. (2) were linear, the above problem could be treated by dynamic programming involving sequences of functions of m variables. Since m is equal to one or two for a number of significant problems, this is a very important reduction in the dimensionality of the problem. This is especially true in view of the fact that Eq. (2) can be linearized by the quasilinearization procedure. Thus, an iterative scheme can be formed by the combined use of dynamic programming and quasilinearization. Applying the generalized Newton-Raphson formula, Eq. (2) can be linearized
I n vector-matrix notation, Eq. (6) becomes d%+l dt - f (xn 9 zn)
+ J(xn
zn)(xn+i - xn)
+ Jz(xn
>
zn)(zn+1
- zn) (7)
where Jz(x,, z), is the same Jacobi matrix as that in Eq. (17.10) of Chapter 2, except that the differentiation is with respect to z not x.
12.
24 1
DYNAMIC PROGRAMMING AND QUASILINEARIZATION-I1
I n obtaining Eq. (7), we have considered both x and z as unknown functions. Comparing Eqs. (11.2) and (7), we obtain Q(t>
=
J(xn
(8)
2,)
+
2,) - J ( x n G)X, JAxn > ~ n ) ( ~ n + l2,) (9) Using Eqs. (8) and (9), the solution of (7) can be represented by Eq. (1 1.8). Introducing the Lagrange multiplier A, the problem becomes the maximization of
~ ( t= ) f (xn
J
7
= + ( ~ l ( t f )x*~ t f ) , * - *Xvm ( t r > ) -
J”
tf 0
f ( z )dt
(10)
over all z ( t ) ,satisfying Eqs. (2)-(4). Using Eq. (11.8), Eq. (10) becomes
where z,+,(t) are the unknown control variables after n iterations. If we consider X as a known parameter, the maximum value of Eq. (11) depends only on c1 , c2 ,..., c, , and tj . Furthermore, by examining Eqs. (11.5), (11.7), and (8), it can be seen that c is independent of the control variables zn+l(t). Thus, we wish to imbed the original problem with particular values of cl, c2 ,..., c, and duration tf within a family of processes in which cl, c2 ,..., c, and t j are parameters. Notice that if the explicit solution, Eq. (1 1.8), were not used, the maximum value of Eq. (10) would depend on c l , c2 ,..., cM and tf . We have reduced the number of variables from M to m. If m is equal to one or two, a feasible computational procedure has been obtained. Following the approach used in Chapter 6, we define g(c,
i
the maximum value of J where the process begins
> ~2 >.*.>
cm
2
a) = at t
=
u with starting state c1
,..., c,
.
1
Since the process is nonstationary, we have fixed the final time tf . A family of processes with different starting points a will be considered. T h e new maximization problem is
242
7.
QUASILINEARIZATION A N D INVARIANT IMBEDDING
T h e maximization is excuted by choosing the proper values of z over the interval [a, tf]. Applying the principle of optimality, we obtain the desired recurrence relation
T h e terms under the integral sign may be approximated by
M
cm
+ c hmj(a)Pj(a) j=l
a
+A)]
(16)
T o obtain the final condition for Eq. (16), observe that if the process had zero duration or a = tf , then the maximum value of Eq. (11) would be equal to zero. Thus g(c, > cz ~
. * cm * ~
7
tj) = 0
(17)
Notice that we have assumed that the duration of the process tf is divided into small intervals of A width. Let tf = AN, then a = 0, d, 24, ..., N d . Thus, Eq. (16) can be solved in a backward recursive fashion starting with the known final condition, Eq. (17), at a = tf . T h e computational procedure can now be summarized as follows: (a) Estimate a reasonable control policy ~ ~ = ~satisfying ( t ) , Eqs. (4) and ( 5 ) .
13.
FURTHER REDUCTION I N DIMENSIONALITY
243
(b) Calculate xn=,(t)from Eqs. (2) and (3), using the newly obtained values of z,=,(t). (c) Obtain z,,,(t) by maximizing Eq. (1l), using the newly obtained values of z,=,(t) and ~ , = ~ ( tT) h. e values of z,,,(t) must satisfy Eq. (4)(d) Return to (b) with n = 1. Equation (11) can be maximized by using the recurrence relation, Eq. (16), remembering that the solution of the linearized equation, Eq. (7), has been used in obtaining this recurrence relation.
13. Further Reduction in Dimensionality
Owing to the limited rapid-access memory of current computers, the above algorithms cannot be used if m is larger than three. However, for a large number of problems, a further reduction of the dimensionality can be obtained. Consider the problem of maximizing the function
Let us introduce a new state variable, xM+,(t), defined by
Differentiating Eq. (2) with respect to t , we have
T h e initial condition is X M + m = H(x(0))
(4)
If we consider Eqs. (12.2) and (3) as the system of differential equations, the objective function, Eq. (12. l), becomes a function of one variable
4 = XM+l(tf)
(5)
If the algorithms obtained in the previous section are used, a problem with a dimensionality of one is obtained. This is a significant reduction in terms of computational requirements.
244
7.
QUASILINEARIZATION AND INVARIANT IMBEDDING
14. Discussion
T h e above procedure can be generalized easily to problems with more general objective function. For example, the problem of maximizing the integral
J
=
/”f(x, 0 z) dt
(1)
can be treated by the above procedure if we introduce a new state variable, ~ ~ + ~defined ( t ) , by
with initial condition %4+1(0) = 0
(3)
T h e problem now becomes the maximization of ~ ~ + ~A( variety t ~ ) .of other forms of objective functions also can be treated by the algorithms obtained in the previous section. More discussion can be found in the references listed at the end of the chapter [ll-131. Let us consider briefly how Eq. (12.16) may be solved. I n order to obtain the values of c and K(a), the homogeneous differential equation, Eq. (1 1.5), must be solved first. Since Q ( t ) does not contain the unknowns x , + ~and z,+~ , Eq. (1 1.5) can be solved easily. Thus, in actual computations c and K(a) in Eq. (12.16) can be considered known. T h e functions f and p contain the unknown control variables Z ~ + ~ ( U T ) . h e problem is to find Z,+~(U) so that the expression inside the square bracket on the right-hand side of Eq. (12.16) is maximized. Since dynamic programming is especially suited for discrete processes, the present approach in the reduction of dimensionality appears to be a promising tool for solving stagewise processes. REFERENCES 1. Bellman, R., Kagiwada, H. H., and Kalaba, R., Numerical studies of a two-point nonlinear boundary-value problem using dynamic programming, invariant imbedding, and quasilinearization. RM-4069-PR. RAND Corp., Santa Monica, California, March, 1964. 2. Bellman, R., and Kalaba, R., Dynamic programming, invariant imbedding and quasilinearization: Comparisons and interconnections. RM-4038-PR. RAND Corp., Santa Monica, California, March, 1964; see also Bellman and Kalaba in “Computing Methods in Optimization Problems.” Balakrishnan, A. V., and Neustadt, L. W., eds., Academic Press, New York, 1964.
REFERENCES
245
3. Bellman, R., and Kalaba, R., “Quasilinearization and Nonlinear Boundary-Value Problems.” American Elsevier, New York, 1965. 4. Bellman, R., and Dreyfus, S., “Applied Dynamic Programming.” Princeton Univ. Press, Princeton, New Jersey, 1962. 5. Kalaba, R., On some communication network problems. “Combinatorial Analysis.” Am. Math. SOC.,Providence, Rhode Island, 1960. 6. Kalaba, R., Graph theory and automatic control, in “Applied Combinatorial Mathematics” (E. F. Beckenbach, ed.). Wiley, New York, 1964. 7. Bellman, R., “Introduction to Matrix Analysis.” McGraw-Hill, New York, 1960. 8. Bellman, R., “Stability Theory of Differential Equations.” McGraw-Hill, New York,
1953. 9. Bellman, R., Some new techniques in the dynamic programming solution of variational problems, Quart. Appl. Math. 16, 295 (1958). 10. Bellman, R., and Kalaba, R., Reduction of dimensionality, dynamic programming, and control processes, J . Basic Eng. 83, 82 (1961). 11. Rozonoer, L. I., The maximum principle of L. S. Pontryagin in optimal system theory, Automatika Telemekhhanika 20, 1320, 1441, 1561 (1959), [English transl. Automation Remote Control 20, 1288, 1405, 1517 (1960)l. 12. Katz, S., Best operating point for staged systems, Ind. Eng. Chem. Fundamentals 1, 226 (1962). 13. Fan, L. T., “The Continuous Maximum Principle.” Wiley, New York, 1966.
Chapter 8
INVARIANT IMBEDDING, NONLINEAR FILTERING, AND THE ESTIMATION OF VARIABLES AND PARAMETERS
1. Introduction
The invariant imbedding concept has been applied to various twopoint boundary-value problems in the two previous chapters. This concept will be used to derive some useful results in nonlinear filtering theory in this chapter. Since Wiener’s pioneering work [l] on the theory of optimal filtering and prediction, also known as the Wiener-Kolomogorov theory, many extensions and new developments hwe been made in this field. Among them, the works of Bode and Shannon [2], Pugachev [3], Kalman and Bucy [4, 51, Ho [6], Cox [7], and Bryson and Frazier [8] may be cited. For detailed treatment of Wiener’s theory refer to Levinson [9], Davenport and Root [lo], and Lee [ll]. The work of Kalman and Bucy is concerned with the estimation of state variables for linear systems. Later Cox treated the estimation problem in a formal fashion by dynamic programming. Bryson and Frazier treated a nonlinear version of this problem. Lee [12] and Deutsch [16] discussed this linear prediction problem in detail. The problem treated in this chapter is essentially an extension of this well-known linear problem. In the literature, most of the works have been limited to linear systems and have assumed that complete statistical knowledge concerning the system is available. Generally, white Gaussian noise has been assumed for the disturbances. Since the invariant imbedding approach is different from the usual classical approach, several advantages have been gained. First, the present approach is applicable to a wide variety of nonlinear problems. 246
2.
AN ESTIMATION PROBLEM
247
Second, a sequential estimation scheme is obtained. T h e usual classical approach results in nonsequential estimation schemes. T h e sequential estimation scheme has two advantages over the nonsequential one for dynamic systems. First, for nonsequential estimation schemes, each time additional observations or measurements are to be included, all the calculations must be repeated entirely. Second, because of these repeated calculations, nonsequential estimation schemes are much more difficult to implement in real time than sequential schemes. No statistical assumptions will be made concerning the noises or disturbances, because for most practical problems the determination of valid statistical data concerning these disturbances is a difficult problem in itself. T h e generally used least squares criterion will be employed to obtain the optimal estimates. If the statistics concerning the disturbances are known, criteria better than the least squares may be obtained. Essentially, two problems are treated in this chapter. They are the estimation of state variables and parameters with measurement errors only, and the same estimation problem with both measurement errors and unknown disturbance inputs. T h e estimator equations were originally obtained by Bellman and co-workers [13], and by Detchmendy and Sridhar [14]. Following the approaches used in the previous chapters, the derivations will be completely formal. T h e simpler scalar case is obtained first. Considerable details are given for these simpler cases. 2. An Estimation Problem
Consider a system whose dynamic behavior can be represented by the nonlinear differential equation
T h e state of the system, x, is being measured or observed starting at an initial time to = 0 and continuing to the present time tr . Owing to the presence of noises or measurement errors, the observed state, x, of the system does not represent the true state. Let
+ (measurement or observation errors) (2) On the basis of this observed signal z(t) in the interval 0 < t < tf , we z ( t )= x(t)
may seek an estimate of the present state x(t,), a past state x ( t l ) , or a
8.
248
NONLINEAR FILTERING
future state x(t2). Let us first consider the problem of estimating the present or current state x ( t t ) of the system. The other two problems can be solved in the same way. In fact, the entire trajectory or profile is estimated during the course of the estimation of x(tr). The problem is to estimate the current state of the system at tr , using the classical least squares criterion, so that the following integral is minimized:
J
=
f’(x(t)
-
~ ( t dt ) ) ~
0
(3)
where z(t) is the observed function. T h e function x ( t ) is determined on the interval 0 t tr by the differential equation (1). This problem can be stated differently as follows: On the basis of the observation z(t),0 t < tt , estimate the unknown condition
< < <
X(tf) = c
(4)
for the differential equation (1) so that Eq. (3) is minimized. Notice that this minimization is done with respect to the unknown condition c, not the entire trajectory x ( t ) . This is due to the fact that the system represented by (1) is completely specified once this unknown condition is specified. 3. Sequential and Nonsequential Estimates
The above estimation problem is essentially the same as that discussed in Chapter 4. Although the signal, z(t), has been expressed as a continuously measured signal in time, it also can be considered as discrete data points for all practical purposes. However, there is one difficulty in using the procedures discussed in Chapter 4 to solve problems whose dynamics are changing fairly fast with time. This comes from the nonsequential nature of that procedure. T o illustrate this, consider the parameter up-dating problem discussed in Section 12 of Chapter 4. There it has been assumed that’the dynamics of the process are not changing very fast, and thus it has not been necessary to up-date the initial conditions at all times. They only need to be up-dated at frequent intervals, say, once a day. However, if the dynamics of the process are changing fast, in order for the differential equations to describe the dynamics of the process accurately, new conditions must be estimated whenever new observations are available. If the procedure discussed in Chapter 4 is used, the complete calculations must be repeated for each additional observed datum. Obviously, these repetitions are quite time consuming. The next few sections will show that the procedure using invariant
4.
249
THE INVARIANT IMBEDDING APPROACH
imbedding is a sequential procedure. I n other words, the previous data points do not need to be repeated whenever new observations are added. The procedure discussed in Chapter 4 treats the problem with a series of data points as a series of two-point boundary-value problems, while the invariant imbedding procedure treats this problem as a family of problems with different final points, tr . 4. The Invariant Imbedding Approach
Let us define a new variable, y(t), Y(t)=
J
t 0
( 4 4 - z(W dt
The integral equation (2.3) can be written as
dY = ( x ( t )- z(t))2 dt
Equations (2.1) and (2) are the two differential equations. If the final condition, Eq. (2.4), is considered as a known condition, then the missing final condition isy(tf). T h e function z ( t )is an observed function and thus is completely known. Although the original problem is to minimize y ( t f ) ,we shall ignore this minimization first and obtainy(tf) for the above system by invariant imbedding. Consider the more general problem dx dt
- =f@, t )
dY = ( x ( t )- z(t))Z dt
with the given condition .(a) = c
< <
with 0 t a. I n other words, the missing final conditiony(tf) is to be obtained by considering a family of processes with different final points, a. Define r(c, a) =
the missing final condition for the system represented by =c
I(4) and ( 5 ) where the process ends at t = a with x ( a )
1
8.
250
NONLINEAR FILTERING
Using the same arguments as those used in Section 2 of Chapter 6, we can obtain the following equation: ~ ( ca , )
+
(C
+
- ~ ( a ) ) ~ dO(d) = r(c + f ( c , a)A
+ O(A),a + A )
(7)
Using Taylor's series, we have for the right-hand side of (7) r(c + f ( C ,
a)d
+ O(d), a + A) =
T(C,
a ) + f ( C , a)d
W c ,4
7
&(" a ) + O(A) + AT
In the limit as d 3 0, we obtain the desired invariant imbedding equation f(G
a r k a ) I &(c, 4 - (c 4 7 aa
- z(a))z
(9)
Since no initial condition for the original equation (4.2) is given, the initial condition, r(c, 0)) for (9) cannot be obtained by considering a process with zero duration. However, an initial condition for (9) can be obtained from the available a priori information on the cost function r. Since Eq. (9) will not be solved directly, this initial condition will not be needed.
5. The Optimal Estimates Heretofore, the value of c, which gives the minimum of (2.3), has not been considered. Our aim is to obtain this minimizing value. In fact, we should like to be able to obtain the minimizing value of c for each value of tt >, 0. In other words, we should like to obtain a series of values of c which minimize the cost function r(c, a) for a series of final terminal points, a. These minimizing values, which will be denoted by e(a), are the desired estimates. At these minimizing points, we see that
The total differential of (1) is rcc(e, a ) de
+ rca(e,a ) da = 0
(2)
5.
25 1
THE OPTIMAL ESTIMATES
or de du
-
rca(e>a ) rcc(e7 4
(3)
The initial condition for (3) might be the equation e(0)
=
(4)
co
where co is the best estimate of the initial state x(0). This estimate might be obtained arbitrarily.from the available a priori information. Notice that the function r(c, u ) represents a series of final conditions whose values are to be minimized. T h u s a series of problems is solved sequentially by integrating Eq. (3). This series of problems is represented by Eq. (4.4) with different final points a and with unknown conditions c. If the classical approach or the approach in Chapter 4 were used, each of this series of problems would be solved separately. Once the functions r(e, a), rcc(e,a ) , and rca(e,u ) have been determined, Eq. (3) can be solved by using (4) as the initial condition. Thus, the best estimates are obtained. However, the computational procedure is not simple. It involves the solution of the partial differential equation (4.9). These expressions can be simplified. We rewrite (4.9)as
f (c, a)yc(c,a) + ra(c, a)
(C
-4
Differentiating (5) with respect to c, we obtain frcc
+ rcfc + rac
or
Substituting (1) into (7), we obtain
Combining (3) and (8), we obtain
Equation (9)can be written as
=2
(~ 4a))
~ ) ) ~
(5)
8.
252
NONLINEAR FILTERING
where
Equation (10) is the desired relation. The function q(a) can be considered as a weighting function. Since (10) is an ordinary differential equation, it can be integrated easily, provided that the values of the weighting function have been obtained. 6. Equation for the Weighting Function
The weighting function involves the unknown function r,, . Let us obtain a differential equation for the weighting function and see how the function rcc can be eliminated. This can be done by using differentiation 1131. A differential equation for the weighting function can be obtained by differentiating (5.11):
Using (5.10) and (5.1l), we have for Eq. (1)
T o eliminate the function r,,, from the right-hand side of (2), we differentiate, again, (5.6) with respect to c: frccc
+
rcfco
+
racc = 2(1 - f c y c c )
(3)
Substituting (5.1) and (5.11) into Eq. (3), we obtain yacc
= 2 (1 -
2 ifc) -f recc
(4)
Substituting Eq. (4) into Eq. (2), we obtain
Equation ( 5 ) involves the function rccc. A differential equation for this function, again, can be obtained by noting that
6.
EQUATION FOR THE WEIGHTING FUNCTION
253
An expression for r,,,, can be obtained by differentiating Eq. (3) with respect to c: -
raccc =
f rcccc
+
3fcrccc
+
rcfccc
+
3fccrcc
(7)
Combining (6) and (7), we obtain
+ ( ~ ( a-) e ) q r c c c c
drccc du- - -3fccrcc - 3fcrccc
Using (5.11), we have for Eq. (8) drccc du
fcc
-6 - - 3 f c r c c c P
+
(Z(U) -
Equation (9) involves the unknown variable rcccc. An additional differential equation for r,,,, can be obtained. However, this additional equation will involve r,,,,, . This refinement can be continued indefinitely. The refinement represented by Eq. (9) is unnecessary. For many practical situations, the function ~ ( c ,a) can be approximated by the equation
d c , 4 zs Po(.)
+ PI(.). + P,(a)c2
(10)
in the neighborhood of the optimal estimate e(a). Equation (10) implies that the function rccc is negligible in the neighborhood of the optimal estimate. We shall assume that this is the case. Then Eq. (5) can be written as
Changing to uniform notations, we can write Eq. (11) as
Rewrite Eq. (5.10):
T h e two equations (12) constitute the desired estimator equations. T h e initial conditions for these two equations are
254
8.
NONLINEAR FILTERING
where e0 represents the best estimate of the state of the system at t = 0. This estimate may be obtained solely on the basis of the available a priori information concerning the system. The value of @ reflects the confidence we have in the initial value of e and the observed signal z(t). 7. A Numerical Example
T o test the estimator equations, some numerical experiments are performed on a digital computer. Consider the chemical reaction scheme A+A-+B
(1)
which is taking place in a batch reactor. The true value of this concentration is to be estimated at time t from noisy measurements on the concentration of A. We shall assume that the reaction is carried out isothermally. The reaction rate equation is dx _ - -kx2 dt
where x represents the concentration of component A, and k is the reaction rate constant. It is simple to show that Eq. (2) is applicable also if the reaction is carried out in a steady-state isothermal plug-flow tubular reactor. The noisy measurements for the concentration are generated by the computer in two steps. First, Eq. (2) is integrated by the Runge-Kutta integration scheme. The numerical values used are x(0) k
At tt
=
1.0
= 0.05 = 0.1
(3)
= 50
where A t is the integration step size. Second, the results from this integration are corrupted with noise by the equation
with to = 0, tf = t, , and tk+l - t, = A t . The values of x(tk) are the values of the grid points from the above integration; and R(tk)represents random numbers with Gaussian distribution. The mean of this distribution is zero, and the standard deviation is one.
7.
255
A NUMERICAL EXAMPLE
With these generated noisy measurements, the true value of x ( t ) is to be determined. From Eq. (6.12), the estimator equations are
-de_- -ke2
+ (z(u) - e)q(a)
du
(5 4
These equations are integrated with various assumed values for the initial conditions q(0) and e(0) and with A t = 0.1. T h e Runge-Kutta integration scheme has been used. T h e results are shown in Fig. 8.1 2.2
1 -
a, a ( 0 ) = 2.0, q(O)=O.1 a, e ( 0 ) - 2 . 0 , q(0)=1.0
1.4
-
c. at01 =2.0, q(O1=5.0
Y
;1.0 L
-
0.6
0.20
1
I
10
I
I
I
20
I
I
30
I
40
I
50
t or a
FIG. 8.1. Estimation of current state.
The true value of x(t) obtained by integrating Eq. (2) also is shown in the figure. It can be seen that for q(0) = 5.0 the true value of x is obtained by time t = 10. Except for the case of q(0) = 0.1, the noisy measurements have been filtered by time t = 50 and e ( t ) x(t). I n all the experiments for q(0) = 1.0 and q(0) = 5.0, the estimated values of the state at t = 50 are within 5 percent of the true value. For most of the experiments, the estimated values are within 2 percent of the ture values. T o give some idea about the generated noisy data, some of the noisy measurements of a typical run are shown in Fig. 8.2. It should be emphasized that not all the noisy data used for this run are shown; only every tenth point of the measurements is plotted. Since the standard deviation of the random number R(t) is fixed, but the value of x ( t ) is decreasing with time, the percentage error in the noisy data is higher at higher values of t. T h e weighting function q(t) is shown in Fig. 8.3.
=
8.
256
NONLINEAR FILTERING
-
I. 2
0
X,
1
ACTUAL
-
z, OBSERVED
-
0.2
-
0
-
0
o o I
I
I
40
I
I
I
20
+
30
I
I
40
0 I
J 50
FIG.8.2. Actual and observed outputs.
Note that in obtaining the estimator equations, the statistical characteristics of the measurement errors are not involved. The random noise used in Eq. (4) is chosen arbitrarily.
el01 = 2.0
W
-
0
2
4
a
6
FIG.8.3. The function q.
0
I0
8.
257
SYSTEMS OF DIFFERENTIAL EQUATIONS
8. Systems of Differential Equations
T h e above results can be generalized easily to systems with dynamics represented by M differential equations. Consider the nonlinear vector equation dx dt
-= f ( x ,t )
where x and f are M-dimensional vectors with components x1 , x, ,..., xM andf, , f, ,...,fM,respectively. It will be assumed that not all the state variables can be measured and some of the state variables can be measured only in certain combinations with other variables. Thus z ( t ) = h ( x ,t )
+ (measurement errors)
(2)
< <
with 0 t t f . T h e vectors z and h are m-dimensional vectors with components z1, z, ,..., z, and h, , h, ,..., h , , respectively. T h e number m represents the number of measurable quantities and m M. On the basis of the measurements or observations z(t),0 t tf , estimate the M conditions
<
x(t,) = c
< <
(3)
for Eq. (1) such that the integral
J
=
st' f
0 j=l
( z i ( t )- h j ( x ,t ) ) , dt
(4)
is minimized. T h e functions hj are evaluated by using the values of x obtained from Eq. (l).Thecomponentsofthevectorcarec, , c, ,..., cM . T h e estimator equations for this problem can be obtained in the same way as that used to obtain the estimator equations for the one-dimensiona1 problem. If we define
then Eq. (4) becomes
8.
258
NONLINEAR FILTERING
The differential equations to be considered are Eqs. (1) and (6). The missing final condition to be obtained is y(tr). Again, consider the family of problems with final points a: (8)
x(a) = c
with 0
< t < a. If we define
r(c, a) =
1
the missing final condition for the system represented by (l), 1(6h and (8) where the process ends at t = a with x(a) = c
then Y ( 4 = r(c, 4
(9)
The invariant imbedding equation for the missing final condition is
If e(a) is the optimal estimate of c, then
-W e , 4 - rct(e,u ) = 0
aci
i
=
1, 2,..., M
(1 1)
or
M a
-[rc,(e,a)] dek +
a
[r,,(e,a)] da = 0
i = 1,2
,...,M
(12)
k = i ack
In matrix notation, Eq. (12) becomes de
da = -[rcc(e, 4I-lrcm(e,a )
(13)
where the symbol [rCc]-ldenotes the inverse of the matrix inside the bracket and
8.
259
SYSTEMS OF DIFFERENTIAL EQUATIONS
T o find an expression for the right-hand side of (13), Eq. (10) can be differentiated with respect to cl, c2 ,..., c M : Tca(C,
+
+
Tcc(C, a ) f (c, 4 [ fc(c, 4 l T ~ , ( C , a ) -2[hC(c, a)lT[z(a)- h(c, a)]
a)
(16)
where f and re are M-dimensional column vectors, z and h are m-dimensional column vectors, and
(17) .fMc,
fMc, ***fMc,
The symbol [fJ' refers to the transpose of the matrix f, . At the optimal estimate of c, Eq. (11) can be substituted into (16): Tca(e,a)
+ fcc(e,a) f (e, a)
=
-2[hC(e, a)l'[z(a)
-
We, all
(19)
Combining Eqs. (13) and (19), we obtain de da
- = f (e, a )
+ 2[r,,(e, a)]-l[h,(e, a)I'[z(a) - h(e, a)]
(20)
A set of differential equations for q can be obtained. Rewrite Eq. (21): iq(a)r,,(e, a ) = 1
(24)
8.
260
NONLINEAR FILTERING
Differentiating this equation, we obtain ds
du rcc(e,
4 +4 0 )
d
[rcc(e,41
=0
(25)
or ds
du =
-44
d
[rcc(e,41[9s(41
(26)
where d
du [rcc(e,a)] = rc,,(e, u ) + (terms involving Y,,,)
(27)
Since terms involving rcccare negligible, Eq. (26) becomes
where rccais the matrix represented by (14) differentiated with respect to a.
T o find an expression for r c c a ,the approach used for the scalar case can be used. Taking the partial derivative of Eq. (16) with respect to c1 , c2 ,..., c, , we obtain Tcca(C,
4 + Tcc(C, 4 fc(c, Q) + [ fdc, U)I'Ycc(C, 4 + 5
=
-2(hcc(c, u ) [ z ( u ) - h(c, a)]>
+ 2[hc(c, a)lThc(c,a)
(29)
T h e elements of the matrix represented by the first term on the righthand side are scalar or inner products of the vectors hcic,and [z - h]. Thus
where
T h e term 5 represents terms that consist of terms of the form of rc or re,, . When c takes on its optimal estimate e, from Eq. (1l), rc = 0. The
9.
ESTIMATION OF STATE A N D PARAMETER-AN
EXAMPLE
261
terms involving rccc are negligible. Consequently, the term 5 drops out in the neighborhood of the optimal estimate. Combining Eqs. (24), (28), and (29), the desired differential equations for q are obtained:
_ dq - f4e, a)q(a) + q(4[ fc(e, 41= + q(a){hcc(e,a"(4 da -
x q(a) - q(a"c(e,
-
h(e, 41>
(31)
a>lThc(e, ah(4
The matrix {hcc[z- h]} is defined by Eq. (30). T o obtain a uniform notation, replacing subscript c by e, Eqs. (22) and (31) become
+ q(a)[he(e,a)l'[z(a) - Me, all dq - fe(e, a)q(a>+ q(a)[ fe(e, a)]' da de da
- = f(e, a)
(324
--
+ q(a){hee(e,a ) [ z ( a )-
a)lh(a)
(32b)
-q(a)[he(e, a)IThe(e,a)q(a)
T h e equations (32) are the desired estimator equations. Notice that Eq. (32a) represents M differential equations and (32b) represents M 2 differential equations. T h e matrices with subscript e are the same as the matrices with subscript c , as previously defined.
9. Estimation of State and Parameter-An
Example
The problem of simultaneous estimation of state and parameters of a system also can be solved by the present approach. T h e unknown parameters can be considered as part of the state of the system and, as has been discussed in Chapter 4, differential equations for these parameters can be established. To illustrate this approach, the problem solved in Section 7 will be considered. Both the state x and the parameter k are to be estimated from the noisy measurements on the concentration of component A. T h e noisy data for x(t), x ( t ) , are generated in the same way as before with Eqs. (7.2) and (7.3). Equation (7.4) is replaced by the equation z(t,)
=
.(tk)[l
+ O.lR(t,)]
k
= 0 , 1,2
,... N )
(1)
By using Eq. (I), the measurement error is approximately proportional to the true value of x.
262
8.
NONLINEAR FILTERING
The equations corresponding to Eq. (8.1) are dx _ dt
4 x 2
dk _ -0 dt
with M = 2 and m = 1. Since
h(x, t )
=x
(3)
Eq. (8.2) is identical with the scalar case for the present example. The estimator equations can be obtained from Eq. (8.32)
where 0 represents the null matrix. The functions e, and e2 represent the optimal estimates of x and K, respectively. Equations (4) and ( 5 ) represent six simultaneous estimator equations. With the following initial conditions for Eqs. (4) and ( 5 )
the results shown in Fig. 8.4 are obtained with the Runge-Kutta integration scheme and with A t = 0.1. Only the estimated values for the reaction rate constant are shown. Since the measurements at t = 0 are used as the initial conditions for the state variable, the true value of this variable is obtained very quickly. I n a way, the value of qza(0)
9.
ESTIMATION OF STATE AND PARAMETER-AN
263
EXAMPLE
represents the confidence one has in the initial value of k(0) and the observed signal x ( t ) . Note that the best filtering action is obtained with qS2(O) = 5. Too large a value for qZ2(O), such as q22(0)= 20, results in overestimation of the value of e 2 .
0.08 0.04 cu 0 L
-
0.0
0
- 0.04 -0.08 -0.12
-
e, 10) = z(01
qn lol=q1~o)=q21~o)= 1
-
'
1
0
I
10
I
I
20
I
t or a
1
I
30
I
40
I
50
FIG.8.4. Estimated parameter as a function of qZa(0).
Instead of using Eq. ( l ) , some experiments also have been performed with the noisy measurements generated by Eqs. (7.2), (7.3), and (7.4). The initial conditions used are:
The results for these experiments are shown in Figs. 8.5 and 8.6. In spite of the large oscillations of e2 at time near zero, the true value of the reaction rate.constant is obtained by time t = 30. T h e values of q(0) are very important in the calculations. T h e true values of x and k cannot be estimated by t = 50 if the following initial values are used:
A minus value of k is estimated for the present case.
8.
264
NONLINEAR FILTERING
2.21
I
t or
FIG. 8.5.
I
Estimated state as a function of el(0).
Only every tenth integration point is plotted in Figs. 8.4-8.6. Consequently, not all the oscillations can be shown in these figures.
0.28 F e210)=0.1
0.24
q,,(o)=q2210)= 5
q,210)=q21(o) =1
0.20 0.16 (v
Y
-
0 L -I
-
-. I
I
I
I
I
I
I
I
FIG.8.6. Estimated parameter as a function of el(0).
I
10.
A MORE GENERAL CRITERION
265
10. A More General Criterion
Instead of the criterion (8.4), the following weighted criterion can be used:
J
=
S"[z(t) - h(x, t)ITQ(t)[z(t)- h(x, t)l dt
where [z - hITQ ( t ) [ z - h] represents the quadratic form [I51 associated with the matrix Q ( t ) . T h e expression 11 z - h ;1 will be used to denote this quadratic form. T h e vector [z(t)- h(x, t)] represents the column vector
The matrix Q ( t ) is a symmetric m x m matrix.* I n addition, this matrix is positive semidefinite. T h e expansion of this quadratic form leads to a weighted sum of squares of the elements of z - h, with the weighting determined by the elements of Q ( t ) . If Q ( t ) is a unit matrix, Eq. (1) reduces to Eq. (8.4). This quadratic form has been used by Kalman [4, 121. Note the versatility of the criterion (1). By choosing the elements in Q suitably, the observations on any variable can be made more important than observations on any other variable. With the criterion (l), the estimator equations for the problem formulated in Section 8 can be obtained in the same way. With terms involving rcCcneglected, the estimator equations are
* As can be shown easily, it entails no loss of generality in the treatment of quadratic forms to assume that the matrix Q is symmetric.
8.
266
NONLINEAR FILTERING
Except for the replacement of the inner product of each element by - h] is similar to
h&, Q[z - h], the definition of the matrix he, Q[z that of matrix (8.30). Thus
The other matrices are defined in the same way as those defined in Section 8.
11.
An Estimation Problem with Observational Noise and Disturbance Input
The problem of estimating state variables and parameters in the presence of both observational errors and disturbances in the input also can be treated by invariant imbedding [14]. Consider the system represented by
The measurements or observations on the output are z ( t ) = h(x, t )
+ (measurement errors)
(2)
where u ( t ) is the unknown disturbance input. Since the function f depends on t explicitly, any known inputs such as control inputs or test signals can be included in this function. The above problem has been treated by Cox [7] by assuming that both the measurement errors and disturbance input are white Gaussian noise. No statistical assumption will be made concerning these disturbances in the present treatment. Thus, the disturbance input may be either random input with unknown statistics or a constant disturbance input. Following the treatments in earlier sections, this estimation problem can be stated as follows: On the basis of the measurement z(t), 0 t tf , estimate the unknown condition
< <
12.
A TWO-POINT BOUNDARY-VALUE PROBLEM
267
for the differential equation (1) such that the following integral is minimized: (4)
where w ( t ) is a weighting factor and is always positive. This is the same estimation problem as that formulated in Section 2 except for the presence of the disturbance input. Consequently, Eq. (4) must be minimized with respect to both the unknown condition x(tr) and the disturbance input u ( t ) for all t, 0 t tf . Notice that this is a problem in the calculus of variations and can be stated in terms of optimization problems as follows (see Appendix I): Find that function u ( t ) such that the function x ( t ) given by Eq. (1) minimizes the integral
< <
(4). In this optimization problem, the disturbance input is considered as the control variable. T h e differential equation (1) is considered as a constraint. Except for the terminal points of the independent variable, no end conditions have been specified. T h e unknown condition (3) is determined from the solution of the state variable and the EulerLagrange equations. This optimization problem is the problem of Lagrange in the calculus of variations. 12. The Optimal Estimate-A
Two-Point Boundary-Value Problem
T h e equations for the above optimization problem can be obtained by using the equations listed in Appendix I. From Eq. (2.17) of Appendix I, we obtain
From Eq. (3), we obtain
268
8.
NONLINEAR FILTERING
Substituting Eq. (4)into Eqs. (1 1.1) and (2), we obtain
T h e problem is reduced to solution of the differential equations in (5). T o find the boundary conditions for these two equations, the transversality condition can be used. Since the end values of the state variable x do not appear in the function G, as defined by Eq. (3.3) of Appendix I, the following free boundary conditions for ( 5 ) are obtained: X(0) = 0
(64
0
(6b)
qt,)
=
T h e solution of Eq. ( 5 ) with boundary conditions (6) will yield the optimal estimate of x ( t f ) . Equations ( 5 ) and (6) constitute a two-point boundary-value problem. 13. Invariant Imbedding
T h e above two-point boundary-value problem can be solved by various methods. However, if a series of estimation problems with different end points tf is considered, a series of boundary-value problems must be solved when the usual classical approach is used. This is especially wasteful for the present situation, owing to the fact that only the values of the different end conditions x(tr) are being sought. The complete trajectories x ( t ) , 0 t tf , of the different boundary-value problems are of little interest. I n the invariant imbedding approach, only end conditions will be obtained. An expression for the missing final condition x ( t f ) for the two-point boundary-value problem represented by Eqs. (12.5) and (12.6) will be obtained by the invariant imbedding approach. Note that this missing final condition is also the current state whose value is to be estimated. Consider the more general boundary-value problem with the boundary condition
< <
X(0) = 0
(14
X(a) = c
( 1b)
13. with 0
INVARIANT IMBEDDING
269
< t < a, for Eq. (12.5). Let
r(c, u )
=
I
the missing final condition for the system represented by (12.5) and (1) where the process ends at t = a with X(a) = c
Then (2)
x ( u ) = r(c, u )
The following invariant imbedding equation can be obtained:
Note that the variables c and r are defined differently from those defined in Section 4. T h e solution of Eq. (3) gives the estimates .(a) = r(c, u ) as a function of all the values of c and a for the series of boundary-value problems. However, we are interested only in the solution of (3) with c = 0. This solution gives the optimal solution of the original problem. Consequently, Eq. (3) can be simplified by considering the values of r at the neighborhood of c = 0 only. Let us use the approximation r(c, a )
= e(a)
(4)
+p(u)c
with terms involving powers of c higher than the first omitted. Substituting Eq. (4)into Eq. (3), we obtain
{--2[44 -W
a )
+ P(&
4lh,(e(4
+ P ( 4 G a)
8.
270
NONLINEAR FILTERING
Equation (5) becomes {-2[z(a)
-
h(e, a ) - P(a)&(e, a)][he(e,a )
- cfe(e, a) -
C2P(a)fee(e,.)Ma)
+ P(a)chee(e,.)I
de +z + c dpz
f ( e , a) + P(a)cfe(e, a ) + 2w(4 C
=
(6)
with higher-order terms of O(d) omitted. Equating terms which do not involve c and those which involve the first power of c, we obtain de
da =z f ( e , a )
+ 2P(a)he(e,a)[%(.) - h(e, a)]
dp - 2p(a)fe(e,a )
da
+2~(a){hee(e,
a)[.(.)
-
(7) h(e, a)] - hz(e, a)>
1 + --244
(8)
We shall assume that terms with second or higher powers of c are negligible. Let 4(a) = 2P(4 (9) Equations (7) and (8) become de da
__ ==
d4
f ( e , a ) + q(a)he(e,a)[z(a) - h(e, a)]
du = 2 d a ) f e ( e , a )
+ @(a){hee(e,a)[.(a)
- h(e, a)] - hz(e, a)>
(10)
1 +4.1
(11)
T h e above two equations are the desired estimator equations. It is interesting to note that if h(e, u ) = e, then the above equations are the same as those given by (6.12) except for the presence of the term l/w. 14. A Numerical Example
T o test the estimator equations obtained in the preceding section, the problem solved in Section 7 can be considered. Let us assume that the process is represented by the equation
where u ( t ) represents the unknown disturbance input. If Eq. (1) represents the rate equation for a bath chemical reactor, this disturbance input may represent the variations in the reaction rate constant k due to the constant variations of environmental temperature. This unknown input
14.
27 1
A NUMERICAL EXAMPLE
also may be caused by the loss or gain of certain chemical components of the reaction mixture. T h e noise measurements for the concentration of component A are generated in the same way as that used to generate z ( t ) in Section 7, except that x ( t ) is obtained by integrating Eq. (1) instead of Eq. (7.2). A random disturbance input is assumed for u and the following equation is used to generate this disturbance input: u(tk) = O.IR,(t,)
K
= 0 , 1, 2
,..., N
(2)
where Rl(tk) represents random numbers with Gaussian distribution. T h e mean of this distribution is zero and the standard deviation is one. Using Eq. (7.4), the results from the integration of Eq. (1) are corrupted with noise. T h e numerical values listed in Eq. (7.3) are used to generate these noisy measurements. T h e estimator equations for the present problem are de _ - -he2 du
+ q(u)(z(a)- e )
(3) 1
q 2 ( 4 + W(.> These equations are integrated by the Runge-Kutta integration scheme with the following initial conditions:
T h e results are shown in Figs. 8.7 and 8.8. Constant values are assumed for the weighting factor w . T h e true values of x obtained by integrating
--
-TRUE VALUE, x ESTIMATED VALUE, e q(0)= 5 0
1.2
L
0 X
I
I
10
I
I
20
I
t or 3
1
30
I
I
I
40
FIG. 8.7. Estimation of current state with unknown input, w = 10.
1 50
8.
272
1.8
NONLINEAR FILTERING
--
-TRUE VMUE. x ESTIMATED VALUE, e e101=2 q@l= 5
I
1
ob
I
I
io
1
2o
I
t or a
I
I
30
1
I
FIG.8.8. Estimation of current state with unknown input, w
I 50
40
100.
=
Eq. (7.2) also are shown in the figures. Another experiment with q(0) = 1 and w = 10 is shown in Fig. 8.9. The disturbance input generated by Eq. (2) is fairly high compared with the term Ax2. This is especially true at t near t t , where the true
-TRUE VALUE, x "ESTIMATED VALUE, e eU=2
i.8
:
\
w(OI= 10
i2- \
\
I
Ob
I
io
I
I
'O
I
t or a
1
30
I
I
I
40
FIG.8.9. Estimation of current state with unknown input, q(0) = 1.
15. Systems of Equations with Observational Noises
and Disturbance Inputs Consider the system of nonlinear differential equations
15.
SYSTEMS OF EQUATIONS WITH OBSERVATIONAL NOISES
273
with the measurements on the output z ( t ) = h(x, t )
+ (measurement errors)
(2)
where x and f are M-dimensional vectors, z and h are m-dimensional vectors, and g is an M x k matrix. T h e k-dimensional vector u(t) represents the disturbance inputs. This problem can be formulated, again, in terms of optimization ) that the vector function problems. Find that vector function ~ ( t such x(t) given by Eq. (1) minimizes the integral (3)
where Q and W are symmetric m x m and M x M matrices, respectively. T h e first term under the integral sign represents the quadratic form associated with the matrix Q ( t ) and the second term represents the quadratic form associated with the matrix W(t). Both Q and W are positive semidefinite matrices. T h e elements of the matrices Q and W represent the weighting factors for the measurement errors and the disturbance inputs. Using Eq. (l), we can write Eq. (3) as (4)
T h e Euler-Lagrange equations for the above optimization problem can be obtained easily. From Eq. (2.17) of Appendix I, we obtain
T h e last term in the above equation is the inner product between the M-dimensional column vector h and the column vector within the square bracket. T h e Euler-Lagrange equations are
8.
274
NONLINEAR FILTERING
where
and
gxu =
An expression for u can be obtained from Eq. (7). Substituting this expression into Eqs. (1) and ( 6 ) , one obtains dh dt
- = -2[hx(x, t>lTQ(t)[z(t) - h ( x , t)] -
dx dt
- --
f ( x ,t )
+ 4g [ g T W g l - l g T A
T. fdx, t)lTX + 5
(lla) (1lb)
T h e term 5 represents terms involving A"-. We shall see later that terms involving powers of h higher than the first will be neglected. T h e boundary conditions for Eqs. (1 1) can be obtained from the free boundary condition h(0) = 0
(124
A(tf) = 0
(12b)
T h e missing final condition x(tr) for the boundary-value problem represented by Eqs. (11) and (12) can be obtained by the invariant
15.
SYSTEMS OF EQUATIONS W I T H OBSERVATIONAL NOISES
275
imbedding approach. Consider the problem with the more general boundary condition h(0) = 0 A(a) = c
with 0
< t < a. If we let X(U) =
r(c, a)
then the invariant imbedding equation is r,(c, a ) -
+ r,(c, a){--2[hr(r(c,
a), a)l'Q(a)[z(a) - h(r(c,a),
+
.>I
[ fr(r(c,a>,a>l*c S> =f
(r(c,a), a )
+ 4g[gWgl-lgTc
where ra is an M-dimensional vector and r, is the matrix
Using the same argument as that used for the scalar case in Section 13, the vector r can be approximated by r(c, a)
=
e(a)
+ p(a>c
(17)
where e is an M-dimensional vector and p ( u ) is an M x M matrix. Using the same analysis as that used in the scalar case, we obtain the following estimator equations:
276
8.
NONLINEAR FILTERING
16. Discussion
Invariant imbedding has been used in two different ways. I n Section 4, imbedding is used to obtain the missing final condition, which represents the nominal value of the integral criterion to be minimized. T h e optimal estimate is then obtained by differentiation. I n Sections 12 and 13, equations for the optimal estimate are obtained first by treating the problem as an optimization problem in the calculus of variations. Then the invariant imbedding equation for the missing final conditions, which represent the optimal estimates, is obtained. These different uses are due to the different natures of the two estimation problems. T h e problem discussed in Section 4 represents a minimization problem in which only the final value of the state variable is within our control. However, the problem discussed in Sections 12 and 13 represents a minimization problem in which the entire trajectory of the unknown disturbance input is assumed to be within our control. Note that Eq. (2.1) is completely determined once a boundary condition is given. However, Eq. (1 1.1) cannot be determined completely until the complete trajectory for u ( t ) is given. Although the invariant imbedding approach appears to be an effective tool to treat nonlinear estimation problems, much more research and computational experiments are needed. For example, it would be interesting to see whether an optimal weighting factor w ( t ) can be obtained for Eq. (13.11). T h e numerical experiments performed in Section 14 seem to indicate that a weighting factor w which varies with time t is preferable to a constant weighting factor. Although all the numerical experiments are performed on digital computers, analog computers also can be used if the estimator equations are not too complex. Economical advantages can be gained by using analog equipment for on-line estimation purposes. This is due to the fact that the estimator equations, which are ordinary differential equations of the initial-value type, are especially suited for real time analog computation.
REFERENCES
1. Wiener, N., “The Extrapolation, Interpolation, and Smoothing of Stationary Time Series.” Wiley, New York, 1949. 2. Bode, H. W., and Shannon, C. E., A simplified derivation of linear least-squares smoothing and prediction theory. Proc. I R E 38, 417 (1950). 3. Pugachev, V. S., “Theory of Random Functions and Its Application to Automatic Control Problems” (in Russian). Gostekhizdat, Moscow, 1960.
REFERENCES
277
4. Kalman, R. E., and Bucy, R. S., New results in linear filtering and prediction theory. J . Basic Eng. 83, 95 (1961). 5 . Kalman, R. E., A new approach to linear filtering and prediction problems. J. Basic Eng. 82, 35 (1960). 6 . Ho, Y., The method of least squares and optimal filtering theory. RM-3329-PR. RAND Corp., Santa Monica, California, October, 1962. 7. Cox, H., Estimation of state variables via dynamic programming. Presented at Joint Autom. Control Conf., Stanford, California, June 24-26, 1964. 8. Bryson, A. E., and Frazier, M., Smoothing for linear and nonlinear dynamic systems. Proc. Optimum System Syn. Conf., Wright-Patterson Air Force Base, Ohio, September, 1962, AST-TDR-63-119. 9. Levinson, N., A heuristic exposition of Wiener’s mathematical theory of prediction and filtering. J . Math. Phys. 26, 110 (1947). 10. Davenport, W. B., and Root, W. L., “An Introduction to the Theory of Random Signals and Noise.” McGraw-Hill, New York, 1958. 11. Lee, Y. W., “Statistical Theory of Communication.” Wiley, New York, 1960. 12. Lee, R. C. K., “Optimal Estimation, Identification, and Control,” The M. I. T. Press, Cambridge, Mass., 1964. 13. Bellman, R., Kagiwada, H. H., Kalaba, R., and Sridhar, R., Invariant imbedding and nonlinear filtering theory. RM-4374-PR. RAND Corp., Santa Monica, California, December, 1964. 14. Detchmendy, D. M., and Sridhar, R., Sequential estimation of states and parameters in noisy nonlinear dynamical systems. Presented at Joint Autom. Control Conf., Troy, New York, June 22-25, 1965. 15. Courant, R., and Hilbert, D., “Methods of Mathematical Physics,” Vol. I. Wiley (Interscience), New York, 1953. 16. Deutsch, R., “Estimation Theory,” Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1965.
Chapter 9
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS-FIXED BED REACTORS WITH AXIAL MIXING
1. Introduction
In this chapter, it will be shown that the quasilinearization technique is also a useful tool for solving parabolic partial differential equations encountered in the study of the dynamics of chemical reactors. Specifically, partial differential equations of fixed bed reactors with axial mixing will be treated under various simplifying assumptions. First, the reactor will be assumed to be an isothermal reactor. Then, the influence of temperature upon reaction rate equations will be considered. And, finally, the transient equations of the packing particle will be included. The last case has been solved by Liu and Amundson [l] by the commonly used first-order convergent method, and thus a comparison can be made between the present approach and the other method. Although we have encountered partial differential equations in connection with invariant imbedding, we have avoided numerical solutions for these equations. The computational solution of partial differential equations is much more complicated. For ordinary differential equations of the initial-value type, a large number of stable methods of numerical integration exists and the truncation errors of these numerical methods are of fairly high order in the integration step size. Thus, the advantage of a second-order convergent process over the first-order is obvious. However, for partial differential equations, especially of the elliptic and parabolic types, the commonly used stable numerical methods usually have higher truncation errors, which are very sensitive to the mesh or integration step sizes used. Because of these numerical inaccuracies, the advantage of the second-order convergent process such as the quasilinearization technique over the commonly used 278
2. ISOTHERMAL
REACTOR WITH AXIAL MIXING
279
first-order convergent process is not so obvious. Consequently, numerical experiments furnish the only source of comparison. We shall not discuss the problems of existence and convergence of the recurrence relations of partial differential equations resulting from the application of the generalized Newton-Raphson formula. This is due to the fact that any detailed discussion of these aspects would carry us too deeply into the theory of partial differential equations. Those interested can consult Bellman and Kalaba [2, 31. I n general, if a fairly accurate and stable numerical integration procedure is available, quadratic convergence should be expected. T h e equations treated in this chapter are extensions of the equations solved in Chapter 3. Consequently, the finite-difference method used there can be applied to these partial differential equations at each integration step in the time direction without modification. However, owing to stability problems, an implicit difference formula by Crank and Nicolson [4] is used to obtain the difference equations in the time direction. T h e numerical aspects of elliptic and hyperbolic partial differential equations will not be discussed in this volume [2, 3, 5-9, 11-13]. This chapter follows the treatment of Lee [lo]. 2. Isothermal Reactor with Axial Mixing
Instead of the steady state case, consider the transient equation of the fixed bed chemical reactor treated in Section 6 of Chapter 3. T h e dynamics of this isothermal reactor with axial mixing can be represented by the equation
where NPe= D,v/D is the Peclet group; z = x / D , is the dimensionless reactor length variable; t = Ov/D, is dimensionless time; and x , 0 are reactor length and time variables, respectively. T h e reaction rate group, r, and other symbols have the same meaning as those defined in Section 6 of Chapter 3. T h e variable p represents the partial pressure of the reactant A in the interstitial fluid. I t has been assumed that the packing has no influence on the reaction except its contribution to the axial mixing. T h e boundary conditions are
280
9.
PARABOLIC PARTIAL DIFFFRENTIAL EQUATIONS
where zfis the total dimensionless length x r / D , of the reactor and p , represents the concentration of A before it enters the reactor. T h e total reactor length is xf. T h e initial condition is p(z, 0 ) = p"2) t = 0 0 < 2 < Zf (2c) T h e partial pressure p is the dependent variable, and z and t are the two independent variables. Since only the term rp2 is nonlinear and all the differentials appear linearly, Eq. (1) is called a quasilinear partial differential equation. Applying the generalized Newton-Raphson formula to the nonlinear term in Eq. (l), we obtain the following linear equation:
where P , + ~ is the unknown variable, and p , is known and is obtained from the previous iteration. T h e boundary and initial conditions for (3) are
3. An Implicit Difference Approximation
At any fixed time t , Eq. (2.3) can be solved by the same finite-difference method discussed in Chapter 3. However, because of the stability problems, it is not at all straightforward to take the difference of (2.3) in the time direction. If explicit difference is used, in order to ensure numerical stability, the integration step size in the time direction must be very small. This problem has been discussed in detail by Forsythe and Wasow [5]. T o avoid these difficulties, the implicit formula of Crank and Nicolson will be used [4]. Suppose that now the bed length zf is divided into M equal increments of width dz, the partial derivatives in Eq. (2.3) can be replaced by the following Crank-Nicolson difference operator:
3.
28 1
A N IMPLICIT DIFFERENCE APPROXIMATION
T h e other unknown variables can be replaced by the simple difference expressions aPn+l -
at P,+l
1 At
+ I)
[pn+l(m,
=$[Pn+1h
k
- P(m9
')I
(3)
+ 1) + P ( m ')I
(4)
where p(m, k ) represents the value of p at axial position m dz of the reactor and at time k At. I n the above equations, the value of p at time step k is considered known; the current unknown time step is k 1. I n this unknown time step, n quasilinearization iterations have been calculated. 1)st time step and (n 1)st iteration Thus, only the values of p at ( k are the unknown values. T h e subscript which represents the number of iterations has no meaning for the values of the previous kth time step. T h e function p , in Eq. (2.3) can be replaced by either of the following two difference operators:
+
+
Pn =
P,
mdm
=P n b ,k
'+
+
1) + P ( m ,
1'1
+ 1)
(5)
(6)
In the present calculation, Eq. (5) is used. Note that in the implicit Crank-Nicolson method the average values of the difference operators at (k 1) d t and k d t are used for the partial derivatives. T h e stability and convergence requirements are much less severe for this method than for the explicit methods. T h e boundary conditions, Eqs. (2.4a) and (2.4b), now become
+
Pn+1W,
'+
1) = Pn+dM
-
1,
'+
1)
(8)
Substituting Eqs. (1)-(5) and Eqs. (7) and (8) into Eq. (2.3) for m = 1, 2, ..., ( M - l), we can obtain the following system of ( M - 1) simultaneous equations:
AP,+l(k + 1) = -(BPW where
A=
+ E)
9.
282
PARABOLIC! PARTIAL DIFFERENTIAL EQUATIONS
I
e
L o
f
E=
with
1 1 +--NPe49 242
1
(17)
At
1/(2Nped4
f
=
h
=f -
1/(2dz)
+
In the above equations the partial pressure, p,,, (k l), is the unknown variable. The value of p , (k 1) is known and is obtained from previous iterations. The partial pressure p ( m , k) is the preceding time step and is considered known. Since the matrix A is tridiagonal,
+
5.
NUMERICAL RESULTS-ISOTHERMAL
REACTOR
283
Eq. (9) can be solved by the straightforward Thomas method discussed in Section 8 of Chapter 3. 4, Computational Procedure
Assuming that all values at kth time step are known, we can calculate 1)st time step as follows: the (k
+
+
Assume the values for pnz0 (m,k I), m = 0, 1, 2,..., M . (2) Calculate P , , ~ (m,k l), m = 1, 2,..., M - 1, from Eq. (3.9). 1) and ( M ,k 1) from Eqs. (3.7) (3) Calculate p,=l (0, k and (3.8), respectively. (4) With the values for (m,k 1) known, obtain the values 1) from steps (2) and (3). Repeat this process until the for P , , ~(m,k required accuracy is obtained. (1)
+ +
+
+
+
Let E be the maximum error allowed; the required accuracy can be defined by the following equation:
1 pn+1(m,
+ 1)
+ 1) I <
- pn(m,
m
= 0 , 1,
L..,
(1)
+
Instead of assuming the starting values, P , , ~ (m,k l), we can calculate them by the explicit difference method. However, during the early stages of the calculations. it has been found that using the explicit difference method to obtain the starting values does not reduce the number of iterations significantly. In fact, the number of iterations needed is fairly independent of the starting values, as long as reasonable values are used. I n actual calculations, only the starting values for the first time step, pnz0 (m,l), m = 0, 1,..., M , are assumed. For time steps larger than one, the values of pressure from the preceding time step, p(m, k), are used as the starting values for the present time step, (m,k 1). This procedure for obtaining the starting values is used in all the numerical examples in this chapter.
+
5. Numerical Results-Isothermal
Reactor
This problem is solved on an IBM 7094 computer. T h e numerical values used are p , = 0.07 d~ = 0.1 Np, = 2.0 A t == 0.2 r
=
1.0
p"z)
=
0
zf = 48
284
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
a07 I
I
'\
I I I
1
OO
FIG. 9.1.
Isothermal reactor with axial mixing.
T h e results are shown in Fig. 9.1. T h e steady state conditions are reached at t = 60. For the first time step, with assumed starting values of p,,o(m, 1) = 0.001, only three iterations are needed to reduce the value As the time step k increases, the number of of E to less than 0.1 x quasilinearization iterations required is reduced to two or one. The convergence rates of the first five time steps are shown in Table 9.1. Only the integration point at z = 0 is tabulated. I t should be pointed out that the values listed in Table 9.1 can be improved by using a smaller step size A t . Accurate values of p are TABLE 9.1 CONVERGENCE RATESOF p ( 0 , t ) , FIRSTFIVETIME STEPS Iteration
t = 0.2
t = 0.4
0 1 2 3
0.001 0.027503 0.027497 0.027497
0.027497 0.044141 0.0441 3 1 0.0441 3 1
t
=
0.6
0.044 13 1 0.049537 0.04953 5 0.049535
t
=
0.8
0.049535 0.054570 0.054568 0.054568
t
=
1.0
0.054568 0.057239 0.057238 0.057238
6.
285
ADIABATIC REACTOR WITH AXIAL MIXING
difficult to obtain at small values of t , unless a very small time step size A t is used. However, for t >, 5, fairly accurate values of p are obtained with d t = 0.2. Thus, Fig. 9.1 is not influenced by these inaccuracies. The purpose of Table 9.1 is to show the convergence rates. 6. Adiabatic Reactor with Axial Mixing
To generalize the problem treated in the above section, the transient equations for an adiabatic reactor with axial mixing will be solved for a particular set of numerical conditions. In addition to the mass balance equation, the energy balance equation with nonlinear exponential temperature term must be considered. In Chapter 3, the quasilinearization technique has been shown to be an effective tool to solve the steady state case of this problem. It will be shown that this technique is equally effective for the transient equations. Using the same chemical reaction and assuming that the packing material plays the same role, the following two equations can be easily established:
where r,
=Dpko
Q =
0
- AH Cf PI
(3)
where T is the temperature of the reaction mixture, AH is the heat of reaction, and cj and pr are the specific heat and density of the reaction mixture, respectively. The frequency-factor constant is k, ,the activation energy of reaction is E , and the gas constant is R. I n obtaining the above equations, the mass axial diffusion coefficient has been assumed to be equal to the thermal axial diffusion coefficient. The boundary and initial conditions for Eq. (1) are Eqs. (2.2). For Eq. (2), the boundary conditions are T,
=
T(0,t ) - -aT
at z = o
t
>
~
N P * aZ
aT _ -0 as
at z = z f at
t > O
t =0 0
< z < zj
(44 (4b) (4~)
9.
286
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
where T, represents the temperature of the reaction mixture before it enters the reactor and is a given constant. Equations (1) and (2) constitute two simultaneous quasilinear partial differential equations. T h e nonlinear terms in these equations can be linearized simultaneously by the generalized Newton-Raphson formula. T h e linearized equations are
Since the variables with subscript n are known and are obtained from the previous iteration, the above equations are linear equations. T h e boundary and initial conditions for Eq. (5a) are represented by Eq. (2.4). These conditions for (5b) are
-aTn+, =o
at z = z f
az
Tn+l(z,0 ) = T o ( z )
at
t
=
t>O
0 0
< z < zf
(6b) (6c)
Equation (5a) can be replaced by the difference quotients, Eqs. (3.1) to (3.5). A set of completely similar difference quotients can be established for Eq. (5b). T h e boundary conditions, Eq. (6), can be reduced to the following difference form:
Tn+,(M, k
+ 1)
Tn+i(M - 1, k
+ 1)
(8)
Substituting the difference quotients and the boundary conditions into Eq. (5), the following system of 2(M - 1) simultaneous equations can be obtained
+ 1) &Tn+l(k + 1) Alpn+l(k
= =
+ + 1) + D lT(k) + El) -(BzT(h) + Dzpn+l(k + 1) + D , P ( ~ + ) Ed - ( B , P ( ~ ) DlTn+l(k
(9a) (9')
6.
287
ADIABATIC REACTOR WITH AXIAL MIXING
where the tridiagonal matrices A, and B, are the same matrices as A and B in Eqs. (3.10) and (3.11), respectively, except that the values for g, are changed: g 77L = d - - 1 z ~ o [ p ( m , +pn(m, k
+ 111
[-
~ X P
R(T(m,k) +2E Tn(m,k m
=
+
1))
1
1, 2, ..., (M - 1)
(10)
T h e matrices A, and B, are the following tridiagonal matrices:
B, =
2
0
where
m = 1 , 2 ,..., (M - 1)
(13)
and D, is a diagonal matrix with the diagonal elements
m
=
1, 2, ..., (M - 1)
(14)
where (diag), represents the diagonal elements at the mth column and mth row.
288
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
Similarly, D, is a diagonal matrix with the following diagonal elements: -2E (diag), = 3ro"(f% k ) +P&, k 111 exp m,k ) + T,(m, k + 1))
+
1
m
+fP(O, k)
-$el
+1
+
=
1, 2, ..., ( M - 1) (15)
f Pf?
r0 7 e2
El
= YO - eM-2
4
5 eM-1
-4
+ hP(M, k ) 1
E2 =
where
-2 E
+ Tn(m,k + 1))1 T h e column vectors ~ % + ~+( 1) k and p(k) are defined by Eqs (3.13) and k T ( m ,k )
(3.14) and (19)
T,+I(M
-
1, k
T(k)= T ( M - 1, k )
+ 1)
7.
NUMERICAL RESULTS-ADIABATIC
289
REACTOR
The values for c, d , f,and h remain the same and are defined by Eqs. (3.16)-( 3.19). 1) and T,+,(k 1) in both Owing to the presence of p,+,(k equations, Eq. (9) must be solved simultaneously. However, if we let 1) and T,(k 1) approximate p,+,(k 1) and T,+l(k I), p,(k respectively, on the right-hand side of Eq. (9), the following two independent equations are obtained
+
+
+
+
+
+ 1) A,Tn+i(k + 1) A1Pn+,@
= =
+
+ D1TnP + 1) + DlT(4 + El) -(BzT(k) + Dzpn(k + 1) + D , P ( ~+ ) E,) -(B,P(k)
(214 (21b)
where
T h e above approximations have been used in Section 11 of Chapter 3. T h e right-hand sides of the equations in (21) are completely known. Thus, Eqs. (21a) and (21b) can be solved independently by the Thomas method. With all values at the kth time step known, the (k 1)st time step can be calculated by essentially the same procedure as that listed in Section 4.
+
7. Numerical Results-Adiabatic
Reactor
T h e numerical values used are
At t
=
p,
=
T,
=
0.07atm 1250"R
Np, AZ
=
2.0
At
=
EIR
Q
=
22,000"R x 104"R/atm
= 0.1
ro = 0.5 x 108atm-l
= 0.1
z f = 48
0.2
0, the initial values are p"z) = 0 T0(z)= 1270"R
(1)
290
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
0.07 I
'0
10
20 30 40 REACTOR LENGTH,z
Zf
50
FIG.9.2. Adiabatic reactor with axial mixing, transients in partial pressures.
T h e results are shown in Figs. 9.2 and 9.3. T h e steady state conditions are reached at t = 70. For the first time step, with ~ , , ~ ( m1), = 0.01 and Tn,o(m, 1) = 1270 as initial approximations, only three iterations 0.1 x for the partial pressure variable. are needed to reduce E T h e convergence rates of the first five time steps at z = 0 are shown in Table 9.2. T h e convergence rates of Table 9.2 are about the same as those of Table 9.1. Thus, in going to Eq. (6.21) from Eq. (6.9), the approximations have not reduced the convergence rates. However, it appears that these convergence rates have been reduced by this kind of approximation for the steady state case (see Table 3.7). As the time step k increases, the number of iterations needed is first reduced to two and then reduced to one. Each iteration takes about half a second of computation time. It should be pointed out that the numerical values listed in Table 9.2 can be improved if a smaller time step size A t is used. T h e purpose of Table 9.2 is to show the convergence rates. However, this improvement, which is largest at the first time step, does not change the results shown in Figs. 9.2 and 9.3. It has been found that a very small time step size
<
7.
NUMERICAL RESULTS-ADIABATIC
1310
29 1
REACTOR
-
I-
w
a
3
I-
<
w LL
a w I I-
I
I
I I
10
I
I
30 REACTOR LENGTH, z
20
1
I
40
zt
FIG. 9.3. Adiabatic reactor with axial mixing, temperature transients. TABLE 9.2a REACTOR CONVERGENCE RATESOF p ( 0 , t), ADIABATIC Iteration
t = 0.2
t = 0.4
t = 0.6
t = 0.8
0 1 2 3
0.01 0.027496 0.027494 0.027494
0.027494 0.0441 17 0.044106 0.044106
0.044 106 0.049479 0.049479 0.049479
0.049479 0.054479 0.054481 0.054481
t
=
1.0
0.054481 0.0571 19 0.057121 0.057121
TABLE 9.2b REACTOR CONVERGENCE RATESOF T(0, t), ADIABATIC Iteration
0 1 2 3
t
0.2
t = 0.4
t = 0.6
t = 0.8
1270.0 1262.1 1262.2 1262.2
1262.2 1257.4 1257.5 1257.5
1257.5 1256.0 1256.0 1256.0
1256.0 1254.7 1254.7 1254.7
=
t
=
1.0
1254.7 1254.1 1254.1 1254.1
292
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
A t is needed in order to obtain accurate values at t = 0.2. However, for t > 1 fairly accuratevalues can be obtained even with A t = 0.2. 8. Discussion
T h e numerical values used for the above example are the same as those used for the steady state case, which is solved in Section 12 of Chapter 3. T h e procedure at each time step is essentially the same as that used in Chapter 3. However, since the steady state condition in the present case is obtained gradually in a time step-by-time step fashion, while this condition is obtained directly from the initial approximation in Chapter 3, the quasilinearization iteration is much more stable in the above calculations. For t = 60 and t = 70 where the steady state condition is practically reached, the following values are obtained: p(z,, 60) T ( z , , 60) P(z,, 70) T ( z , , 70)
= 0.0088082
1308.9 = 0.0086671 = 1311.2 =
These compare favorably with the results listed in Table 3.7. 9. Influence of the Packing Particles
Heretofore, the influences of the packing particles have not been considered. T o generalize the problems treated above and also to compare the quasilinearization approach with the commonly used numerical methods, the problem solved by Liu and Amundson [l] with reaction occurring inside the particles will be solved. These authors have considered adiabatic fixed bed catalytic reactors with axial mixing. T h e mass and heat transfer resistances are lumped at the particle surface and the only intraparticle effect is that of the chemical reaction. Let us consider the simple first-order, irreversible chemical reaction (1) with uniform interstitial velocity zi. Because it is adiabatic, there is no radial transport of heat or mass. Only axial transport will be assumed. A material balance on the interstitial fluid gives A+B
9.
INFLUENCE OF THE PACKING PARTICLES
293
where a, =
a,k,M’P
(3)
PfY
The last term on the left-hand side of Eq. (2) represents the lumped mass transfer rates at the surface of the packing particle. T h e other three terms have the same meanings as those of the previous sections, except that dimensionless parameters and variables are not used. T h e variable p , represents the partial pressure of reactant A inside the particle; a, is the total surface area of particles per unit volume of bed; K , is the lumped mass transfer coefficient at the surface of the particles; M’ is the molecular weight of the reaction mixture; P is total pressure; p, is the density of the reaction mixture; and y is the fractional void volume of the bed. Assuming that the mass axial diffusion coefficient equals the thermal axial diffusion coefficient, we can obtain the energy balance equation D
~
a2T aT -v 8x2 ax
+ a,(T,
-
aT
T)=a0
(4)
where
where the first term on the left-hand side represents the axial heat mixing and the last term on the left-hand side represents the heat transfer rate at the particle surface. T h e variable T, represents the particle temperature; h, is the lumped heat transfer coefficient at the particle surface; and c, is the specific heat of the reaction mixture Now, consider a single solid particle. A material balance on this particle gives
T h e last term is the reaction rate term and a3 =
~
6M’Pk, DDolPf,
(7)
where a is the fractional void fraction of the particle; pm is the density of intraparticle reaction mixture; ps is the density of the particle; and S, is surface area per unit mass of particle.
294
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
T h e following equation can be obtained from an energy balance on a single particle:
where
/3
k hf
= -2 ( - A H )
and c, is the specific heat of the particle. With the presence of the Arrhenius expression, Eqs. (6) and (9) are highly nonlinear. Equations (2), (4), (6), and (9) are four simultaneous quasilinear partial differential equations. T h e boundary conditions for the two equations of the interstitial fluid are
vp,
=
vp(0,O) - D -aP
ax
vT, =vT ( O, B ) - D -
% =o ax
-aT =o ax
=0
at
x
at
x=O
B
>0
(W
aT ax
at
x=xf
e>o
at
x=xf
e>O
0>O
T h e intial conditions of the interstitial fluid are:
p ( x , 0) = p O ( x )
at
T ( x ,0)
at 0
=
To(x)
0
=0 =
0
< x < xf 0 < x < xf
0
(13)
and the initial conditions within the packing particles are
p,(x, 0 ) = p”,x)
at
e =0
T,(x, 0)
at
0
=
T i( x)
=
0
< x < xf 0 < x < xf
0
(14)
10. The Linearized Equations
Since Eqs. (9.2) and (9.4) are linear equations, only Eqs. (9.6) and (9.9) need to be linearized. Furthermore, since the temperature T and pressure p do not appear in the nonlinear terms of Eqs. (9.6) and (9.9),
10.
295
THE LINEARIZED EQUATIONS
only the two variables, T, andp, , need to be considered in applying the quasilinearization procedure. Equations (9.6) and (9.9) can be written in the following form:
-1 aP, - p
=
-p,
T
=
-T,
u3 a0 1 aT, u4 a0
-~
p exp ,
(+ BSP, exp (-
E
x) E
The right-hand side of Eqs. (1) and (2) can be linearized by the application of the generalized Newton-Raphson formula. T h e linearized equations are
where b,
=
exp
(- -)
E RTDn
Equations (9.2) and (9.4) now become
D--va2Tn+1 ax2
ax
+
-
Tn+l) = 7 aTn+l
The partial pressure capacity term in Eq. (3) can be neglected:
Then, Eq. (3) can be reduced to the following form:
296
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
where
Equations (8), (1 l ) , and (12) are the three equations solved. T h e three unknowns are Tn+, p n + l , and Tp(n+l). 7
11. The Difference Equations
where b,(m, k )
=
exp
(
11.
297
THE DIFFERENCE EQUATIONS
T h e b’s are introduced only for the purpose of simplifying notations. They are not constants, but are functions of the grid points. However, since they are functions of the variables with the subscript n, they are known variables. T h e boundary conditions in difference forms are
I n order to obtain the desired set of equations, Eqs. (10.8) and (10.12) are reducedfirst into two difference equations. Then the unknown variable, Tp(n+l)(m, K l), can be canceled from these two difference equations by the use of Eq. (1). Finally, by substituting Eqs. (7)-(10) into these difference equations, the following 2(M - 1) simultaneous algebraic equations are obtained
+
+ 1) A2Tn+,(K+ 1)
A,Pn+,@
+ C,TD(K) + D,Tn+,(K + 1) + DlT(k) + El) = -(BzT(k) + C,T,(k) + DzPTZ+dK + 1) + D,P(k) + E2)
=
-(B,P(k)
(11)
(12)
where the tridiagonal matrices, A, and A , , are the same as A and A, in Eqs. (3.10) and (6.1l), respectively, except that the values forf, h, c, and g are changed: g,
gk
=
=
d
d’
a +$ [b3(m,K)-l]
-
+ & z ~ uA0b5(m, ~ K) f=-
D 2 Ax2
a,A0/3Sbl(m, k)b3(m,K)b,(m, k) 2 m = 1, 2 , ..., M - 1 m
=
1, 2 ,..., M
-
1
(13)
(14)
298
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
T h e tridiagonal matrices, B, and B, , are 2 -
h
A0
g,
+ j2g f
h g3
+ j2g
h
f
gM-a
2 +A0
f h
2 g; +jg
f
h
2
g;+jg
h
f T h e matrices C,, C,, D , , and D, are diagonal matrices with the following diagonal elements:
C , : (diag),
= +a,
+ &z,b,(m, k)(1 + +a4AOb,(m, k))
D, : (diag),
= -*a4
D, : (diag),
= ~ a , a ,A@3Sb,(m, k)b3(m,k)b5(m,k)
AOb,(m, k)
m
=
1,2,...,M
-
1 (24)
m
=
1,2,..., M
-
1 (25)
m
=
1,2,..., M - 1 (26)
1 1,
299
THE DIFFERENCE EQUATIONS
where (diag), represents the mth column and mth row of the respective matrices. The column vectors, Eland E, , are
El=
E, =
I
iaza4 mj3bl(M - 2, K ) ~ , ( M - 2, k ) b 5 ( ~ 2, K ) [ s ~ , ( M - 2, K) x b3(M - 2, K)-
13
gaZa, dej3b1(M- I , K ) ~ , ( M - 1, K ) ~ , ( M - 1, K ) [ S ~ , ( M 1, k) x b3(M - 1, K)- I] hT(M, K)
+
+
+
The vectors P , + ~ ( K l), p(K), T,+,(K l), and T(K) are defined by Eqs. (3.13), (3.14), (6.19), and (6.20), respectively, and
Equations (11) and (12) are made independent of each other by 1) and T,. [(K 1) on the right-hand sides by replacing p,+,(K p,(K 1) and T,(K I), respectively:
+
+
+
+
+ -(Bip(K) + C,TD(K) + DiTs(K + 1) + DiT(k) + El) (30) A2Tn+1(k + 1) -(B,T(K) + + D,pn(k + 1) + D2p(K) + E,) (31) where p,(K + 1) and T,(K + 1) are defined by Eqs. (6.22) and (6.23). Al~n+l(k 1)
=
=
C2Tp(K)
Note that the only unknown variables in Eqs. (30) and (31) are
300
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUAT.IONS
+
~ , + ~+ ( k 1) and T,+l(k 1). The other two unknown variables p p and T p at the (k 1)st time step and the (n 1)st iteration have been
+
+
eliminated by using Eqs. (10.9) and (1 1.1). Since the right-hand sides are completely known, Eqs. (30) and (31) can be solved independently by the Thomas method. Equation (10.9) can be reduced to the following difference equation:
12. Computational Procedure-Fixed
Bed Reactor
+
+
The values of the unknown variables ~ , + ~ ( m k , l), T,+l(m, k l), P ~ ( , + ~ Ik( ~ , 11, and Tp(,+l)(m, k l), m = 0, 1, 2,..., M , can be obtained by solving Eqs. (ll.l), (11.30), (11.31), and (11.32) independently. With all the values at the kth time step known, the (k 1)st time step can be obtained as follows:
+
+
+
+
+
1) and Tp(,=o)(m,k l), (1) Assume the values for pp(,=,)(m, k m = 0, 1 , 2 ,..., M. (2) Assume that p,,o(m, k 1) = p(m, k), Tn,o(m, k 1) = T(m, k), m = 0, 1, 2 ,..., M.
+
+
+
(3) Calculatep,,,(m, k l), m = 1, 2,..., M - 1, from Eq. (11.30); and p,,,(O, It 1) and p,,,(M, k 1) from the boundary conditions, Eqs. (11.7) and (11.9), respectively. l), m = 1, 2,..., M - 1, from Eq. (1 1.31); (4) Calculate Tn,l(m, k 1) and T,=,(M, k 1) from the boundary conditions, and T,=,(O, It Eqs. (11.8) and (ll.lO), respectively.
+
+
+
+
+
+ +
( 5 ) Calculate Tp(,-,)(m, k l), m = 0, 1, 2,..., M, from Eq. (11.1). (6) Calculatepp(,=,)(m, It l), m = 0, 1, 2,..., M , from Eq. (11.32). (7) Repeat steps (3) to (6) with the subscript n = 2, 3,... until the required accuracy is obtained. Step (1) has been used only for the first time step. For It = 1, 2,..., the values of pp(,=,)(m, k 1) and Tp(,=,)(m,k 1) are assumed to be equal to pp(m, k) and Tp(m, k), respectively. Note that in calculating
+
+
13.
NUMERICAL RESULTS-FIXED
BED REACTOR
30 1
+ 1) and Tn,l(m, k + l), the values of pn,o(m, K + 1) and + l), or step (2), would not be needed if we had not reduced 1) and (1 1.12) to Eqs. (1 1.30) and (1 1.31) by approximation.
13. Numerical Results-Fixed
Bed Reactor
By using the above procedure, Figures 1 and 2 of Liu and Amundson [I] are repeated. T h e results are shown in Figs. 9.4-9.7. T h e numerical values used by the above mentioned authors are 125 ft2/ft3 1 mole/hr-atm-ftz = 48 Ib/lb-mole = 1 atm pf = 0.07 lb/ft3 y = 0.35 h, = 20 Btu/hr-ft2-"F C, = 0.25 Btu/lb-"F ps = 60 1b/ft3 S,k, = 13.878 x lo5 mole/hr-atm-lb C, = 0.196 Btu/lb-"F D, = 0.375 inch -AH = 1.2 x lo5 Btu/lb-mole U,
k, M' P
=
1
From these values, the constants in Eqs. (1 l.l), (1 1.30), (1 1.31), and (11.32) can be obtained. T h e numerical values used to solve these four equations are summarized as follows: 4.0816 x lo3 min-1 x lo3 min-1 u4 = 5.45 min-1 B = 6 x 103"F/atm 6 = exp(12.98) AX = 0.004 ft A0 = 0.02 min U, =
u2 = 6.8027
D
8 ft2/min o = 408 ft/min E/R = 22,000"R p , = 0.07 atm T , = 1250 R Xf = 1.5 ft =
9.
302
E
<
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
0.08
l-
a
2
0
0
' 0.2'
I
0.4 '
0.6 0.8 1.0 REACTOR LENGTH, FEET
1.2
1A
FIG.9.4. Packed bed reactor, partial pressure inside particle.
Since the partial pressure capacity term has been neglected, the value of a3 is not needed. T h e initial conditions are p"(x) = 0
T"(X)= 1500"R
pE(x) = 0
$(x)
=
1500"R
The convergence rate of the partial pressure for the first time step inside the particle p , is shown in Fig. 9.8. All other variables have about the same convergence rate. Assuming that the starting values are 0.08
l-
a
2
o
o
~ a2
'
' 0.4
'
~
'
"
0.6 0.8 l.0 REACTOR LENGTH, FEET
12
FIG. 9.5. Packed bed reactor, partial pressure in fluid phase.
1.4
13.
NUMERICAL RESULTS-FIXED
BED REACTOR
303
a
1
1I
,
,
0.2
0
,
,
,
FIG.9.6.
,
(
,
,
,
I
,
0.6
0.4
1.2
0.6 1.0 REACTOR LENGTH, FEET
1.4
Packed bed reactor, particle temperature.
pP(,=o)(m, 1) = 0 and Tp(n,o)(m,1) = 1500, only four iterations are needed for eP, 0.1 x Only the first two iterations can be shown in Fig. 9.8. The results for the third and fourth iterations cannot be
<
1.1
1
0
a2
,
0.4
,
,
0.6
,
,
0.0
,
,
REACTOR LENGTH, FEET
,
1.o
FIG.9.7. Packed bed reactor, fluid temperature.
,
,
1.2
,
1.4
304
9.
PARABOLIC PARTIAL DIFFERENTIAL EQUATIONS
0.061
o
I
a2
a4
a0
o
1.0
i.2
1.4
REACTOR LENGTH, FEET
FIG.9.8. Approach to correct partial pressure profile, first time step results.
distinguished from those of the second iteration in the figure. I n spite of the complexity of the problem, the convergence rates are not noticeably slower than the problems solved in the previous sections. Liu and Amundson [ 11 have mentioned in their paper that 25 iterations are needed for the first time step. Comparing the number of iterations needed, it can be seen that a tremendous saving in computation time is realized by the present technique. Each iteration uses about less than one second of computation time. If a better computer program with less printout were used, this computation time could be further shortened. As the time step k increases, the number of iterations required at each time step is reduced considerably. Instead of assuming the starting values, the explicit difference method could have been used to calculate these approximations in steps (1) and (2). This has been done, but the number of iterations required remained nearly the same. 14. Conclusion
It has been shown that the quasilinearization technique is a useful tool for solving nonlinear parabolic partial differential equations of the boundary-value type resulting from fixed bed reactors. For the problem solved in the preceding section, only four iterations are required for the first time step as compared to the 25 iterations needed by Liu and
REFERENCES
305
Amundson [I]. Furthermore, the quasilinearization technique allows the use of a very rough initial approximation and still retains the very rapid rate of convergence. Although only simple chemical reactions have been considered, the approach also can be used to treat more complex reactions. Following the approaches used in the previous chapters, no discussions concerning the dynamics of chemical reactors have been included. Our purpose has been to show the effectiveness of the quasilinearization technique. This has been done by a few numerical examples. T h e dynamics of reactors with extensive calculations will be discussed elsewhere. REFERENCES
1 . Liu, S.-L., and Amundson, N. R., Stability of adiabatic packed-bed reactors. Effect of axial mixing. 2nd. Eng. Chem. Fundamentals 2, 183 (1963). 2. Bellman, R. E., and Kalaba, R. E., “Quasilinearization and Nonlinear BoundaryValue Problems.” American Elsevier, New York, 1965. 3. Kalaba, R., On nonlinear differential equations, the maximum operation, and monotone convergence. J. Math. Mech. 8, 519 (1959). 4. Crank, J., and Nicolson, P., A practical method for numerical evaluation of solutions of partial differential equations of the heat-conduction type. Proc. Cambridge Philos. SOC.43, 50 (1947). 5. Forsythe, G. E., and Wasow, W. R., “Finite-Difference Methods for Partial Differential Equations.” Wiley, New York, 1960. 6. Abbott, M. B., “An Introduction to the Method of Characteristics.” American Elsevier, New York, 1966. 7. Courant, R., and Friedrichs, K. O., “Supersonic Flow and Shock Waves.” Wiley (Interscience), New York, 1948. 8. Milne, W. E., “Numerical Solution of Differential Equations.” Wiley, New York, 1953. 9. Bellman, R., Juncosa, M. L., and Kalaba, R., Some numerical experiments using Newton’s method for nonlinear parabolic and elliptic boundary-value problems. Commun. A C M 4, 187 (1961). 10. Lee, E. S., A generalized Newton-Raphson method for nonlinear partial differential equations-packed-bed reactors with axial mixing. Chem. Eng. Sci. 21, 143 (1966). 11. Ames, W. F., “Nonlinear Partial Differential Equations in Engineering.” Academic Press, New York, 1965. 12. Fox, L., “Numerical Solution of Ordinary and Partial Differential Equations.” Addison-Wesley, Reading, Massachusetts, 1962. 13. Bramble, J. H., ed., “Numerical Solution of Partial Differential Equations.” Academic Press, New York, 1966.
Appendix I
VARIATIONAL PROBLEMS WITH PARAMETERS
1. Introduction
Some of the results in the classical calculus of variations will be summarized in this appendix. No attempt has been made to derive any of the results [1-4]. T h e most general problems in the calculus of variations with one independent variable are those of Mayer, Bolza, and Lagrange with variable endpoints. Theoretically, these three problems are equivalent and any one of them can be transformed into another by a change of the coordinates. T h e equations for the problem of Mayer will be summarized first. Then, it will be shown how the problems of Bolza and Lagrange can be treated by essentially the same equations. Although constant parameters are present in the originally formulated problem, it is shown that this problem with parameters can be transformed easily into the usual form of the calculus of variations by formulating additional differential equations. 2. Variational Equations with Parameters
Let us consider the following variational problem: Find that function z(t) and that set of constant parameters such that the set of functions given by the differential equations x: = f i ( t , X , P , z ) 306
i
=
1, 2,..., M
(3)
VARIATIONAL PROBLEMS WITH PARAMETERS
307
and end conditions
minimize a function of the form
where x is the M-dimensional state vector and P is the m-dimensional constant parameter vector. T h e variable x ( t ) is within our control and is called the control variable. T h e variable t can be considered as the time or length coordinate. T h e problem formulated above is essentially the problem of Mayer [11 except for the presence of the unknown constant parameters. However, this difference can be eliminated if we consider the constant parameters as functions of t and treat them as state variables. T h e following differential equations can be established: dP.(t) P;(t) = 3= 0 dt
j
=
I, 2, ..., m
Now, the constant parameter vector P becomes P ( t ) ; the number of differential equations becomes ( M m). T h e unknown initial conditions P(to), which are also the constant parameters P, can be obtained from the free boundary or transversality conditions during the solution process. T o simplify notations, let yl(t),y z ( t )..., , yMMtnl(t) represent the state variables xl(t), x2(t),...,xM(t),Pl(t),P2(t),..., Pm(t).Following the classical treatment in the calculus of variations, let us introduce the set of Lagrange multipliers
+
hi(t),
i
=
1, 2 ,...,( M
and the set of constant multipliers
Define the functions
+ m)
(7)
308
APPENDIX I
+
where the vectors y, y', and h represent the ( M m)-dimensional t l vectors with components y l , y z ,..., y l ,y e ,...,yb,, , and A , , A, ,...,,A, , respectively. The Euler-Lagrange equations are
d aF dt ay;
----=
8F
i = 1, 2, ...,M
ayi
+m
aF _ -0 az
I n addition, the equation
must hold at to and tf for every choice of dyi(to),dy,(t,), dt, , and dt, . Equation (13) does not hold for any of the terminal conditions, y,(t,), yi(t,), t, , and t o , if the value of that terminal condition is given. The symbol It, means that the expression at the left is evaluated at t o . Equation (1 3) is known as the transversality condition. Equations (1 1)-(13) form a necessary condition for the optimization problem and have been called the multiplier rule by Bliss [l]. Applying Eq. (11) to (9), we see that dhi aF _ -i = 1, 2,...,M m dt
+
aYi
Now our system is composed of
2(M + M) differential equations (Eqs. (3), (6), (11)); 2(M + m) + 2 transversality conditions (Eq. (13)); one equation for the control variable (Eq. (12)); and m1 end conditions (Eq. (4)), to determine ( M m) state variables and (M m) Lagrange multipliers; 2(M m) 2 end values to , t, ,ya(to),yi(tr),i = 1, 2 ,..., M one control variable; and m1 constant multipliers, uj ,j = 1, 2,..., m, .
+
+
+
+
+ m;
Since not all the boundary conditions are given at the initial point t o , the above system forms a two-point boundary-value problem.
309
VARIATIONAL PROBLEMS WITH PARAMETERS
The differential equations which are encountered in engineering applications are generally nonlinear and cannot be solved analytically. T h e problem of finding numerical answers for this nonlinear boundaryvalue problem is not simple and limits the use of the calculus of variations. T h e above problem is formulated in the form which is most frequently encountered in applications. Some generalizations can be made easily. If there are m 2 control variables, zl(t),..., zm,(t),then Eq. (12) becomes
-aF= o
i
azi
=
1, 2,..., m2
(15)
Instead of Eq. (5), the optimization of the following functional
also can be treated. The function F now becomes
T h e other equations remain the same. The optimization of Eq. (16) is known as the problem of Bolza. If the function g equals zero in Eq. (16), we obtain the more familier Lagrange problem and, obviously, the above equations are still applicable. 3. Simpler End Conditions
For many engineering problems, the values of to and t j are given. Furthermore, the end conditions frequently are separated. Thus, instead of Eq. (2.4), one has the initial conditions for Eq. (2.3) i = 1, 2, ..., M
xi(t0) = x,P
(1)
and the end conditions at the final terminal t,hj(tf , x ( t f ) ,P)= 0
j = 1, 2 ,..., 2
<M
(2)
Equations (2.3), (2.5), and (2.6) remain the same. With the state vector y defined the same way as before, Eq. (2.10) becomes
+ c vi?Mtf 2
G(to ? Y(tO), tf ? Y(tf))
= &!(to
>
Y(tO), tf 3 Y ( t f ) )
j=1
9
Y(tf))
(3)
310
APPENDIX I
Equations (2.9), (2.1 l), (2.12), and (2.14) are still valid. Equation (2.13) can be simplified in the following manner. At the initial point t = t, , the values of y1 ,y z ,...)y Mare fixed. Thus, we only have the following m relations for the constant parameters: aG
=0
i
=M
+ 1, M + 2,..., M + m
(4)
At the final terminal t = tf , we have =0
i
=
+m
1, 2,..., M
Using Eqs. (2.9) and (3), we can write Eqs. (4)and ( 5 ) as
I
&(to)= ayi to
i=M+l,M+2,
..., M + m
(6)
and i
=
1, 2,...,M
+m
(7)
+
Equations ( l ) , (6), and (7) constitute the 2(M m) boundary conditions for the 2(M m) differential equations represented by (2.3), (2.6), and (2.11). Note that Eqs. (2) and (7) constitute M m I equations. Since there are I unknown multipliers, vi , Eqs. (2) and (7) give M m conditions only. If the end values of a certain state variable, say y,(t,) and y,,(tr), do not appear in Eq. (3), then Eqs, ( 6 ) and (7) for this variable can be reduced to
+
+ +
+
which is known as the free boundary conditions [5]. 4. Calculus of Variations with Control Variable Inequality Constraint
Now let us assume that the control variable z(t) is chosen subject to the following inequality constraint: +(Y! z ) G 0
(1)
31 1
VARIATIONAL PROBLEMS WITH PARAMETERS
If we introduce the multiplier p ( t ) and treat the product p+ in the same way as we have treated the product h,(yi -fi), Eq. (2.9) becomes
T h e Euler-Lagrange equations remain the same except that F is replaced
Fl . I n terms of F , Eqs. (2.11) and (2.12) become
_d _ aF - aF a+ dt ay; - ayi + p- ay, aF
i
=
1, 2, ..., M
+m
(3)
a+ aZ
-+p-=O
(4)
When the constraint is not violated, p = 0, and Eqs. (3) and (4)are reduced to Eqs. (2.11) and (2.12). However, when the constraint is violated, the control variable z is determined by the equality in Eq. (1) and the extra equation (4)is used to determine the newly introduced variable p. T h e problem with control variable inequality constraints was first investigated by Valentine [6,7]. Obviously, the results can be extended easily to several control variables with several inequality constraints. It should be pointed out that in order for the method to be valid, the control variable must appear in the inequality constraint. Inequalities involving state variables only are more difficult. This is because of the basic difference between state and control variables. A control variable is, in a sense, more independent and is not subject to differential equation constraints; state variables are not independent. A trial-and-error or iterative procedure is needed when the inequality constraint involves state variables only. If the constraint involves the control variable only, then a+/ayi= 0 and Eq. (3) is reduced to Eq. (2.11). Thus, if only the control variable is in the constraint equations, such as = z - zo 0, the numerical solution procedure is the same as that of the unconstrained case except that whenever the constraint is violated, the control variable is obtained from the equality in the constraint equation. Since the independent variable t can always be treated as a state variable by establishing
+
x,;
=
1
<
(5)
the above approach also can be used when the contraint equation involves the variable t explicitly.
312
APPENDIX I
5. Pontryagin’s Maximum Principle
T h e maximum principle [8-101 is a very powerful tool for obtaining analytical solutions for optimization problems with control variable inequality constraints. It is especially useful for linear optimization problems. However, when the problem is nonlinear and an analytical solution cannot be obtained, the maximum principle has the same boundary-value difficulties as those nf the calculus of variations in obtaining numerical answers [ll]. T o show the similarity between the maximum principle and the calculus of variations with bounded control variables, the maximum principle will be formulated formally from the Weierstrass necessary condition. Consider the problem discussed in Section 3 and add the following inequality constraint on the control variable: zmin < z ( t ) < Zmax (1) Following the work of Valentine [ 6 ] , we can express the inequality constraint as
4
=
.(
4 - T2 = 0 r2 = 0. I n the
- Zmin)(%nax -
(2)
When z = xmin or x = zmax,then region between zmaxand xmin,q2 is positive. Thus, 7 is a real variable. Define the function Mtm
Fdt, Y, Y‘, z, A, P) =
c Ai(t)(Y,c -&(4
+ dt)4
Y, 4)
i=l
(3)
T h e Weierstrass necessary condition for a local minimum is [I] M+ rn
E
Fl(t, y, Y’, Z, A, P ) - Fl(t, Y, Y’, z, A, P) -
C
i=l
aF1 (Y,(- Y:) -T Z 0 (4) aYi
and hi and p have the same meaning as before. T h e Y’and 2 are nonoptimum but permissible values of y’ and z. I n other words, Y’and 2 represent perturbations from the optimum. T h e E is known as the Weierstrass excess function or E function. T h e Weierstrass E function condition is a stronger necessary condition. By using this condition, a local minimum may be obtained. T h e Euler-Lagrange equation only gives an extremal arc which may be minimum, maximum, or even a stationary point. T h e Weierstrass condition for the present problem can be reduced to
VARIATIONAL PROBLEMS WITH PARAMETERS
313
which is clearly equivalent to M+m
max H ( t , y, z , h) = max
2
Aifi(tl y, z )
(6)
i=l
Equation (6) is generally known as the maximum principle. T h e function H is known as the Hamiltonian function. As has been shown previously, the addition of inequality constraints involving the control variable only does not change Eq. (2.1 1) or (2.14). Furthermore, it can be shown that
where the second expression is obtained from the Euler-Lagrange equation. Now our problem is reduced to the solution of differential equation (7). At the same time, Eq. (6) is maximized for all values of t, to t tf , subject to the inequality constraint equation (1). The boundary conditions for (7) are the given initial or final conditions. Any condition which is not given can be obtained from the transversality condition. I n the literature, the variables h i , used in the maximum principle, have been called the auxiliary variables, the impulse functions, or the adjoint variables. One can see that these variables are essentially the Lagrange multipliers in the calculus of variations. I n the maximum principle approach, Eq. (2.12) is replaced by Eq. (6). Equation (6) is a much stronger necessary condition than Eq. (2.12). Generally Eq. (2.12) can be obtained by differentiating Eq. (6) with respect to the control variable for most problems. It can be shown that if the problem is to maximize the expression (2.5), then the Hamiltonian function H must be minimized with respect to the control variable x ( t ) for all values of t, to t tt . T h e other equations remain unchanged.
< <
< <
REFERENCES 1. Bliss, G. A., “Lectures on the Calculus of Variations.” The Univ. of Chicago Press, Chicago, Illinois, 1946. 2. Pars, L. A., “An Introduction to the Calculus of Variations.” Wiley, New York, 1962. 3. Breakwell, J. V., The optimization of trajectories. J. SOC. Ind. Appl. Math. 7, 215 (1959). 4. Dreyfus, S. E., “Dynamic Programming and the Calculus of Variations.” Academic Press, New York, 1965.
314
APPENDIX I
5. Courant, R., and Hilbert, D., “Methods of Mathematical Physics,” Vol. 1. Wiley
(Interscience), New York, 1953. 6. Valentine, F. A., The problem of Lagrange with differential inequalities as added side conditions. “Contributions to the Calculus of Variations 1933-1937.” Univ. of Chicago Press, Chicago, Illinois, 1937. 7. Leitmann, G., ed., “Optimization Techniques.” Academic Press, New York, 1962. 8. Pontryagin, L. S., Boltyanskii, V. G., Gamkrelidze, R. V., and Mishchenko, E. F., “The Mathematical Theory of Optimal Processes” (English transl. by K. N. Trirogoff). Wiley (Interscience), New York, 1962. 9. Rozonoer, L. I., The maximum principle of L. S. Pontryagin in optimal system theory. Automutika Telemehanikn 20, 1320, 1441, 1561 (1959) [English transl. Automation Remote Control 20, 1288, 1405, 1517 (1960)l. 10. Fan, L. T., “The Continuous Maximum Principle.” Wiley, New York, 1966. 11. Lee, E. S., Optimization by Pontryagin’s maximum principle on the analog computer. A.I.Ch.E. J. 10, 309 (1964).
Appendix 111
THE FUNCTIONAL GRADIENT TECHNIQUE
1. Introduction
T h e method of steepest ascent, or gradient technique, will be discussed briefly in this appendix. This technique has been studied by various authors [l-81 and has been found fairly effective in obtaining the optimum of continuous and stagewise processes. Those interested may consult the references where more details on the applications of this technique can be found. This appendix not only provides a comparison between the numerical results of the gradient technique and those obtained by the quasilinearization procedure, but also illustrates another use of the idea that forms the basis of the invariant imbedding concept. This formulation originally was obtained by Dreyfus [4]. T h e results obtained here also have been obtained by Bryson and Kelley [l-31, using more complicated derivations. T h e greatest disadvantage of this technique is that there is the possibility of converging to an extremal which does not yield the absolute minimum or maximum. Inequality constraints on the state and control variables can cause considerable difficulty. Furthermore, the convergence rate for continuous problems is fairly slow compared to the quasilinearization procedure. 2. The Recurrence Relations
Consider the system represented by the following set of differential equations [5] :
i = 1, 2, ..., M 315
316
APPENDIX I1
where the state vector x is M-dimensional and the control variable z is a scalar. T h e initial conditions are (2)
x(to) = c
T h e problem is the optimization of a specified function (3)
Q(x(tr)l tr)
of the state variables at some unspecified future time first time that a terminal condition +(x, t )
=
tf
, where
tf
is the
0
(4)
is satisfied. As can be seen from Appendix I, this is the problem of Mayer with separate end conditions. Since differential equations must be reduced to difference forms for digital computations, Eq. (1) can be treated in the following difference form without loss of generality: xi(t
+A )
=z
xi(t) + f i ( x ( t ) , z ( t ) ,t)d
+ O(d)
(5)
Observe again that the value of Q with a given function zo(t)depends on the initial instant to and the initial state vector c. I n fact, we can say that once zo(t) is given, the value of Q depends on to and c only; provided that a unique solution exists for the systems (1) to (4) with this given zo(t),and that to is within the interval of interest of the original system. This given function zo(t)will be called the nominal control variable which can be considered as an initial approximation of z(t).This initial approximation can be assumed to have been obtained from the initial knowledge concerning the system. Define the value of Q at time t, , where the starting state vector is x(t,) at
the starting instant
to , and
using the nominal control variable z,(t)
1
It should be emphasized that the function g defined here is different from the optimum return function g used in Section 15 of Chapter 6. In general, the present function g is not the optimum return function, but is the nominal return function only. Notice that this nominal return function has the semigroup property
THE FUNCTIONAL GRADIENT TECHNIQUE
317
where we have used ( 5 ) with higher-order terms of O(d) omitted. If the right-hand side of ( 6 ) were expanded by Taylor’s series and if the limit d -+ 0 were taken, we should obtain the usual invariant imbedding equation (see Chapter 6 , Section 4). I n that case, x ( t ) would correspond to c, and t to a in terms of the invariant imbedding nomenclature. We would have a family of processes. Each member of the family would have a different starting instant t or a and a series of processes with different starting state vectors x ( t ) or c with each fured value of a. However, this invariant imbedding approach will not be used. Instead of a series of values for the vector x ( t ) , the values of x ( t ) , with a given t, are fixed and are obtained from Eqs. (1) and (2) with z(t) = z,(t). T h e terminal value tf is obtained from (4). We still can consider a family of processes, and each member of the family still has a different starting instant t. However, since the starting state vector x ( t ) is fixed and always obeys Eqs. (1) and (2), each member of this family of processes is a special case of the original given process onIy. Now, let us consider the dependence of g on the control and state variables and obtain the direction of steepest ascent of g with respect to the control variable at the nominal value z,(t). This can be done by differentiating ( 6 ) with respect to z(t):
Using Eq. ( 5 ) , we obtain
I n order to evaluate ( S ) , we need to know the influence of the change in state variables on the value of g. This can be found by partial differentiation of (6) with respect to the state variables
j
=
1, 2,..., M
(9)
318
APPENDIX I1
by essentially the same manipulations as those used in obtaining (8). T h e change of g with respect to time can be obtained in the same manner:
T o simplify notations, let
Equations (8) and (9) become
j
=
1, 2,..., M
(14)
A similar relationship exists for Eq. (10). T h e variables A, and A, are not introduced arbitrarily. If the EulerLagrange equations for the present system are obtained by using the results in Appendix I, we get
Comparing Eq. (14) with Eq. (15), we see that (14) is the discrete analog of (15). However, the Lagrange multipliers Ai(t) in (15) are different from Az.Q, t ) in (14). T h e Lagrange multipliers are obtained by using the optimum control variable, while the functions A,Q t), which are nominal functions, are obtained by using the nominal control variable z,(t). If z,(t) were the optimum control variable, we see that A,@, t ) would be zero and Eq. (13) would reduce to (16). Furthermore, the
THE FUNCTIONAL GRADIENT TECHNIQUE
319
functions &JQ, t ) reduce to the Lagrange multipliers h,(t) when the optimum control variable profile is used. With assumed control and state variables, Eqs. (13) and (14) can be solved in a backward recursive fashion, provided that the values of X,l(Q, tt) are known. These values at the final time tf can be obtained formally in the following manner [4, 51. A variation in xi at the final time tf varies the value of Q, owing to Eq. (3) directly and indirectly because of the change in the final time determined by Eq. (4). Let 6xj denote the variation in xj ; then,
where 6 t is the change in the final time and dQ It, = dQ evaluated in terms of the state and control variables at the final time tt . Since $ = 0 at the final time, d$ I t f = 0. Equation (18) can be solved for 6t. Substituting 6 t into Eq. (17), we obtain dQltf =
(TIaQ
xi
tf
-
1-
-p-/ Q' t f ax, a# t, ) Sxi
j
=
1,2,..., M
(19)
where Q' represents the derivative of Q with respect to t. Since dQ/Sxj It, is the change in the final value of Q due to a change in xi at the final time tf , Eq. (19) can be written as
Equation (20) represents the desired final conditions. T h e sequence A,(&, t k ) k = 0, 1 , 2,..., N
(21)
with tk+l - t, = d and t, = tt is essentially the gradient of Q with respect to the control variable z(t,). If an improvement of A Q is asked for, the greatest improvement will be obtained if
Then the procedure for obtaining the optimum of the above system is as follows: (a) Estimate the nominal control sequence zo(t,), K = 0, 1, 2, ..., N . (b) Integrate Eq. (1) with z(tk)= zo(tk).
320
APPENDIX I1
(c) Determine Az(Q, t k ) and AJQ, t k ) along the nominal control sequence starting with boundary conditions (20) in a backward recursive fashion. (d) Determine ~ ( twith~ z(tk)old ) ~ = zo(t,). ~ ~ (el 4 t k ) = 4 t k ) n e w * (f) Repeat steps (b) through (e) until Cj”=,[A,(Q, tj)12 becomes so small that possible further improvement is not significant. The method can be extended easily to problems involving additional final conditions. 3. Numerical Example
T o illustrate the use of optimization procedure and also to compare the present approach with that discussed in Chapter 5 , the problem discussed in Section 2 of Chapter 5 will be solved. Equations (2.3) and (2.4) now become
Q
=
(1)
dtf)
(2)
*=t-t,=O
The recurrence relations can be obtained easily from (2.13) and the state variable equations in Section 2 of Chapter 5.
k E x (t)
h(Q, t ) = -hl(Q,t + A ) R, T2( ’ ’t )
+ ha(Q> t + A)
Using Eq. (2.14), we obtain
h L Q , t ) = (4zz(!2?
t
+A )
-
4rJQ,
h&?,t ) = h,z(P,t
t
+ A))kid + 4q(Q,t + A )
+4
1
-k24
(4a) (4b)
where the value of the control variable T in the expressions of the rate constants, k , and k , , is evaluated at time t. T h e final conditions can be obtained from Eq. (2.20). 0
(54
hz(Q, tr) = 1
(5b)
&(Q,
tf)
1
This problem is solved by using the numerical values listed in Eqs. = A t . A constant value of
(3.1) and (3.5) of Chapter 5 [5] and with A
THE FUNCTIONAL GRADIENT TECHNIQUE
32 1
OQ = 0.002 has been used throughout the calculations. T h e initially estimated nominal control sequence together with the convergence rate of the control variable is shown in Fig. AII.l. T h e numerical RungeKutta integration scheme has been used. After 45 iterations and two minutes' computing, the total yield of x2 is 0.680 and the final value of x1 is 0.177. T h e rate of convergence to the optimum solution would have been faster if the value of OQ were adjusted according to the magnitude of the gradient during the calculations.
"h
t, MINUTES
FIG.AII.1. Convergence rate by gradient technique.
Since the calculation starts from an assumed control policy, the gradient technique forms another application of approximation in policy space. This approximation has been discussed in Section 15 of Chapter 2 and generally it leads to a monotone sequence of approximations. 4. Discussion
One of the disadvantages of the gradient technique is its slow rate of convergence. This is especially true when the initially estimated nominal
322
APPENDIX I1
control sequence is near the optimum. T o increase the convergence rate, the second variations have been used by various investigators. T h e method using the second variations appears to be a promising technique for solving optimization problems [9-121. Various generalizations can be made to the algorithms obtained in this appendix. As has been discussed in Section 14 of Chapter I , the objective function, Eq. (2.3), is actually a fairly general optimization criterion. Various other optimization problems can be put into the form discussed in this appendix by the use of a simple transformation. Since the recurrence relationships are in discrete form, this method also has been extended to stagewise processes [5]. Furthermore, it has been found that these recurrence relationships can be generalized easily to stagewise processes in which the stages are interconnected in a complex manner. REFERENCES
1. Kelley, H. J., Method of gradients, in “Optimization Techniques with Applications to Aerospace Systems.” Leitmann, G., ed., Academic Press, New York, 1962. 2. Bryson, A. E., and Denham, W. F., A steepest-ascent method for solving optimum programming problems. J. Appl. Mech. 29, 247 (1962). 3. Kelley, H. J., Gradient theory of optimal Flight paths. ARS ( A m . Rocket SOC.) J. 30, 947 (1960). 4. Dreyfus, S., Variational problems with state variable inequality constraints. P-2605. RAND Corp., Santa Monica, California, July, 1962. 5. Lee, E. S., Optimization by gradient technique. Ind. Eng. Chem. Fundamentals 3, 373 (1964). 6. Stancil, R. T., A new approach to steepest-ascent trajectory optimization. A I A A J. 2, 1365 (1964). 7. Denham, W. F., and Bryson, A. E., Optimal programming problems with inequality constraints. 11. solution by steepest-ascent. A I A A J . 2, 25 (1964). 8. Denn, M. M., and Aris, R., Green’s functions and optimal systems. Ind. Eng. Chem. Fundamentals 4, 7, 213, 248 (1965). 9. Merriam, C. W., “Optimization Theory and the Design of Feedback Control Systems.” McGraw-Hill, New York, 1964. 10. Breakwell, J. V., Speyer, J. L., and Bryson, A. E., Optimization and control of nonlinear systems using the second variation, J. SOC. Ind. Appl. Math. Control 1, 193 (1963). 11. Kelley, H. J., Guidance theory and extremal fields, IRE Trans. Automatic Control AC7, 75 (1962). 12. Merriam, C. W., A computational method for feedback control optimization, Information and Control 8, 215 (1965).
AUTHOR INDEX
Numbers in parentheses are reference numbers and indicate that an author’s work is referred to although his name is not cited in the text. Numbers in italic show the page on which the complete reference is listed. A
Abbott, M. B., 207(72), 216, 279(6), 305 Ambarzumian, V. A., 179, 213 Ames, W. F., 207(73), 216, 279(11), 305 Amundson, N. R., 53(6), 82, 130(3), 177, 278, 292, 301, 304, 305 Aris, R., 130(4, 5, 6), 177, 207(67, 68), 208(67, 68), 215, 216, 315(8), 322 Aroesty, J., 179(30, 31), 214
Boltyanskii, V. G., 312(8), 314 Box, G. E. P., 95(7), 97(7), 126 Bramble, J. H., 279(13), 305 Braun, L., 83(1), I26 Breakwell, J. V., 306(3), 313, 322(10), 322 Brooks, S. H., 95(8), 97(8), 126 Bruce, G. H., 57(11), 82 Bryson, A. E., 246, 277, 315(7), 322(10), 322 Bucy, R. S., 246, 265, 277 Buehler, R. J., 95(6), 97(6), 126
B Bailey, P. B., 179(7, 18, 34), 192(18, 3 4 , 193(7, 34), 195(7), 213, 214 Beckenbach, E. F., 9(4), 38 Bellman, R. E., 9(1, 3, 4), 24, 33(3, 14, 15, 16), 38, 39, 73(13, 15, 16), 79, 82, 85(2), 86(2, 3),95(5), 103(15), 111(3, 20), 122(3, 23, 24, 25, 26, 27), 123(3, 5 , 28), 124(23), 126(30, 31, 32, 33, 35, 36), 126, 127, 128, 129(1), 147(9), 175(9), 177(17), 177, 179(8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 31, 32, 33, 43, 44, 45, 46, 47, 48, 50), 180(5, 52, 53), 193, 197(55, 56, 57), 198(62), 202(5, 43), 207(63, 64, 65), 208(63, 64), 213, 214, 215, 217(1, 2), 236(1, 3), 237(4), 239(7, 8), 240, 244, 245, 247, 252(13), 277, 279(9), 305 Bilous, O., 130(3), 177 Bliss, G. A., 306(1), 307(1), 308, 312(1), 313 Bode, H. W., 246, 276
C Carberry, J. J., 53(7), 82 Chandrasekhar, S., 179, 213 Coddington, E., 12(7), 25(7), 38 Collier, C., 126(32), 127 Conte, S. D., 79(21), 82 Coste, J., 53(6), 82 Courant, R., 25(12), 39, 207(70, 71), 216, 265(15), 277, 279(7), 305, 310(5), 314 Cox, H., 246, 266, 277 Crank, J., 279, 280, 305
D Danckwerts, P. V., 41(1), 81 Davenport, W. B., 246, 277 Denham, W. F., 315(7), 322 Denn, M. M., 130(6), 177, 315(8), 322 Detchmendy, D. M., 126(38), 128, 179(51), 215, 247, 266(14), 277
323
324
AUTHOR INDEX
Deutsch, R., 246, 277 Dreyfus, S., 95(5), 123(5, 28), 126, 127, 147(9), 175(9), 177, 207(65), 208(65, 74), 215, 216, 237(4), 245, 306(4), 313, 315, 319(4), 322 E
Eisenberg, B. R., 126(34), 127 Ergun, S., 174, 177
F Fan, L. T., 130(7), 177, 244(13), 245, 312(10), 314 Fletcher, R., 95(9, 1 I), 97(9, 1l), 126 Forsythe, G. E., 207(69), 216, 279(5), 280, 305 Fox, L., 4(7), 8, 72, 73, 82, 279(12), 305 Frazier, M., 246, 277 Friedrichs, K. O., 207(71), 216, 279(7), 305
G Gamkrelidze, R. V., 312(8), 314 Gluss, B., 122(24), 126(36), 127, 128
H Hamming, R. W., 4(5), 8 Hilbert, D., 25(12), 39, 207(70), 216, 265(15), 277, 310(5), 314 Hildebrand, F. B., 4(2), 8, 10(5), 17(5), 38, 160(12), 177 Hille, E., 189(54), 215 Ho, Y., 246, 277 Hougen, 0. A., 103(16), 104(16), 127 Hunter, W. G., 103(17, 18), 127
I Ince, E. L., 12(8), 38
J Jacquez, J., 103(15), 127 Juncosa, M. L., 279(9), 305
126, 127,128, 177(17), 178, 179(8, 23,45, 47, 48, 50), 213, 214, 215, 217(1), 244, 247( 13), 252( 13), 277 Kalaba, R., 9(2, 3), 24, 25, 30, 33(3), 38, 73(13, 14, 15), 79(19), 82, 85(2), 86(2, 3), 103(14, 15), 111(3, 20), 122(3, 23, 25, 26, 27), 123(3),124(23),126(30,31,32,33,35), 126, 127, 128, 177(17), 178, 179(5, 8, 9, 10, 11, 12, 13, 14, 15, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 43, 44, 45, 46, 47, 48, 50), 180(5, 52, 53), 193, 197(55, 56, 58), 202(5, 43), 213, 214, 215, 217(1, 2), 236(1, 3, 6), 237(5), 240, 244, 245, 247(13), 252(13), 277, 279(9), 305 Kalman, R. E., 246, 265, 277 Kantorovich, L. V., 24(10, l l ) , 38, 39 Katz, S., 244(12), 245 Kelley, H. J., 315, 322(1 I), 322 Kempthorne, O., 95(6), 97(6), 126 Kenneth, P., 177(18), 178 Kittrell, J. R., 103(17, 18), I27 Kopp, R. E., 177(19), 178 Kotkin, B., 79(19), 82, 122(23), 124(23), 126(30), 127 Krylov, V. I., 24(11), 39 Kumar, K. S . P., 126(37), 128
Lanczos, C., 16(9), 38, 57(10), 79(10), 82, 111(19), 123(19), 127 Lapidus, L., 4(4), 8, 57(9), 82 Lee, E. S., 28(13), 39, 46(3), 48, 53(8), 82, 95(13), 126,130(2, 8), 133(2), 145, 147(2), 149(2, I I ) , 151(11), 153(2), 160(16), 177, 279, 305, 312(11), 314, 315(5), 319(5), 320(5), 322(5), 322 Lee, I., 177 (21), 178 Lee, R. C. I:., 246, 265, 277 Lee, Y. W., 246, 277 Leitmann, G.,123(29), 127, 31 I , 314 Levinson, N., 12(7), 25(7), 38, 246, 277 Liu, S.-L., 278, 292, 301, 304, 305, 305 Lockett, J., 111(20), 127
M
K Kagiwada, H., 73(15), 82, 85(2), 86(2), 103(14), 122(25, 26), 126(31, 32, 33, 35),
McGill, R., 177(18, 19, 20), 178 McHenry, K. W., 52(5), 82 Merriam, C.W., 322(9, 12), 322
325
AUTHOR INDEX
Meyer, F., 73(20), 82 Milne, W. E., 4(3), 8, 10(6), 38, 279(8), 305 Mishchenko, E. F., 312(8), 314 Mishkin, E., 83(1), 126 Moyer, H. G., 177(19), 178 Mullikin, T. W., 179(40), 214
N Nicolson, P., 279, 280, 305
P Pars, L. A., 306(2), 313 Peaceman, D. W., 57(11), 82 Phillips, D. L., 111(21), 127 Phillips, R., 189(54), 215 Pinkham, G., 177(19), 178 Pontryagin, L. S., 312(8), 314 Powell, M. J . D., 95(10), 97(10), 126 Preisendorfer, R. W., 179(35, 36, 37, 38), 214 Prestrud, M. C., 179(8, 17, 20), 213 Pugachev, V. S., 246, 276
R Rachford, H. H., 57(11), 82 Radbill, U. R., 73(17), 82 Ralston, A., 4(8), 8 Rechard, O., 179(41), 214 Redheffer, R., 179(39), 197(59, 61), 214, 215 Reeves, C. M., 95(9), 97(9), 126 Reid, W. T., 197(60), 215 Rice, J. D., 57(11), 82 Roberts, S. M., 207(66), 208(66), 215 Root, W. L., 246, 277 Rosenbrock, H. H., 95(12), 97(12), 126 Roth, R., 122(24), 126(36), 127, I28 Rozonoer, L. I., 244(11), 245, 312(9), 314 Rudd, D., 53(6), 82 S
Sage, A. P., 126(34), 127 Scarborough, J. B., 4(1), 8
Schley, C. H., 177(21), 178 Schwimmer, S., 103(15), 127 Selvester, R., 126(32), 127 Shah, B. V., 95(6), 97(6), 126 Shannon, C. E., 246, 276 Shoemaker, E. M., 179(49), 215 Speyer, J. L., 322(10), 322 Sridhar, R., 122(27), 126(37, 38), 127, 128, 179(46, 50, 51), 215, 247(13), 252(13), 266(14), 277 Stancil, R. T., 315(6), 322 Sylvester, R. J., 73(20), 82
T Todd, J., 4(6), 8 Twomey, S., 111(22), I27
U Ueno, S., 122(26), 126(33), 127, 179(30, 31, 42), 214
V Valentine, F. A., 311, 312, 314
W Wasow, W. R., 207(69), 216, 279(5), 280, 305 Watson, C. C., 103(17, 18), I27 Watson, K. M., 103(16), 104(16), 127 Wehner, J. F., 41, 82 Wendel, M. M., 53(7), 82 Wengert, R. E., 176, 177 Wiener, N., 246, 276 Wilde, D. J., 95(4), 97(4), 226, 147(10), 175(10), 177 Wilf, H., 4(8), 8 Wilhelm, R. H . , 41, 52(4, 5), 82 Wilkins, R. D., 176(15), I77 Wilson, K. B., 95(7), 97(7), 126 Wing, G. M., 179(5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 18, 43), 180(5, 52, 53), 192(18), 193(7, 34), 195(7), 202(4, 5, 43), 213, 214, 215
SUBJECT INDEX
A
D
Accuracy of numerical solution, 4, 7, 8 Activation energy, 62, 106, 111-1 16 Adaptive control, 83 Analog computer, 276 Approximation in function space, 33 by linear differential equations, 123, see also Differential approximation in policy space, 32-35, 321 Arrhenius rate expression, 62, 69, 106, 115, 135 Axial mixing, 41, 50, 52, 53
Differential approximation, 122, 123 Differential-difference equations, 126 Differential equations large system of, 35-38, 73-78, 203-206, 257, 272 with variable coefficients, 105, 106 Differential inequalities, 28-30 Differential reaction rate, 103, 104 Diffusion theory, 192, 202 Dimensionality difficulties, 207, 21 1 Double-precision arithmetic, 113 Dynamic programming, 32-34, 129, 177, 208-211, 236, 237, 239-244, 246 Dynamics of chemical reactors, 279, 305
B Back and forth integration, 146 Black box problem, 83, 84 Bolza, problem of, 306, 309
C Calculus of variations computational difficulties, 129 with control variable inequality constraints, 170, 171, 310, 311 with parameters, 306-31 3 Catalytic reaction, 103, 104 Characteristic values, 111 Classical approach, 3 Closed-end integration formula, 6 Computation time, 8 Concave function, 19, 29 Control variable, 33, 307 Convergence, 24-28, 279 Convex function, 17, 19, 29 Crank and Nicolson formula, 279-281
E Eigenvalue problem, 179 Empirical approximation, 116 Estimation of activation energy, 106-108, 111-1 15 of frequency-factor constant, 106-108, 111-115 with observation noises and disturbance inputs, 266, 267, 272-275 of reaction rate constants, 103-105, 254 of state and parameter, 261-264 of variable parameters, 105, 106 Euler’s method, 5 Euler-Lagrange equation, 131, 149, 155, 174, 267, 273, 308, 311-313, 318 Existence, 24-26, 279 Experimental determination of physical constants, 84, 85 Explicit integration method, 16, 53 326
327
SUBJECT INDEX
F Fast memory requirement, 71, 78, 79, 207 Fibonacci search technique, 147, 175 Finite-difference method, 14-16, 53, 207, 279 First-order convergence, 19, 24, 278 First-order irreversible consecutive reaction, 130 Fixed bed reactor, 51, 279, 285, 292 Free boundary condition, 274, 310 Functional gradient technique, 129, 145, 315-322
G
comparison with dynamic programming, 207 computational considerations, 206-208 concept of, 2, 3 equations for large linear systems, 205, 206 formulations, 180-182, 192-195, 19720 1 in functional gradient technique, 315 in parameter estimation, 249, 250, 268270, 276 quasilinearization and, 217-235
J Jacobi matrix, 37, 74
Gaussian distribution, 95, 97, 103, 254,271 Gaussian noise, 246 Gradient technique, 95, see also Functional gradient technique Green’s function, 25, 30 Grid points, 4
H Hamiltonian function, 146, 174, 313 Higher-order difference, 72 Homogeneous solution, 12, 13, 43-46, 74-78 Homogeneous solution matrix, 75-78
I Identification, 84, see also Parameter estimation Ill-conditioned systems, 109-1 15 Ill-conditioning, 2, 79, 110, 224, 226 Implicit difference approximation, 280 Implicit integration method, 16, 53 Inequality constraints, 170, 171, 310-312 Initial approximation, 21, 36, 48, 50 Initial value problem, 4-7, 13, 72 Integral-conversion data, 103 Integration constant vector, 75 Integration interval, 4 Integration step, 4 Integrodifferential equations, 126, 180 Interval of convergence, 8, 50, 61, 176, 177 Invariant imbedding versus classical approach, 3
Lagrange, problem of, 306, 309 Lagrange multiplier, 131, 307, 313, 318 Least squares criterion, 86, 100, 248 Linear algebraic equations, see Ill-conditioning Linear boundary value problems, 224-226, see also Linear differential equations Linear differential equations, 11-16, 205, 206 with variable coefficients, 22,74,238,239 Linear differential operator, 28 Linear programming, 103 Linearization, 16
M Marching integration techniques, 4, 53, 59 Matrix inversion, 16, 78, 110 Maximum operation, 28-30 Maximum principle, 147, 174, 175, 312, 313 Mayer, problem of, 306, 307, 316 Method of characteristics, 207 Milne’s method, 6 Missing final condition, 188 Monotone convergence, 18-20, 32 Monotone sequence, 31-34 Multiple step integration methods, 5, 6 Multiplier rule, 308 Multipoint boundary value problems, 38, 78, 85, 86
328
SUBJECT INDEX
N
Q
Neutron transport theory, 179 Newton-Raphson-Kantorovich technique, 24 Newton-Raphson method, 2, 17-20, 160 Nonlinear boundary condition, 92-95 Nonlinear boundary value problem, 10, 11 Nonlinear filtering, 246-277 Nonlinear least squares estimation, 103, 104 Nonlinear process, 202 Nonlinear programming, 177 Numerical differentiation, 104 Numerical solution of initial value problems, 4-7
Quadratic convergence, 2, 19, 20, 23, 24, 278 Quadratic form, 265, 266, 273 Quasilinear partial differential equation, 280, 286, 294 Quasilinearization, 2, 21-23, 33 comparison with other methods, 145, 153 computational considerations, 78, 79 dynamic programming and, 236-244 invariant imbedding and, 217-235
0
On-line computer control, 84, 100, 125,276 Open-end integration formula, 5 , 6 Optimization with pressure drop, 171-174 Optimizing control, 83 Optimum feed conditions, 175, 176 Optimum pressure profiles, 149-153 Optimum temperature profiles, 130-144, 229-235 with pressure as parameter, 153-168
P Parabolic partial differential equations, 278-305 Parameter estimation, 83-128, 246-277 Parameter up-dating, 84, 100-102, 248 Partial derivative evaluation, 176 Partial differential equation, 207, 278-305 Particle counting technique, 192 Particular solution, 12, 13, 44-46, 75-78 Particular solution vector, 75 Peclet number, 41, 52, 53 Perturbation technique, 197-201 Picard approximation, 23 Positivity property, 30, 34, 35 Predictor-corrector formula, 6, 217-223, 236 Pressure drop in fixed bed reactor, 171-174 Principle of optimality, 33, 210, 242
R Radiative transfer, 179, 192 Random number, 95, 97, 254, 271 Random search technique, 95-99, 175 Random walk, 179, 192 Rarefied gas dynamics, 179 Recurrence relation, 42, 43, 315 Reduction in dimensionality, 239-244 in fast memory requirement, 79-81 Reflection functions, 201-203 Restrictions, 69, 71, 91, 145, 161 Riccati equation, 196, 197 Runge-Kutta method, 4, 5 , 7 S
Search techniques, 95, 97, 147, 211 Second-order convergence, see Quadratic convergence Second variational method, 129, 322 Semigroup property, 189, 316 Sequential estimation, 247-249 Simpson’s rule, 6 Simultaneous solution of different iterations, 79-81 Single-precision arithmetic, I 13 Single-step integration methods, 4-6 Stability problem with high Peclet number, 51, 61 in marching integration methods, 5 , 6 , 53 State variable, 33, 307 Steady state, 51, 279 Successive substitution, method of, 160 Superposition principle, 2,12,43-45, 74-78 System of second-order differential equations, 71
329
SUBJECT INDEX
T Taylor series, 2, 17, 21, 181, 210 Thomas method, 57 Transient equations, 279, 285 Transmission function, 201-203 Transversality condition, 132, 150, 155, 268, 308 Trial-and-error procedure, 11, 42 Tridiagonal matrix, 15, 55-58, 64, 281, 282, 281 Tubular reactor, 41
U Uniqueness, 1 Unstable initial value problems, 72
W Wave propagation, 119, 192 Weierstrass necessary condition, 312 Weighting factor, 96, 99, 267, 273, 276 Weighting function, 252, 253 Wiener-Kolomogorov theory, 246