Advances in COMPUTERS VOLUME 3
This Page Intentionally Left Blank
Advances
in
COMPUTERS edited b y
FRANZ L.ALT N...
16 downloads
1286 Views
16MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
Advances in COMPUTERS VOLUME 3
This Page Intentionally Left Blank
Advances
in
COMPUTERS edited b y
FRANZ L.ALT National Bureau of Standards Washington, D. C.
and
MORRIS RUBINOFF University of Pennsylvania and Pennsylvania Research Associates Philadelphia, Pennsylvania
associate editors A. D. BOOTH
R. E. MEAGHER
VOLUME 3
Academic Press New York London 0 1 9 6 2
COPYRIGHT @ 1962
BY
ACADEMICPRESSINC.
ALL RIGHTS RESERVED
NO PART O F T H I S BOOK MAY B E REPRODUCED I N ANY FORM BY PHOTOSTAT, MICROFILM, OR ANY OTHER MEANS, W I T H O U T WRITTEN PERMISSION FROM T H E PUBLISHERS.
ACADEMIC PRESS INC. 111 FIFTHAVENUE
NEW YORK3, N. Y.
United K-ingdom Edition Published by
ACADEMIC PRESS INC. (LONDON) LTD.
BERKELEY SQUARE HOUSE,BERKELEY SQUARE, LONDON W. 1
Library of Congress Catalog Card Number 59-15761
PRINTED I N THE V S I T E D STATES O F AMERICA
Contributors to Volume 3
GARRETTBIRKHOFF,Department of Mathematics, Harvard University, Cambridge, Massachusetts E. F. CODD,Development Laboratory, Data Systems Division, International Business Machines Corporation, Poughkeepsie, New York SAMUEL D. CONTE,*Computation and Data Reduction Center, Space Technology Laboratories, Inc., Los Angeles, California IiEED c. LAWLOR, t Electronic Data Retrieval Committee of the American Bar Association, Los Angeles, California HAROLD I(.SKRAMSTAD, U . S. Naval Ordnance Laboratory, Corona, California RICHARD S . VARGA, Computing Center, Case Institute of Technology, Cleveland, Ohio PHILIPWOLFE,Mathematics Division, The R A N D Corporation, Santa Monica, California ]]AVID YOUNG, Computation Center, University of Texas, Austin, Texas * Present address: Computation Sciences Center, Purdue University, Lafayette, Indiana. t Mailing address: Park Central Building, 412 West Sixth Street, Los Angeles, California.
V
This Page Intentionally Left Blank
Preface The editors of Advances in Computers have been joined by Morris Rubinoff. This addition, whose effect will be more fully felt in future volumes, is expected to strengthen still further the tendency to broad coverage of different aspects of the computer field, a tendency which has guided us in the earlier volumes and which is demanding increased emphasis as the field is being split into more and more areas of specialization. In the present volume are represented applications, both scientific and data processing; methods, both of numerical analysis and of computer programming; and engineering considerations in computer selection. Taken together with the articles on artificial intelligence, logical design, components and others appearing in the earlier volumes, these contributions appear to constitute a fully representative sample of computer science and technology. We hope that they will be taken as an antidote to specialization. FRANZL. ALT b’eptember, 1962
vii
This Page Intentionally Left Blank
Contents CONTRIBUTORS TO VOLUME3 . PREFACE . . . . . . . . CONTENTS OF VOLUMES 1 AND 2 The Computation
. .
. .
. .
. .
. .
. .
. . . . . . . .
.
.
.
.
.
.
.
.
.
V
vii
...
.
Xlll
. . . . . . . .
2 4 18 28 35 48 70 74
. . . . . . . . . . . . . . . . . .
78 81 83 87 104 122 150 152 152
of Satellite Orbit Trajectories
SAMUEL D. CONTE
1. The Problems Posed by Artificial Satellites . . 2. The Equations of Motion . . . . . . . 3 . Methods of Integration . . . . . . . . 4. General Perturbation Methods . . . . . . 5 . Accuracy Tests for Integration Programs . . . 6 . Orbit Determination and Tracking Methods . . 7. Organization of a Tracking and Prediction Program Bibliography . . . . . . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
Mu1t iprogramming
.
E. F CODD
1 . Introduction . . . . . . . 2. Early Contributions . . . . . .3 . Current Scope of Multiprogramming 4 . Batch Multiprogramming . . . 5. The Optimizing Problem . . . . 6. Multiprogramming with Two or More 7. Concluding Remarks . . . . . 8. Acknowledgments . . . . . . Bibliography . . . . . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . . Processing Units . . . . . . . . . . . . . . . . . . .
Recent Developments in Nonlinear Programming PHILIP WOLFE
1. Introduction . . . . . . 2. Differential Gradient Methods . 3 . Large-Step Gradient Methods . IX
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
156 161 165
CONTENTS
X
4. Simplicia1 Methods
. . . . . . . . . . . . . 172
5. Columnar Procedures . . . . 6. The Cutting-plane Method . . 7. Initiating an Algorithm . . . 8. Computer Routines and Literature Bibliography . . . . . . .
.
.
.
.
. .
. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
175 180 . . . . . . . 183 . . . . . . . 184 . . . . . . . 186
Alternating Direction Implicit Methods
.
GARRETT BIRKHOFF, RICHARD S VARGA. and DAVID YOUNG
INTRODUCTION
1. General Remarks . . 2. The Matrix Problem . 3 . Basic AD1 Operators .
. . . . . . . . . . . . 190 .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
PART I: STATIONARY AD1 A1K;THODS (Casem
4. Error Reduction Matrix . . . . . . 5. Norm Reduction . . . . . . . . 6 . Application . . . . . . . . . . 7 . Optimum Parameters . . . . . . . 8. The Function F . . . . . . . . 9 . Helmholtz Equation in a Rectangle . . . 10. Monotonicity Principle . . . . . . 11. Crude Upper Bound . . . . . . . 12. Eigenvalues of H , V . . . . . . .
=
191 192
1)
. . . . . . 194 . . . . . . 195 . . . . . . 196 . . . . . . 198 . . . . . . 199 . . . . . . 200 . . . . . . 202 . . . . . . 203 . . . . . . 204
PART 11: COMMUNICATIVE CASE:
13. Introduction
.
.
.
.
.
.
.
.
.
.
14. Problems Leading to Communicative Matrices 15. The Peaceman-Rachford Method . . . . 16. Methods for Selecting Iteration Parameters for Rachford Method . . . . . . . . . 17. The Douglas-Rachford Method . . . . . 18. Applications to the Helmholtz Equation . .
.
. . . . 205 . . . . . 206 . . . . . 210 the Peacenian. . . . . 211 . . . . . 217 . . . . . 222
PART I11: COMPARISON WITH SUCCESSIVE OVERRELAXATION VARIANTS
19. The Point SOR Method . . . 20 . Helmholtz Equation in a Square 21. Block and Multiline SOR Variants 22. Analogies of AD1 with SOR . .
.
.
.
.
.
.
.
.
. 224
.
.
.
.
.
.
.
.
.
. .
. .
. .
. .
. .
. .
. .
. .
225 . 227 . 229
CONTENTS
xi
PART IV: NUMERICAL EXPERIMENTS 23 . Introduction . . . . . . . . . . . . . . . 24 . Experiments with the Dirichlet Problem . . . . . . . 25. Analysis of Results . . . . . . . . . . . . . 26 . Conclusions . . . . . . . . . . . . . . . 27 Experiments Comparing SOR Variants with AD1 Variants . . Appendix A: The Minimax Problem for One Parameter . . . . Appendix B: The Minimax Problem for m > 1 Parameters . . . Appendix C : Nonuniform Mesh Spacings and Mixed Boundary Conditions . . . . . . . . . . . . . . Appendix D : Necessary Conditions for Commutativity . . . . Bibliography . . . . . . . . . . . . . . . .
.
231 232 242 219 250 254 259 263 266 271
Combined Analog-Digital Techniques in Simulation
.
HAROLD K SKRAMSTAD
1. Comparison of Analog and Digital Computers in Simulation . 2 . Interconnected Analog and Digital Computers . . . . . 3. Example of a Combined Solution . . . . . . . . . 4. Analog-Digital Arithmetic in a Digital Computer . . . . . 5 . Systems Using Analog-Digital Variables . . . . . . . Bibliography . . . . . . . . . . . . . . . .
275 277 281 283 288 296
Information Technology and the l a w REED C. LAWLOR
1 . Introduction . . . . . . . . . 2 . Information Growth . . . . . . . 3 . Mechanization in Lam Practice . . . . 4. Applications of Symbolic Logic to Law . . 5. Information Storage and Retrieval . . . 6. Punched Cards and Notched Cards . . . 7. Prediction of Court Decisions . . . . 8. Thinking Machines . . . . . . . 9 . The Law of Computers . . . . . . 10. Use of Computers in Court . . . . . 11 . New Horizons . . . . . . . . . Bibliography . . . . . . . . . . Exhibit “A” . . . . . . . . . .
. .
. .
. .
. .
. .
. . . . .
. . . . .
. . . . .
. . . . .
. . . . .
. . .
. . .
. . .
. . .
. . .
.
.
.
AUTHORINDEX . . SUBJECTINDEX .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
.
.
.
.
.
.
.
.
.
.
. .
. .
.
. 299 . 300 . 302 . 305 . 310 . 323 . 324 . 334 . 335 . 339 . 340 . 343 . 317 .
.
.
353 357
This Page Intentionally Left Blank
Contents of Volume 1
General-Purpose Programming for Business Applications CALVINC. GOTLIEB n’umerical Weather Prediction KORMAN A. PHILLIPS The Present Status of Automatic Translation of Languages YEHOSHUA BAR-HILLEL Programming Computers to Play Games ARTHUR1,. SAMUEL Machine Recognition of Spoken Words RICHARDFATEHCHASD Binary *4rithmetic GEORGEW. REIT~-IESXELL Contents
of Volume 2
A Survey of Numerical Methods for Parabolic Differential Equations JIM DOUGLAS, JR. Advances in Orthonormalizing Computation PHILIPJ. DAVISand PHILIPRABIXOWITZ Microelectronics Using Electron-Beam-l-ictivated Machining Techniques R. SHOULDERS KENNETH Recent Developments in Linear Programming SAULI. GASS The Theory of Automata, a Survey ROBERTMCNAUGHTON xiii
This Page Intentionally Left Blank
The Computation of Satellite Orbit Trajectories" SAMUEL D. CONTEt Computation and Data Reducfion Center. Space Technology Laboratories. Inc.,
Los Angeles. Calif
.
1. The Problems Posed by Artificial Satellites . . . . . . . . . . . . . . . . . 2. The Equations of Motion 2.1 The Cowell Method . . . . . . . . . . . . 2.2 The Encke Method . . . . . . . . . . . . 2.3 Variation of Parameter Methods . . . . . . . . 3 . Methods of Integration . . . . . . . . . . . . 3.1 Runge-Kutta Method . . . . . . . . . . . 3.2 Multi-step Methods . . . . . . . . . . . . 3.3 Special Methods for Second Order Equations . . . . . 3.4 Accumulated Round-off Error . . . . . . . . . 3.5 Integration in Multirevolution Steps . . . . . . . 4 General Perturbation Methods . . . . . . . . . . 4.1 The Diliberto Theory . . . . . . . . . . . . 4.2 Numerical Results . . . . . . . . . . . . 5. Accuracy Tests for Integration Programs . . . . . . . 5.1 Comparison with Analytic Formulas . . . . . . . 5.2 Consistency Checks . . . . . . . . . . . . 5.3 Double Precision Operations . . . . . . . . . . 5.4 Use of Integrals of the Motion . . . . . . . . . 5.5 Comparison Using Different Methods . . . . . . . 5.6 Estimates of Accumulated Truncation and Round-off Errors 5.7 Numerical Comparison of Special Perturbation Methods . 6 . Orbit Determination and Tracking Methods . . . . . . 6.1 Editing the Observational Data . . . . . . . . . 6.2 The Least Squares Problem . . . . . . . . . . 6.3 Stagewise Differential Corrections and Shifting Parameters . 6.4 The Partial Derivatives . . . . . . . . . . . 6.5 The Choice of Burnout Parameter Coordinates . . . . 6.6 Error Analysis in Differential Corrections . . . . . .
.
.
.
2
. . . .
.
.
4
.
.
.
.
. .
. .
. .
. .
. . . . . . . . .
. . . . .
. . . . .
. . . . .
.
.
.
.
.
.
.
.
6 7 15 18 19 21 24 25 28 28 31 34 35 36 36 37 38 38 38 42 48 49 50 56
.
.
.
.
. .
. .
. .
. .
.
.
.
.
.
.
.
.
. . . .
. . . .
. . . .
. . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
58 64
.
.
.
.
66
* The preparation of this paper was made possible by the support. both direct and indirect. of the Computat.ion and Data Reduction Center a t Space Technology Laboratories. Inc. I n particular. the author is indebted to I . J. Abrams. D. D . Morrison. 0. K . Smith. and R . J . Mercer for many of the techniques and ideas contained in this survey paper . t Present Address: Director. Computer Sciences Center. Purdue University. Lafayette. Indiana
.
1
2
SAMUEL D. CONTE
7. Organization of a Tracking and Prediction 7.1 Input and Conversion Block. . . 7.2 Trajectory Integration Block . . 7.3 Partial Derivative and Residual Block 7.4 The Differential Correction Package 7.5 The Ephemeris Processor. . . . Bibliography
.
.
.
.
.
.
.
.
Program . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
70 70 71 72 72 74 74
1. The Problems Posed by Artificial Satellites
The post-Sputnik era has seen a phenomenal growth in the computation of the orbits of artificial satellites. There are literally dozens of installations actively engaged in computing orbits and in related research. Most of the personnel involved are novices in the field of astrodynamics and must inevitably be unfamiliar with the methods and even the literature of classical astronomy on orbit determination. While familiarity with these methods would be of inestimable value t o the modern astrodynamicist, the problems of artificial satellite theory differ in some important respects from those of classical astronomy and therefore call for new methods of attack. Some of these differences arise from the emphasis on and importance of engineering aspects; others concern the relative importance on near-earth satellite orbits of such perturbative forces as drag and oblateness. Rapidly changing forces such as arise from the near approach of a satellite t o a planet also lead t o new effects and to the need for refined computing techniques. The necessity for real time orbital determination and prediction presents new problems which were not encountered by astronomers. The advent of the high speed computing machine makes possible the consideration of complicated forces and effects which were too laborious to be considered in the days of the desk calculator and a t the same time makes necessary a re-evaluation of the numerical techniques used for orbit determination. The engineer is sometimes prone t o accept machine results on faith. The numerical analyst is aware of the many errors which enter in a complicated way into the computations, and it is his responsibility t o make clear to the engineer to what extent, he can trust machine results. I n this paper we propose to discuss and evaluate methods of orbit prediction and determination on high speed computers, pointing out, whenever possible, the sources and the magnitude of errors which enter into the computation. At the outset i t may be well to distinguish, as some writers have done, between “feasibility orbits” and “precision orbits.” Feasibility studies are concerned with the over-all performance characteristics of a missile configuration, with fuel and payload requirements, with the optimization of orbit parameters, and with optimum guidance requirements. I n such studies extreme accuracy is usually not required, two or three significant digits
SATELLITE ORBIT TRAJECTORIES
3
being normally adequate. In feasibility work it is permissible in some cases to use crude mathematical models as is done, for example, in replacing the true orbit of a planet by an approximating circle or in omitting perturbations due to small perturbative forces such as oblateness on an interplanetary flight. In some cases the n-body problem may be approximated by a succession of two-body problems. In addition such studies are often based on the use of approximate values for the physical constants. Even in such studies, however, proper evaluation of the results requires that the nature and magnitude of the approximation be fully understood. In precision orbit work on the other hand one should strive for the ultimate accuracy possible within the limitations of the information available, the machine being used, and the mission under consideration. Precision orbits are required for accurate navigation, for the proper conduct and interpretation of physical experiments, and for determining improved values of physical and astronomical constants. The number of significant digits required for precision work will generally be on the order of six or more depending on the objective of the study. The mathematical model should include, when applicable, perturbations due to nongravitational as well as gravitational forces. Aerodynamic drag effects, for example, on near-earth satellites are very significant. Even small effects such as those caused by electromagnetic forces, meteoritic drag, radiation pressure and relativistic effects may be significant for some missions. Gravitational anomalies may also introduce appreciable effects. The effect of the earth’s oblateness on near earth satellites is now fairly well understood; for lunar orbits the oblateness of the moon may need to be considered. In addition to the forces, every effort should be made to obtain the best available physical and astronomical constants. Indeed as noted above one of the major uses of precision orbits is to determine better these very constants. The present uncertainty in the solar parallax, for example, assumed to be sec, leads to an uncertainty in a Martian flight of on the order of 1 x some 50,000 miles; the uncertainty in the principal oblateness parameter which is on the order of 4 X 1 0 - 6 leads to appreciable effects on the orbital elements of a near earth satellite. Even the tables of the planetary coordinates introduce uncertainties of several hundred miles in the position of a planet in its orbit. The effect of the inaccuracy in the planetary coordinates is considerably more striking if it is necessary to obtain the velocity of the planet by interpolation. It can be shown that errors in the velocity of the earth of up to 1 fps are encountered if they are obtained by interpolation in the tables. This error when translated into errors in the satellite’s velocity will subsequently lead to errors of several thousand miles on flights to Mars or Venus. Assuming that an adequate mathematical model is being used and that
SAMUEL D. CONTE
4
the physical constants are known exactly, one is faced with the problem of maintaining accuracy in the numerical computations. Computational errors, if not properly controlled, may be as serious as the physical errors. Among the computational errors are those which arise from the truncation of series, from the use of approximating polynomials, from the accumulation of rounding errors, from loss of significance through differencing nearly equal quantities and from small divisors. Techniques for estimating these errors and methods for reducing their effects will be discussed in succeeding sections. 2. The Equations of Motion
No attempt will be made here to derive the equations of motion for a satellite acting under the influence of a central body force and various perturbative forces. This material is well covered in several books [37]. However, the equations will be given here both for reference purposes and to serve as a basis for subsequent discussion. Assuming an inertial rectangular equatorial coordinate system centered a t the earth the equations of motion for a vehicle with respect to the earth center have the form
i: =
-P-
r r3
+ Fa + Fi + Fz
(2.1)
where
r
= (5,y, z )
r
= (x2
is the position vector of the vehicle relative to the central body,
p =
+ + y2
~2)~’2,
Gm where G is the gravitational constant and nz is the
mass of the earth, Fa = (Fa,, Fa,, FOE)is the force due to oblateness, FI = ( F I ~F,,, , FlZ) is the force due to the attraction of planetary bodies other than the central body, Fz = (Fz,, FZ,, Fz.) is the force due to drag.
-p
(5>
=
(-
p
2, -p $ -p E+, 2
(2.2)
is the attraction of the central
body on the vehicle. More specifically, the components of the oblateness force, including only the first three harmonics, are :
- J+R4
6 (3
- 42
2 + 63 22
SATELLITE ORBIT TRAJECTORIES
5
22
where J1, Jz, J3 are the oblateness parameters corresponding to the second, third, and fourth harmonics respectively, and R is the radius of the earth. The components of the perturbations due to other planetary bodies, including the moon, are:
FZ1=
-p
,e
mi
t=l
r T + ”) Pi3
(x + Y,z )
where
xi
=
ri
=
x component of the position of the i t h body with respect t o the origin,
p; =
mi
=
+ (y - yJ2 + (z - z ~ ) ~ ] ” ~ + ya2 +
[(x - x J 2 (.a2
za2)1’2
ratio of mass of i t h body to that of the central body.
The form of the drag vector will depend on the model assumed for the atmosphere. If the vehicle is assumed to be spherical so that lift can be neglected, and if variations of the density with latitude or time of day are ignored, the components take the form
FzZ = -D-X a Va
(x --+ Y, 2 )
(2.5)
where
D = pVa2ACD,
2w
density of atmosphere a t height h above surface of the earth, Va = (ka2 ga2 ia2)1’2 = velocity of the missile with respect to the surrounding air, A = cross sectional area of the vehicle, W = mass of the vehicle, CD = drag coefficient, xa = x We’,
p(h) =
+ +
+
ya = y - w,x, ia= 2,
SAMUEL D. CONTE
6
and where the rotation ratc of the atmosphere is assumed to be equal to that of the earth, we.The density p(h) may be approximated over a limited range in height h by a formula of the type p =
exp (cl
+ c2h + cyh2)
where the coefficients c; (i = 1, 2, 3) which may differ for various height levels are obtained by making a fit of p ( h ) to the latest standard atmosphere table. If the perturbativc forces in (2.1) arc all neglected, the motion reduces t o that of a body moving in an inverse square law field. I n this case the orbit is a conic section and explicit analytic formulas can be given for the motion of the vehicle. Another problem which can be solved explicitly is the restricted three body problem. I n the general case analytic solutions are not available and recourse must be made t o numerical integration, or possibly t o series solutions. Our major concern will be with the various possible forms of the equations of motion and with the methods of numerical integration which will lead to the most efficient computational schemes for solving (2.1). Three mathematical formulations which are in common use today-those of Cowcll and Encke and the variation-of-parameters method-will be described and evaluated for computational efficiency. The two major criteria to be used in this evaluation are overall accuracy and computational efficiency, although other criteria such as simplicity and versatility will he discussed. 2.1 The Cowell Method
The direct integration of (2.1) in rectangular coordinates is referred t o in the literature as Cowell’s method. If the position and velocity components (20,yo, 20, 5 0 , go, 2 0 ) are given at a time to, this system of three secondorder equations can be integrated directly to obtain the total velocity and position a t any subsequent time t. In this form the equations, although nonlinear, are very simple and symmetrical. For the integration itself no conversion from one coordinate system to another is necessary and integration time per step is very nominal. However, because the total accelerations are integrated, the attractions change rapidly with small time changes so that small integration steps are required to maintain accuracy and in addition a large number of significant figures must be carried. Over-all computing time depends upon the computing time per step and on the number of steps required for a given accuracy. For many orbits the Cowell method requires about ten times as many integration steps as the Encke or Variation of Parameter Methods, and although computing time per step is approximately 50% less, over-all computing time may be considerably greater. The Cowcll method also suffers more from accumulation of round-
SATELLITE ORBIT TRAJECTORIES
7
off errors which may lead to serious degradation of accuracy. I n general, round-off errors will accumulace as some power of the number of steps. Since the Cowell method requires more integrating steps for a given accuracy, round-off error will be proportionately larger and over-all accuracy may suffer as a result. I n general, a method which requires the smallest number of integration steps should be preferred because round-off error effects will be minimized. For many orbits-including lunar orbits-and in general for any orbits for which two body motion is a reasonable approximation, the Cowell method is probably the least efficient computationally of the three methods to be discussed. Studies a t Aeronutronics [2] and Republic Aviation [33] confirm these remarks. There are some orbits in which the Cowell method does show up t o good advantage, however, particularly those where the thrust and perturbations are changing rapidly. Moreover, it is universally applicable t o all types of orbits and presents no fundamental difficulties in the exceptional cases of nearly circular, nearly parabolic or even hyperbolic orbits. Because of its simplicity and universality of application, every installation engaged in serious work in space trajectories should have available a routine based on Cowell’s method, this in spite of its apparent deficiencies on many types of orbits. 2.2 The Encke Method
Over a century ago the German astronomer J. E. Encke observed that the motion of a celestial body, such as a planet, deviates only slightly from two-body motion. He proposed that instead of integrating the total accelerations as in the Cowell method one integrates only the deviations of the actual motion from that of a reference conic. Encke’s method has been adapted to the earth satellite problem in recent years with striking success. When the reference orbit is that for two-body motion analytic solutions are available. Since, theoretically, these equations can be solved exactly and since the deviations from the two-body motion are assumed to be small, it seems intuitively evident that much larger integrating steps for the deviations should be possible. Moreover, greater accuracy should be possible when working with a fixed word length because round-off and truncation errors enter only into the deviations. To insure that the deviations are kept small compared to the reference orbit motion, a process of rectification is necessary. Whenever the deviations from the fixed reference orbit become large-on the order of 1000 miles-a new reference orbit is determined. The frequency of rectification will depend upon the type of orbit. The computing time per integration step is a t least 5Ooj, greater than for the Cowell method, particularly when frequent rectification is necessary, but the integrating step may be ten times as large so that the Encke method compares very favorably in over-all computational efficiency with the Cowell method.
SAMUEL D. CONTE
8
The advantages of Encke’s method are particularly evident on lunar flights where the deviations from two-body motion are slight but seem to be less marked on near earth satellites where the effects of oblateness and drag cause frequent rectification. To derive the equations for Encke’s method we rewrite the equations of motion (2.1) in the form r r = -p-fF 1.3 where F is the vector sum of all perturbations ,acting on the vehicle. If the perturbations are neglected, the resulting equations
re r,3 describe a conic section with the center of the earth a t one focus. Analytic formulas are known for re, i, as functions of time. Now letting E represent the deviations of the actual orbit from the reference orbit’, one has
re =
5
=
and
..
..
E=r-re=-p
-p-
r
-
re,
(s
-
3)+
F.
Equations (2.9) may now be integrated for the components of E and iand the components of the actual motion r and r obtained from (2.8). From a computational point of view the solution of the two-body formulas for re and ?, is very critical and is the source of the largest error in the Encke method. Several sources of computational errors will be mentioned in succeeding paragraphs. In particular errors in computing the mean motion n and the mean anomaly M when the time is large are especially serious. To avoid these errors it is recommended that the computation of n and M be done in double precision. If the rectification were exact, the initial conditions for & and 50 would be zero. Due to rounding and loss of significance errors, the conversion from elliptic elements to rectangular coordinates will not be exact and hence the initial displacements E,,) iowill not vanish. Since the reference orbit need not be the true osculating conic section, one can simply consider that the erroneous-elements so obtained define a conic section and that the deviations be based on this. Thus the initial displacements will in general not vanish a t rectification but instead will be given values equal to the difference between the actual coordinates at the time and those computed from the slightly erroneous elliptic elements. I n attempting to carry out numerically the integrations in (2.9) we are immediately faced with one of a number of computational difficulties which
SATELLITE ORBIT TRAJECTORIES
9
arise in the Encke method. At the beginning of the flight r/r3 and re/r? are very nearly equal to each other and significance will be lost in differencing these quantities. To avoid this loss of significance a method involving a series expansion is given in the literature [&$I. However, a simpler exact form more suitable for computation is the following: (2.10)
where p = re/r. In order to start the integration of (2.10) we must have the elements of the reference orbit and the initial values of E, a t time t = to. If the initial conditions are given in rectangular coordinates we must first compute the elements of the osculating conic section (a, e, i, i2, o,M ) (see Fig. 2). The formulas differ for elliptic motion ( a > 0) and for hyperbolic motion ( a < 0). To determine the semimajor axis a, the eccentricity e and the mean anomaly M we proceed as follows:
r
=
(x2
+ y2 + z2)1/2
v
=
(vz”
+ v; +
Tl
=
1 - r/a
v,)1‘2
(2.11)
+ T22)1’2
=
(T?
=
(TI2- T22)1/2
=
tan-l T 2/T 1
>0 for a < 0 for a > 0
=
tanh-I T 2 / T 1
for a
p
=
a(1 - e2)
M
=
E - esinE
a>O
=
e sinh E - E
a
e
E
for a
<0
< 0.
To determine the inclination i, the longitude of the node i2 and the argument of perigee w , it is convenient to introduce unit vectors P, Q directed along the semimajor axis toward perigee and in the direction of the velocity vector when the satellite is a t perigee.
10
SAMUEL D. CONTE
P
=
Q
=
r
cos E - vd/asin E
-[1
r
4; sin E
4 P
(2.12)
+ va (cos E - el
1
for elliptic motion and for hyperbolic motion replace the trigonometric functions by hyperbolic functions and 4 ; by dm.The remaining elements can now be computed as follows:
w =
tan-'-
PZ
(2.13)
Q3
Q = tan-'
PI/QZ- PzQu. PzQz- PzQz
Formulas (2.11)-(2.13) are used initially or whenever rectification is required in order to convert from rectangular coordinates to elliptic elements. To carry out the integration we must know re, i, a t any time t. From the elements of the reference orbit the mean motion n = and the time of perigee passage 7 are known. We then find the mean anomaly M = n(t - T) a t time 1 and solve Kepler's equation for the eccentric anomaly E : M
=
=
( a > 0) (a < 0).
E - e sin E e sinh E - E
(2.14)
To compute the position and velocity in rectangular coordinates from the elliptic elements we define a rectangular coxdinate system in the plane of the orbit with the 2,-axis directed toward perigee and the yw along the semi-latus rectum. Then z, = a(cos E - e )
y, =
r
=
a41
- e? sin E
a(1 - e cos E )
- sin E xw = - d f l a -
r
(2.15)
- cos E
Yw
= 4 f l P T
for elliptic motion with the usual modifications for hyperbolic motion. The unit vectors P, Q introduced in (2.12) can also be obtained from the orientation elements (i, Q, w ) as follows:
SATELLITE ORBIT TRAJECTORIES
P,
=
cos w cos D - sin w sin D cos i
P, P, Q, Q,
=
cos w sin D
=
sin w sin i
=
-sin
w
cos D - cos w sin D cos i
=
-sin
w
sin D
11
+ sin w cos D cos i
(2.16)
+ cos w cos D cos i
cos w sin i. Finally the rectangular coordinates a t a point on the reference orbit are obtained from re = x,P yWQ (2.17) i, = kwP gwQ. Kepler’s equation (2.14) plays an important role in all orbit calculations. In the Encke method it must be solved a t each step of the integration and any inaccuracies in its solution will affect subsequent calculations. Many methods have been proposed for solving it for the eccentric anomaly corresponding t o a given time. Perhaps the most convenient and the fastest method for computational purposes on a high speed computer is Newton’s method. Starting with an initial approximation Eo t o E which can be taken as the value of E determined at the previous integration step, the method consists of iterating using the algorithm M - E, 4-e sin En’ AE, = e < 1, I - e cos E , - -M - E,+esinhE,,, (2.18) e > l 1 - e cosh En Qz
=
+
+
+
Erz AEa. The iterations are continued until E,+1 agrees with Ento as many significant digits as are desired. The rate of convergence is quadratic but the number of iterations will clearly depend on the goodness of the initial approximation. In the usual case two or three iterations are sufficient to yield seven-place accuracy. There are cases, however, where this iterative procedure may fail to converge or where convergence will be very slow. This occurs for instance in the important case of nearly parabolic orbits when e 1 and E is small so that the denominator of (2.18) is close to zero. On a typical lunar flight an error of 1 X lop7 in E will lead to an error of 100 feet in the position coordinates. The exceptional case of nearly parabolic orbits is discussed later. En+l =
-
2.2.1 The Enclce Method with E or v as Independent Variable Some authors advocate the use of the eccentric anomaly E or the true anomaly v as independent variables in the Encke method. The equations
SAMUEL D. CONTE
12
of motion for the deviations 4 in terms of the eccentric anomaly E are easily derived. From the relations
E - e sin E re = a(1 - c cos E ) , a>0
M
=
n(t - T)
=
we obtain dE dt
- 4; red;
From the Encke equations with time as independent variable
it now follows that
Using the relation tan
2
=
Jz 1 - e tan E, 2
Encke's equations with true anomaly v as independent variable become
d2E = 5 [ 2 e sin d4 d2v2
p
+ f(4,t)].
The principal advantage in using E or v as independent variable is that the necessity of solving Kepler's equation is avoided altogether thus resulting in a more rapid and somewhat more accurate determination of E. A secondary advantage is that the integration step size is more nearly uniform when using E or v instead of time. On highly eccentric orbits for example, when a variable step integration routine is used, and time is the independent variable, the step size must be reduced considerably near perigee to maintain accuracy. If v is the independent variable, the step size Av will remain nearly constant. Frequent changes in the integration step size is costly in machine time and also results in a small loss of integration accuracy. On the other hand time is a much more natural variable and engineers usually require output at specified times. The most convenient
SATELLITE ORBIT TRAJECTORIES
13
way to obtain information at a specified time is the following. If E is the independent variable and E j are the points at which information is available, solve Kepler’s equation the (‘easy way” to obtain the corresponding time tJ. Since the position, velocity and accelerations are available a t each time ti, one can interpolate for any desired information at a time t which falls between successive values of t j. This interpolation will have to be based in general on nonequally spaced intervals and either a Lagrangian or Hermite type interpolation formula may be used [23]. 2.2.2 Parabolic and Nearly Parabolic Orbits When the reference conic is an ellipse (e < 1) or a hyperbola (e > 1) the formulas given in Section 2.2 are reasonably accurate. When the orbit is nearly parabolic (e 1) the use of either an ellipse or a hyperbola as an osculating conic leads to severe computational difficulties. For parabolic orbits the true anomaly v is used in place of the eccentric anomaly E because its range is much greater. The position and velocity in the plane of the reference conic are computed from the formulas
-
P
r=
1
+ cos v
xu
= rcosv
yo
=
r sin v
(2.19)
r-
?j, =
v/’cLp cos v/r
while the inertial rectangular coordinates are obtained exactly as in the elliptic case. Kepler’s equation in terms of the true anomaly is
M = tan
(5) +
tan3
(i)
and Newton’s method applied to this yields the iterative formulas
Vn+l
= vn
+ Avn.
AS mentioned above substantial numerical errors may be sustained in nearly parabolic orbits when using the standard formulas for the reference orbit. A good discussion of nearly parabolic orbits is given in Herrick [21]. To see how these numerical difficulties arise, we may examine in detail some of the formulas used for the range of parameter values under consideration:
14
SAMUEL D. CONTE
r
=
a ( l - eco sE ) ,
(2.21)
M
=
E
(2.22)
-e
sin E,
(2.23)
-
Consider first (2.23). If e 1, a small error in e will be magnified into a much larger error in a. By considering the differential 2ae da = -de 1 - $2
it is seen that an error in the seventh significant figure in e can lead to an error in the fourth significant figure in a. Since a is used to compute the distance r from the focus, it is clear that such errors will be propagated. A similar loss of significance occurs in computing r when e is near one and E is near zero, as is the case in most parabolic orbits. A loss of one or more digits will be sustained in differencing e and e cos E. A similar remark applies t o the solution of Kepler's equation (2.22). This loss is especially dangerous when Kepler's equation is used to compute the time t or the mean anomaly M initially since the initial timing error so introduced will seriously affect subsequent calculations. Herrick [ 2 l ] has derived a formula which avoids some of these difficulties. I n place of solving Kepler's equation for the time he proposes to use the formula
where
X
=
V
tan2
A=--- 1 - e
I
+ e'
The series converges for AX2 < 1 but its use is advised only when AX2 < 0.2 ( E < 49"). When E > 49", Kepler's equation (2.18) is used. On orbits for which the two body problem is a reasonable approximation, the Encke method is computationally more efficient than the Cowell method. This advantage is especially marked on lunar flights where accuracies comparable to those for the Cowell method can be obtained in 1/2 to 1/3 of the computing time. It is much less sensitive to the accumulation of round-off errors, it is capable of maintaining accuracy for much longer periods of time, and, in addition, it can reflect the effect of very small perturbations. On an IBM 704, using a fourth order integration method, an Encke program will require about 100 integrating steps and about 25 sec of computing t.ime on a typical lunar flight with an error of 0.1 miles.
SATELLITE ORBIT TRAJECTORIES
15
If higher order integration formulas are used, it is possible to take as few as 20 integration steps and a running time of 15-20 sec for the same accuracy. On near earth satellite orbits, the advantages of the Encke method are not nearly so marked. See, for example, the comparison of special perturbation methods on a typical earth satellite orbit given in Section 5. In the latter case the use of reference orbits more complicated than conic sections holds promise of yielding comparable computational efficiency. The major disadvantages of the Encke method are its complexity, and the need for special care in handling the analytic expressions for the reference orbit in order to obtain maximum efficiency. 2.3 Variation of Parameter Methods
In the Encke method the elements of a reference orbit are determined a t a fixed instant of time and the deviations from this reference orbit computed. Whenever desired, a new reference orbit is computed. In variationof-parameter methods equations are derived for the instantaneous rate of change of a selected set of orbital elements, i.e., the reference orbit is continually rectified. In general, for earth satellites one would expect the orbital elements to change more slowly than rectangular coordinates. This in turn implies that a larger integrating step size can be taken for a required accuracy. Several sets of orbital elements have been proposed and are described in the literature under the names of Stromgren, Merton, Hansen, and Oppolzer [34]. More recently S. Herrick has introduced a specially chosen set of parameters which define the osculating orbit a t each epoch. Herrick's method has been programmed for several installations and appears to be well suited to the computation of the orbits of earth satellites. A brief description of the method and the formulas mill be given here. Details of the derivation are given in Baker [ 3 ] .For the purposes of this section the equations of motion (2.1) are writteii in the form r f=-p--+F (2.24) r3 where F is the sum total of all perturbative forces. A set of unit vectors P, Q, W is first introduced (see Fig. 2) with P pointing toward perigee, Q pointing 90" east of P in the plane of the orbit, and W completing a right handed orthonormal system. The parameters for Herricks' method are taken to be vectors a(t) and b(t) along P and Q together with the mean anomaly M and the mean motion n. i.e., a = eP, nf = n ( t - t o ) , -
b
= ed\/pQ,
n
= l~,l/pa-~/~.
(2.25)
SAMUEL
16
D. CONTE
Here to is the initial time and a is the semimajor axis (not the magnitude of a), e is the instantaneous eccentricity, and p is the parameter of the orbit. The differential equations for the instantaneous rate of change of these elements are
b
=
bo
(2.26)
+ k , lotb' dtj
+ k, J' n' dt M ( t ) = MO+ no(t - to) + k, [ I'n' dt dt + k , 1'M'dl n(t) = no
to
(2.27)
to
to
where the perturbative variations a', b', n', M' are to be defined. Equations (2.27) determine the mean anomaly. The system (2.26)-(2.27) is redundant since only six independent equations are needed to describe the motion but the redundancy is used as a check on the computations. To relate the Herrick elements to the rectangular coordinates of the vehicle we proceed as follows. Assuming that a, b, M are known at time t we form: a - a = a2 a> az2 = e2 3 eccentricity
+ + b.b = b2 + b,2 + b,2 = e2p
3
parameter p
a1 = + semimajor p axis a - e2
(2.28)
p = ae
For elliptic orbits we now compute E from M inplanar rectangular coordinates from
r 2,
- e cos E ) = a(cosE - e) = a(l
yw =
=
=
E
- e sin E
and the
magnitude of radius vector
.\/a?, sin E E
-sin
kw = -.\/pa-
r
The position and velocity in inertial rectangular coordinates then are
SATELLITE ORBIT TRAJECTORIES
r
=
x,P
+ ywQ
17
+ ywQ
i = xwP and for later convenience we also form
D
=
ed/asinE
H
=
-exw
b
r.P = -r.a. =
To carry out the integration of equations (2.26)-(2.27) the variations a', b', M' must be obtained. Letting F,, F,, F,, be the components of the perturbations, we compute:
n',
diD'
=
d&'
=
+ yF, + zF, 2 f . F = 2(XF, + yF, + ZF,)
H'
=
200' - rZD'/di
r . F = xF,
A ' = dp- D' r (2.29)
The mean anomaly M arid mean motion n can now be updated using (2.27) and the vectors a, b updated using (2.26). It is clear that these equations are considerably more complicated to program than the Cowell equations and that the computing time per step is considerably greater. Moreover, the two body formulas must still be solved a t every step since the perturbations are expressed in rectangular coordinates. In addition, accuracy is difficult to maintain on low eccentricity orbit as can be seen from the computation of v' and subsequently of M'. For low eccentricity orbits a different set of parameters which avoids the small divisor problem has been proposed by Herrick and is described in his book [62]. No universal set of parameters which apply equally well to all types of orbits has yet been developed so that different sets of parameters must be used for essentially different types of orbits (e 1, e 0, and e moderate). It is often claimed that these formulas are less sensitive
- -
18
SAMUEL
D. CONTE
to round-off accumulation because they have been expressed as a system of eight first-order equations. It can be shown that round-off errors do accumulate less rapidly with first order systems than with second order systems. This conclusion is, however, not valid here since the integration of (2.27) for the mean anomaly is essent,ially a double integration and any errors introduced int,o the mean longitude here are propagated throughout. On the other hand, the Herrick method does allow the use of larger time steps because the dependent variables are slowly changing functions of time. Except for low eccentricity orbits, it is a stable method relative to the growth of round-off and truncation errors and it is capable of yielding good accuracy over long time periods. It is particularly well suited to the integration of orbits where the total perturbation forces, including thrust, are small. See Section 5 for the results of a comparison of the Herrick method with the Cowell and Encke methods on an earth satellite orbit.
3. Methods of Integration
A great variety of methods arc available for the numerical integration of systems of first order differential equations. The general criteria for the choice of an integration method are the following: (a) Storage requirements for the subroutine (b) Complexity of the formulas (c) Flexibility (d) Speed (e) Over-all accuracy. A flexible computing program for the artificial satellite problem which is designed for a variety of missions, which takes into account all significant perturbations and which provides for detailed input and output conversions will inevitably lead t o a very large complicated routine. The number of instructions will be on the order of 20,000 or more. The typical application of such a program-whether for mission design purposes, for prediction of actual motion, or for tracking purposes-will involve large time spans and frequent usage and therefore considerable amounts of computing time. In view of these requirements, it will be assumed that a large high speed digital computer of the IBM 7090 type is available. Criteria (a) and (b) are then definitely of secondary importance while speed and over-all accuracy are of primary importance. While extreme accuracy is not always necessary-in feasibility studies or in preliminary design studies for example-the routine should be capable of producing very accurate results when they are desired even a t the expense of increased computing time.
SATELLITE ORBIT TRAJECTORIES
19
By flexibility we mean the facility with which the program can perform the following functions: (a) Print out results a t a specified time or a t a set of equally spaced times. (b) Change the step size based on an error criterion. (c) Restart the integration when discontinuities are introduced. While some of these functions can be performed by the user, it is more convenient and faster t o have these built into the integration subroutine. The flexibility features affect both the speed of the integration and the accuracy of the results. Frequent interruption of the basic integrating routine results in increased computing time because the restarting procedure, except for Runge-Kutta methods, is expensive and also tends to reduce accuracy although the exact reason for this is not clear. I n discussing the various integration methods emphasis will be placed on the factors which affect speed and on the errors-round-off and truncation-which affect accuracy. An integration routine for space trajectory calculations should strive to obtain a balance among the following requisites : (1) It should allow the largest possible step size compatible with a given error criterion, i.e., higher order methods are preferable to lower order method. This will serve to increase the speed and minimize the accumulation of round-off error. ( 2 ) It should be capable of automatically changing the step size based on an adequate estimate of the local truncation error. (3) The procedure for changing the step size or for restarting should be as inexpensive as possible. (4) Adequate safeguards should be provided against excessive accumulation of round-off error. (5) Provision should be made for the output of information at any desired time based on the use of interpolation formulas. This is particularly true when frequent output is required as in station ephemerides print out or during tracking operations when a great many observations must be processed. This function is perhaps more conveniently performed outside of the subroutine although the subroutine should be written with this use in mind. 3.1 Runge-Kutta Methods
I n this country Runge-Kutta methods are very popular-particularly a version due t o Gill which requires only 3N storage cells-N being the number of equations-and which attempts to reduce the growth of roundoff error. On modern computing machines the savings in storage are insignificant, and round-off error control, while quite important, can be accomplished more simply and more universally by double precision
SAMUEL D. CONTE
20
accumulation of the increment, a process which will be described later. There no longer appears to be any good reason for using the Gill version and it is recommended that if a Runge-Kutta method is desired the standard fourth order method be used. The formulas for this method are well known [23]. For a first-order equation y‘ = f(z, y), assuming that the functional value y1is known a t the ith step, the next value y2, is obtained by the formula
=
+ h6(ki + 2kz + 2k3 + h)+ O(h5! yZ+ a y I +
=
hf(xi, yJ
=
~ t + i
ki
YZ
~
5
)
(3.1)
kr = hf(zt
+ h, yZ+ k ~ ) .
The increment Ayl thus requires the evaluation of the derivative function four times for each integrating step. Since the derivative evaluation is the most time consuming portion, the necessity for four such evaluations provides one of the least desirable features of this Runge-Kutta method. A second disadvantage is that the coefficient in the principal part of the local truncation error is an extremely complicated function of y and its derivatives. I n trajectory calculations it is important to use the largest integrating step possible for a required accuracy in order to reduce both machine time and round-off error. The difficulty of evaluating the error term makes the choice of the proper integrating step difficult. Various methods have been proposed for eliminating this defect. One suggestion is that the integration for yt+l be performed first with a step of length h and then with two steps of length h / 2 . This will yield 2 values for yt+l. The difference between these two values then provides a reasonable estimate of the local truncation error. This method requires three times as much computing per step and for this reason cannot be seriously considered. Another suggestion is the following : having obtained three successive equally spaced values yIP1, y E ,yz+l,usc Simpson’s rule over the two intervals to obtain a new estimate of yz u;+1
= 2/*
+ h ( y L 1 + 2y’, + yE+d
which has the same local truncation error as the Runge-Kutta method. Oiie can then use the difference y; k l - yl+l to decide on whether to increase or
SATELLITE ORBIT TRAJECTORIES
21
reduce the basic step size. This appears to be a reasonable and inexpensive procedure, although there is no rigorous mathematical justification for it nor has the method been used extensively [ti']. Another procedure is to examine the magnitude of the attractions acting on the vehicle-for example, the distance from the earth might be one simple criterion-and choose the interval on the basis of experience. When integrations are performed over a great many time steps, the accumulation of round-off errors can lead to very serious degradation in the accuracy of the results. A very simple, effective, and inexpensive method for reducing accumulated round-off error in any numerical integration method is that of double precision accumulations. I n this procedure the dependent variable is always carried in double precision form, the derivative calculations are carried out in single precision, and the increment Ayi is added to the dependent variable yi in double precision. This process is effective in either fixed point or floating point operations. Round-off error will be discussed in more detail later. To summarize, Runge-Kutta methods are capable of good accuracy, follow the solution curves very well, do not suffer from excessive growth of round-off error, and can change the stepsize at will. On the other hand the usual method is of fourth order so that relatively small step sizes must be taken: it is slow because four derivative evaluations are required at each step; and there is no simple criterion for deciding on how to change the step size. By and large Runge-Kutta methods require more computing time than ot,her methods and for this reason are not recommended for space trajectory calculations. 3.2 Multistep Methods
Multistep methods as opposed to single-step methods such as those of Itunge-Kutta type, require information at several successive equally spaced time steps. Such methods usually lead to a finite difference approximation to the solution of a first-order equation y' = f(z, y) of the form
+.. .+
+ .+
(3.2) where ao,. . . , ( Y k ; P O , . . . , Pk are fixed constants; yn is the value of y at 2 = zo nh, and fn = f(z,, yn). If Pk = 0 the formula is open and yn+k can ffkUn+k
+
aO?Jn
= h(@kfn+k
* *
POfn)
be obtained directly; if Pk # 0, the formula is closed since fn+k requires knowledge of yn+k and hence (3.2) must be solved by iterations. Since closed formulas are more accurate than open formulas, it is customary to obtain a first estimate of y n + k using a predictor formula and then to use (3.2) as a corrector formula. Using the finite difference operators in (3.2) which are of order lc it is theoretically possible to obtain formulas whose However, sincc the difference local truncation error is of degree hZA++'.
22
SAMUEL D. CONTE
operator is of order k arid the differential equation is of first order, (3.2) will have in general k solutions, all but one of which are extraneous. There is some danger in the use of such formulas that small errors such as roundoff introduced a t some point of the computation will become magnified and even dominate eventually the true solution. This phenomenon is referred t o as instability. Dahlquist r9] has studied such finite difference approximations and has shown that if the method is to be stable the local truncation error can be at most of degree hk+3. Moreover, such formulas of maximum degree must be closed. Thus it is possible to generate families of finite difference equations from (3.2) which are stable. We list here two familiar predictor-corrector formulas of the type (3.2). The Milne formulas for first order equations are
As the error terms indicate both methods are of fourth order although for the Milne method the truncation error is somewhat smaller. For sufficiently small values of h the Adams-Moulton formulas are unconditionally stable. The Milne method on the other hand is unstable, and while several modifications have been suggested to remove this instability [IS]it is probably best t o avoid this method. On the assumption that the fifth derivative is constant over an interval, the difference between the predicted and corrected values of y provides a good estimate of the local truncation error and thus provides a basis for deciding on whether to reduce or increase the step size. I n using formulas of this type it is advisable to use the corrector formula once only. If the predicted and corrected values do not agree to the desired number of places, then the integrating step should be reduced. Thus each step involves two derivative evaluations as contrasted with four for Runge-Kutta methods. This fact together with the ease of determining the local truncation error make the Adams-Moulton formulas considerably faster. On the other hand, this method as well as all multistep methods requires an independent starting method whenever the step size is to be changed. While special formulas can be derived to obtain the starting values or to change the interval, it is very convenient t o use a Runge-Kutta
SATELLITE ORBIT TRAJECTORIES
23
method for this purpose. Double precision accumulation is also recommended for round-off error control. To summarize, the Adams-Moulton predictor-corrector method is of the same order of accuracy as the fourth order Runge-Kutta method, it is very stable and is considerably faster. When combined with a Runge-Kutta method for starting and for changing intervals it makes for a convenient rapid method which should be preferred t o a straight Runge-Kutta method. Its major disadvantage is that it is of low order thus restricting the interval step-size for a required accuracy. Of the numerous methods of higher order which are available, we mention briefly the Adams open formula. Written in terms of differences this formula is
+
+
+
+
+
+
h ( 1 &V +AVO" 3 7 3 27 L 2 0V 4 Jp5-0j 288 . . .)y', (3.5) where Vy', = y', - yk-1 is the backward difference operator. If only third differences are retained and these differences are expressed in terms of ordinates we obtain the first of formulas (3.4). By retaining a sufficient number of differences a formula of any order may be obtained. While this method is satisfactory, the Gauss-Jackson method, sometimes erroneously referred t o as the Cowell method, is commonly used b y astronomers and is particularly well suited to the equations of motion expressed in rectangular coordinates. Because of its length and complexity a complete treatment of the Gauss,Jackson method of integration will not be reproduced here. The reader is referred t o Hildebrand [W]for the derivation and usage of the formulas. These formulas are often expressed in the form of differences but it is more convenient to express the differences in terms of ordinates. Let the basic second order equation to be integrated have the form k = X(z, 2, t). Let ~ ~ - 15,-2, , . . . , 5 0 , &, . . . , &; and Xa--l,. . . , Xo be i given successive equally spaced values of the position z, the velocity j: and the attractions X . Then a formula for the predicted value of x, and x.,a t step i has the form yn+l = yn
+ '2 c k X k ] 1 , I 2 % ~h [f X t - l i z+ '2 d L X k ] , J
5," =
h2 ["X.
k=O
=
where the first sum recurrence formulas
'Xz-1,2
(3.6)
k=l
and the second sum " X , are given by the
IX1-1,2
lfXi
+
=
xi-1
=
'Xi-l/2
IXi-3,2,
+
(3.7) "Xi-1.
Using the predicted values xi, Li one may calculate X i from the equations of motion and then apply corrector formulas t o obtain improved values of xi, &. The corrector formulas will have the form
24
SAMUEL D. CONTE r
i
1
(3.8)
+2
xic = h [‘Xi-,,,k = l d f k X k ] .
The difference between the predicted and corrected values can now be used to decide whether the interval h is too large or too small for the accuracy required. For the case when eleven successive values are assumed known the coefficients ck, ellc,dk,d f kare given to nine significant figures in Garrett [14l. The starting values must again be obtained by some independent method, both for the attractions and for their first and second sums. The starting values are usually obtained by a complicated iterative process, although a Runge-Kutta method could be used. In the latter case a considerably smaller integrating step must be used since the truncation error of the Gauss-Jackson method is O(hn+2) if nth differences are retained. A special procedure for doubling or halving an interval must also be available. The Gauss-Jackson method will allow fairly large integrating steps if a sufficient number of differences are retained. Moreover the second sum process inhibits the growth of round-off errors as will be shown in Section 3.4. It is probably the best integration method for Encke and Cowell programs where one is basically dealing with second order systems of equations expressed in rectangular coordinates. It appears to be less well adapted to first order systems such as arise in variation-of-parameter methods. I n general, it is most efficient on orbits which require relat,ively infrequent changes in the integration step size. 3.3 Special Methods for Second Order Equations
In the absence of drag and thrust perturbations, the equations of motion in rectangular coordinates have the form y” = f(z, g), i.e., first derivative terms are absent in the forcing function. Special integration methods both of the multistep and Runge-Kutta type have been proposed to take advantage of this feature. A Runge-Kutta method of this type is the following : kl = hf(xn, 2 / n ) ,
yn+1 =
yn
+ h [ Y f . + g (kl + 2 k 2 ) ] , 1
(3.9)
SATELLITE ORBIT TRAJECTORIES
25
This method has a local truncation error of order h5 just as the corresponding method for first order equations, but involves only three derivative evaluations instead of four. A saving of about 25% in computation time for the same accuracy thus appears possible. Of the various multistep methods we mention the predictor-corrector formulas usually ascribed to Millie and Stormer :
(3.10) The apparent advantage of this method is that a local truncation error of order h6 is achieved compared to an h5 error for similar formulas for firstorder systems. As shown in Hildebrand [23] this advantage is illusory since the total propagated error is only of order h4. I n addition these formulas are more sensitive to the growth of round-off errors than first order methods as shown by Henrici [18].In practice there appears to be little to recommend (3.10) for the free-flight problem. Moreover, since it is frequently necessary t o include nonconservative forces, it is probably advisable to avoid the use of either method (3.9) or (3.10).
3.4 Accumulated Round-off Error Since a machiiie works wilh a finite number of digits, and since some sort of rounding is involved in each calculatioii, it is clear that some significance will be lost due to round-off. Indeed the loss due to round-off can be disastrous in some problems, aiid every effort should be made to assess the extent of such loss. The proper assessment of round-off error is, however, complicated by the fact that very little is known about it and few thorough studies have been made. Rademacher [35] made a study of round-off error accumulation and obtained some results assuming a statistical model of round-off propagation based on fixed point operations and symmetric rounding. Brouwer [S] studied the accumulation of round-off errors for the n-body problem when the Cowell formulation and the GaussJackson integration method were used. He also assumed symmetric rounding and fixed point arithmetic, but he was concerned primarily with hand computations. His results indicate that, for a fixed step size, the error growth is of order N3I2where N is the number of integration steps. Experience on high speed computers of the IBM type with floating point operations indicates that this estimate is probably pessimistic, particularly if the process of double precision accumulation as described in Section 3.1 is used. A more realistic estimate based partially on experience and partially on analysis indicates an error growth of order N1I2.Henrici [IS] has recently
SAMUEL D. CONTE
26
made a study of round-off error propagation and it may be worthwhile to summarize some of his results here. The most important factors affecting round-off error propagation in the solution of differential equations are the following: (1) the method of integration used; (2) the kind of arithmetic, i.e., fixed point or floating point; (3) how the rounding operations are performed. For simplicity we consider second order equations of the form y“ = f(x, y) which are typical for the free flight problem. For machine solution this differential equation can be replaced by a straight finite difference scheme of which (3.10) is typical or by a summed finite difference scheme of which (3.6) is typical. If infinitely many places were carried by computing machines the results would be the same for either method. There is a considerable difference, however, if finitely many places are carried. The integration methods being considered are of the form akYn+k
+ .- + *
aOYtr = h2[Pkfn+k
+ ..
*
f
(3.11)
POfn1.
Let g, denote the numerically calculated values of y, and letf, and define the local round-off errors E, by ffkgn+k
+ . . + aOgn =
h2[bkfn+k
*
+ .. + *
PCLfn]
+
= f(z,,
jj,),
En.
We now adopt a statistical model of round-off propagation. The E, are considered to be random independent variables about which the expected value E and the variance V are assumed to have the form (3.12)
where p , q are functions of x but independent of h, and p , u are functions of the step-size h but independent of x. Using perturbation methods and probability theory, Henrici shows that for the orthodox methods of using (3.11)
E(r,)
=
V(rn>=
L5 h2
$
. *
WGL)
{v(x,)
+ O(h)) (3.13)
+ O(h))
where T , = 5, - yn is the accumulated round-off error after n integration steps and m(z), v(x) are known functions which satisfy certain differential equations. The differential equations satisfied by m and v are:
+ p , m(a) 4gv’ + 2g’v + 2q,
m” = gm 0’” =
=
m’(a) = 0,
v(a) = v’(a)= v’l(a)
=
0
(3.14)
27
SATELLITE ORBIT TRAJECTORIES
where g(z) = fJz, y(z)]. Equations (3.14) can be integrated along with the original equations 9’’ = f(z,y). The summed form of (3.11) is equivalent to the pair of difference equations 0:-12/n+k . . * a’oyn+L = h{PkFn+k . . . PoFn) (3.15)
+ +
+
- Fn+k-l
+
hfn+k. (3.16) Now let en denote the local round-off errors for (3.15) and 9% those for (3.16) and assume as before that E(9n) = vP(zn),V(vn)= ~zQ(z,)and that the en, qn are mutually independent. Then in place of (3.13) we obtain Fn+k
E(rn) =
V(Tn) =
f
*
=
M(zn)
+ aN(zn)
f ~ ( z n+) f ~ ( z n )
(3.17)
where M, N , R, S are again obtained as solutions of certain differential equations. Thus both the expected value and the standard deviation of the accumulated round-off error are improved by a factor of the order of h in the summed method. These results indicate the superiority of the GaussJackson method described in Section 3.2 over the unsummed methods of which (3.10) is typical. I n order t o obtain quantitative results for a particular method of integration one has to make more definite assumptions about the distribution of the local error, i.e., about p , y, P, Q and the constants p, v, u, T . For fixed point operations and symmetric rounding and assuming uniform distribuof tion between the limits -u/2 and u/2 where u denotes the basic unitthe machine, the distributions are p = P = 0, y = Q = 1, u = T = u / d 1 2 . Some experiments on some simple equations show that quite accurate predictions of the distribution of accumulated round-off error can be made. Experiments applied specifically to the equations for the n-body problem are currently being conducted a t Space Technology Laboratories, Inc. Experimental results also indicate that the method of rounding has a considerable effect on round-off error propagation. I n general symmetric rounding is much better than rounding b y chopping. IBM machines normally round by chopping unless a code can be written to achieve symmetric rounding. This fact together with the short floating point word length of IBM machines (8+ decimal digits) constitute two of the poorest features of the 700 series. On the basis of these studies and experiments the following conclusions concerned with minimizing round-off error accumulation seem warranted : (1) the summed form of finite difference integration schemes should be preferred; ( 2 ) symmetric rounding should be used; (3) fixed point arith-
28
SAMUEL D. CONTE
metic is preferable to floating point arithmetic because a longer word length is thereby obtained (lo+ on IBM machines) and because round-off error analysis is much simpler; (4) double precision accumulation as described in Section 3.1 should always be used. 3.5 Integration in Multirevolution Steps
I n many problems such as that of determining the lifetime of a satellite it is necessary t o obtain fairly accurate estimates of the orbital elements over hundreds or even thousands of revolutions. Straight integration of the equations of motion cannot be considered both because of the extensive machine time required, and because accuracy cannot be maintained over that many revolutions. Several papers have appeared recently suggesting that difference equations for the orbital elements be obtained and that an integration be performed in niultirevolution steps. Let yn represent the orbital elements a t the end of the nth revolution. Let fn represent the changes in the elements over the next revolution. Numerical integration over this revolution leads to the difference equation ~ . + l-
Yn = f ( t n ,
yn>
= fn.
(3.18)
Multirevolution steps in y can be obtained through the use of predictorcorrector difference equations of the form y k - YO = k kjv3fk (3.19) 3=0
where
Vjk
represent multi-int ervnl backward differeiiccs, i.e.,
vfn = fn
- fn-k.
The coefficients X, are given as j t h degree polynomials in l / k . The methods proposed by Smith [do] and Cohen and Hubbard [7] use backward difference formulas of the type (3.18) while those given b y Thomas [44]use the Gauss-Jackson central difference formulas. Numerical experiments by Smith on a n IBM 709 using Herrick’s method for the numerical integration led to extremely disappointing results unless the solution of (3.18) was obtained with extremely high precision. On the other hand experiments by Thomas using a machine with a 12-digit word length and based on Cowell’s method led to optimistic conclusions. Because of the possible application of this approach to the satellite lifrtimc problem, further investigation of its capabilities appear warranted. 4. General Perturbation Methods
The large majority of vehicles launched over the past three years have been placed into orbits within 1000 miles of the earth. The major forces
SATELLITE ORBIT TRAJECTORIES
29
affecting the motion of such satellites are drag and the oblateness of the earth. If the perigee distance is greater than 300 miles the motion is relatively drag-free and the oblateness effect dominates. For short term prediction of the motion on such orbits the special perturbation methods discussed above are capable of yielding very good accuracy. For long term prediction over hundreds and even thousands of revolutions, however, they suffer from two important disadvantages: First, step by step integration is subject to the inevitable accumulation of round-off and truncation errors which will eventually destroy completely the validity of the results, and second, they are extremely time consuming since many thousands of integration steps will be required. As a rule of thumb, one can estimate that 100 integration steps per revolution will be required for a near-earth satellite orbit. Assuming an orbital period of 144 min or 10 revolutions per day with 100 steps per revolution would require lo5 integration steps for 100 days. Using Brouwer’s estimate that the round-off error in the mean longitude accumulates as the 3/2 power of the number of steps implies a loss in accuracy, due to round-off alone of seven significant figures. This implies that double precision on IBM machines would be necessary to maintain an accuracy of six or more figures. Since the oblateness parameters in the earth’s gravitational potential are small, and since they enter analytically in the differential equations of the motion, it is reasonable to expect that the motion can be described adequately by power series expansions in these oblateness parameters. Those methods which attempt to obtain series expansions in the oblateness parameters-or perhaps in the eccentricity-are known as general perturbation methods. These methods have some important advantages over the special perturbation methods-at least theoretically. These are : (1)the position and velocity at any epoch can be obtained without the necessity for step by step integration and consequently there is no significant loss of accuracy because of accumulated round-off or truncation error; (2) they are extremely rapid requiring less than 1 sec of computing time per point on an IBM 704, after the initialization parameters have been obtained; (3) they are theoretically capable of maintaining accuracy over hundreds of revolutions; (4) they allow for a clearer interpretation of the sources of the perturbative force and of the qualitative nature of orbital motion. Thus the recent discovery of the “pear” shaped earth was made possible by an analysis of the long period terms in a general perturbation study applied to the 1958?!z, satellite [%’I. In this instance general perturbation theory led to the discovery of the existence of the third harmonic in the earth’s gravitational potential, a discovery which might have been almost impossible to arrive at using special perturbation methods.
30
SAMUEL D. CONTE
On the other hand they suffer from a number of disadvantages, both theoretical and practical. From the theoretical aspect, although mathematicians and astronomers have investigated this problem for hundreds of years, no theoretical proof of convergence of the series expansions has yet been given nor have any estimates of the truncation error in these expansions been obtained, except for the special case of equatorial orbits. In addition the general perturbation methods do not naturally lend themselves to the inclusion of nonconservative forces such as drag and this imposes a severe limitation on the type of orbit to which they are applicable. From a practical point of view, the series expansions are extremely complicated, even to first order terms in the parameters, and almost hopeless for the higher order terms. The derivation of these higher order terms is extremely laborious, the correctness of the expansion is difficult to establish, and the programming of the method is extremely involved. For most of these methods, there is a serious degradation in accuracy for small eccentricity orbits or for orbits near the critical inclination angle of 63.4"where small divisor problems arise. Even for noncritical orbits, the accuracy is limited and for short term prediction cannot be as accurate as numerical integration. A large number of general perturbation methods, have been proposed. The classical theories of Hansen and Delaunay have been modified so as to apply to the artificial satellite problem, the former by Dr. Musen [31] and the latter by Dr. Brouwer [GI. More recently King-Hele suggested a different approach [25] and Brenner and his associates a t Stanford Research Institute have developed a complete first order theory based on a modification of the King-Hele theory [4].A novel approach based on the mathematical theory of periodic two-surfaces of Diliberto [lo]is being developed at Space Technology Laboratories. Other theories have been proposed by Kosai [27], Garfinkel [13],and Struble A complete exposition of these theories cannot be undertaken in this paper but a few comments concerning their current and potential usefulness seem appropriate. Apparently the only general perturbation method which is relatively complete and which has actually been used on the near-earth satellite problem is the Hansen method. A program based on the Hansen method was initiated under the Vanguard Project and written by IBM, and is now being expanded under the jurisdiction of NASA. In this theory the disturbed eccentric anomaly is used as independent variable and extensive use is made of Fourier series expansions. The program is extremely complicated and represents an investment of a great many man-years of effort. It seems to have been used successfully on a great many satellites. The accuracy of the predictions using this program varies with the particular orbit but is stated to be roughly about 0.1" of arc over one revolu-
[@I.
SATELLITE ORBIT TRAJECTORIES
31
tion. No complete write up of the equations appears to be available for Hansen’s method although publication is now contemplated. Brouwer’s adaptation of Delaunay’s method, which was published in 1959, seems to hold great promise for a practical perturbation method. The theory is complete and available to first order in the periodic terms for the first five harmonics of the earth’s gravitational potential, and to second order in the secular terms. It is relatively simple to program and requires a very small initialization time. In these respects it is recommended over Hansen’s method. A comparison with respect to accuracy and length of time of validity is much more difficult to make and such a study has not been undertaken. The Delaunay theory suffers from the problem of small divisors for small eccentricities particularly in the mean anomaly and in the argument of perigee, from singularities in the short period terms of the odd harmonics both a t low eccentricities and a t lorn inclinations, and from resonance difficulties for satellites with inclinations near the critical value 63.4”. Research is currently underway to remove the singularities from the Delaunay theory, and to include a drag theory as well [24,4l].Some tests of the Delaunay theory conducted a t STL indicate that the major error arises in the computation of the mean anomaly so that the error is largely along the orbit rather than perpendicular to it. Most of the other theories mentioned above are not complete or h a w not been sufficiently tested to determine their usefulness. 4.1 The Diliberto Theory
To establish the flavor of general perturbation methods, and also because the Diliberto theory is not now available in the literature, a brief exposition of this theory will be given here. We begin by considering the equations for the drag-free motion of a satellite about an oblate spheroid. In polar coordinat,es (r, 8, 4) these equations are (a) i: - re2 - r sin2 e$
av
=-
ar
d ( ~ ~ 6-) r sin 0 cos 8@ (b) -I r dt d (c) - [rz sin2 e$] dt
=
1 av
= --
r a0
1 av r sin 0 134
where V is the gravitational potential which including only the second harmonic has the form (4.2)
where R is the equatorial radius of the earth and J is a constant which is a
SAMUEL D. CONTE
32
measure of the earth’s oblateness. The solutioii of (4.1) with the graviiational potential (4.2) is the main problem of artificial satellite theory. More complete theories would be bascd on a gravitational potential in the form
where P, is the Legendrc polynomial of order n. The force field is assumed to be rotationally symmetric so that (aV/a4) = 0 and hence (4 .1 ~ )can be integrated to give sill2 e4
=
p where p is a constant,
(4.3) which states that the angular momentum about the polar axis is constant. Also C#I is a monotonic function of time and can therefore be used as a n independent variablc. Introducing two new dependent variables r2
U
=
cot 8,
W
=
1/r sin 0
(5.4)
Eqs. (4.1) with C$ as indcpcndeiit varia1)lc become
d@?
d42
+W
=
A(]+
[-2)--3/2
+ XWz[s(l + 1-2)--7/2
- 4 (1
+
7,T2)-5’2]
\vherc X = Jpli?/p2. A = PIP2, The solution of (4.5) will yield the position and velocity as a function of the longitude 4. Equation (4.3) must be integrated if the position as a function of time is desired. Equations (4.5) can be interpreted as a system of coupled harmonic oscillators and this interpretation suggests the introduction of phase space variables: 51 =
cr,
y1 =
w
For a spherical earth (A = 0 ) Eqs. (4.5) expressed in terms of xi,yi become
One can now find functions ol;(z~, Q) so that under the new variables 2; =
y; -
(Yi(Z1, z2)
i = (1, 2)
SATELLITE ORBIT TRAJECTORIES
33
(4.6) becomes uncoupled, i.e., (4.7)
The phase space has been deconiposed into the product of two planes. If polar coordinates are introduced into the two planes
x1 = rl sin 01, z1 = r2 sin O2 x2 = r1 cos 01, z2 = r2 cos O2 the unperturbed equations (4.7) become dri-dOi =I, (i = 1, 2 ) . -0
d4 d4 Applying the same transformations to the perturbed system (4.5) yields equations of the form
Explicit expressions for Hi, R ; are given by Diliberto [ l o ] . The theory now postulates the existence of integrals of the system (4.9) which are called periodic two surfaces. They are closely related to the concept of periodic integrals. An approximation theory is then developed based on this assumption. The theory is characterized by the fact that it splits the description of the solutions into two distinct parts; one element is the description of the periodic surface, the other is a description of the position on the surface. The description of the surface requires two doubly periodic functions Xi, S2; SO that (4.10) T , = Xz(&, 82, J ) . These functioiis are obtained to first order in J by an espansiori procedure for the corresponding periodic integrals. Once the functions Siare approximated, the position on the surface is obtained from expansions of the form 01
=
0l0
e2 = 020
+ xFl(4,4°) + O ( W + ~ ~ (40)4+, O(W
(4.11)
The superscripted variables are obtained from the initial elements for the unperturbed orbit. The functions F1, F2 are of course quite complicated and must be solved b y iteration. For a given value of the longitude 4
34
SAMUEL D. CONTE
(4.10)-(4.11) are solved for 0;) T ; and from these one can obtain the position and velocity directly. The theory as developed thus far is complete to first order in X but an analytic relationship for 4 as a function of time has not yet been derived. 4.2 Numerical Results
Some numerical results are included here to give the reader a feeling for the kind of accuracy that can be expected from general perturbation methods. A typical non-critical orbit was chosen with initial elements a = 1.5, e = 0.2, i = 45" and period 155 min. The only perturbation considered was the second harmonic in the gravitational potential. The standard was provided by a Cowell double integration routine which carried out the numerical integration over 64 revolutions at a step size of 1/8 min. For this standard the position and velocity are correct to seven significant digits after 64 revolutions. Both the Diliberto and Delaunay methods were then used to obtain the position and velocity at 20-min intervals in each revolution. Table I gives the maximum difference in the position coordinates in feet over selected revolutions. In the Diliberto method the longitude 4 corresponding to a given time was obtained from the numerical integration since no time-longitude relationship has yet been developed for this method. The column Delaunay I gives the results using the mean anomaly as output from the Cowell run and the last column gives the results when the Delaunay method computes its own mean anomaly. The error in the Diliberto and Delaunay I columns must be attributed directly to the fact that in the expansions terms of order higher than the first have been neglected. The Delaunay I results are somewhat better than the Diliberto results, the maximum errors being on the order of 1mile and 3 miles respectively. The Delaunay I1 results are somewhat poorer. The major part of this error can be attributed directly to small errors in the mean anomaly as computed by the Delaunay formulas. The error is thus almost entirely along the path of the motion rather than perpendicular to it. At the end of 64 revolutions (about 9940 min) the mean anomaly determined from the Delaunay theory differs from that of the numerical integration by 0.035". The error Ax in any position component x can be obtained from the formula AM Ax=-X
n
where AM is the error in the mean anomaly, n is the mean motion in degrees per second and x is the velocity in feet per second. For this orbit at t = 9940 min, AM = 0.035,
35
SATELLITE ORBIT TRAJECTORIES
2?r n = -2n =T 155(60)’
x
-
-20,500 fps and
18,500 ft. The error in the mean anomaly thus accounts for almost 90% of the actual error in the x-coordinate which is -21,000 feet and this is true even though the secular terms in the mean anomaly are computed to second order terms. After 1000 revolutions a loss in accuracy of approximately six significant digits will be sustained from this source. TABLE I. NUMERICAL RESULTS-GENERAL PERTURBATION METHODS -
Revolution number
Diliberto
Delaunay I
Delaunay I1
1 2 20 40 64
150 ft 250 2800 5600 14,000
150 f t 240 1400 3000 5000
320 ft 650 TOO0 14,000 22,000
5. Accuracy Tests for Integration Programs
Having decided on a mathematical formulation and on a method for numerical integration, it is then important to know how accurately a trajectory can be computed. Pu t differently, one may ask whether it is possible to estimate the totality of computational errors for a given orbit a t any particular time. Several proposals have been suggested for ail accuracy study, among these being: Comparison of the computed results with analytic formulas for problems t o which solutions are known. Consistency check on the integration. Use of complete double precision. Use of energy and angular momentum integrals. Comparison of results obtained by using different mathematical formulations and different methods of numerical integration. Use of numerical methods which estimate the propagated truncat,ion error and the accumulated round-off error. The relative efficiency of these tests will be discussed in the following sections.
36
SAMUEL D. CONTE
5.1 Comparison with Analytic Formulas
To determine the accuracy of a particular method, one can compare the results for a n idealized two-body motion where the analytic solution is known. The assumption is then made that similar accuracies are attainable on nonidealized orbits. This approach is of limited value for the following reasons : (1) The two-body problem is esseiitially two-dimensional in nature. The effects and the accuracy on true three-dimensional orbits may be significantly different. (2) This method provides no check a t all on the Encke and Variation of Parameter methods which use two-body motion as a reference orbit. The only special perturbation method which does not become degenerate for two-body motion is the Cowell method. (3) The computation of the position and velocity a t a given time from the two-body formulas will itself lead to errors. This is especially true for the limiting case of nearly parabolic orbits. Thus when great accuracy is required, it will not be clear whether the integration or the analytic formulas introduce the largest error. The first two objections, but not the third, can be partially removed by basing the comparison on a three dimensional problem for which an analytic solution is known. Among such problems are the restricted three-body problem and the problem of a vehicle moving under the attraction of two fixed centers of gravitation. For both of these problems an exact solution is known in terms of elliptic functions-although these solutions are fairly complicated. Comparisons based on thrse two problems have been made by Baker [2] and Pines [ 3 3 ] . Those problems for which an analytic solution are known are very special in nature and it is not a t all clear whether the generalization of results to more complicated motion is valid. The results may be useful for orbits which resemble closely those on which the comparison is based. 5.2 Consistency Checks
111 this method the same trajectory is computed several times using either (a) a fixed step size for each integration but reduced for succeeding integrations, e.g., h, h / 2 , h/4, or (b) a variable step size based on a n error criterion which is successively tightened, e.g., E = lo+, lop9. The number of digits of agreement in the position and velocity is then taken as a n indication of the accuracy of the computation. As the step size is reduced the truncation error becomes smaller but the round-off errors become larger. There is therefore an optimum step size for a given method of numerical integration. I n the absence of an absolute standard it is
SATELLITE ORBIT TRAJECTORIES
37
difficult to detcrmine this optimum step sizc. Moreover, thcrc arc ccrtain systematic errors, such as thosc caused by cancellation, which are not uncovered by simply reducing tho step size. Thus it is possible for two successive integrations to agree to N significant digits over a broad range of time values and yet the results may both be correct to somewhat fewer significant digits. Thus the consistency check does not provide a positive test of accuracy, although it does give useful information especially when it can be ascertained that round-off and cancellation errors are not major factors. The h2 extrapolation method can also be used to obtain improved accuracy. Thus, if a pth order integration method is being used, and if two integrations at fixed step size h and h / 2 are available, the formula
will yield an extrapolated value for the dependent variable 'y a t time t. This extrapolation formula is obtained under the assumption that the coefficient c in the truncation error O(chp) is constant over an interval and that the error is completely truncation. If these assumptions are approximately fulfilled, the extrapolated value will have considerably more accuracy than can be obtained by continuing to reduce the integration step size, primarily because round-off errors will affect the results for very small step size. This is not recommended as a general procedure since it involves the storing of all dependent variables at each of the desired times, but it is useful when good accuracy using a single precision routine is required. 5.3 Double Precision Operations
For an idealized problem in which all constants are assumed known exactly, a completely double precision program will allow the use of integration steps so small that truncation errors will be negligible without incurring the danger of round-off error accumulation. On idealized problems involving reasonable time spans, a double precision program should be able to provide an accurate standard against which t o test single precipion programs. The use of double precision programs for the integration of real orbits is not recommended, however. Apart from the fact that double precision operations are very expensive in machine time, the physical constants, the initial conditions, and the planetary coordinate are seldom known to more than six significant figures. The addition of dummy digits to these constants will certainly not lead to increased accuracy. Except for some reduction in round-off error, double precision programs have very little advantage over
38
SAMUEL D. CONTE
single precision programs in producing significantly more accurate results on real problems. 5.4 Use of Integrals of the Motion
For some problems an integral of the motion can be used as a check on the solution. Thus for the two-body problem the energy integral is constant, and for the motion of a satellite about an oblate earth the vertical component of the angular momentum is invariant. These integrals are usually stable in the presence of errors so that errors in the position and velocity cancel when evaluated for the integral. A physical explanation of this lies in the fact that the major portion of the error is along the line of motion rather than perpendicular to it. Thus, the major error is accounted for by a time discrepancy so that the integral is actually a t a point on the orbit but a t a different time. Thus even though the integral is constant to N significant digits the actual position and velocity may be considerably worse. The energy integral does provide a good negative test-the method is generally poor if the integral does not remain constant. In some cases the energy integral has remained constant to seven digits, while the position coordinates were correct to only two digits. Of course, these integrals cannot be used when nonconservative forces are present, but even when they do apply they provide a very inconclusive test. 5.5 Comparison of Different Methods
Agreement between two distinct formulations and if possible two distinct methods of integration provides probably the best indication of accuracy for an arbitrary orbit. Thus if an Encke integration and a Cowell integration agree a t all points to seven significant digits one is reasonably safe in assuming that results for the theoretical orbit are correct to that many digits. This conclusion is based on the assumption that round-off is a random process and that systematic errors such as cancellation are different for different methods. The probability of such errors causing identical effects over a large number of points is almost surely very small. Of course, agreement among three distinct methods provides an even better indication of accuracy. For groups which are heavily engaged in the problems of orbit prediction, it is recommended that a t least two distinct methods be available for orbit integration. 5.6 Estimates of Accumulated Truncation and Round-off Errors
Theories have been developed which make it possible to obtain estimates of the accumulated truncation and the accumulated round-off error a t a given time. If these estimates were available then it would be theoretically possible to choose an integrating step which would minimize the sum of
39
SATELLITE ORBIT TRAJECTORIES
these errors and a t the same time an indication of the over-all accuracy would be available. One such theory is described by Kopal [26] and is applied specifically to the satellite problem by Garrett et al. [ I d ] . Briefly the method proceeds as follows: Let the system of equations to be solved be
9%= f,(Y*, . . . , Yn)
(i = 1, 2,
. . . , n).
(5.1)
Let the system adjoint to the variational equations for (5.1) be
x,
= -
2 a,&)ha
u=l
i = (1, . . . , 1 2 )
(3.2)
where = (af,/dy,). The system (5.2) is solved n times under n sets of initial conditions. If s,(T) represents the error in yz a t time T , the total truncation error will be given by
z,(T) =
J' k5 b k ( t ) X % L ( t ) dt =l 0
(i = 1, . . . ,n)
(5.3)
where b k is the local truncation error a t time t, h , k ( t ) is the solution of ( 5 . 2 ) beginning a t the time t = T with initial conditions
h&(T)= 6ak = 1 =0
(i = k), (i # k),
the functions b k ( t ) are estimates of the local truncation error which for a multistep integration method will have the form Chp+'y(p+')(t). The method requires a forward integration of (5.1) to obtain and store the position and velocity at equally spaced time steps t = kh, k = 0 , 1, 2 , . . . . These are 1, at the correused to compute y(pfl), the derivatives of y of order p sponding times, which are also stored. The adjoint equations (5.2) are then solved backwards in time using n sets of initial conditions corresponding to the identity matrix. With the values of h& so obtained and the estimates of bk(t), the integral in ( 5 . 3 ) is evaluated by quadratures for each of the z,(T). The result will be an estimate of the total truncation error in the position and velocity at time t = T . A similar procedure can be used to obtain the accumulated round-of€ error where now the bk(t) will represent the round-off error a t time t. This procedure is clearly very cumbersome, it requires extensive storage, and it is very expensive. Moreover, several approximations and assumptions must be made concerning the magnitude of the local truncation error and the distribution of the round-off errors, and the approximations to the derivatives must certainly be poor. It is not clear whether the error bounds so obtained are realistic. This method has been programmed for the Cowell method [see 141 and some results are given. A good evaluation of the usefulness of this technique as applied t o the orbit problem is not now available. Because of its complexity
+
SAMUEL D. CONTE
40
it will probably not gain wide acceptance, nor can it be strongly recommended. A simpler and more realistic theory for estimating accumulated truncation and round-off error has recently been proposed by Henrici. Beginning again with the system (5.1), one next derives the associated nonhomogeneous variational system n
+ b,(t)
x, = 1 U J , 3=1
(i = 1, . . . , n)
(5.4)
where again at3(t)= [8fZ(t)/8y3], and b,(t) are estimates of the local truncation error for the method of integration being considered. The system (5.4) is solved simultaneously with the system (5.1) under the initial conditions X,(to) = 0. The coefficients a,(t) are evaluated along the solution curve obtained from (5.1). The solutions X,(t) are proportional to the "discretization" or accumulated truncation error in y % ( t )at time t. This process is a t once much simpler than that described by Kopal, much less time consuming, and more convenient for machine computation. Moreover, it is based on a firm mathematical foundation. Indeed it is shown by Henrici [18] that if a pth order multistep integration method is being used so that b,(t) = -Cyy+1)(t), and if e ( t ) represents thc error at time t, then asymptotically as h -+0, e(t)
-
(5.5)
hpX(t)
where X(t) is the solution of (5.4). For the n-body problem the matrix (uJ is not difficult to derive. Indeed a t many installations the variational equations (5.4) are also required to obtain the partial derivatives of the vehicle's position and velocity with respect to initial parameters. This use of the variational system for this purpose will be described in Section 6. The b,(t) must in general be obtained numerically by differencing the solutions yz(t) obtained from (5.1). This theory for (5.1) can also be extended to a consideration of round-off errors following the method outlined in Section 3 but this will not be pursued here. It may be worthwhile to illustrate this approach to determining the discretization error with a simple example. Written as a first order system the equations of motion for a two-dimensional elliptic orbit are: j,
n
=
=
Ay
[
0
-fi/,."
0
0
where r
= dyl2
1 0 0 0
0 0 0 -p/rJ
Sl '1
(5.6)
0
+ yZ2,and y = (g1, y2, y3, y4) is a vcctor of position aiitl
41
SATELLITE ORBIT TRAJECTORIES
velocity of the vehicle in a rectangular coordinate system. The nonhomogeneous variational system is
i=BA+b 1 B=
-.[$-y] 0
O1
0 P
m
0
r5
0
0
where h is the vector of errors corresponding t o y. If a fourth order multistep method of integration is being used, then the essential components of the vector b will be (y1v(t), yyzv(t>,ySv(t), y p ( t ) ) . Normally b(t) will have to be obtained numerically since the solution y(t) will not be known analytically. If, however, we change the time scale in (5.6) so that p = l and if we prescribe the initial conditions y(0) = (1, 0, 0, 1) then (3.6) leads t o circular motion for which an explicit solution is known. The solution is given by y ( t ) = (cos t, -sin 2, sin t, cos t ) and the vector b(t) by (sin t, cos t , -cos t , sin t). The solution of (5.7) is then h(t) = (t sin t , t cos t, - t cos t, t sin t). The accumulated truncation error e(t) a t any time t is thus seen to oscillate with a period of 27r and t o grow linearly with time. Its numerical value can be obtained from the formula
e(t) = -ch5h(t), where h is the iiitegration step size. For the Adams-Moulton fourth order method c = 19/720. From this formula one can decide on the proper step size for a required accuracy. If for example we require seven decimal places of accuracy in the solution y ( t ) a t the end of the first revolution, then for t = 27r the maximum error mill be 19 E = -h4 X 271. 720 a i d for this to be less than 5 x lo-* will require a step size h of approximately 1/40 or about 240 integration steps. If a multistep method of the Gauss-Jackson type is used with local truncation error of order h9 and if c is assumed t o be on the order of 1/1000, then approximately thirty-five integration steps would be required for the same accuracy. These estimates of course neglect round-off error effects. If an odd order integration method is used so that locally the error is O(h2*f2)for the circular orbit problem, the propagated truncation error will behave like ch2”+’t2cos t as compared with ch2%cos t for an even order
SAMUEL D. CONTE
42
method. It thus appears that for sufficiently large times there is no advantage in choosing say a fifth order method instead of a fourth order method. To what extent this situation carries over to the n-body equations is not known but the conjecture that it may actually hold raises interesting possibilities about the choice of integration methods. 5.7 Numerical Comparison of Special Perturbation Methods
In this section we give the results of a numerical study conducted at STL whose objective was to yield quantitative estimates of the computational efficiency of the three special perturbation methods discussed in Section 2. The idealized orbit selected for the study is the one described in Section 4. This is an earth satellite orbit in which the only perturbation force included is that due to the second harmonic in the earth's gravitational potential. The orbit is defined by the initial elements: a = 1.5 earth radii, e = 0.2, i = 45", D = w = M = 0. The period of the unperturbed orbit is 155 min, perigee distance is 800 miles, apogee distance is 3200 miles, and the energy integral E has the value
=
- 0.0018451686 (e.r./min)2
In rectangular coordinates the initial values are x,,= 1.2 e.r., YO = zo = 0, 0, Ijo = d a ,zo = d a with p = 0.0055302633 (e.r.3,'minZ) and
XO =
J
= 0.001638. Since an analytic solution t o this problem is not known, it was first necessary t o obtain a standard against which to check the integrations. This standard was provided by a completely double precision Cowell program using the second-diff erence integration scheme (3.10). The accuracy attainable on an orbit of this type was checked by integrating the unperturbed orbit ( J = 0 ) and comparing the results with the known analytic solution. Uniform agreement to one or two digits in the eighth significant figure was obtained. For the perturbed orbit, the results provided by the standard are correct to a t least seven significant figures, an accuracy more than adequate for this study. Single precision, floating point programs for the Cowell, Herrick, and Encke methods were then run on an IBM 7090 and compared with the double precision standard. Great care was used to insure that the physical constants and the initial conditions were identical in all programs. The following table gives the method of integration used, the local truncation error criterion, the number of integration steps required, the computing
SATELLITE ORBIT TRAJECTORIES
43
TABLE11. NUMERICAL RESULTS-SPECIAL PERTURBATION METHODS
Formulation
Method of integration
Error criterion
Number of steps
Computing time (min)
Maximum AT (ft)
Cowell Encke Herrick
Gauss-Jackson Gauss-Jackson Adams-Moulton
1 X 10-lo 7 x 10-lo
10,200 6395
5.75 5.31
800 1700 400
5 X 10-lo
(7000)
11.45
time for 64 revolutions, and the maximum error in the distance Ar over the 64 revolutions. The Adams-Moulton and Gauss-Jackson methods are described in Section 3. The former is a fourth-order method, the latter, a sixth-order method and both are of predictor-corrector type with variable step size capability. For each formulation several runs were made with successively tighter error criteria and the most accurate of these selected for the comparison. To put it differently, the error criterion for each of the programs is optimum and the results obtained are the best possible with a single precision program. The Cowell method required almost twice as many integrating steps as the Encke and Herrick methods but only about 15% more computing time than the Encke method. The relatively large computing time required by the Herrick method is partially accounted for by the fact that the Adams-Moulton formulas are of lower order than the Gauss-Jackson formulas. Since the latter will allow perhaps twice as large an integrating step for the same accuracy, the adjusted computing time would be about six minutes or only slightly more than for the Cowell method. In general, there appears to be no large differential in adjusted computing time among the three methods. Relative to accuracy the Herrick method yielded the best results and the Encke method, the worst results, although again there appears to be no order of magnitude preference for any one method. The favorable showing of the Cowell method is accounted for largely by the conscious effort to reduce round-off error growth by the use of double precision accumulation. As mentioned earlier, both the Encke and Herrick methods are considerably more complicated programs and require much more careful numerical analysis. In particular, inaccuracies introduced in the Encke method during the rectification process probably account for most of the errors. In the results given here, four rectifications were used. Rectifying more frequently, or less frequently, led to poorer results. It is entirely possible that the errors in the Encke results can be reduced by an even more careful analysis of the operations involved. For this type of orbit there appears to be very little reason to prefer Encke's method to Cowell's method.
44
SAMUEL D. CONTE
A more detailed comparison relative to accuracy is contained in Graphs I-IV where the errors in position, mean anomaly, energy integral and semimajor axis are plotted a t selected times on the 20th, 40th, and 64th revolutions. All methods gave exceedingly good results on the first few revolutions and hence these errors are not included. Graphs I and I1 show that the Encke errors are growing a t about four times the rate of the Herrick errors and two times the Cowell errors. A comparison of Graphs I and I1 also shows a strong correlation between position and mean anomaly errors. Indeed for all methods over 90% of the position error in magnitude and direction is accounted for by the mean anomaly error; i.e., the error is largely along the path of the motion. We observed earlier that this phenomenon applied to general perturbation methods as well. From these results, we may conclude that the dominant errors in position arise from accumulated truncation or approximation errors which are systematic in nature rather than from round-off which is essentially random in nature. Graph 111 is a plot of the errors in the semimajor axis for the Cowell and Herrick methods. The Encke results are omitted because they are more erratic but generally they are of the same order of magnitude. This plot, as well as those for e and i, which are not included here, show that the geometrical elements a, e, i can be more accurately determined than the position. Thus, for the Herrick method, the absolute value of the maximum error in a is 3 X lo-’ ex., while the maximum error in the position is 2X ex. Graph IV is a plot of AE, the difference between the known energy integral and that obtained from the integration. It will be seen that for all methods the energy E remains constant to a t least seven significant figures while the position coordinates are correct to only four or five significant figures. This observation supports the statement made earlier that the constancy of a known integral of the motion is a poor positive test of accuracy. The results presented here may be assumed to be representative for earth satellite orbits in which the dominant perturbative force is that due to oblateness, and which avoid the exceptional cases of zero eccentricity, zero inclination, and critical inclination. The results should not be assumed t o be typical for lunar or interplanetary trajectories where the dominant forces are different in nature. Indeed, as observed earlier, the Encke method does seem to have a clear advantage over the Cowell method relative to speed on lunar flights. While this study is by no means complete, it does give an indication of what one may expect in everyday use of machine programs based on special perturbation methods.
SATELLITE ORBIT TRAJECTORIES
0
a
X
0
45
X
0
a
X
0
a
X
0
X X
0 0
X
0
X
0
X
0
a!;a
X
u
'r o x a O X a o x a
a
s
k
G o % I
0 (0 I
"
0
w
2
W
* 00 0 I d
0
*
N
OI
N
0
0
0 0 0
0
0
0
0
0
9
9
0
9
at
SAMUEL D. CONTE
46
0
0 0
X
0 0 0 0 0 0
0 0
0 0 0
0
-If
t 0.6
-
-0.2
-0.4
-0.2
0
t0.2
I
l
l
X
l
&
I
I
I
6220
//
//
//
I 9760
I
I
I
x
1 1 T (MIN.) 9940 I
=
rn
5
rn
-I
P
A
2940
4/ I
-
-
A & 6040
l
a l
I
l
6220
1
&a
x
GRAPH3. Semimajor axis errors Au. GRAPH4. Energy integral errors AE.
// "
1 3120
A
x . x
//
I
9760
A
n
I
Y
x x x
I
A
I
I T(MIN.) 9940
n
xx
P
v
v,
rn
6040
-
//
"
1 3120
n
Q
3
I 2940
&
X
-
b/
t0.4
-0.6
-0.4
-0.2
0 .
t0.2
$0.4
48
SAMUEL D. CONTE
6. Orbit Determination and Tracking Methods
Once a satellite has been launched, it is important to determine accurately the actual orbit of the satellite. A preliminary orbit determination is necessary for obtaining steering information for the nearest observing station and in addition for deciding on the amount and the timing of a corrective thrust so as to achieve a certain objective. A more definitive determination would be needed to obtain improved information about certain astronomical and geophysical data. The basis for improved orbit determination rests upon observational data which is made available during the course of the flight. The observing stations may have optical, radar, or Doppler equipment; the observations may take the form of angular information, range from the observing station to the satellite or range rate. The observations are of varying accuracy, and reliability. In general optical observations are more accurate than radar observations and moreover are highly reliable. Optical accuracies on the order 0.2" of arc are attainable. Optical devices cannot always be used however under certain atmospheric conditions and they cannot measure range. Electronic devices include pulsed radar systems, radio interferometers, and Doppler systems. Range and range rate can typically be determined to a few parts in a million. The observational data will undergo processing both a t the observation site and at a central computational site. The on-site calculations may include corrections for instrumental or environmental errors, and changes in coordinate systems. It is advisable to keep the on-site reductions to a minimum, however, and to rely heavily on a central computational facility to make the necessary transformations and corrections. The central facility should be responsible for the following functions: (1) receive and transform early data; ( 2 ) edit the data for systematic or accidental errors; (3) determine a preliminary orbit; (4) transmit quick look data to the receiving stations; ( 5 ) as more data is received, determine an improved orbit using differential corrections; ( 6 ) determine a definitive orbit after sufficient data has been obtained. As indicated above it is customary to distinguish three phases of orbit determination : preliminary, improved, and definitive. During the preliminary phase information may be limited. For a friendly satellite one has available the nominal precalculated burnout conditions and trajectory as well as launch site observations. Abundant data is usually available and this information is sufficient to apply differential corrections immediately. In the case of a foreign satellite very incomplete data of various types and varying accuracy may be available. A variety of methods are available for preliminary orbit determination based on the type of information given,
SATELLITE ORBIT TRAJECTORIES
49
among these being those associated with the names of Laplace, Gibbs, Gauss, and Herrick. Baker [S] gives an excellent summary of these methods, but the variations in these approaches will not be pursued here, As more data is obtained it will be possible to determine an improved orbit from which ephemerides can be computed for that portion of the satellite’s life during which the satellite is being tracked. I n addition to station ephemeris print outs, improved orbits are useful in determining salient characteristics of the flight such as its lifetime and period and also in providing trajectory information which may be needed if later corrective thrusts are to be applied. A definitive orbit is one which fits best all of the observational data. It can be determined at leisure. Its primary function is to lay the foundation for the proper interpretation of physical experiments and for more accurate determination of geophysical and astronomical constants. Definitive orbits have been used to improve our knowledge of the shape of the earth, the atmospheric density profile, and the astronomical unit. In an attempt to determine the astronomical unit at Space Technology Laboratories, some 20,000 observations based on the Pioneer V satellite were processed over a period of six months before a definitive orbit was obtained. Differential corrections are indispensable to improved and definitive orbit calculations. This section will be concerned primarily with a description of the method of differential corrections as applied to orbit determination. Theoretically an orbit is completely determined if 6 independent initial parameters are given. The objective of a differential correction process is to determine these initial parameters so that the best fit possible is obtained between the subsequent trajectory based on these parameters and the observations. In addition to these injection parameters, differential corrections may also be used to determine constants such as the drag coefficient and the solar parallax, and even to refine radar station locations. In describing the process we shall be concerned primarily with the determination of the injection (burnout) parameters. 6.1 Editing the Observational Data
The goodness of the determination will depend largely upon the accuracy of the observations. It is important to discover and eliminate any data which is grossly in error, especially early in the flight since a distorted fit may result, when only a small number of observations are being used. The errors may be accidental in nature, such as transcription errors, or more systematic errors such as arise from faulty instrumentation. The editing is sometimes performed by the orbit analyst by inspection of the data or hy passing a free hand curve through the points. However, this is generally
50
SAMUEL
D. CONTE
too slow during the early stages of a flight and will certainly not uncover systematic errors. A data editing routine which pre-processes the data is recommended. A brief description of such an editing routine follows. Let (ti, yi) (i = 1, . . . , N ) represent a discrete set of observations y; of a particular type at times t ; over one pass from a given station. The first differences of the yi are examined and the points contributing the largest such differences are determined on a statistical basis. The local pattern configurations of these points are then examined and some of these points are rejected on the basis of inconsistency. A regression analysis is then used on the remaining points to obtain an average regression function m(t). Now the original data is compared with the estimates of m(t) and the residuals are obtained as well as the variance 8.Those data points which lie outside of a specified band width from m(t) are rejected as outliers. Of course one must use care to insure that good points are not rejected. While such a routine cannot hope to detect all of the errors, it will certainly eliminate all of those which are likely to distort the fit. More subtle errors such as bias errors can probably be detected from statistical evidence after a fit has been made. A detailed description of such a routine, which has been successfully used at STL, is given by Aroian and Robison [ l ] . 6.2 The Least Squares Problem
The differential correction process which is commonly used to determine the injection parameters for a satellite is usually justified by setting up a statistical model and making certain assumptions concerning the distribution of missile and radar errors [%,491. We shall content ourselves with a heuristic approach with the objective of stressing the basic programming and computational techniques and problems. The trajectory of a satellite is completely determined when the burnout position and velocity are specified. Several coordinate systems are available for specifying the initial values among the more common being: (a) (XO,yo, 20, &,y o , i o ) ; inertial rectangular coordinates (see Fig. 1); (b) (a,e, i, Q, w , 7 ) ; instantaneous classical elliptic elements at time t o (see Fig. 2) ; (c) (T, a, 6, v, p, A ) ; local spherical coordinates at time to with T defined as the distance from the origin of the coordinate system to the satellite, a the right ascension and 6 the declination of the position, v the magnitude of the velocity, p the angle between the velocity vector and the local vertical and A the azimuthal angle measured from north of the velocity vector (see Fig. 1). While the corrections may be applied to any of these sets of initial values, there are distinct differencesamong them relative to computational efficiency and convergence properties. These differences will be discussed
SATELLITE ORBIT TRAJECTORIES
51
FIG.1. Inertial rectangular and local spherical coordinates.
later. It is convenient to pursue a general treatment here. Thus let p = ( p l , . . . , ps) denote any set of six independent burnout (or injection) parameters. Let v = v(t, p) denote a radar observation from any station (e.g., elevation angle El azimuth A , range R, range rate I?). If the time t and any value of p are given, the equations of motion can be integrated and v(t, p) computed from the trajectory information and from analytic expressions for the type of observation. I n a typical situation an approximate value po of the true burnout parameter p mill be known, either from the nominal prelaunch conditions or from a preliminary orbit determination. We will also have an observed value of v which in the absence of error would be the true value of v. The object of a differential correction procedure is to determine the correction vector q which must be added to the approximate value po to obtain the true burnout vector p, i.e.,
P or in terms of components
= PO
+ q,
SAMUEL D. CONTE
52
The radar coordinates are then expanded in a Taylor’s series about the computed value u(t, PO). If po is suffkiently close to p, terms of order higher than the first in the corrections may be neglected. Thus we have
or 6
=
ao.q
where 6 is the difference between the true and computed values of v and ao is a vector of partial derivatives of v with respect t o the initial elements evaluated a t p = PO. Since there are six unknown corrections (91, . . . , 96) t o be determined we must have a t least six observations. In general there will be many observations available, say N >/ 6. We thus obtain the socalled equations of condition 6,
=
(i
a,O.q
1,.
=
. . ,N ) .
(6.4)
In general because of errors in the observations we will not know the 6, exactly. Instead we will have an approximate value 6’%.
+
6‘s = 6%
%,
where E, is a random error. The usual procedure is to determine the correction vector q so as t o minimize the weighted sum of squares of these errors, i.e., to minimize N
N
F(q) =
C a=1
u,e?
=
C a=1
w,(6’, - az0.q)2.
(6.5)
The solution of this least squares problem is obtained in the usual may by solving the system of equations
-aF= o dqj
( j = l ,. . . , 6)
or
Written more compactly, we have ATWAq
=
ATW6’
(6.7)
where A is an N X 6 matrix of partial derivatives, W is a diagonal matrix where elements are the weights wi, and ATWA is a symmetrical 6 X 6 matrix, and 6’ is a column vector of residuals. These are the so-called normal
SATELLITE ORBIT TRAJECTORIES
53
equations from which corrections q and a new estimate of the burnout vector p' are obtained. Using p' the trajectory is recomputed and new residuals v(t, p) - v(t, p') are obtained. Because of the linearity assumption, the residuals may not have been sufficiently reduced and it may be necessary to recompute new partial derivatives evaluated at p' and t o iterate the least squares solution until the residuals are sufficiently reduced or until no further change in the residuals is obtained. The best choice for the weights w z would be l/uiz where u,is the standard deviation of the errors in the observations. However, the ui are not known a priori. Normally one takes an estimate for wi and keeps it fixed while carrying out the iterated least squares solution. It has been suggested that since a posteriori estimates of the standard deviations u iare available after the first iteration that w i be modified accordingly and that this new set of weights be used in the next iteration. This procedure changes the fundamental nature of the least squares problem and it is not clear that this procedure will converge, or if it does converge, to what it will converge. Indeed it has been shown [29] that for some cases this procedure using where k is the iteration number will certainly diverge. I n general, even if the assumed fixed weights are only approximate but reasonable, and if po is close to p, the iterated least squares method will converge to a solution which is independent of the weights. In some cases, however, the choice of wi is critical. We shall indicate later another more sophisticated method for choosing the weights. The differential correction procedure will sometimes fail to converge or will sometimes lead to unreasonably large corrections. Mathematically this will occur when the normal matrix in (6.7) is ill-conditioned, or nearly singular, an effect which results when the determinant is small in a relative sense or when the ratio of the dominant eigenvalue of ATWA to its smallest eigenvalue is large. In cases like this small changes in the coefficients may lead to large changes in the solution of the system. Thus there may not be a unique solution within the accuracy desired. Failure of the iterated least squares procedure to converge is generally an indication that the initial estimate pa was not close enough to the true burnout vector to make valid the assumption of linearity on which the differential correction process is based. Among the reasons for nonconvergence or nonuniqueness of the solution are the following: (a) The initial estimate pa may be very poor. (b) The observations may be too few or concentrated on a portion of arc which leads to indeterminacy, as for example at perigee. ( c ) The observations may be too restricted in type, as for example angular data only from a single station. (d) The quality of the observations may be poor.
SAMUEL D. CONTE
54
In some cases when the data is not sufficiently separated to determine the burnout vector completely, it may still be possible to determine some of the initial parameters. The data may for example allow a good determination of the magnitude of the velocity v and the flight path angle /3 but not of the other elements. In such a case, one would carry out the differential correction process for only two corrections. Several techniques t o reduce ill-conditioning of the normal system and to improve convergence of the iterated problem have been suggested. One simple and effective technique is t o solve instead of the normal system (6.7) the system (ATWA D)q = ATWG (6.8) where D is a diagonal matrix whose elements are chosen so as to restrict the size of the corrections which can be made on any one iteration. By proper choice of the elements d j of D convergence can be forced. The difficulty with this technique is that it is not clear how the elements of D must be chosen so as to guarantee convergence and at the same time to make the convergence reasonably rapid. A technique which provides a systematic method for preserving linearity has been proposed by Morrison [28]. This method which makes use of the eigenvalues and eigenvectors of the normal matrix will be described here briefly. The objective of a differential correction process is to minimize a sum of squares of residuals F ( q ) which we assume in the form
+
F(q) = 1 1-4- b1I2 (6.9) where the norm of a vector w of N components is defined by I[w][2= CP w2. This leads to the normal system (6.7). Instead of solving this problem, we may ask for a vector q which will minimize F(q) under the constraint that the corrections qj do not exceed certain bounds. The solution of this problem as developed in [28] is as follows: Let B = ATA, c = A%, B1 = D-lBD-' where D is a diagonal matrix whose elements will be given later. The normal equations may be written: or
Since B1 is symmetric and positive definite it has a set of n ( = 6) positive eigenvalues X i and corresponding eigenvectors ui, i.e., BiUi =
xiui
(i = 1, . . . ,n).
(6.11)
BiU = UA where 0' is the matrix of eigenvectors (ul, . . . , u,) and A is the diagonal matrix of eigenvalues. Since UTU = I (6.11) becomes
SATELLITE ORBIT TRAJECTORIES
55
R1 = CAUT and the normal system (6.10) becomes
(UAUT)y = D-'c
UTD-lc = e UTy. It can then be shown that if we choose Az
where z
=
=
and hence the sum of squares of the residuals is actually reduced. Under the transformations given above and since l x j l Q 1, and therefore,
11ZlP
=
IlDqlP
n
In actual practice we proceed as follows: (1) First choose M i such that for Iqjl < M j linearity will be preserved. (2) Set d, = &/Mi. (3) Compute the normal matrix B and the vector C . ( 4 ) Find the scaled matrix D-lBD-l and D-lc. ( 5 ) Find the eigenvalues Xi and the eigenvector matrix U of B1. This can be done most efficiently with the Jacobi method, a routine for which is available in the SHARE library for IBM machines. (6) Find in succession the vectors z = A-lUT(D-'c), y = UZ and q = D-ly. (7) Also compute the diagonal of B-' using B-l = D-l(UA-lUT)D-l. The theory indicates that the iterated least squares problem will always converge if the bounds M j are chosen small enough. The theory does not indicate how these bounds are to be chosen. They are related to the bounds on the second derivatives of the radar coordinates but these are not usually available. It is not difficult to obtain reasonable values for the M i based on experimentation. Using for the initial parameters (r0,ao,a0, oo, Po, A,) a set of reasonable bounds are M I = 200,000 ft, M z = M 3 = 3 O , M4 = 1000 fps, Ms = M S = 3' where all angles are expressed in degrees, distance in feet and velocity in feet per second. This eigenvalue-eigenvector procedure requires perhaps 20 or 30 times as much computing time as the straightforward Gaussian solution of the
56
SAMUEL D. CONTE
system (W3-perhaps 1 sec on an IBM 709 computer. However, this is still a tiny fraction of the t.ime required to compute the trajectory and the matrix A of partial derivatives, and the increased information obtained together with the guarantee of convergence make the procedure well worth the additional time involved. A routine for the eigenvalue-eigenvectorsolution of the constrained minimization problem has been developed at Space Technology Laboratories and is available to interested parties [3O]. Using this procedure detailed information can be obtained about the nature of the difficulties encountered. In particular correlation effects can be easily discovered. By examining the eigenvectors and eigenvalues, one can say which elements are well determined and which poorly determined and one can obtain estimates of the standard deviations of the corrections from the standard deviations of the radar errors. 6.3 Stagewise Differential Corrections and Shifting Parameters
After all of the available observations have been used to determine the best set of trajectory parameters, new observations may become available and it is reasonable to expect that this new information will lead to further improvement in the trajectory parameters. One could read in all of the data, both new and old, and perform a least squares fit. However, since this is wasteful of machine time, it is desirable to read in only the new data to obtain modified parameters. This problem has been discussed by Swerling [43! and others. In treating this problem, it is useful to consider a statistical model for the tracking of space vehicles. In the approach described in Section 6.2 the errors in the observations are assumed to be independent and normally distributed with mean zero. Under these assumptions the matrix W is the inverse of the covariance matrix of the observational errors and the inverse of the normal matrix (ATWA)-l is the variance-covariance matrix of the estimates of the corrections due to these errors in the observations. The diagonal elements of (ATWA)-l are the variances-i.e., the square of the standard deviations-of the components of the correction vector and the off diagonal elements are the covariances. Now let p' be the best set of initial parameters obtained from all of the old observations and let a,' be its covariance matrix. Let 6~ represent new residuals based on the new observations, let q, = p - p' be the desired corrections to the latest parameter estimate p' and let AN be the matrix of partial derivatives of the new observations evaluated for p = p'. One can then solve the system of equations (6.12)
for the corrections qAy.This proccss can be repeated as often as desired. For
SATELLITE ORBIT TRAJECTORIES
57
handling a large number of observations it is convenient to batch them into groups of say 50 to 100 observations and apply (6.12) to these groups successively. After tracking an earth satellite over many revolutions or over a fairly long arc of an interplanetary flight, it may be desirable to choose a set of parameters at some new epoch t l a t which to make the corrections. One reason for this is that the normal matrix becomes increasingly more illconditioned if corrections are made a t time to when data is used over too many revolutions. Another reason is that the integration of the equations of motion from launch time is time consuming. At the same time one wishes to preserve some of the information gained from the earlier least squares fits, although the new observations should be given more weight than the old. At any stage of tracking we have an estimate pO(to)= (p?, . . . , pG0) of the true burnout vector p(4) and the associated covariance matrix u(to)for parameters a t time to. From integrating the trajectory based on pO(to)we also have an estimate po(tl) = (plo(tl), . . . , p a ( t 1 ) ) of the parameters a t time tl. If we wish to shift to a new time tl a t which to make succeeding corrections we must obtain the covariance matrix associated with the normal matrix a t time tl. This may be done as follows. To first order terms we have p(to) - pO(to)= S[P(tl) - PO(tl)l (6.13) where S is a matrix of partial derivatives whose elements arc
The matrix puted from
X is not immediately available but its elements may be com(6.14)
where x = ( 5 1 , 5 2 , 5 3 , 5 4 , s5,ss) is the vector of missile position and velocity. In symbolic matrix form (6.14) is (G.15)
The matrices are evaluated for pO(to).The elements of Q are ordinarily available since they are needed for the differential correction procedure and the elements of P can be obtained directly since x(t1) is known explicitly as a function of the parameters p. Then the covariance matrix a t time tl is obtained from (6.16) U+(tl) = ST(t0)u-1( to)S(to) .
SAMUEL
58
D. CONTE
The matrix u-l(tl) is then added to the normal matrix obtained from observations obtained after time tl and succeeding corrections are made to the parameters a t time tl. 6.4 The Partial Derivatives
The most time-consuming portion of any differential correction procedure is that required for obtaining the partial derivatives of the radar coordinates. The method by which these derivatives are obtained is therefore of considerable importance even though extreme accuracy is not necessary. Three methods for obtaining these derivatives will be described.
6.4.1 The Variant Method Letting v(t, p) = v(t, pl, . . . , pa) denote as before any observation and the nominal value of the initial burnout parameter we must compute ( d ~ / d p j ) ~ =To ~ o .obtain an approximation to av/dpl for example we niay form the different quotient. PO,
*I
aPlP=P
N
v(t, PI' -I- Apl0jPzO, *
* 9
-
v(t, PI', . . . 9
P6').
&I'
This requires running two trajectories with the parameter pI0 perturbed by an amount Aplo.To obtain all six of the partial derivatives requires seven trajectory computations in all, usually performed simultaneously. The amount of the increment Apjomust be chosen carefully to obtain maximum accuracy. If it is chosen too small, accuracy will suffer from loss of significance through subtraction of nearly equal quantities; if chosen too large accuracy will suffer because the difference quotient will be a poor approximation to the derivative. The best value of the increments to be used will depend upon the particular parameter and upon the coordinate system being used, and should be determined by experimentation. The variant method suffers from some obvious disadvantages. The computation of seven trajectories is very slow and leads to awkward computational procedures, including the necessity of storing large amounts of information. This is particularly true when real time operations are involved. Moreover, the accuracy attainable is a t best of low order because of the use of the first order difference approximation and also because of accumulated round-off and truncation errors coupled with loss of significance through cancellation. On the other hand, the variant method is simple in concept, it requires very little additional programming, and it can be applied readily to the determination of any constants such as the solar parallax, the drag coefficient, etc.
SATELLITE ORBIT TRAJECTORIES
59
6.4.2 The Variational Method The derivatives of the radar coordinat.es depend upon the variations of the solution as a function of the initial conditions. If ( 2 , y, z, 5,g, S) gives the position and velocity of the vehicle in an inertial rectangular coordinate system and pa = (p?, . . , p6') a set of independent initial parameters we wish to obtain the following matrix of partial derivatives at any time t.
.
-
-ax .
.
2%. ap,o
.
aplo
.
.
.
ap60
.
.
.
.
.
a~
.
-app ai.
...q ...*I
(6.18)
6 0
One way of forming this matrix is to use the variant method described in Section 6.4.1. However, a more direct approach is to solve a related system of variational equations. If the equations of motion are assumed to have the form 2 =
f(z, Y,z , t )
Q
=
2
=
g(x, Y, z , t ) h(x, y, 2 , t )
then the variational equations corresponding to one component of the burnout vector, say pk are
i = fzE + full + fir
+ + h d + h,q + h d
9 = SUE
5
=
9Ytl
szr
(6.19)
cients in (6.19) are to be evaluated upon the unperturbed or nominal solution. The initial conditions to be used in solving (6.19) are
If in particular p is the set (20,yo, zo, Lo, go,io)and if pk is one component of p, say 20, then .$o = 1, go = 70 = 7jo = pa = fo = 0. For each fixed value of pk we solve the variational equations (6.19) under the appropriate conditions and we obtain one column of the matrix (6.19). To obtain the full matrix of partial derivatives (6.18) the system for (6.19) must be solved
SAMUEL D. CONTE
60
for each variation with initial conditions given by the 6 X 6 unit matrix when the parameters p k are the initial rectangular coordinates. In all a set of 42 first-order equations must be solved. Fortunately the coefficients in (6.19) are all evaluated for the same nominal values and since the six sets of variational equations are solved simultaneously, the over-all computing time required is about two or three times that required for the basic equations of motion. This method is therefore at least twice as fast as the variant method and is moreover considerably more accurate, the accuracy being comparable to that of the basic integration itself. In addition it is computationally more efficient since all the information required is available simultaneously. It should be noted that the solutions of the variational equations are also useful for determining miss coefficients, for setting the requirements for guidance accuracy, and for determining changes in initial conditions which result in impact or in meeting certain terminal conditions. To illustrate the form of the variational equations we derive them for the case of a vehicle moving under the influence of an oblate earth and n spherical bodies. The equations of motion as specialized from (2.1) and including only the second harmonic in the Earth's gravitational potential are
with similar equations for y and Z and where defined in Section 2. Letting
p,
mi, m, ri, pi, and J' are
the variational equations are:
(;) (
P,, - Q
= 3p
P,,
+ J'(x2S - U )
+ ZyJ'S
P,, 4- xzJ'T
+ + -+ yzJ'T
P,, XYJ'S P,, - Q J'(g2S - V ) P,, P,,
+ +
xzJ'T P,, xzJ'T P,, - Q f J'(z2T - 3U) where
SATELLITE ORBIT TRAJECTORIES
61
and all other elements of the matrix in (6.21) are obtained from symmetry. This matrix is of course somewhat more complicated if perturbations due to drag and higher order oblateness terms are included. When the burnout parameters are other than the rectangular s-t (TO,YO,Zn, lo,$0, So) the initial conditions for the variational equations will be different. Since our personal preference for reasons to be given later is the local spherical coordinates (To, ao,60, vo, Ao,Po) it may be worthwhile to exhibit the initial conditions for each of the variations in this coordinate system. The equations relating the rectangular and spherical coordinates are (Fig. 1): xo = rg cos a0 cos a, yo = ro cos 6o sin a0
zo
=
20
=
sin 6 0 vo[(cos 0 0 cos 6o - cos A , sin Po sin 6 0 ) cos a0 - sin A0 sin Po sin ao] yo = ~ ~ [ ( c Po o scos - cos A , sin Po sin So) sin a. sin A0 sin Po cos a,] t o = eo[cos A0 sin Po cos 60 cos Po sin So] TO
+
+
From these we arc to derive
where ph is any one of the set we have
(To,
ao, SO,
Aa, Po). For the r0 perturbatio:is
to,
(6.22%)
To For the
For the
to
= -To
a0 perturbations
60
sin
=; :
=
0.
we have
'$0
= --yo;
719
=
lo
= 0;
xo;
perturbations: cos a,;
to
go =
-zo cos a.
go =
-yo
?jJ = X o
to = 0.
(6.2213)
SAMUEL D. CONTE
62
For the vo perturbations : = 0;
go = io/vo
70 =
0;
q o = yo/vo
lo
0;
to= io/vo.
40
=
(6.22d)
For the A0 perturbations: =
0;
70 =
0;
40
= vo[sin A . sin 6o cos a.
- cos A, sin aO]sin Po
+
GO = vo[sinA0 sin 60 sin a. cos A0 cos a,] sin Po (6.22e) t o = -vo[sin A, cos 60 sin P O ] .
r o = 0; For the Po perturbations: =
0;
io
70 =
0;
40 = -vo[(sin POcos 60
to
-vo[(sin
=
PO
cos 60
+ cos
cos p0 sin s ~cos ) a.
+ sin A0 cos Po sin aO]
+ cos AOcos POsin SO) sin
a0
(6.22f)
- sin A0 cos Po cos L Y ~ ] l o = 0;
50
=
cos p0 cos 6o - sin po sin s,)].
td(cos
In actual usage the radar observabions are referenced to a topocentric rectangular coordinate system (f, g, h , f , g, h) located at the station site. In terms of these the usual radar coordinates ( R = range, A = azimuth, E = elevation, k = range rate) may be expressed
+ 9 2 + h*)l/Z = R ( z , y, x )
R
=
(f2
A
=
cos-1
E
=
A
=
+ .f -
(SZ
s i r 1(h/R) 1
- (jj
R
g*)'/2
A ( z , Y,
2)
= E ( z , 7J,
x)
=
(6.23)
+ gg + hh) = A(z, y,
2, k ,
g, 2 ) .
The second equality indicates the functional relationship obtained when the topocentric coordinates are expressed in terms of the inertial rectangular coordinates (2,y, z, 2 , ?j, i ) .Explicit formulas for these are given by Hanson and Routh [16]. If the partial derivative of say the range R relative to any one of the initial parameters p = (r0,ao,So, v,, A,, Po) is desired one forms _ aEz -- aEz ax - + - A aR+at/ - aR ax ap 9.r ap au a p az a p where (aR/az, aR/ay, aZi/az) are obtained by differentiating Eqs. (6.23) and ( & l a p , a R / a p , a R / a p ) are obtained from the solution of the varia-
SATELLITE ORBIT TRAJECTORIES
63
tional equations corresponding to each component of the burnout vector p. For range rate which depends on velocity as well as position we must use
The variational method can be used effectively with any numerical integration scheme. It gives very accurate values of the partial derivatives, and leads to a computationally efficient method. A complete derivation of these variational equations for the N-body problem with oblateness and drag terms included is given in Smith [%I. 6.4.3 The Analytic Method Let a represent the vector of instantaneous elliptic elements (a, e, i, Q, w , T ) and let 8 0 : (ao,eo, io, Q0, wo, r 0 )be their values a t time t = to. Corrections are then desired to a".The equations of condition are of the form
where v = v(t, a) represents any observation a t time t and Av is the difference between the observed and computed observation. The observations may also be considered functions of rectangular coordinates, p: (x,y, x , f, g, 2). The partial derivatives can be obtained by the chain rule. Symbolically, letting a, aO, p represent any component of the vectors a, ao,p we have (6.24)
where the parentheses represent 6 X 6 matrices. In practice the matrix (aa/aao)which gives the change in the elements at time t relative to the initial elements is assumed to be the identity matrix, i.e., the elements are assumed to change so slowly that the effect on the partial derivatives is negligible. This assumption is reasonably good over a small number of revolutions of an earth satellite but will certainly be a poor approximation over many revolutions. However, the assumption is necessary if we wish to obtain completely analytic formulas for the partial derivatives. Under this assumption (6.24) yields for example
with similar expressions for the other partial derivatives. Since the radar coordinate v is known explicitly as a function of the rectangular coordinates p and since the rectangular coordinates are known explicitly as functions of the elliptic elements, the partial derivatives can be computed analytically and evaluated a t any required time. As might be expected the formulas
64
SAMUEL D. CONTE
are rather complicated. The formulas for the derivatives of rectangular coordinates relative to the elliptic elements were first derived by Eckert and Brouwer [ I 1 1 and more recently by Smith [39]. Similar formulas which take into account drag and oblateness are derived by Garrett and others [14l. The use of these analytic formulas makes unnecessary the repeated solution of the equations of motion or of the variational equations and leads to an unquestionably faster procedure for carrying out a differential correction process. Since it is necessary to neglect the effect of perturbations acting on the vehicle, and since secular effects are not taken into account, there is some danger that the formulas used may not be accurate enough over extended time intervals. The following conclusions may be reached concerning the three methods which have been discussed for obtaining the matrix of partial derivatives: (1) The variant method is computationally the least efficient. However, its simplicity and universality of application make it a useful tool in special cases. It is not recommended for the main problem of tracking-that of determining the burnout parameter. ( 2 ) The variational method gives the most accurate results and is very efficient computationally. However, it is complicated and must be changed with the force model. (3) The analytic method is the fastest computationally. It is particularly suitable for tracking near earth satellites although it.s accuracy is questionable over long time intervals. 6.5 The Choice of Burnout Parameter Coordinates
As noted above any number of coordinate systems are available for the burnout parameter vector. Moreover it is not necessary that the integration be carried out in the same coordinate system. Thus one may integrate in rectangular coordinates but make corrections based on a spherical coordinate representation of the burnout parameters. The three most commonly used burnout vectors are rectangular, elliptic, and spherical. Apart from considerations of convenience, there are apparently fundamental reasons for preferring one coordinate system to another. It has been observed that the coordinate system used affects the rate of convergence of the differential correction process and the accuracy of the determination, at least for certain orbits. The mathematical reasons behind this observation are not clear but they are apparently related to the conditioning of the normal matrix. This matrix appears to be more nearly orthogonal for instance when local spherical coordinates are used than when elliptic elements are used so that the corrections are more nearly independent in the former case. The use of elliptic elements for differential corrections will sometimes
SATELLITE ORBIT TRAJECTORIES
65
lead to difficulties for low eccentricity orbits or for critical inclination orbits. In particular, an attempt to determine the eccentricity e on nearly circular orbits may lead to negative eccentricities. There are, of course, many sets of initial elements on which to base differential corrections, and one might hope that among these there would be a “best” set although the mathematical criteria for such a set are difficult to establish. Aeronutronics [S] has recently proposed the use of the initial position vectors Uo, Vo (Fig. 2) which, it is claimed, is applicable without restriction to all types of earth satellite orbits. The vector Uois the initial radial unit vector with components ( x / r , y/r, Z / T ) and the vector Vo is the transverse unit vector These two vectors plus the semimajor in the orbit plane perpendicular to Uo. axis and the quantities e sin Eo,e cos Eo constitute the six parameters of the representation. NORTH CELESTIAL POLE
t
FIG.2. Projection of orbit on celestial sphere.
66
SAMUEL D. CONTE
Experience indicates that, for lunar or interplanetary flights, the rate of convergence and the accuracy attainable with differential correct.ionsare best when local spherical coordinates are used and poorest when elliptic elements are used. 6.6 Error Analysis in Differential Corrections
6 6 . 1 Sources of Error The estimate of the burnout parameters obtained from differential corrections is affected by three primary error sources: (1) the linearization process; (2) errors in the computations; (3) errors in the observations. It has already been observed that the iterated differential process may fail to converge if the linearity assumption is violated. I n Section 6.2 a method was described for solving a constrained least squares problem in which the size of the corrections is restricted sufficiently so that linearity does hold. This approach will generally lead to convergence even when the initial estimate of the burnout parameter is poor. Computational errors may arise from several sources including : (a) the basic integration for position and velocity; (b) the computation of the matrix A of partial derivatives; (c) the interpolation for the exact time of the observation; and (d) the solution of the least squares problem. Integration and partial derivative errors become especially serious when long time periods are involved. The secular error in the mean anomaly increases with time thus limiting the time over which accurate predictions can be made. The normal matrix will become increasingly more ill-conditioned as the partial derivatives decrease in accuracy. Interpolation for the exact time of the observation should be very carefully done, using double precision if necessary. The normal system of equations will usually be somewhat ill-conditioned and great care should be used in solving it. If the eigenvalues and eigenvectors of the normal matrix are desired, the Jacobi rotation method [SO] is probably the best available. In general effective numerical techniques are available for reducing the impact of computational errors so that these errors should not be dominant, except in the special case of tracking over long time periods. The more important of the observational errors are of the following types: (a) random errors; (b) bias or instrumentation errors in measuring range, elevation, azimuth, or range-rate; (c) errors in measuring the time of the observation; and (d) station location errors, particularly due to errors in the geographic latitude and longitude of the observing station. The observation errors are difficult to assess and are usually treated on a statistical basis. Some knowledge about the standard deviations of these errors and of their distributions can generally be obtained from experimen-
SATELLITE ORBIT TRAJECTORIES
67
tation. Relative to these errors two important problems can be formulated. The first problem is this: under certain assumptions about the distribution of these errors, determine their effect on the estimate of the burnout parameters obtained from differential corrections. The second problem is: using differential corrections determine the errors-e.g., bias or station location errors-for a particular station. Although the two problems are related, they will briefly be considered separately. A gross estimate of the errors in the corrections obtained from the least squares solution may be obtained as follows. Let q represent the vector of corrections, A the matrix of partial derivatives with respect to the initial parameters, and b the vector of residuals, i.e., the difference between the measured and the computed value of the observations. The normal system with normalized weights is ATAq = ATb arid the solution is q = (ATA)-'ATb. Let 6A represent the matrix of errors in A and 6b the totality of errors in the observations. Then the errors in the corrections 6q can be estimated to first order by 6q = (ATA)-'{AT(6b - 6Aq) (b - Aq)).
+
If the errors 6q are larger than q, then the iterated least squares process is almost certain to diverge. I n practice 6A and 6b will not be known very well so that estimates based on this computation will be very crude. An even simpler indication of the convergence of the iterations can be obtained by examining the covariance matrix (ATA)-l. If the elements of this matrix, for example, are large the estimates of q is probably poor and continued iteration will probably lead to divergence. If more is known about the distribution of the errors in the observations, a more detailed analysis of the errors in the estimate of q can be made following the statistical approach discussed in Section 6.6.2. 6.6.2 A Statistical Estimate of liJrrors We will consider here the first of thc problems posed in Section 6.6.1, i.e., under proper assumptions about the nature of the observational errors, determine the covariance matrix of the estimated corrections in the burnout position and velocity as determined by differential corrections. For simplicity we consider that the observations are over one pass from a single station. The observations are subjected to random, bias or station location errors. We make the following assumptions about these errors. The random errors are independent, normally distributed with mean zero. The bias errors are constant over each pass for each of the four observation types
SAMUEL D. CONTE
68
(R, A , E , R ) ; these are independent of each other, and the covariance matrix of these errors is given. The station location errors arise from imprecise knowledge of latitude and longitude, and affect only elevation and azimuth measurements; these errors are independent of each other and of the bias and random errors and their covariance matrix is known. The nominal values of the bias and survey errors are assumed to be zero. ) = 1, 2, 3 ) Denote the errors of the three types by &), d2),d3)and let U ~ G(i be their respective covariance matrices. If there are n observations then dl)will be an n X 1 column vector, e(2) is a 4 x 1 vector of bias errors, e(3) is a 2 X 1 vector of survey errors; uc(l)is a diagonal (n x n) matrix, u0w is a diagonal (4 X 4) matrix and ut(J)is a ( 2 x 2 ) diagonal matrix. The elements of these matrices are the variances which are assumed known appro-rimately from experimentation. If v is a typical observation and b the residual, an expansion to first 01 der terms in the residuals yields b
=
dv av cpi + €1" + c api at, 6
4
i=l
i=l
(2)E?)
dv + c aea (3) el3). 2
i=l
(6.24)
The partial derivatives dv/dpi are obtained by any of the methods described in Section 6.4; the partial derivatives with respect to bias errors dv/ae12) are either 0 or 1depending upon the type of observation; the partial derivatives with respect to location errors dv/dei3' are zero if the observation is range or range rate, while for elevation or azimuth they can be obtained either by: (1) evaluating known analytic formulas for these partial derivatives or ( 2 ) by the variant method, i.e., by numerical differencing of perturbed trajectories. The residual vector b will then have the form
b = Aq
+ I,(') + Bd2)+ Ld3)
(6.25)
where A is an (n X 6) matrix of partial derivatives of the observations with respect to the initial parameters, B is an (n X 4) matrix of bias partial derivatives and L is an (n x 2 ) matrix of survey partial derivatives. If we denote by 4 the estimate obtained by differential corrections, q the true corrections, and a = q - q the errors in this estimate, then
Q
+ +~43)1, = (ATXA)-l[ (ATX)e(') + (ATXB)d2) + (ATXL)r(3)], = ( A T S A ) - ~ A T S [ I ~ ~( ~~ ) (
2
)
(6.26)
and the covariance matrix of this estimate is uq =
-
aq* = (ATSA)-' + [(ATSA)-'(ATSB)]~,c*)[ (ATSA)-'(ATXB)IT
+ [(AT2M-l (ATSL)]~,(a)[ (ATSA)-'(ATSL)IT,
(6.27)
SATELLITE ORBIT TRAJECTORIES
69
where S = u$. The matrices S, u . ~ ,U.W are assumed given a priori; the matrices A and L are obtained as output from a tracking program; the bias matrix B which consists of zeros or one’s depending on the observation type will also be output from the program. Thus the covariance matrix UQ can be computed after the estimates 4 have been obtained. I n practice it will be most convenient to store A , B, L on tapes and to use a separate program to carry out the matrix manipulations in (6.27). The input to this program would be
s = u,cl:,
U&), a&).
Generalization to more than one station and more than one pass is immediate. Since the bias errors from a second station, for example, will be independent of those from the first it is only necessary to add to (6.27) a matrix of the second type with the appropriate B and uCb) matrices. The effect of new station locations errors is obtained by adding another matrix of the third type in (6.27) with the corresponding L and u . ~matrices. If it seems desirable to consider that bias errors are not constant over an entire pass but are constant over separate portions of the pass, this can also be handled as above by considering each portion as independent of the others. The second problem posed in Section 6.6.1, that of determining the bias or station location errors, can be handled by solving an augmented problem. I n the case considered above the vector q will consist of the six position and velocity corrections, the four bias corrections, and the two station location corrections. Thus q will have twelve components and the normal matrix will be (12 x 12) instead of (6 X 6). As more stations and more biases are to be determined, the augmented normal matrix will grow in size and numerical difficulties may be expected. The relative simplicity of the approach suggested here is due largely to the assumption of independence of the various types of errors. More sophisticated theoretical models which remove this and other assumptions can, of course, be derived but the practical difficulties involved in such models are enormous. The procedure outlined here can be added to an existing tracking program, and has successfully been used at, Space Technology Laboratories, Inc. for design trajectory studies. The steps outlined above for a statistical error analysis are conceptually simple, but because the matrices involved are very poorly conditioned, the practical implementation of such a program on a computer is very difficult.. I n a program based on this analysis, it was found necessary to carry out all matrix multiplications and inversions in a t least double precision floating point, arithmetic on an IBM 7090 in order to retain any significance in the results.
SAMUEL D. CONTE
70
7. Organization of a Tracking and Prediction Program
A complete prediction and tracking program will inevitably be extremely complicated. The number of instructions will be well over 40,000, the liberal use of tapes is essential, and several man-years of effort will be required to produce it. Such a program should be very flexible because unforeseen needs will demand frequent modification, and because new developments aimed a t improvements in computational efficiency will be the rule rather than the exception. It is therefore advisable to organize the program in the form of macro-blocks, each of which is substantially independent of the others in that each block can be replaced without altering the basic structure. Thc flow diagram a t the end of this section shows the major blocks in such a program. A brief description of the function of each block, together with some suggestions for improving computational efficiency, is given here, although the exact equations needed are not included. I n general, the diagram follows closely that used by Space Technology Laboratories in its General Tracking Program (GTP), a routine that has been used successfully for tracking a large number of American satellites, including the Able series, some of the Pioneer and Explorer series, the Discoverer series, and the Transit and Courier series. G T P will perform on option any combination of three major functions: trajectory intcgrat ion; differential corrections; ephemeris generation. Since the original submission of this manuscript, the author has directed the development of a substantially more sophisticated tracking program A complete dea t Aerospace Corporation. The program is called TRACE. scription of this program together with detailed derivation of equations is contained in Ref. [&I. 7.1 Input and Conversion Block
7.1.1 Input Conversion
The program should be capable of accepting initial conditions in any one of the following coordinate systems : instantaneous elliptic elements, inertial rectangular equatorial, inertial rectangular ecliptic, geo-spherical; and of converting these to the working coordinates of the tracking system which are not necessarily the same as the integrating coordinates. I n GTP, the tracking coordinates are ( r , 01, 6, v, p, A ) while the integrating coordinates are earth-centered inertial rectangular equatorial. This sub-block will also accept control parameters which will: (1) select the perturbations to be included such as drag, oblateness terms, relevant planetary bodies; (2) set the integration accuracy criterion; (3) specify which major functions are to be performed-trajectory, differential correction, or ephemeris generation.
SATELLITE ORBIT TRAJECTORIES
71
7.1.2 Observation Processor If the differential correction option is selected, radar or optical data from any one of several stations is accepted and converted. Station location information is stored in this block for any pre-selected station. Depending upon the equipment available a t a station, the observational data will be transmitted in a variety of forms including direction cosines, declination and right ascension, elevation, azimuth, range, range rate. This routine (1) converts these to a uniform set-range, range rate, elevation, azimuth, and range acceleration; ( 2 ) applies necessary corrections such as refraction; and (3) converts observation times to minutes after the reference time. 7.1.3 Data Editing Routine This routine processes the data, as described in Section 6, to eliminate gross errors and blunders in the data. 7.2 Trajectory Integration Block
Among the more important sttbroittiues to be incorporated in this block are the following: 7.2.1 The Numerical Integration Subroutine G T P operates in a combined Runge-Kutta and Gauss-Jackson method with automatic step size selection utilizing sixth differences. The RungeKutta method is used for starting the second-sum method and for integration up t o exact observation times when small integration steps are required. I n the latter case, basic information for the second-sum method is saved for resumption of integration in that mode. 7.2.2 Planetary Coordinates Look-lip Roziiiw Coordinates of the planets are stored on tapc and rend into the high speed computer in blocks. Interpolation to the required time is performed with Everett's central difference interpolation formula through fourth differences. The coordinates are referred to a fixed rqninos-that of 1950.0. 7.2.3 Coordinate Transformation S i d m u t i i w On interplanetary flights, provision is madc for shifting the center of
coordinates to the dominant body. This routine will supply the proper constants such as the mass ratios in each operating mode and will provide the necessary planetary coordinate subtractions. In addition, it is necessary to obtain the velocities of one body-say the earth-relative to the sun. This is done by numerical differentiation but should be done very carefully since any errors committed here will propagate. I n general, three operating modes are allowcd: from an earth-centered to a sun-centered to a planet-
72
SAMUEL D. CONTE
centered coordinate system. On a lunar flight, it is possible to shift to a moon-centered system. 7.2.4 An Atmosphere Subroutine This routine should provide the density profile for a given altitude above the earth's surface.
7.2.5 An Output Subroutine 7.3 Partial Derivatives and Residual Block
This block operates simultaneously with block 7.2 because the variational equations which supply the derivatives of the rectangular coordinates relative to the initial conditions requires the output from the basic trajectory. This block then consists of: 7.3.1 The Variational Equation Package The initial conditions for these equations must first be computed using the formulas given in Section 6. I n general, six different sets of initial conditions are computed and six sets of variational equations solved to yield the 6 X 6 matrix ( a z / a p ) for x = (2,y, x , 2 , ?j, .k) and p = ( T O , (yo, 60, 210, P o , Ao). 7.3.2 Partial Derivatives of Radar Coordinates Using the output from 7.3.1 and analytic expressions for the radar coordinates (R,A, E, R ) as functions of the position and velocity, this routine computes the derivatives of the radar coordinates with respect to the initial spherical coordinates. 7.3.3 The Residuals and Equations of Condition This routine forms the difference between the observed and computed values of (R, A , E, R, R ) and sets up the equations of condition for the differential correction process. 7.4 The Differential Correction Package
7.4.1 The Least Squares Subroutine The normal matrix ATAis formed, the constrained least squares problem is solved for the corrections q; and the improved estimate of burnout parameters p'. The eigenvalues and eigenvectors of B = D-'ATAD-' and the elements of the covariance matrix (ATA)-' are printed out on-line. New residuals are also computed and the integration block is re-entered, if necessary, for another iteration.
SATELLITE ORBIT TRAJECTORIES
-7I
I
73
74
SAMUEL D. CONTE
7.4.2 Updating the Trajectory
This routine follows the procedure outlined in Section 6 for constructing the covariance matrix a t a time tl so that a least squares fit can be carried out with new observations obtained after time tl. 7.5 The Ephemeris Processor
After the differeiitial correction process has converged, it is necessary t o produce a sighting ephemeris for each of the observing stations. The sighting data must be processed into a format suitable for acceptance by each station. Such sighting data will usually be required a t equally spaced and fairly frequent time intervals. The most efficient way to obtain this information is t o interpolate-using a Lagrangian formula-for the position and velocity a t the required times and then to convert these into radar coordinates. Bibliography 1. Aroian, L. A., and Robison, D. E., A data editing routine. Space Technology Labs. Internal Report No. P A 2952-01, July (1960). 2. Baker, R. M. L., et al., Efficient precision orbit computations. Aeronutronics PAM 59-444 (1959). 3. Baker, R. M. L., Astrodynamics. Academic Press, New York, 1960. 4. Brenner, J. L., and Latta, G. E., Satellite orbit theory using a new coordinate system. Proe. Roy. SOC.(London) (1960). 5. Brouwer, D., On the accumulation of errors in numerical integration. Astron. J . 46 (1937). 6. Brouwer, D., Solution of the problem of artificial satellite theory without drag. Astron. J. 64,37&397, November (1959). 7 . Cohen, C. J., and Hubbard, E. C., Algorithm applicable to numerical integration of orbits in multi-revolution steps. U. S. Naval Weapons Lab. Report No. 1705, May (1960). 8. Contribution to astrodynamics. Aeronutronics Publ. U-880, June (1960). 9. Dahlquist, B., Convergence and stability in the numerical integration of ordinary differential equations. Math. Scand. 4 (1956). 10. Diliberto, S. P., Kyner, W. T., and Freund, R., The application of periodic surface theory to the study of satellite orbits. Astror. J . April (1961). 11. Eckert, W. J., and Brouwer, D., The use of rectangular coordinates in thc differential correction of orbits. Astron. J . 46, August (1937). 12. Ehricke, I<., Space Flight. Van Nostrand, Princeton, New Jersey, 1959. 13. Garfmkel, B., On the motion of a satellite of an oblate earth. Astron. J . 63 (1958). 14. Garrett, J. R., et al., Satellite orbit determination and error analyses of procedures. Holloman Air Force Base, New Mexico, Project No. A-398. 15. Hamming, R. W., Stable predictor-corrector formulas for ordinary differential equations. J. Assoc. Computzng Machinery 6, January (1959). 16. Hanson, G., and Routh, D., Space Tcchnology Labs. General Tracking Program CDRC Report No. 9830.30-018 (1960).
SATELLITE ORBIT TRAJECTORIES
75
17. Helvey, T. C., ed., Space Trajectories, p. 119ff. Academic Press, New York, 1960. 18. Henrici, P., Discrete Variable Methods in Ordinary Diflerential Equations. Wiley, New York, 1961. 19. Herrick, S., Precision orbits and observation reduction. Univ. of California (Los Angeles) Astrodynamical Report S o . 1 (1959). 20. Herrick, S., Astronautics information. Proc. Seminar on Orbit Determination, Jet Propulsion Lab., Pasadena, California, February (1960). 21. Herrick, C. E., On the computation of nearly parabolic orbits. Ast,on J . 65, No. 6, (1960). 22. Herrick, S., Astrodynamzcs. Van Sostrand, Princeton, New Jersey, 1961. 23. Hildebrand, F., Introduction to Numerical Analysis. McCraw-Hill, Massachusetts, S e w York, 1956. 24. Hori, G., Development of Delaunay thcory a t critical inclination. Astron. J . 65, 291 (1960). 25. King-Hele, D. G., The Effect of the Earth‘s Oblateness on the Orbit of a Near Satellite. Proc. Roy. Soc. (London) 947,49-72 (1958). 26. Kopal, Z., Numerical Analysis. Wiley, New York, 1955. 27. Kosai, Y., The motion of a near earth satellite. Astron. J . 64 (1959). 28. Morrison, D., A method for nonlinear minimization problems. Space Tcchnology Labs. Internal Report No. “-140 (1959). 29. Morrison, D., Some remarks on weights in least squares. Space Technology Labs. Internal Report No. PA 2027-1-9, October (1960). 30. Morrison, D., and Holt, J., General linear equation solver. Reports RWLS4F(709) and RWEGGS (FORTRAK), SHARE,September (1960). 31. Musen, P., Application of Hansen’s theory to the motion of an artificial satellite in the gravitational field of the earth. J. Geophys. Research 64, December (1959). 32. O’Keefe, J. A., Eckels, A., and Squires, R. K., Vanguard measurements give pear-shaped component of earth’s figure. Science 99, 565-566 (1959). 33. Pines, S., Payne, M., and Wolf, H., Comparison of special perturbation methods in celestial mechanics. ARL, ARDC, August (19G0). 34. Planetary coordinates for the years 1960-1980. I-I. M . Nautical A41manac(1958) 35. Rademacher, H., On the accumulation of errors in processes of integration on highspeed calculating machines, Proc. Symposium on Large Scale Digital Computing. A n n . Computing Lab. Harcnrd 16 (1948). 36. Shapiro, I., The Prediction of Ballistic Missile Trajcctorits ji cm 2iadai Obsercations. McGraw-Hill, New York, 1957. 37. Smart, W. M., Celestial Mechanics. Longmans, Green, Boston, 1953. 38. Smith, 0. K., Perturbation methods for free flight trajectories beyond the atmosphere. Space Technology Labs. Report EO.GM-TM-0165-0038 (1958). 39. Smith, 0. K., Derivativas of radar coordinates with respect to elliptic elements. Space Technology Labs. Internal Report No. PA 2138-1,2 (1958). 40. Smith, 0. K., Predictor-corrector formulas for difference equations. Space Technology Labs. Report No. STL/TR-60400040294 (1960). 41. Smith, 0. K., The computation of coordinates from Brouwer’s solution of the artificial satellite problem. Submitted to Astron. J . 42. Struble, R., A Rigorous Theory of SalcElite Motion. North Carolina State, 1960. 43. Swerling, P., A proposed stagewise differential correction procedure for satellite tracking and prediction. Rand Corp. Report No. 1292, January (1958).
76
SAMUEL D. CONTE
44. Thomas, L. M., and Mace, D., An extrapolation formula for stepping the calculation of the orbit of an artificial satellite several revolutions a t a time. Astrun. J. 65, June (1960). 45. Titus, J., The Encke lunar trajectory program. Space Technol. Labs. Report No. TR-fjO-0000-00249, August (1960). Aerospace Orbit Determination Frogram, 1215-2-115. Aerospace Corpore46. TRACE: tion, Los Angeles, California, March, 1960.
Multiprogramming E
. F. CODD
Development laboratory. D a t a Systems Division International Business Machines Corporation Poughkeeprie. N e w York
1 . Introduction . . . . . . . . . . . . 1.1 Concurrency . . . . . . . . . . . 1.2 Inter- and Intraprogram Concurrency . . . . 1.3 Time Sharing . . . . . . . . . . . 1.4 Space Sharing . . . . . . . . . . . 1.5 Possible Difficulties . . . . . . . . . 2 . Early Contributions . . . . . . . . . . 3 . Current Scope of Multiprogramming . . . . . 3.1 Environments . . . . . . . . . . . 3.2 Plan of Attack . . . . . . . . . . . 4 . Batch Multiprogramming . . . . . . . . . 4.1 Goals . . . . . . . . . . . . . . 4.2 The Computer System . . . . . . . . 4.3 The Pending Workload . . . . . . . . 4.4 The Four Phases . . . . . . . . . . 4.5 Phase Concurrency . . . . . . . . . 4.6 Task Concurrency . . . . . . . . . . 4.7 I 0 Requests and WAIT Pseudo-OpP . . . . . 4.8 Execution Control . . . . . . . . . . 5. The Optimizing Problem . . . . . . . . . 5.1 Scheduling, Allocation, and Queueing . . . . 5.2 Nonscheduled Mode . . . . . . . . . 5.3 Space-Scheduled Mode . . . . . . . . 5.4 Space-Time Scheduled Mode . . . . . 5.5 Tape Allocation . . . . . . . . . . 5.6 Disk Allocation . . . . . . . . . . 5.7 Core-Storage Allocation . . . . . . . . 5.8 Advance Commitments . . . . . . . . 5.9 Short-Range Scheduling . . . . . . . . 5.10 Queueing . . . . . . . . . . . . 6 Multiprogramming withTwo or More Processingunits 6.1 Motivation and Requirements . . . . . . 6.2 Note on Implementation . . . . . . . . 6.3 Rules for Interruption . . . . . . . .
.
77
.
.
. .
. . . . . . . . . . . .
.
. .
. .
. .
. .
. .
. . . . . .
. . . . . .
. . . . . .
. . . . . .
. . . . . . . .
.
.
.
.
.
.
.
. .
. .
. . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
83
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. .
. .
. .
. .
. .
. . .
. . .
. . .
. . .
. . .
. . . . . .
. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
. .
78 78 78 79 79 80 81
. .
.
.
.
.
.
.
.
. .
. .
. .
. .
. .
. .
. .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
83 86 87 87 88 90 91 92 92 95 95 104 105 106 106 108 109 110 112 115 116 120 122 122 125 125
E. F. CODD
78
.
. . . . . . . . . . . . . . 128 . . . . . . . . . . . . . . 130
.
.
.
. . .
. . .
. . . . . . . . . . . . . 150 . . . . . . . . . . . . . 152 . . . . . . . . . . . . . 152
6.4 Protection and Relocation
6.5 Special Operations. . 6.6 The Queueing System 7 . Concluding Remarks . . 8. Acknowledgments . . . Bibliography . . . .
.
.
.
.
.
.
.
.
.
.
.
.
134
1. Introduction 1.l Concurrency
The basic concern of multiprogramming is concurrency of operations within computer systems. Many different types of concurrency are incorporated in the computers in use today. Not all of these types are of interest in multiprogramming. Operations which are performed concurrently range from the very small scale t o the very large. One extreme is represented by the simultaneous operation of two triggers during the execution of a single instruction. The other extreme is represented by the concurrent activity of two processing units sharing a common core storage, each capable of interpreting and executing its own stream of instructions. To eliminate consideration of small-scale concurrency, we focus attention on concurrent operations each of which requires at least one machine instruction for its specification. This qualification alone is, however, not enough. It is also desirable to eliminate local concurrency in which the execution of a n instruction is overlapped by the execution of one or more of its neighbors in a single instruction stream. This particular type of coiicurrency gives rise to highly specialized problems [ 2 ] . We are now in a position to define multiprogramming as the technology associated with the concurrent execution of instructions which are not restricted t o being immediate neighbors in any instruction stream. The most common form of concurrency which is consistent with this definition is that of overlapping input-output (10) operations with each other and with processing unit (PU) operations. A few computer systems are now coming into use which contain two or more PU’s capable of concurrent operation: for example, the GAMMA60 [5] and the RW 400 [16]. Exploitation of systems containing two or more PU’s poses some additional problems. For the most part, however, the problems encountered are similar. This similarity is recognized in the definition of multiprogramming which encompasses both the single and multiple PU cases. 1.2 Inter- and lntraprogram Concurrency
An observer taking an instantaneous look a t a computer in action might see one unit servicing instructions belonging to one program and another
MULTIPROGRAMMING
79
unit servicing a second. In such a case, the concurrency may be characterized as interprogram. If, on the other hand, both units are servicing the same program, intraprogram concurrency is exhibited. The distinction between inter- and intraprogram concurrency is very much dependent upon the use being made of the term “program.” It is partly for this reason that multiprogramming is defined in a sufficiently general way t o encompass both types of concurrency. An additional reason is that, if the main objective is to load all the computer units as heavily as possible, it is inadequate to confine one’s attention to either inter- or intraprogram concurrency alone: one is forced to exploit both to the limit. 1.3 Time Sharing
Now suppose that the observer watches one unit over a period of time. He may notice that this unit services first one program, then another. These programs are said to time-share the unit in question, and the unit itself is called a time-shared facility. Normally, the processing unit(s) and I0 channels are time-shared facilities in a computer system. If the mean time spent by the unit in servicing each program is sufficiently small, the observer may get the impression that the programs are receiving simultaneous service from this one unit. Of course, this impression is false. However, time-sharing and true concurrency are complementary aspects of multiprogramming: it would be a most uiiusual situation in which a unit was being time-shared and no other unit mas engaged in concurrent activity. 1.4 Space Sharing
When a set of programs or program segments is being executed in a concurrent manner, space must be found in core storage to accommodate the instruction and associated data. If the total core-storage requirement does not exceed the available capacity, it is clearly possible to allocate disjoint areas privately to each member of the set. The space reservations in core storage may, in this simple case, be regarded as permanent; that is, not subject t o cancellation unless an emergency arises. Looking a t core storage as a whole, w e may say that it is being space-shared b y the programs in questioii. Looking at any onc particular location, however, we do not observe sharing. If on the other hand, the total core-storagc requirement does exceed the available capacity, it becomes necessary to treat one or more of the space reservations as temporary. Thus, some core locations, indeed perhaps all of them, are sometimes in use by one program and sometimes by another. Generally speaking, the only truly p c r n ~ ~ ~spacc c n t reservation in corc
80
E. F. CODD
storage is enjoyed by the supervisory program, and even it may not be permanently assigned all the core space it could use. Core storage is only one of several space-shared facilities to be considered in a comprehensive computer system. There may be a large, quasi randomaccess auxiliary memory such as high-speed magnetic disk units, and space in such memory must be shared in some manner. Then again, the set of tape units constitutes a space-shared facility in which the normal unit of space is the tape unit itself. Allocation of space on all these facilities is an important part of the concurrency exploitation problem. 1.5 Possible Difficulties
In articles describing computer systems, much emphasis has been placed on the provision of abilities to execute various types of operations concurrently. It is true that careful consideration must be given to this question in planning and designing a new computer. All too often, however, the difficulties of exploiting these concurrency abilities have been left as “an exercise for the programmer.” To avoid disappointing, if not disastrous, consequences, the exploitation problem must be thoroughly examined at the machine planning stage. Consider some of the questions which may arise. What is the user’s objective? Is the prime objective fast response to a variety of messages or transactions entering the system a t random intervals, or is it the minimization of time to process a given set of programs regardless of delay to individual members of the set? Perhaps, the objective is a combination of these extremes. What features or schemes are needed or desirable for facilitating the control and coordination of concurrent operations? To what extent should these features be provided in hardware rather than by programming? Can the burden of controlling and coordinating concurrent operations be assumed entirely by a combination of hardware and systems programming, leaving the problem programmer free to express his problem in a conventional sequential manner, if he wishes? Are any changes needed in problem-oriented languages to permit effective exploitation of certain types of concurrency? Must the operating staff be superhuman to keep pace with a machine which is handling several programs at a time and consuming them at a very rapid rate? When a machine malfunction, a programming blunder or an operator error occurs, what aids are needed for identifying the source of trouble and determining which programs have been adversely affected? How can the risk of accidental or fraudulent manipulation of one program by another be virtually eliminated? Are not new techniques in numerical analysis required if machines with large numbers of autonomous arithmetic units become a reality? Is a centralized
MULTIPROGRAMMING
81
large-scale computer system more economical than several less powerful decentralized systems? These questions are but a few of those associated with multiprogramming today. As new forms of machine organization, new applications, and new machine environments develop, we may expect the subject of multiprogramming to evolve from its present primitive beginnings to become an important branch of the computing art. 2. Early Contributions
Multiprogramming has not been called into existence by any single pronouncement or development or conjecture. Almost every computer built to date has contributed something to the subject, usually by possessing some new form of concurrency, or some new interlocks which facilitate exploitation of concurrency. Contributions have also been made in the systems programming area: for example, development of buffer service routines (and corresponding pseudo-ops) which provide reading or writing of successive records from or to tape asynchronously with respect to the main program. The earliest use of the term “multiprogramming,” which the writer has been able to find in the literature, occurs in a paper by Rochester published in 1955 [17]. In this paper Rochester discusses the problem of handling efficiently such applications as premium-notice writing, which requires relatively small amounts of computing and relatively large amounts of tape reading and writing. “The trick used,” he states, “is called ‘multiprogramming’ and it involves doing two or more jobs at once.” Referring to an IBM 705 system, he goes on to state, “The Tape Record Coordinator . . . runs its master tape units for the file maintenance job almost autonomously while passing over inactive records. Then when an active record is found, the calculator briefly interrupts the work it was doing [on another job] to deal with this active record.” This “trick” proved to be highly successful in several field installations. For example, the Cataloging Division of the Department of Defense cut the total time for their daily workload almost by half in the following way. A large tape file (involving some 200 tape reels) had to be processed on a daily basis. Two versions of the file-processing program were placed in different parts of core storage, each version being assigned the processing of a corresponding half of the file. A third program provided supervision of the other two, enabling them to operate asynchronously, and enabling their corresponding tape-record coordinators to operate concurrently. In 1954 an interesting experiment was conducted at the National Bureau of Standards under the direction of A. I,. Leiner. A direct coupling was
82
E. F. CODD
made between two normally self-sufficient computers, namely SEAC[ I ] and DYSEAC[ I l l . The coupling was such that each computer behaved as if it were an input-output device for the other. The resulting system was capable of handling efficiently problems which the two component computers could scarcely have handled if each were working alone. This experiment foreshadowed the later development of systems (for example, the NBS PILOT [ l a ] )containing two or more virtually autonomous processing units closely coupled for fast interaction. A key factor in making I0 and PU concurrency more readily exploitable -and in a more general manner-has been the development of automatic interruption of programs. This feature has removed the necessity for awkward and time-consuming testing to find out whether an I0 operation has been completed or if some exceptional event, such as machine malfunction, has occurred. One of the earliest machines to be equipped with program interruption was the UNIVACI [8]. However, the only condition which could cause an interruption in this machine was arithmetic overflow. In the NBS DYSEAC the very significant step was made of extending interruption to inputoutput operations. Leiner [IO] comments: “This enables optimum use to be made of the computer’s concurrent operating ability; at the same time it relieves the programmer of the responsibility for working out, exactly, the timing interrelationship between the mutually unsynchronized internal and external portions of the program.” At the National Aeronautics and Space Administration a USIVAC1103A was applied to the on-line reduction of wind-tunnel data, and at the suggestion of Turner [see 1-41an external signal originating from the wind tunnel was used to trigger an interruption in the computer program. A further extension of automatic interruption has been made in the TX-2 computer [8]developed at the Lincoln Laboratory of the Massachusetts Institute of Technology. Upon interruption, control is automatically given to one of 25 possible programs: specifically, that one which possesses the highest priority of all those currently in a ready state. For each instruction, the programmer is required to permit or prohibit interruption. One program may accordingly hold up indefinitely activity on all others. I n a paper published in 1958 in the British Computer Journal, Gill [9] of Ferranti Ltd. gave a very lucid account of the problems and potentialities of multiprogramming. This was the first paper on the subject of such a comprehensive nature, and undoubtedly contributed greatly to the current widespread interest the subject enjoys. His introduction of the term “parallel programming” in place of “multiprogramming” appears to have started a fad for inventing even more synonyms; for example, “concurrent pro-
MULTIPROGRAMMING
83
gramming,” “asynchronous programming,” “simultaneous programming,” and the like. 3. Current Scope of Multiprogramming
There exists today a wide variety of environments in which computer systems are required to operate. Many new types of computer organization are being developed to cope with these environments. Multiprogramming appears to serve different objectives in each. Common to all theseobjectives, however, is the basic objective of obtaining the maximum possible throughput rate. Somewhat minor variations of meaning are attached to “throughput rate” in different situations. Accordingly, we proceed to examine several types of environment with a view t o determining more specifically the role which multiprogramming plays in each. It will be observed that much of the variation in the environments to be described is due to the different time scales upon which service is measured. 3.1 Environments
3.1.1 Commercial Batch Processing Consider first the typical commercial installation. It is concerned with the processing of large quantities of business data on a batched basis. The bulk of the work may be characterized as maintenance of magnetic tape files, sorting, and report generation. The programs tend to be large in size and not subject to rapid obsolescence. The runs are to a large extent production runs to be processed according to a comparatively elastic schedule with as much as an hour’s leeway, even for a critical run. Consequently, when a backlog of work exists (and this is commonly the case), the principal objective is to dispose of this backlog in the shortest possible time. Throughput rate is here identified with the rate a t which the given backlog is processed. Suppose the computer system can accommodate two or more of these runs simultaneously. Such a set of runs may be completed in a shorter time if the runs are executed concurrently rather than sequentially. In the concurrent mode, however, any one run belonging to the set may take longer to complete than if it were executed alone. Multiprogramming may therefore yield an increased throughput rate for the backlog as a whole, and a reduced throughput rate for certain individual members of the backlog. In commercial batch processing, delays of an hour (or more in some cases) may be tolerated in individual runs if this leads to a significant time saving in disposing of the entire backlog.
84
E. F. CODD
3.1.2 Problem Solving with Programmer Of-Line The typical large-scale scient.ific and engineering installation is serving many users (possibly numbered in the hundreds), most of whom require short compiling and debugging runs. The length of these runs on current equipment varies from a few seconds to 30 minutes or more. Perhaps as much as 50% of the machine use is accounted for this way. The remaining amount is consumed by production runs of widely varying length-say from 10 minutes to several hours-some to be processed urgently, others when convenient. As with the commercial environment, it is common to be faced with a backlog of runs to be processed. The multiprogramming objective is again an improved throughput rate on the entire backlog, but with perhaps more stringent limits on the delay imposed upon individual runs, particularly compiling and debugging runs. The greater emphasis on individual service for these users is due to their productivity being significantly affected by the average number of machine runs per day they can obtain.’ 3.1.3 Problem Solving with Programmer On-Line Several universities, notably M.I.T. [It?, 191 and Carnegie Institute of Technology, are currently engaged in the development of techniques to bring the user back into close communication with the machine in order to accelerate certain types of problem-solving activity. Each of several users is provided with a typewriter and other terminal equipment connected to the machine as input-output devices. From time to time each user’s program receives short bursts of service (a few seconds in length) until the user suspends activity on his program to contemplate displayed results and consider his next move. These programs are supplemented by more conventional problem-solving runs with the programmer off -line. Multiprogramming plays an essential part in this environment. If the on-line problem-solving activities were not overlapped, the throughput rate expressed in terms of problems solved would drop enormously, and thc entire operation would become prohibitively expensive. 3.1.4 Industrial and Military Monitoring and Control For monitoring or control purposes a computer system may be connected with automatic data sources operating a t high speed; for example, a wind tunnel or space vehicle “71. During the monitoring or control periods the machine must keep pace with the external events, but may return to other, less urgent activities, in the intervals between these periods. In this envi1 It was once common to get only one compiling and debugging run per normal shift; now, howevcr, with higher performance machines, this number has climbed t o three or four.
MULTIPROGRAMMING
85
ronment, extreme emphasis is placed on speed of handling of the incoming stream of data. Concurrency between jettisoning the less urgent work and getting the urgent data into core storage, and also between transmitting this data and processing the data already in core storage, may be employed to increase the throughput rate for the urgent work. If control rather than mere monitoring is involved, it is likely that a very high degree of reliability is required. For this reason there may be at least two processing units in the system, each one capable of handling the critical parts of the workload alone. During normal operation, the throughput rate of all work, critical and noncritical, may be increased by concurrent activity on all processing units capable of functioning. 3.1.5 Commercial Real-Time Processing At the present time a few commercial installations are being established with the objective of processing transactions as they arise instead of batching them for later sorting and processing. A good example is the handling of airline reservations and related applications on a centralized generalpurpose computer system [15]. Remotely located agent sets are linked by a communications network to the central computer. At each terminal, very prompt response is required from the computer system for the majority of the message types to avoid annoying delays to the customer. The average time allowed for both transmitting and processing may be only five seconds. Because of this need for fast response, the programs for the various types of transactions, together with most records in the centralized shared files, must be extremely accessible. Now, access to currently available, quasirandom, auxiliary storage (i.e., disk or drum) takes from 2 to 200 msec or more. Therefore, in order to maintain sufficiently high throughput rates to meet the transaction response requirements, several transactions must be handled concurrently. Further, as in the industrial and military control applications, two or more processing units may be needed for reliability reasons. 3.1.G Ultrahigh-Performance Requirements
Finally, consider an environment in which problems involving very large amounts of computation must be processed within relatively short time periods. Examples of such problems may be found in the fields of hydrodynamics and linear programming. As research progresses in these (and similar) fields, the magnitude of the problems to be solved grows steadily. It seems most unlikely that circuit speeds can be improved indefinitely. As the fundamental barrier of the speed of light is approached, the dlstances over which signals travel become critically important. 1.ess cen-
86
E. F. CODD
tralized logic appears to provide at least a partial solution to this problem. Observing current trends in the costs of fast storage and logic, it seems inevitable that a point will be reached at which two processing units of given speed working concurrently on different parts of a single problem will cost less than one unit which has double this speed. This point may have been reached already. The decision to employ two or more processing units in a computer system to achieve high performance leads inevitably to the multiprogramming of single problems.
3.1.7 Mixed Environments I n actual practice the “pure” types of environment we have described are not very likely to exist in isolation. Almost every large-scale computer installation is, or will be, faced with a mixture of these types. For example, a commercial installation may have both a real-time and a batch-processing workload. 3.2 Plan of Attack Before starting to consider in detail some of the problems associated with multiprogramming, it is convenient to break the subject down into manageable pieces. There are three important ways of classifying multiprogramming. First, and perhaps most obvious, is a division into batch multiprogramming on the one hand and real-time multiprogramming on the other. Second is a division based on the types of program interdependencies which may exist. Programs may, of course, be completely independent of one another; or interdependencies of various degrees of complexity may occur. At one end of the scale is the simple case of final results of one program being initial operands for another. At the other end, we may have concurrent programs sharing access to files, sharing use of subroutines and possessing interlocks as complicated as those in the supervisory program itself. Third is a division based on the multiplicity of processing units in the computer system. If a system has two or more processing units, an important distinction may be drawn between the case in which these units are functionally identical and that in which they are functionally specialized. Of these three we select the third as a basis for discussion. Accordingly we deal first with the case of a system containing just one processing unit, and later with the case of a system containing two or more functionally identical processing units. In this brief account we place considerable emphasis on batch multiprogramming with independent programs. The lack of emphasis on realtime multiprogramming should not be interpreted as a measure of the
MULTIPROGRAMMING
87
importance attached to it. On the contrary, there is every indication that, real-time multiprogramming will be of prime importance, while batch multiprogramming will play a supporting role. However, many of the multiprogramming problems and difficulties associated with real-time processing are included in those associated with batch processing. For example, in contrast to a batch workload, there is very little scope for scheduling a real-time workload, since most of the demands upon the system cannot be significantly delayed. In what follows an attempt will be made to separate the administrative techniques from the optimizing techniques. The former permit concurrent operations to take place in a safe and orderly manner. The latter are aimed a t maximizing throughput rate in the sense appropriate to the environment. The tools available for satisfying the various requirements and overcoming the numerous difficulties are (1) the hardware itself, (2) the supervisory program, (3) the compiler, and (4) the language (both source and object).
4. Batch Multiprogramming 4.1 Goals
The system and techniques to be described have two main objectives: (1) optimizing and (2) administrative. The optimizing objective is to minimize the execution time of the pending workload, assuming (for the time being) there are no precedence or urgency constraints. The administrative objective is t o shield the problem programmer, operating staff, and maintenance engineers from the complexities of concurrency. The requirements which a multiprogramming system should meet were described in more detail in a paper by Codd et al. [4]. The following six requirements were proposed: Independence of Preparation. The multiprogramming scheme should permit programs to be independently written and compiled. This is particularly important if the programs are not related to one another. The question of which programs are t o be coexecuted with which should not be prejudged even at the compiling stage. (b) Minimum Informationfrom Programmer. The programmer should not be required to provide any additional information about his program for it t o be run successfully in the multiprogrammed mode. On the other hand, he should be permitted t o supply extra information (such as expected execution time if run alone) t o enable the multiprogramming system to run the program more economically than would be possible without this information. (c) Mam’mum Control by Programmer. It may be necessary in a multiprogramming scheme to place certain of the machine’s features beyond the programmer’s direct This reduction in direct influence (for example, both cloclrs in IBM STRETCH).
“(a)
88
E. F. CODD
control by the problem programmer must riot only be held to an absolute minimum, but must also result in no reduction in the effective logical power available to the programmer. (dl Noninterference. No program should be allowed to introduce error or undue delay into any other program. Causes of undue delay include a program which gets stuck in a loop, and failure of an operator to complete a requested manual operation within a reasonable time. (e) Automatic Supervision. The multiprogramming scheme must assume the burden of the added operating complexity. Thus, instructions for handling cards, tapes, and forms should originate from the multiprogramming system. Similarly, machine malfunctions, programming errors, and operator mistakes should be reported to the responsible party in a standard manner by the multiprogramming system. Again, all routine scheduling should be handled automatically by the system in such a way that the supervisory staff can make coarse or fine adjustments a t will. Further responsibilities of the system include accounting for the machine time consumed by each job and making any time studies required for operating or maintenance purposes. (f) Flexible Allocation of Space and Time. Allocation of space in core and disk storage, assignment of input-output units, and control of time-sharing should be based upon the needs of the programs being executed (and not upon some rigid subdivision of the machine) .”
4.2 The Computer System For the sake of clarity it is necessary to make assumptions about the computer system to be exploited. We shall attempt to keep these assumptions few in number and simple in character, adding to them only as necessary. A STRETCH-like system is assumed, including the following items of equipment : (1) one processing unit; ( 2 ) a large core storage (e.g., 64,000 words); (3) one disk channel with two disk units attached; and (4) two tape channels, each with four magnetic tape units attached. The units are interconnected as in Fig. 1. Each disk has just one seeking mechanism and a storage capacity of, say, two million words. A seeking activity on one disk unit may proceed concurrently with either a seeking or a data-transmission activity on the other. Only one disk unit a t a time is allowed to transmit data over the disk channel. Similarly, only one tape unit a t a time is allowed to transmit data over the tape channel to which it is attached. Any of the other units on this channel may, however, be engaged in activities other than transmitting data, for example, rewinding. Each I0 channel is sufficiently autonomous to take an I0 operation t o completion once the operation has been initiated by the processing unit.
1
MULTIPROGRAMMING
UNITS DISK I
STORAGE
STORAGE
89
UNITS TAP ]:
STORAGE
STORAGE
FIG.1. Computer system with single processing unit.
Upon completion, the channel signals the processing unit. If the interruption system is enabled, the signal causes a program interruption. Otherwise, the signal is held until the system is re-enabled, and the interruption occurs a t that time. The processing unit is assumed to have high performance with operation times of a few microseconds. This assumption is convenient primarily because generality and automatism would have t o be sacrificed t o some extent in slower machines. Moreover, the mismatch between processing and I 0 speeds would very likely be less, and hence the profitability of batch multiprogramming would also be less.
90
E. F. CODD
The core storage is sufficiently modular that references by the processing unit are seldom delayed by I0 references. Incidentally, the core storage bus itself is assumed never to be a limiting factor. Thus, the effective speed of the processing unit is not reduced as the I0 load is increased. This is important because multiprogramming normally results in an increased I 0 load. Card readers, printers, and punches have been omitted, partly for the sake of simplicity, and partly because their use in the batch environment with a high-performance machine for anything other than supervisory activity is highly questionable. It frequently proves to be more economical to operate the central machine on a tape-to-tape basis, and use satellite computers for preparing input tapes and interpreting output tapes. In the computer system illustrated in Fig. 1 the programs being concurrently executed share time on (1) the processing unit, (2) the core storage bus, (3) core storage modules, (4) the disk channel, (5) the two disk-seeking mechanisms, and (6) the tape channels. Such programs share space in (1) core storage, (2) disk storage, and (3) tape storage. For the time being we shall assume that individual tape units are not shared, since this would normally entail too much overhead activity in the form of tape searching.2 We shall also assume that a program in the execution phase is assigned an area in core storage, and if the program needs it, an area in disk storage. The assignment of core, disk, and tape space is treated as a permanent and private reservation to be held by a program until completion or termination of the program by the supervisory control. For this particular configuration of equipment the number of programs which may be operating concurrently at any instant is five, if tape rewinds are excluded from consideration. Note that this does not limit the number of programs which may be in the execution phase together. 4.3 The Pending Workload The machine must be made aware of the nature of its pending workload if it is to attempt to minimize the time for disposing of the workload. Records representing run requests are accordingly read into core storage from a tape unit reserved for program loading. Normally, accompanying each run-request record on tape are records containing the corresponding program and data. If, however, the program is retained in disk storage on a more or less permanent basis (presumably because it is so frequently used), then the run-request record on tape may be accompanied by data records only. The overhead activity may be justifiable for extremely fast tape units.
E. F. CODD
92
Neither outputting nor compiling is treated as a phase. The assumption regarding output is that during an execution phase, a program places its final results on one or more output tapes, which are later interpreted by a satellite computer. As far as possible, a compiling run is treated just like any other run, the compiler behaving like a problem program, and the program to be compiled being treated as data. 4.5 Phase Concurrency
The time spent by any one program in each phase is significant enough to warrant concurrent treatment of the phases. We shall assume that, subject to the space limitations of the machine, any number of programs may be in each of the four phases. Consequently, if an observer were to take an instantaneous look a t the entire system, he might see several programs in the scheduling phase (awaiting selection by the scheduling routine), several in the preparation phase, several in the execution phase, and several in the rewind-demount phase. Success in overlapping the preparation phase of a given program with the preparation and execution phases of other programs depends very largely on the tape-unit requirements of the program. If the number of tapes to be mounted for this program is less than or equal to the number currently unreserved, it may be possible to overlap the preparation phase completely with activities on other programs. A similar remark applies to the overlapping of the rewind-demount phase of a given program with the execution phase of other programs. 4.6 Task Concurrency
We now wish to examine the execution phase in more detail, and consider first a program P running alone. Suppose that, at some point, P calls for a record to be read into core storage from one of the tape units. While this record is being transmitted to core storage, the processing unit is free to continue servicing P. If P called for this record sufficiently in advance of the need for the information contained therein, then P would be able to continue to supply the processing unit with useful work throughout the transmission period. We then obtain a timing diagram as in Fig. 2. -TIME
PU
-Po
REQUES;-;
I
TAPE CHANNEL
I
L-----A END OF OPERATION
FIG.2 . Timing diagram illustrating continuation of processing throughout the time interval needed to complete an I0 operation.
MULTIPROGRAMMING
91
Until a run-request record enters core storage, the machine cannot be said to be aware of the corresponding run. Hence, the pending workload, as far as the machine is concerned, consists of all those runs for which (1) requests have entered core storage, and ( 2 ) the corresponding programs have not yet been selected for preparation and execution.
4.4 The Four Phases Each run from the pending workload is taken through four phases: (1) scheduling, (2) preparation, (3) execution, and (4) rewind-demount. Let us follow a particular run through this sequence. In the scheduling phase, the run request is examined by the scheduling routine to determine if, in view of the current state of the machine, this is an opportune time to begin preparations for the execution of the run. Several examinations may take place before the scheduling routine finally decides to place the run in the preparation phase. At this point the scheduling routine allocates tape units, disk space, and core space to the program. A method for determining which units and storage areas are to be assigned will be described later. In the preparation phase the allocated areas are loaded and initial tape reels (if any) are mounted. Changing a tape reel by hand usually takes 30 or more seconds. Automatic reel changers are likely to take some 10 seconds. In either case, a fast computer can do a lot of work in periods of t,his magnitude. As soon as its core area is loaded, the given program may be brought into the execution phase, even though its preparation phase may not be completed yet. Of course, this implies that interlocks are provided to hold up any program in the execution phase which attempts to use a disk area or a tape unit which is not fully prepared. These interlocks are also useful in handling in-execution reel changes associated with multireel files. The activity of a program on the processing unit may be terminated altogether for a given run either because the program itself requested it or because the supervisory control demanded it. In either case, the end of processing is not necessarily coincidental with the end of the execution phase. The program may have I0 operations either active or pending. Some or all of these may entail transmission of data and hence require use of the core reservation for this program. When all these data-transmission operations have been either completed or for some reason canceled, the core reservation may be released for use by the other programs. At this point, the program is said to reach the end of the execution phase. The only activities for this program which may still be unfinished are tape rewinding and demounting operations, and these constitute the rewind-demount phase.
MULTIPROGRAMMING
93
If, on the other hand, program P reaches a point beyond which further processing must await the arrival of the record in core storage, then P releases the processing unit pending completion of the transmission operation. If a supervisory program is present, P accomplishes this release by means of the pseudo-op WAIT, which not only passes control to the supervisory program, but also requests that P itself be placed in the NOT READY (for processing) state. Upon completion of the I0 transmission operation, the supervisory program may pass control back to P (Fig. 3) or, more generally, it may place P in the READY (for processing) state. 4
[I0
R
E
Q
7
PU
TIME
T
I
u I
TAPE CHANNEL
END OF 0 P ERAT1ON
FIG.3. Timing diagram illustrating continuation of processing for only part of the time interval needed to complete an I0 operation.
Figure 4 illustrates the behavior of a program A when run alone. Figure ti shows what might happen if a second program B mere executed concurrently with A. Several items are worth noting. First, queues3are formed on the processing unit and channel 3. Second, program A no longer spends time in the SOT READY state due to I 0 task A-1. This is because A is dis-
-
c
- - - - - -- - p u TASK
I0
10
REOUEST WAIT
pu
A {cH2
(
I0 TASK A-I END OP
CH 3
-TIME
----------+ 30
REQUEST 1
REOUEST WAIT
i ' :
I
I
4
I I
I0 TASKA-2
'
F--
I 0 TASK A-3
END OP
END OP
FIG.4. Behavior of program A running alonc.
placed from the processiiig unit by B for a period of time a t least as long as A previously spent in the NOT READY state. Third, the delay experienced by program A in obtaining service from channel 3 and for I0 task A-2 results in A entering the KOT READY state; when run alone this was not necessary. As a consequence, we may state the following general rule: for The queue discipline exhilitrd on the PU is time-lirnitpd FIFO.
B{:3
CH 3
CH 2
PU
END OP
I0 TASK 8-2
END OP
I
-I
FIG.5. Behavior of program A when run concurrently with program B.
8-1
I
MULTIPROGRAMMING
95
every I0 request issued by a program it is necessary for that program to be prepared to supply a WAIT pseudo-op, because the extent of delay in servicing the request is unpredictable by the programmer or compiler. 4.7 1 0 Requests and WAIT Pseudo-Ops
All I0 requests are channeled through the supervisory control, partly because it may be necessary to queue these requests and partly to keep each program from damaging others (inter-program protection is treated in Section 4.8). Thus the compiled program contains no absolute READ, WRITE, etc., operations. I n their place it contains the pseudo-ops READ REQUEST, WRITE REQUEST, etc., each of which consists of a call for the supervisor followed by a designation of the operation to be performed together with a symbolic identification of the file to be operated upon. Similarly, when a program needs to release the processing unit, it does not issue an absolute WAIT operation, but rather the pseudo-op WAIT. This again is a call for the supervisor followed by information as to what condition is being awaited. Three versions appear to be useful: (1) W-wr for spec.i,fied symbolic file, (2) WAIT for a n y symbolic file, and (3) WAIT for specified number of symbolic files. I n each case it is understood that only those symbolic files belonging to the program issuing the WAIT are pertinent. Each of these pseudo-ops calls for the supervisor to place the current program in the NOT READY state. The program is later returned to the READY state upon completion of (1) the specified task, (2) a n y task, or (3) the specified number of tasks. The only use made of the absolute WAIT operation occurs when the supervisory control finds that there are no programs in the READY state, nor any that can be made ready by transferring the data of a pending output request to an output buffer. Other pseudo-ops will be discussed later. 4.8 Executive Control
The supervisory control may be neatly divided functionally and structurally into two parts: the execution control, which supervises the execution phase; and the pre- and post-execution control, which supervises all other phases. The principal functions of the execution control are: (1) Preservation of the status of arithmetic registers, mode settings, etc., when switching the PU from one program to another. (2) Handling service requests, including queue formation and selection. (3) Buffer service. (4) Inter-program protection.
96
E. F. CODD
(5) In-execution relocation. (6) Program suspension, dumping, and relocatioii. (7) Communication with the operating staff. (8) Space release and request. (9) Time studies. (10) Miscellaneous services. 4.8.1 Status Preservation A processing unit which operates so that no status information (i.e., operand, result, indicator, or mode) is carried over within the unit from one instruction to the next is said to be “core-storage reflected.” Few, if any, processing units in use today are completely core-storage reflected. An example of a machine which is nearly so is the Honeywell 800 [ I S ] . Thus, if interruption is normally permitted a t the end of executing any instruction-and we shall assume that it is-we are faced with the need to preserve all the PU status iiiformation for the interrupted program. At some later time when this program is resumed, it is usually necessary (though not always) to return control to the instruction which, in the usual flow sense, immediately follows the point of interruption. Immediately prior to this return of control, the P U status information is normally restored unchanged so that execution will continue as though no interruption had occurred. Kote that an important item of PU status information is the instruction-counter contents. One might hope that it would be sufficient to provide one dump area per program for PU status information. TTiifortunately, it appears necessary to provide two per program. The basic reason is that for I0 and arithmetic types of interruption, the supervisory program cannot, in general, provide a complete interruption service. After initial, general handling of an interruption by the supervisor, a program may supply additional, special handling by means of an interrupt routine of any length. Because of this indefinite length, the supervisor must be prepared to switch the PU from program A to some other a t a time when an interrupt routine belonging to A is being executed. 4.8.2 Service Requests As the execution of a program proceeds, it may from time to time issue an I0 request in the form of a pseudo-op to the supervisory control. If, after determining which channel and unit are required, the supervisory control finds these are both available, it initiates the operation (or chain of operations) without delay. If the unit is not yet prepared (for example, a tape unit is involved and the required reel is not yet mounted), further service on the PU for this program is temporarily suspended by the super-
MULTIPROGRAMMING
97
visory program. This is an example of a program being placed in the NOT READY (for processing) state, although it did not specifically request such action. If either the channel or unit or both are busy, the request is placed in a queue which may be ordered, for example, by time of arrival. On some occasion, not necessarily the next one, when the channel and unit become available, the request is taken out of the queue and is serviced. Whenever program A is returned from the NOT READY state to READY for processing, we have, in effect, an implied request for service from the processing unit. This request is serviced without delay if the processing unit would otherwise be idle. If, however, program B were being serviced, the supervisory program selects a program from the processing unit queue, treating B as well as A as a member of this queue, and examines the situation in accordance with the queue-selection rule to determine which program should be serviced next. Selection rules for queues on the processing unit and I0 channels are discussed later. 4.8.3 Bu$er Service If a program requires a set of records to be read into core storage one by one in the order in which they are stored on tape or disk, a buffer area may be set aside which is large enough to hold two or more records. While the program is processing a record in one part of the buffer, the supervisory program can very often be reading subsequent records into other parts. The pseudo-op GET is used by the program to indicate a readiness to advance to the next record and discard the current one. The supervisory program permits this advance if the next record is already in core storage and prepares to refill the area occupied by the record which is now obsolete. If the supervisor has fallen behind in the buffer refilling activity and the next record is not yet available, the program is put in the NOT READY state for the time being. Accordingly, unlike the READ REQUEST, it is not necessary for the program to supply a pseudo-op WAIT for any pseudo-op GET issued. Buffered writing is handled in an analogous but complementary manner by the pseudo-op PUT. Buffering may also be applied to the reading of records from disk storage in some order other than that in which they are stored, provided the program is normally able to supply disk addresses well in advance of the need for processing the corresponding records. Buffered writing into nonconsecutive disk locations also requires that disk addresses be supplied, but not necessarily in advance of the need to write the corresponding records. Buffering should not be overlooked simply because there may be other programs in the execution phase concurrently. A relatively small invest-
98
E.
F. CODD
ment in buffer space can impart an elastic quality to a program’s demands for service. Thus, if delay is experienced in obtaining service from one facility, the program may still be able to remain active on others. 4.8.4 Interprogram Protection
There are many ways in which one program, P, can cripple another, Q, if they are in the machine together. One obvious way is for P to modify a n instruction or data word in the core or disk area assigned to Q. Another way would be for P to backspace a tape assigned to Q. Havoc might be createdand probably would be-if P transferred control to some arbitrary point of Q. I n each of these cases, if Q is the supervisory program, the entire workload-current and pending-is placed in jeopardy. Protection measures are accordingly vital to the success of multiprogramming with independent programs. We shall see later that these measures may be extremely desirable when closely related programs are being processed concurrently. Two degrees of protection are readily identifiable: malfunction-proof protection which is inviolable, no matter what machine malfunctions or program errors occur; and program-proof protection which can only be violated if machine malfunction occurs. Malfunction-proof protection appears to be unattainable in practice. For, if information were stored in a read-only memory, a malfunction might occur on read-out and hence yield an incorrect copy even though the original were unchanged. However, it is possible to achieve a level of protection arbitrarily close to malfunction-proof. At the present time it appears justifiable to go beyond mere program-proof protection only for certain military applications, and for protecting the copy of the supervisory program which is kept in disk storage for restoration in case of a n emergency. Program-proof protection appears to be attainable rather readily and is ample to guard against accidental or fraudulent manipulation of one program by another. The question arises: should this degree of protection be extended to prevent a program from merely reading information which does not belong to it? If the applications require that commercial or national security be preserved, the answer is clearly yes. Whatever the applications, read protection is a useful adjunct to write protection as a program debugging aid. The protection problem can be summed up as follows: each program is to be contained throughout its execution phase within the assigned core area(s), disk area(s), and tape units; and the supervisory program is to have access to any part of the machine. We now consider the protection problem in five parts: (1) references to core storage by the processing unit,
MULTIPROGRAMMING
99
(2) references to core storage by the I0 channels, (3) references to disk storage, (4) references to tape units, and ( 5 ) special operations reserved for supervisory control only. n’ote that protection of the contents of high-speed registers in the processing unit is provided by the status-preservation activity of the supervisory control (4.8.1). 4.8.4.1 PU References to Core Storage. Because of the extreme frequency of references to core storage by the PU, it is unreasonable to monitor these references by programmed inspection. Many hardware schemes have been devised. They may be classified by the following properties: (1) Resolution: what is the smallest block of core storage which can be protected? (2) Adjacency: can nonadjacent areas (not necessarily a t the extreme ends of core storage) be simultaneously protected? (3) Treatment of potential violation: is a n alarm given or the address silently transformed to some safe value? (4) Treatment of fetching: are data-fetching and instruction-fetching violations detected, and if so, are they identified separately from data storing? (5) Performance: is any penalty paid in performance due to the monitoring activity? Some examples follow. I n STRETCH, references by the processing unit to core storage are monitored to see if the effective address falls within a certain fixed area or within a second variable area. If so, the reference is suppressed and a n interruption occurs. The boundaries of the variable area are specified by two addresses stored within the fixed area. These addresses may be changed only if the interrupt system is disabled. The resolution of this scheme is one word. Nonadjacent areas cannot be simultaneously protected (unless they are at the extreme ends of core storage). A potential violation causes a n interruption and, if necessary, the illegal address may be reconstructed. Protection is provided on fetches as well as stores, and the interruption indicators distinguish between three cases: instruction fetch, data fetch, and data store. This feature is useful not only for debugging but also as a n aid to dynamic core-storage allocation. X o performance penalty is paid in STRETCHfor the address monitoring. The protection scheme in ATLAShas a coarser resolution, 512 words, but nonadjacent blocks of this size can be simultaneously protected. 4.8.4.2 I0 References to Core Storage. Usually, references by the I0 channels to core storage are not monitored by hardware, due chiefly to the
100
E. F. CODD
additional expense which would be incurred for each channel if one permitted each channel to be servicing a different program. If each I0 request specifies a single core-storage urea, only a small amount of information (a single word or less) needs to be inspected. This inspection can be performed just prior to the servicing of the I0 request. I n this way the requesting program gets no opportunity to modify the area definition after its inspection and before it is dispatched to the appropriate channel. A single core-storage area per I0 request is very common due to the widespread adoption of GET-PUT buffering. However, one important class of programs, namely sorting programs, tends to use I0 requests of the scatterread, scatter -write type involving many core-storage areas per I0 request. I n such cases inspection and prevention of modification of the area definition words become more space- and time-consuming. 4.8.4.3 References to Disk Storage. Throughout the execution phase of a program, the supervisory control retains information concerning the area(s) of disk storage assigned to this program and the corresponding symbolic file name(s) which the program uses in lieu of disk base addresses. When the program issues the pseudo-op SEEK REQUEST, it supplies a symbolic file name and a relative arc number. The supervisor checks that these items represent a disk address to which this program is allowed access. Later when a READ REQUEST or WRITE REQUEST is issued, the control word is examined to insure that the entire disk area affected lies within this program’s assignment. When reading from or writing into consecutively located sets of arcs, a program need not issue a SEEK REQUEST for each READ REQUEST or WRITE REQUEST. Accordingly, for protection (and for other reasons, as we shall see later) the supervisory control must keep track of the last position reached on behalf of this program in seeking, reading, or writing. 4.8.4.4 References to Tape Units. When referring to a tape unit for reading or writing, a program uses a symbolic file name. The supervisory control checks that there is an absolute tape unit assigned to this program and file name, and if so, proceeds to service the request, other conditions permitting. An additional protection measure being adopted rather widely nowadays is that of requiring all tapes to possess an initial record identifying the reel. The supervisory control may accordingly check, whenever a tape reel is mounted, that it is the one requested and that it has been put on the proper unit. 4.8.4.5 Restricted Operations. Certain machine operations must be reserved for the sole use of the supervisory control. Included in these restricted operations are those which directly control input-output and the interrup-
MULTIPROGRAMMING
101
lioii system. If a problem program attempts to issuc one of these restricted operations, a n interruption should occur in order that the supervisor may immediately gain control. In particular, the problem program must not be allowed to disable the interruption system entirely; it would, however, be permissible for it to turn off the arithmetic class of interruptions, because this action does not affect any other programs. 4.8.5 In-Zxecution Relocation Suppose that, before a program enters the execution phase, it is converted to absolute form (except for refercnces to disk and tape, which remain semisymbolic). Kow, suppose that, a t some arbitrary stage of its exrcution, we desire to move this program to some other part, of core storage. It is most unlikely that itj will be possible to relocate that program correctly. The reason for this is that, unless some very constraining conventions have been adopted, there is no way of deciding whether the index registers. accumulator, and other registers contain location-dependent or location-independent information. Why should it be necessary or desirable to relocate a program a t some arbitrary stage of its execution? It is normally neither necessary nor desirable for short runs. For long runs, however, any one of the following possibilit,ies may be encountered. First, a lengthy program may be scheduled to operate on a standby basis; that is, it is normally kept with its associated data in disk storage. From tinie to time, when the level of activity in the machine is getting low, this standby program is called into core storage and its execution is resumed. Then later when, for example, the preparation phase of some other program or an in-execution reel change has been completed, the standby program is suspended and dumped back into disk storage. Each time the program is recalled from disk storage it may have to go into a new position in core storage, because its former position may now be occupied by other programs. Second, a lengthy program not being operated on a standby basis may nevertheless have to be dumped in disk storage, because some fault may have become apparent in the program, and an attempt is to be made to diagnose the trouble without removiiig the program from the machine. One solution to this problem consists of providing in hardware a means of executing directly a program expressed in either relative or differential form. Thus, in the relative case every address which is to be used to refer to core storage, be it a n instruction fetch, data fetch, or data store, is incremented by the contents of a register containing the base address of the program. I n the differential case, the instruction counter supplies the
102
E. F. CODD
increment. Modification by the base address fits in nicely with a single-area core storage protection scheme. The ATLAScomputer goes a step further and provides the ability to execute a program in semisymbolic form.
4.8.6 Program Suspension, Dumping, and Restoration It is a simple matter to bring a program to a complete halt without regard for the problem of resuming its operation; one merely stops its activity abruptly on all facilities which are currently servicing it. If, however. execution of the program is to be resumed a t a later time with a minimum of effort, any I0 activities currently in progress should be allowed to come to completion in the normal way. Each completion may generate an implied request for PU service. All of these requests must be stacked rather than serviced; otherwise, the program is not effectively halted. Thus, for each program we need to be able to stack interrupts for as many channels as the program uses during the execution phase. Note that this interrupt stacking is invoked not only for a program which has been put in the NOT READY state in order to bring it to a halt, but also for each program in the READY state, so long as the selection rule for the PU queue keeps such a program from being serviced by the PU. I n addition, as a convenience to the programmer, he may be provided with the pseudo-ops STACK 10 INTERRUPTS and RELEASE 10 ISTERRUPTS, which again make use of the interrupt stacking feature. If a program A and its associated data are to be temporarily dumped into disk storage and later restored, the dumping should not be initiated until all data transmission has been successfully completed for all of A’s pending and active I0 operations. Restoration and resumption of execution are then quite straightforward. 4.8.7 Communication with the Operating Staff A small number of different types of messages, all simple in character, will suffice for communication between the supervisory program and the operating staff. An I0 typewriter proves to be quite adequate as a terminal device for this purpose. Consider, first, messages originating from the supervisory program. These should include tape mounting and demounting instructions, reports of machine malfunctions and program error, indications of overrun of a program, and reports of major items of progress (for example, the completion of a run). Certain types of outgoing messages are desirable as responses to incoming ones. For example, the instruction “repeat last message” is useful if the last message sent in was unintelligible to the supervisor or if an error was detected in transmission of the message. The outgoing message “z done” may also be helpful as an indication that the supervisory program has completed action on an incoming message marked z.
MULTIPROGRAMMING
103
Messages from the operating staff to the supervisory program should include (1) instructions to modify the current schedule (in case very urgent work comes to hand) ; (2) notification regarding units being taken out of service for repair and units being put back into service; and (3) requests for diagnostic information about the supervisor itself. A message of the type ‘‘5 done” may prove useful for transmission to, as well as from, the supervisory program. Signalling the completion of a tape-mounting operation is best done at the tape unit itself.
4.8.8Space Release and Request If a program reaches a point in its execution phase a t which it no longer needs some portion of the space assigned to it, it may issue the pseudo-op FREE, and designate symbolically the space it is willing to give up. Since the execution control decodes all pseudo-ops issued to the supervisor, it decodes the FREE pseudo-op in particular. It then calls for adjustment of corresponding allocation entries in the control table. This may in turn call for the scheduling routine, which is part of the pre-execution control. There is no particular difficulty about freeing a tape unit. Freeing disk space and core space, on the other hand, can under certain circumstances be meaninglcss, because the space allocation scheme is unable to exploit the released space. Here, we must remember that the disk and core allocation schemes may be heavily constrained by the respective protection devices or procedures. For example, release of the middle 1000 words of a 3000-word core-storage block is useless unless the core-storage protection scheme permits the simultaneous protection of nonadjacent areas. Similar remarks apply to in-execution requests for additional core or disk space. This subject will be discussed further in Section 5.2. 4.8.9 Time Studies
In many computer installations, particularly those concerned with problem solvir?gwith the programmer off-line, users are requested to supply an estimated time for each run as part of the corresponding run request. This estimate is used by the operating staff to limit the amount of machine time used by the program. The intent is to avoid undue waste of machine time due to faulty programs. Accounting for machine use is normally handled by clocking each program into and out of its execution phase. When independent programs are being run concurrently, the time spent by a program in the execution phase ceases to be a good guide either for terminating runs before completion or for accounting purposes. This is due to the fact that any program is likely to experience delay waiting for other programs to rdinqukh time-shared facilities. Therefore, the duration of the
104
E. F. CODD
execution phase of any program is, in general, dependent upon the program mix. A measure is needed which, for a given run, is independent of its core, disk or tape assignment, and also of the activities of any program with which it may be executed. The PU service time, defined as the total time spent by the PU servicing the program in question, possesses this property of invariance. The service time (similarly defined) for each tape unit assigned to the program and for the disk channel are also invariant with respect to allocation and program mix. I n contrast, the service time for any particular tape channel or disk-seeking mechanism is highly dependent upon the tape and disk allocation, respectively; in addition, the observed seeking service times are highly dependent upon program mix. Any or all of the service times which are invariant with respect to allocation and program mix may be used as factors in an accounting formula, along with space factors such as the amount of core, disk, and tape space reserved for the program. The PU service time is likely to be the most suitable means of determining when an incompleted run is to be terminated. The accumulation of both time and space statistics for each run yields informat,ionabout an installation’s workload which is invaluable for determining the kind of scheduling and allocation best suited to this workload. 4.8.10 Miscellaneous Services A supervisory program may provide many services which are desirable if only one program at a time is permitted to be in the execution phase. Some of these services may become vital if two or more programs are executed concurrently. Examples of such services are automatic recovery from tape errors and reporting certain types of program errors. One highly desirable service is associated with the output of final results, namely, the use of a shared output tape. Whenever a program is ready to p u t out a record consisting of final results, it calls for the supervisory program to write this record on a tape designated for shared output. The supervisory program appends to the record a label identifying the program which created it. Accordingly, records created by different programs may follow one another on the tape, and a satellite computer may be used to select all records pertaining to any one program in a single pass of the tape. 5. The Optimizing Problem
Ideally, the optimizing problem might be formulated as follows. We arc given a computer system equipped with space-shared and time-shared facilities. A set of runs (programs and associated data) is to be executed so
MULTIPROGRAMMING
105
as t o minimize the time for the whole set. The space and time requirements, including the pattern of demands on the time-shared facilities, are given for each program executed alone with the associated data. The time-minimizing algorithm is itself executed on the computer. I t s own space requirements and pattern of behavior together with the time consumed in its (possibly repeated) execution must be taken into account in the minimizing procedure. This ideal problem appears to be unsolvable. The practical problem is beset with additional difficulties. First, the behavior of a program may depend very heavily upon the data associated with it for a given run. Hence, observations of its behavior on past runs may be quite unreliable as a guide to its behavior on subsequent runs. Second, the activity of the supervisory program may interfere in a relatively unpredictable way with the activity of the programs being supervised. This interference may be felt on the disk and tape channels as well as on the processing unit. Third, considerable variation may be expected in the speed with which tape-handling operators respond to reel-changing instructions. Fourth, if runs are taken out of their arrival sequence, the space and time overheads are difficult to predict, since they are dependent on the arrival sequence itself, as well as on the characteristics of each run to be done. Fifth, delays which may be incurred in recovery from machine malfunctions of various types are also virtually unpredictable. These practical difficulties suggest the adoption of an empirical approach in which heavy emphasis is placed on short-range, rather than long-range, decision-making. I n an article entitled “Multiprogram Scheduling” [S], the writer described an approach which might be used on either a short- or long-range basis. This approach has now been adapted by R. H. Ramey and the writer in order to include the special aspects of tape scheduling and allocation, and to emphasize short-range decision-making more heavily. Before proceeding to describe various approaches, the terms (‘scheduling,” ‘(allocation,” and “queueing” need clarification. 5.1 Scheduling, Allocation, and Queueing
By “scheduling” we mean the determination of which run is next to enter the preparation phase and at what stage of the proceedings this entry is made. “Allocation” refers to the determination of which parts of core and disk storage, and which tape units are to be assigned to a program under consideration by the scheduling routine. The term “queueing” is used primarily to refer to the set of queue selection rules (or queue disciplines) applied to the servicing of demands arising from programs in the execution phase. Kote that in some programming circles the term “scheduling” has been used rather oddly to denote nothing more than queueing in the execution phase.
106
E. F. CODD
We may now identify three principal modes of operation, according to the information assumed to be available for each run: (1) the nonscheduled mode (no information) ; (2) the space-scheduled mode (space information only) ; and (3) the space-time scheduled mode (space and time information). The fourth logical alternative, the time-scheduled mode, seems to be of little practical interest. A cursory description of the three principal modes now follows. 5.2 Nonscheduled Mode
In the nonscheduled mode, space reservations are acquired by each program only as the need for space becomes vital to the continuation of the program’s loading or execution. For practical reasons, a demand for more space in core and disk storage results in the assignment of a block of locations large enough to keep the assignment overhead reasonably low and consistent with the resolution of the protection scheme. Whenever a request arises for core space, disk space, or a tape unit, and the space currently available is insufficient, the program issuing the request is, at the very least, held up until the required space is available. It may be necessary to remove the program from the machine. This case arises when, for example, execution of two or more programs has been started and it is subsequently discovered that their combined tape-unit requirements exceed the number available on the machine. A space overload might also occur in disk or core storage. A disk overload is about as awkward to handle and as easy to avoid as a tape overload. A core overload, however, may be readily handled by the supervisory program, if programs and their associated data are not location-dependent at any time during their execution phase. The nonscheduled mode is most undesirable if the workload entails a significant amount of tape handling. It provides no assurance that reelchanging activities will be handled concurrently with productive processing of other parts of the workload by the computer system. Note that, in any event, optimizing is confined to the choice of suitable queue disciplines for the execution phase. The nonscheduled mode has very little application in batch multiprogramming. It is discussed here only for the purpose of exhibiting an extreme approach, and thereby putting some more reasonable approaches in their proper perspective. 5.3 Space-Scheduled Mode
We shall assume that the space requirements for a run are completely specified in the corresponding run request, except for compile-and-execute
MULTIPROGRAMMING
107
runs. In the latter case the compilation phase will generate a run request with the appropriate space information to be used for the execution phase. Time information is assumed not to be available. One simple approach is to service run requests in the order of their arrival. Upon reading a run request into core storage, the scheduling routine compares the tape space required with that available. If all the tape space needed is available, tape units are allocated and the execution control is notified that tape-handling instructions must be issued to the operators. The scheduler then calls for allocation of the required disk space. If space is available and there is a block of initial disk data to be loaded, loading is initiated. Finally, when tape and disk requirements have been met, an attempt is made to find a sufficiently large block of core storage for the run. If successful, the program is loaded into the assigned area and adjusted if necessary to tzheform appropriate for this particular place in core storage. Now, of course, any of the comparisons of space needed and space available may revcal a deficiency in that available. The preparation phase for this program is then stalled until sufficient space of the kind needed becomes available. Release of space reservations normally results from a program reaching the end of its execution phase. Possible elaborations of this approach include permitting piecemeal allocation and preparation of tape units whenever any of the needed tape space is available. Also, a program requiring no tape-unit assignment (for example, one that uses the shared output tape for its final results), might be allowed to overtake another program in the preparation phase if this other program were held up for lack of tape units. As we shall see when we deal with tape allocation, some saving in the number of reel changes can usually be achieved with this simple approach. Of course, the composition of program mixes in the execution phase is quite uncontrolled. Nevertheless, this type of operation may be profitable. Is there any possible advantage in servicing run requests out of their order of arrival? In the absence of time information for each run, only two potential gains arc apparent. First, a further reduction in reel changes may be achieved. Second, the average number of programs run concurrently may be increased. An example will illustrate this latter point. Suppose there are twenty runs to be executed, all of approximately equal length, and the run requests arrive in the following sequence: ten runs, each requiring three-quarters of the total core storage available, followed by ten runs, each requiring one-quarter. If the runs are taken in their order of arrival, the average number of programs run concurrently is approximately 1.5, while an average of 2 can be achieved if they are taken out of this order. Now, an increase in the average number of programs run concurrently does not necessarily result in a reduced time to execute the entire set of runs, but
108
E. F. CODD
the statistics collected by a particular installation may show that such a reduction is likely. To service runs out of the sequence of arrival of the corresponding requests, a more sophisticated scheduling routine is required, and provision must be made for storing the programs and initial data in a more readily accessible medium than tape. Thus, an area in disk storage which is termed the staging file is set aside for this purpose. We may expect the most frequently used programs to be kept permanently in disk storage until obsolete. Whenever any one of these is required for a run, it need not be loaded into the staging file, as it is already in an accessible spot. 5.4 Space-Time Scheduled Mode
I t is unrealistic to assume that detailed information can be made available about the expected pattern of use of each of the time-shared facilities by each program. It is reasonable, however, for a large class of programs, to assume that each program’s over-all use of the time-shared facilities is given in approximate form. We have already observed that the supervisory program can readily accumulate for each run of a program the total PU service, disk-channel service, and service from each tape unit. I n addition to these times, the supervisory program can generate an approximate (in some cases, exact) value for the execution time of a program which would have been observed had that program been run alone. A convenient way to characterize a program’s expected use of the machine is therefore as follows: (1) the space requirements; (2) the execution time if run alone; and (3) time fractions for the PU, disk channel, and each tape file; where the time fraction rii of program i on facility j is equal to the corresponding service time p i j divided by the execution time if run alone t,. rij = p,j/ti
The values of p ; j ( j = 1, 2, . . .) and ti which are produced by the supervisory program in one run of a program i may be supplied to the programmer for use on a subsequent run. If the program is expected to make the same gross demands for time as before, these values may be fed back to the scheduling routine unchanged. If change is expected, the programmer is called upon to make rough estimates of new values. For example, the programmer might reasonably be asked to select one of the five values, 0, $, 4, 3, 1 for an expected time fraction. Note that, if the programmer had to provide his own assignment of tape units, he could not do this intelligently without some knowledge of the time fractions for each of his tape files. Having considered a possible characterization for the time requirements
MULTIPROGRAMMING
109
of a program, JVC may now discuss how such information can be used. In scheduling it may be used to select mixes of programs which are likely to prove more profitable. In tape allocation, it may be used to achieve morc uniform loadings of the tape channels. (Incidentally, this latter use would be completely unnecessary if the tape channels were equipped with a crosspoint switch, so that any tape unit could communicate with core storage over any nonbusy tape channel.) As in the space-scheduled mode, the order in which run requests are serviced needs to be resolved. In the space-time scheduled mode, adherence to the sequence in which run requests arrive in core storage would appear inconsistent with the provision of time information. Accordingly, as each run request comes in, the program and initial data (if any) which accompany the request are normally transmitted to the disk staging file, later to be selected for preparation and execution when the scheduling routine considers the prevailing conditions to be opportune. An algorithm for scheduling in the space-time mode is discussed later. First, we consider the special problems of allocating space in tape, disk, and core storage. In passing, we note that the choice of scheduling mode and the more basic choice of executing programs one a t a time or concurrently must be based (at least in part) upon the nature of the workload. For example, if the workload consists of runs, all of which have a PU time fraction of unity, then it would be pointless (in the batch environment and assuming a single PU computer system) to place more than one program a t a time into the execution phase. In this case, concurrency between the execution phase of one program and the preparation phase of another might still prove profitable. 5.5 Tape Allocation
The choice of method for allocating tapes to tape units can have a very considerable effect upon the throughput rate in both sequential and multiprogrammed operation. Well-planned allocation can result in a reduction in the number of reel changes. It can also provide more uniform loading of the tape channels with the result that channel bottlenecks are avoided or reduced in magnitude. To understand the problem we must consider the various states which may be assumed by tapes and tape units. Three initial states, u, v, w and three final states, U , V , W are defined for tapes. To treat the initial states, suppose a program is about to use a tape for the first time in a run. If the information on this tape is of no significance to the program, the initial state of the tape is u. Otherwise, the initial state is either v or w.It is w if, after the significant information was recorded, the tape was left mounted on the tape unit for use by this program. It is v if the tape was demounted and the informabion saved off the machine.
110
E.
F. CODD
To treat the final states, suppose that a program has just finished using a tape. If the information on this tape is now obsolete, the final state of the tape is U. Otherwise, the final state is V or W . It is W if the tape is left mounted on the tape unit so that its information content may be used in some other run. It is V if the tape is demounted and saved for some other run. Note that a program may transform a tape from any one of the three initial states to any one of the three final states. The popular term for a tape with initial state u and final state U is “scratch.” Five states A , El U , V , W are defined for tape units. These states are pertinent when the allocation routine is being executed. If a unit is already assigned, it is in state A . If not assigned and no tape is mounted, the unit is in state E.If, finally, a tape is mounted but the unit is not assigned, the unit assumes the same state as the final tape state (i.e., U , V , or W ) . The allocation of tapes to tape units may now be treated in terms of these five tape-unit states and the three initial states for tapes. The permissible couplings between tape-unit states and initial tape states are as follows: Eu, Ev, Uu, Uv, Vu, Vu, Ww. Couplings of type Uu and Ww require no tape handling a t all. Couplings of type Eu and Ev require tape mounting only. All other types of couplings require tape demounting as well as tape mounting. The following allocation rules minimize the number of reel changes required to prepare a given run, assuming there are enough unallocated tape units to accommodate all the initial tape files for this run. First, dispose of all Ww couplings which were predetermined. Second, make all possible Uu couplings. All remaining couplings necessarily involve tape mounting. Third, make all possible Eu and Ev couplings. Now, if there are any tapes left to be assigned, a full reel change is necessary for each. Finally, therefore, make Uv,Vu, and Vv couplings as necessary for the remaining tapes. In each of the second, third, and final steps, any one of several tapes may be assigned to any one of a corresponding number of tape units. Whenever this is the case, the freedom of association is exploited to make the loading of the tape channels as uniform as possible. 5.6 Disk Allocation
Reservations of space in disk storage are conveniently divided into two classes: short term and long term. Short-term reservations are intended for the use of programs (and associated data) for which a run request has been received. Such reservations are normally cancelled upon completion or termination of the run. Long-term reservations may last for a day or, in some cases, for weeks.
MULTIPROGRAMMING
111
The long-term reservations consist of seven large areas into which disk storage is divided. These areas are now listed with their uses. (1) Systems File. This area is reserved for systems programs such as the supervisory program, compilers, and debugging aids. Only occasionally is it necessary to write into this area. At all other times this area is used on a read-only basis. (2) Nonsystems Program File. This area is reserved for programs other than systems programs which are executed sufficiently frequently to justify their retention in disk storage. Changes in the contents of this area are likely to be considerably more frequent than in the systems file, due to new programs being introduced and old ones being deleted. (3) Staging File. This area is required if run requests are being serviced in some sequence other than their arrival sequence. The information for each run, other than that already present in some other diskstorage area, must be transmitted into the staging file if the run is not selected for preparation and subsequent execution at the time of the arrival of the corresponding run request. (4) Execution File. This area is reserved for the use of all nonstandby programs in the execution phase. (5) Log File. This area is reserved for the current section of the operating log for the machine. (6) Dump File. This area is reserved for emergency dumping of the entire contents of core storage, and therefore has a capacity equal to that of core storage. (7) Standby File. This area is reserved for programs being operated on a standby basis. In general, programs in this area have reached some arbitrary stage of execution, and are accompanied by data and intermediate results. The boundaries of all seven files are fixed on a long-term basis. Short-term reservations are made within the boundaries of the execution file, the staging file, and the standby file. For the sake of brevity, we discuss allocation within the execution file only. Within the disk space allocated to a particular program it is desirable to permit the programmer to organize his data into separate files. Each of these files is identified by a symbolic address, rather than an absolute oneas mentioned in connection with disk protection (4.8.4.3). Initial states analogous to those defined for tapes may be defined for disk files. Thus, we consider a disk file belonging to a program which is about to enter the execution phase. If the information in the disk area assigned to this file is not required to be of significance to the program, the state of the file is 11,. If the program depends upon thc loader to copy initial disk data
112
E. F. CODD
from the master input tape into the assigned area, the state of the file is v. Finally, if the program depends upon some program other than the loader to produce results which become the initial data for this file, the state is w. Allocation of disk space to the files belonging to a given program may be handled in many ways. We assume that the area assigned to any single file always consists of a set of consecutively addressed arcs. The allocation routine may or may not require that the files be placed adjacent to one another. Arguments for permitting scattered placement of a program’s disk files include the following. (1) The space in the execution region of disk storage may be better utilized because a tighter packing is achievable. (2) A file of results produced by one program can become a file of data for another without moving the information. (3) If time fractions (or equivalent information) are available for each file, more uniform loading of the disk-seeking mechanisms may be attainable through placing some files on the first disk unit and others on the second. These advantages of scattered placement are accompanied by the penalty of extra overhead activity in the allocation routine, and also the possibility of higher seek times, which will occur if the files of two programs are interspersed and one of the programs terminates, leaving the other to seek back and forth between widely separated files. More tests are necessary to determine if a program’s requirements for disk space can be satisfied. For simplicity of exposition, we assume that scattered placement of a program’s disk files is not permitted. Kow, under these assumptions, the problem of allocating disk space to nonstandby programs entering the execution phase is essentially the same as that of allocating core space to such programs. We proceed to treat this problem in the next section. 5.7 Core-Storage Allocation
The problem to be treated first is that of allocating space in the execution region (Fig. 6 ) of core storage to nonstaiidby programs. Each program is assumed to require a single set of consecutively addressed words (or space units4).Such a set is called a block of core space. In this context, blocks may consist of any number of space units. The block allocated to a nonstandby program is held by the program until the end of its execution phase. The expected duration of the execution phase is initially assumed to be unknown or ignored. Because of the wide variation ill the core-space requirerimits for dif4
It matters little whether the unit of spare is a single word or many words.
EXECUTION SET
SHAREDOUTPUT
1
MASTER INPUT
TAPE STORAGE
PROGRAMS EL INITIAL DATA
FIG.6. Organization of storage for batch multiprogramming.
RUN-REQUEST FILE
CORE STORAGE DISK
2
NONSYSTEMS PROGRAM \ FILE
FILE
STORAGE
E. F. CODD
114
ferent runs, it is desirable to allocate space so that as much as possible of the space which remains unallocated belongs to a single block. Therefore, whenever only x words are to be allocated from an available block of y words (y > x), the set of x words at one end or the other of this block is selected. The original block is accordingly divided into an allocated block of x words and an unallocated block of (y - x) words. Generally, when a new request for space is about to be considered, there exist several unallocated blocks separated from one another by allocated blocks (Fig. 7). Suppose that the allocation routine maintains a list of ALLOCATED BLOCK
0 UNALLOCATED BLOCK
B
FIG.7. Example of allocated and unallocated blocks of space in the execution region of core or disk storage.
unallocated blocks ordered by size. A request for x words is satisfied, if possible, by scanning the unallocated-block list for the smallest block which contains a t least x words. When such a block B is found, an arbitrary choice is made between the two extreme positions in B, except when one of the boundaries of B happens to be a boundary of the entire execution region; in this case, the extreme position on this region boundary is selected. A scheme such as this which ignores occupancy times may be perfectly adequate if all occupancy times are comparable in magnitude-a common characteristic of the commercial real-time environment (3.1.5). In batch multiprogramming, however, wide variation in the occupancy times for different runs is normal. The resulting difficulty may be demonstrated by an example. If expected occupancy times are ignored, it is clearly possible for a very long program P to be given a position in core storage which is not on either boundary of the execution region (Fig. 8). As long as P occupies this non-
TIME
FIG.8. Fragmentation of unallocnted space by a long program occupying a central position in the execution region.
MULTIPROGRAMMING
115
boundary position, the largest block of space which can be made available is the larger of S1, SZ.If P were in a boundary position, a block as large as SI SZcould be made available. If the computer is capable of executing a program in relative form, a periodic relocation of long programs toward the boundaries of the execution region solves the problem. In the case of a computer capable of executing a program with semisymbolic addresses, the problem arises only if the space unit of the allocation scheme is not an integral multiple of the symbolic block size. For a computer which has neither a relative nor a semisymbolic addressing capability, we may solve the problem, a t least partially, in the following way. Associated with each nonstandby program is a maximum occupancy time. When such a program is being considered for placement in an unallocated block B1 flanked by two allocated blocks Bz, Ba, we require that the maximum occupancy time for this program be less than or equal to the larger of the remaining maximum occupancy times of Bz and BS. If the unallocated block B1 has a boundary in common with the execution region (i.e., it is flanked on only one side at most by an allocated block), no time constraint is applied. Variations of this rule may be worth considering, depending upon the average number of programs sharing core storage. The allocation of core space to standby programs is somewhat simpler, because such programs normally retain their core reservations for the short time intervals associated with rewinding and reel-changing activities. Thus, an allocation rule such as the first one mentioned in this section may be used. We observe that, in a machine which has neither a relative nor a semisymbolic addressing capability, standby programs may be constrained to operate in those core locations originally assigned to it. In such circumstances, it would appear wise to have at least one standby program assigned to one boundary of the execution region and a t least one to the other.
+
5.8 Advance Commitments
In Section 5 arguments have been presented for short-range, rather than long-range, scheduling. We now consider how short the scheduling range may usefully be, when programs are being serviced in an order which is not predetermined. Suppose the scheduling routine has determined that P is the next program to enter the preparation phase, even though sufficient space for P will not be available until the execution phase of at least one current program is finished. Such a decision by the scheduling routine is called an advance commitment. For practical reasons, it is particularly undesirable to call for tapes to be mounted for P, then cancel the commitment to P and call for these tapes to be demounted, not having used them.
116
E. F. CODD
The chief incentive for making an advance commitment to P is that it may be possible t o complete the tape-mounting activity for P while the execution phase of the current programs proceeds. The chief difficulty in making an advance commitment to P is that the selection of P itself frequently requires a judgment to be made as to which of the current programs will be completed first. There are three special cases in which advance commitments may be made without difficulty. I n the first case, the workload consists entirely of programs which behave very much as predicted (under and overrunning being very rare). This case is sufficiently unlikely that we shall not discuss it further. In the second case, only one program Q is in the execution phase, none is in the preparation phase, and none of the pending programs can fit with Q or be profitably mixed with Q. In the third case, P is considered sufficiently urgent that its execution phase must be started as soon as possible without displacing any current programs, but it cannot be accommodated until one (or more) of these programs release space. A program may be placed in the urgent category if it remains in the scheduling phase an excessive length of time. Since the scheduling algorithm given in the next section will tend to delay programs with large space requirements in favor of programs with lower space requirements, it may be desirable to treat programs as urgent if they are delayed too long. Apart from these special cases, advance commitments are likely to prove unprofitable. Normally, therefore, scheduling is extremely short range and is based very heavily on the conditions which have actually developed, rather than projected conditions. The selection of P as the next program to enter the preparation phase is normally not made until its preparation can be initiated and taken to completion without waiting for release of space by any other program. 5.9 Short-Range Scheduling
Barring an emergency such as a unit becoming unserviceable, scheduling activity is required only when the execution phase of a run is completed (or terminated) or a new run request is read into core storage. In the first case (end of execution phase) the scheduling routine considers which run of all those pending would make the most profitable addition to the scheduled load. If successful in finding a profitable addition, it includes this run in the schedule and then searches for a profitable addition to the augmented schedule, and so on, until no further profitable additions may be made a t this time. The preparation phase is then initiated for all selected runs. In the second case (run-request arrival) only one run need be considered; namely, the one whose request has just arrived. It is scheduled or
MULTIPROGRAMMING
117
temporarily shelved according to whether it makes a profitable or unprofitable addition t o the scheduled load. It would be most direct to identify profitability of an addition to the schedule with the resulting time saved in disposing of the scheduled and pending workload. However, estimates of this time saving may be grossly in error due to (1) programs, especially long ones, overrunning or underrunning their estimated service requirements; and (2) delays suffered by each program in each mix being difficult to predict. These uncertainties suggest an approach in which profitability is treated as a simple function of the loads on the time-shared facilities. The load X, on a time-shared facility j may be measured by the sum of the time fractions of all the scheduled programs X (excluding advance commitments) for this facility; that is, XI = C r23.Loads defined in this arX
way must be normalized, since a time-shared facility cannot dispense more than one unit of service in one unit of time. We therefore define the normalized load as h,
=
Al/max { 1, max (A,)}. I
As an example, consider a machine with three time-shared facilities j = 1, 2, 3. Let there be three programs i = I, 2, 3 with time fractions listed as follows: j = 1 j = 2 j = 3 1
3
i = l 4 4 0 1 -1 1 i = 2 4 2 3 1 1 i = 3 1 2 2 If the set X of scheduled programs consists of program 2 only, we have the following loads : x = (21 x1 = f, Xa = 3, A3 = 3 ~
XI =
f, hz
=
3, XJ = 3
Programs 1 and 2 together yield
x=
(1, 2:
x1 =
1, A? =
2, As
X I = 1, A? = $, ha
3 = 3 =
whilc programs 1, 2, 3 together yield
x
=
(1,2,3)
X I = 2 , Xr = It,
X I = 1, A2 =
5,
=
1
ha =
3
x3
Notice the effect of iiorninlizing the loads in this last case.
E. F. CODD
118
Associated with the set P of pending and scheduled programs are the total expected service times required for each time-shared facility. When normalized, these times become dimensionless fractions which may be used both as target loads for the corresponding facilities and as measures of the importance of attaining these target loads. Let aij be the expected service time required by program i on facility j . The total expected service time required from j by set P is given by wj =
c
aij,
ifP
and the normalized weight wj is given by w i = wj/max (wj). j
We define the rating
T,
of a given set X of scheduled programs by T,
=
C wjA(wj - Xj), i
where A(wj - Xi)
=
if wj - Xj 5 0 - X i otherwise
("wj
The A function is used in place of Iw, - A,] or (1 - A,), because it appears desirable neither to discourage nor to encourage loads greater than the target values. On the other hand, it is desirable to discourage loads less than the target values. Suppose a program has just ended and the set of programs remaining in the schedule is denoted X. Each of the pending programs which can be accommodated in the tape, disk, and core space available is rated as an addition to the schedule by tentatively including it in the set X to give a set X', computing the corresponding value of Tzf. That program is selected which gives the minimum value of r2', provided5 this value is less than the rating T, of the unaugmented set X. Whenever the set X becomes empty, we may bypass all comparisons of space required and space available, and omit the rating procedure entirely. In such an event, we select the longest tapeless program if one is available; otherwise, we select the longest program from the pending workload. If a program Q is selected when the rating procedure is invoked, Q is included in the set X until its execution is completed or terminated. The space available is adjusted to reflect the inclusion of Q in the schedule. Now, a second attempt is made to find a pending program which can be profitably accommodated. Such attempts continue so long as they are E This provision may be advantageously omitted when the set X has only one membcr. If thc membership of X is not increased beyond two by the current scheduling activity and the mix (R, Q ) is less profitable than the original single program R, then R mny
l x run with priority over-Q on all fari1itic.s.
MULTIPROGRAMMING
119
siiccessful. Failure to select a program for inclusion in X causes the scheduling routine to become inactive until triggered once again by an end-ofrxecution phase or run-request arrival. This simple procedure is unfortunately inadequate without some modification, because it ignores the special properties of the disk and tape facilities. When two or more programs share use of a single disk, the resulting seeking activity may be considerably in excess of that which would have been experienced had these programs been run alone. Then again, the profitability of adding a given program to a given schedule may be highly dependent on the various allocations for its tape files which are currently attainable. The following procedure takes these considerations into account for a system with a single disk unit (equipped with just one seeking mechanism) and two tape channels. Extensions of this procedure to handle more than one disk unit or seek mechanism and more than two tape channels are readily apparent. Time fractions rz,, loads A,, and weights w,are relabeled as follows for clarity. PU DISK T-4PE FILE
f
rt,w
Xpu
wpu
r%>D,
*
wDK
r%,TPf
TAPE CHANNEL
* *
y
TAPE SET
AT,,
*
*
* WTP
Note: in this table, “*” means “irrelevant.” The disk time fraction r,,,, includes both transmission and that part of the seeking activity which would be experienced if program i were run alone. In addition to this, we require an estimate 6rc,Dxof the extra seeking activity which is included when program i is run concurrently with another program which uses the disk. An approximate measure for this is 6rZ,DK = m,S/t, where (1) m, is the total number of disk reads and writes requested by program i, excluding those for which program i explicitly requests seeks; (2) S is the average seek time for the disk. Whenever a run request for a nonstandby program i arrives, the weights are updated as follows: w’,= w,f r& wLaX= max (w’,) 3
w‘,= w’,/wLax. The end-of-execution phase of a nonstandby program triggers a similar recomputation of weights, the service times for the departing program being subtracted, instead of added. The primes on the w’s are now dropped.
E. F. CODD
120
To rate a program Q as an addition to the set X of scheduled prograins, we tentatively allocate the tape files (see Section 5.5) to determine the channel loads The disk and PU loads are computed
where X' is X augmented by program Q. We also require the induced disk load
C 6r1,vKif more than one program uses disk, 6hDK= fx
0 otherwise. Loads are now normalized as follows:
A,,
max (Apc, AD, max (I, A,,) = Apu/m
AVK
=
A,
=
m
+6 L ,
h i ,
ATCd
=
XDKIm
XTCl/m ATc2/m Finally, the rating of program Q is given by 70
=
ATCl
=
hTC2
=
wpu.A(wpu - Apu)
+ wDK.A(wDK - h v ~ ) + wTP.A(wTP - ~ C I +) wTP.A(WTP - L P ) .
Note that the inclusion of the induced disk load in the determination of together with its exclusion from AD, gives the desired effect of a potential reduction in the normalized load on the disk.
, , ,A
5.10 Queueing
Four requirements for the queue disciplines used in batch multiprogramming are: (1) a tendency to keep all facilities heavily loaded, particularly the bottleneck facility; (2) the ability to handle urgent programs on a high priority basis; (3) the ability t o expedite programs consuming large amounts of space, if space-time is a bottleneck; and (4) simplicity. To observe the first requirement, it is necessary to exploit the special
MULTIPROGRAMMING
121
properties of the various time-shared facilities; for example, the ability of the processing unit to be interrupted. It is also necessary for the queueing scheme t o be responsive to changing patterns of behavior on the part of the programs currently being coexecuted. The following scheme is likely to be found satisfactory in batch multiprogramming. On the processing unit, priority is given at queue selection time t o that ready program which required the shortest burst of service from the PU when it last obtained such service. Each time a program relinquishes the P U or is displaced from it, the value of the length of the last burst is replaced. Consequently, the processing priority of a program is subject t o continual change depending not only upon the variability of its own behavior, but also on that of the other current programs. Queue selection is carried out when any of the following events occur. (1) A program being serviced b y the PU becomes not ready for processing (for example, a WAIT pseudo-op is issued for a n I0 operation which has not been completed). (2) A program, formerly not ready, becomes ready for processing (for example, an I0 operation being awaited is now completed). (3) A program being serviced by the PU has failed to relinquish it and has not been displaced from it for x units of time; where z is a fixed arbitrary limit imposed on the length of continuous P U service to a single program. At queue selection time, all programs ready for processing are considered t o be in the P U queue, even the program serviced most recently (provided it is still ready). This queueing rule tends t o expedite entry into the NOT READY state of those programs which have a tendency to enter this state. When in this state, these programs are utilizing the I0 equipment. Meanwhile, the P U is kept well-loaded by programs which tend to (but are not allowed to) monopolize it. These latter programs may also use the I0 equipment concurrently with the PU. Associated with this queueing rule on the PU, first-come-first-served (FIFO) would be appropriate on each tape channel. On the disk channel, unnecessary delays in seeking may be avoided by selecting that service request which entails the least movement of the seek mechanism, taking its current position into consideration. This rule needs slight modification because it could result in a request for service being ignored for an indefinitely long time interval if an outlying area of the disk were involved. A simple solution is to make sweeps in alternate directions clearing u p all the current requests for one direction before changing direction. E. S. Lowry has proposed the following, more sophisticated scheme. For program P , the quantity
122
E. F. CODD
Y i= C rij 3
where j ranges over those time-shared facilities for which Pi is currently unready, gives a good measure of the capacity of work on Pi to create readiness on ot,her facilities. The values of rij (supplied initially if the space-time scheduled mode is being used) are added to and subtracted from Yi whenever Pi goes unready or ready on a facility j . The initial value of Yi is the sum of rij for all j except the PU. Queue selection for the PU and tape channels entails choosing that program which has the largest value of Y;at this instant, unless two or more programs possess values very close to this maximum. In this case, priority is given to that request (associated with those programs with values of Yi at or near the maximum) which is likely to restore buffer levels to equilibrium most promptly. Note that, if buffer levels are kept in or near a state of equilibrium, all Yiare likely to be very small.
6. Multiprogramming with Two or More Processing Units 6.1 Motivation and Requirements
The incorporation of two or more functionally identical, self-sufficient, in a single computer system is general purpose processing units (PU’S)~ becoming increasingly important as higher processing speeds and higher degrees of reliability are demanded. We focus attention on systems in which the PU’s share the use of memory and input-output channels, because, in such systems, the current workload can be distributed over the various system components in an extremely flexible way, and this will very often yield high overall efficiency. An example of this type of system is illustrated in Fig. 9. The workload is assumed to consist of a number of independent programs (referred to as problem programs or PP’s) which need to be protected from damaging one another when they are concurrently executed. Each of these problem programs may itself be a complex of dependent programs which can be executed concurrently, subject to constraints contained within the programs themselves in the form of special operations to be discussed later. We shall deal with the object form of these programs and omit consideration of their source form and compilation. A fundamental requirement is that the system is to continue in operatio11 if any PU’s become inoperable, so long as at least one PU remains operable. This requirement has many implications ; in particular, the following: Note that the PU’s may differ in their performance characteristics and construction, but are completely interchangeable in all functional rePpcrt,s.
...
----
9
L-----
I0
\
1 -----
DISK CHANNEL I
\
\
/
1
TAPE UNITS
-
-
I'
-
2' -
3'
4'
2
\
L/
3
TAPE CHANNEL
\
..*
-- - - - 3 - - - - -
TAPE CHANNEL
\
-7-
FIG.9. 0rganisat.ion of computer system.
'~NSTRUCTIONS ---L
I
2
\
PROCESSING UNIT
PROCESSING UNIT
3
/
I-
I0 INTERRUPTIONS 7----7----F----
/
---
32-
TAPE UNITS
4-
I-
DISK UNITS
2-
z
w
h)
d
0
3 3
3
F-r 8-u
124
E. F. CODD
(1) The supervisory program must not be permanently associated with any particular PU or subset of PU’s, nor must it require the undivided attention of a whole PU. (2) It must be possible to initiate I0 activities on any channel from any PU. (3) Every PU must be capable of responding to interruptions of all types, including I0 interruptions. Of course, to avoid duplicate handling of I0 interruptions, it is desirable at any instant for only one PU to be designated to receive such interruptions. (4) Every problem program must be in such a form that the correctness of its execution does not depend on which PU’s, and how many PU’s, are available to service the program. A second requirement is that two or more PU’s be permitted to execute concurrently a single set of instructions using different, but possibly intersecting, sets of data.’ This requirement arises when processing large arrays of data. In these circumstances, segmentation of data for concurrent operation is more readily effected and likely to be more profitable than segmentation of instructions. When several concurrent executions of a single set of instructions are to be initiated, the starting address for fetching instructions is insufficient to characterize uniquely each of the corresponding requests for processing service. For each request we require, in addition to the starting address, those index quantities and parameters which are pertinent to this request. All of these items may be made available in a set of consecutive locations. A request may then be uniquely characterized by specifying the base address of this set. This base address is called the jirst base of the corresponding request. Note that this requirement would not arise at all in a system in which all the PU’s were functionally specialized. A third requirement is a means of preventing more than one PU from concurrently modifying an item in memory. Consider, for example, that two processing units are concurrently servicing a common section of code, and the code requires that each PU reduce a certain count in memory by unity. If the first PU fetched the count from memory after the second PU had fetched it but before the second PU had stored its reduced value, then, when both PU’s have completed their decrementing and storing of the count, the value in memory is only one less, instead of two less, than the original value. To overcome this difficulty it is necessary to provide in the system for temporarily blocking references to selected locations in memory or entry by more than one PU into selected sections of code. The latter approach appears more satisfactory and is adopted in this paper. Note that a shared set of instructions may he a large or a small set, and may or may not contain branches and loops.
MULTIPROGRAMMING
125
A final requirement is that there be a priority scheme which permits urgent programs to be processed expeditiously and normal programs to be processed with relative priorities which yield good utilization of the equipment. Priorities must be under the control of the supervisory program. Accordingly, no problem program must be able to alter the priorities allocated by the supervisory program or impede their implementation by holding on t o a processing unit which is needed by a higher priority program. Thus, it is necessary to provide for displacement (from a PU) of one program by another program a t an arbitrary stage of execution of the first. An address is required for dumping (and later restoring) the P U stat,us (arithmetic and index registers, etc.) of the displaced program-this address is called the second base. 6.2 Note on Implementation
I n what follows, the supervisory functions are described as though they were implemented by an ordinary program executable b y any PU. For the sake of simplicity, and because the supervisory activity may be expected to take but a small percentage of time of the PU’s, we shall assume that the supervisory program always operates in the blocked mode; i.e., a t any instant only one PU may be executing it. An alternative implementation would be by a microprogram. However, whether program or microprogram is used, the supervisor is retained in read-only memory because of its critical role in the operation of the whole system. Supervisory tables, on the other hand, are held in regular core storage and are protected by the same means applied to problem programs. 6.3 Rules for Interruption
Interruptions generated within a given processing unit are normally handled by this same unit. Examples are: (1) the interval timer in this PU reaching zero; ( 2 ) program exceptions, such as invalid op code or illegal address; (3) data exceptions, such as overflow, zero divisor, flagged data word, etc.; (4) a CALL SUPERVISOR operation being encountered in the program. I n cases (I), ( 2 ) , and (4) the supervisory program is called in on the same P U in which the interruption occurred. I n case (3) the interruption causes a trap t o a location within the execution area assigned to the problem program. An exceptional case is that of an interruption generated as a result of a malfunction within some PU. The corresponding interruption signal causes the malfunctioning PU to stop with its operable bit turned off (i.e., set to indicate that this PU is not operable in the normal sense for the time being). This signal also interrupts some other P U which
126
E. F. CODD
has its operable bit on (which one does not matter). Thus the supervisory program may be executed by a PU which is still functioning properly and may also take note of the temporary unavailability of the malfunctioning PU. We have already noted that all PU’s must be capable of receiving and acting upon I0 interruptions, and that only one PU at a time is so designated. If a malfunction is detected in the PU designated to receive I0 interruptions, these interruptions must be switched either automatically or under the control of the supervisor to some other PU which is operable. We choose the latter approach because it facilitates implementation of the priority requirement. Thus, whenever the supervisor assigns work to a PU-or attempts to find work and fails-it determines which PU has the lowest priority activity, and selects that one to receive I0 interruptions, at least until the next work assignment for PU’s is considered. Note that idleness is the lowest priority activity of all. 6.3.1 Nondata-Exception Interruptions Suppose the supervisory program is not currently active on any PU. Then, every operable PU is capable of accepting, and acting upon, a nondata-exception interruption generated within itself and is said to be in the normal state. In addition, one of these PU’s is set to accept and act upon an I0 interruption, should it arise. Now, suppose a nondata-exception interruption occurs on Pun.Further nondata-exception interruptions in Pun are not disabled, because, as we shall see, their occurrence means an emergency situation. PU, is, however, placed in the executing supervisor state. In this state nondata-exception interruptions cause a trap to special locations designated for emergency action. Simultaneously with PU, being placed in the executing supervisor state, all other PU’s and all I0 channels are placed on notice that each one may continue to operate concurrently with PU, until such time as a nondata-exception interruption is generated within that I0 channel or PU. This channel or PU must then enter the waiting for supervisor state, in which all of its registers are frozen until the supervisor can be made available to it. In this way any interruptions requiring supervisory treatment which are generated at a time when the supervisor is busy handling some other activity are held in suspension until the supervisor is free to work on them. The supervisory program is constructed so that it does not generate interruptions at all unless a malfunction has occurred in the PU, memory bus, or memory. Therefore, the generation of an interrupt condition in a PU which is executing the supervisor calls for emergency action. Upon completing its activity on PU,, the supervisor places this PU in the on-notice state and issues a release signal to all I0 channels and all
MULTIPROGRAMMING
127
PU’s including itsclf. If none of the PU’s is waiting for the supervisor, all PU’s and all channels are released by this signal from the on-notice state and returned to the normal state. If any of the PU’s are waiting for the supervisor, one of these is selected in an arbitrary way for placement into the executing supervisor state, and all other PU’s and all channels are kept in the on-notice state. Finally, after PU’s waiting for the supervisor have passed one by one through the executing supervisor state, the frozen channels, if any, are selected one by one to submit their waiting interruptions to the PU with the lowest priority activity. Note that the executing supervisor state is not defined for channels, because they only generate interrupts-they do not act upon them. We may now summarize the interruption states of I0 chaniiels and PU’s by means of the state diagrams in Fig. 10. 1/0 CHANNEL
/-\ NORMAL
% s; : : supervisory :state
Release with no PU waiting for supervisor
WAITING FOR SUPERVISOR
ON NOTICE
I/O interruption
generated within this channel, with supervisor busy on some PU
PROCESSING UNIT
1
Nondata -exception interruption, with supervisor not busy
+ EXECUTING SUPERVISOR
NORMAL Other PU begins executing supervisor
visory activity superon
IReIease
F WAITING FOR SUPERVISOR
ON NOTICE
Nondata -exception interruption, with supervisor busy on other PU
FIG.10. Summary of interruption states of I 0 channels and PU’s.
128
E.
F. CODD
When a P U is in the normal or on-notice stsate,it is either executing a problem program or it is idle (i.e., it is not assigned to any stream and is merely marking time). Conversely, when a PU is executing a problem program or it is idle, it must be in the normal or on-notice state. I n the waiting for supervisor state, a PU is assigned to a stream and is therefore not idle in the sense defined above. The handling of nondata-exception interruptions by the supervisor is facilitated by the availability of two pieces of information in the hardware. First, the identifying number n of PU, may be read by the supervisor and used to locate table entries in memory for PU,. Second, the identifying number m of I0 channel m is deposited by hardware in a standard supervisory location whenever an interruption from that channel is taken by the PU designated to receive and act upon I0 interruptions. 6.3.2 Data-Exception Interruptions A data-exception interruption on a given PU disables further dataexception interruptions on that PU only and has no effect on nondataexception interruptions or their associated int,erruption states described above. It is the responsibility of the problem program generating a data-exception interruption to handle this interruption. A hardware operation ENABLE DATA EXCEPTIONS is available for use by problem programs. When one stream is displaced by another on a PU, the data exception state (enabled or disabled) is saved for the former and restored for the latter-along with all the other it,ems such as accumulator contents, index registers, etc. 6.4 Protection and Relocation
Each PU is equipped with its own protection system and, since all PU’s are functionally identical, so are all the protection systems. The protection system of a given P U is automatically disabled when a nondata-exception interruption occurs on that PU, thus permitting the supervisory program to have access to normally protected memory areas and registers, including the protection system registers themselves. Just prior to passing control back to a problem program on some PU, the supervisory program sets up the protection system registers with values appropriate to this problem program. As it passes control back to this problem program, the supervisor re-enables the protection system on this PU. A simple form of relocation and protection will sufIice for the purpose of illustration. Consider any one of the PU’s and suppose its protection system is enabled. All addresses developed within this PU for use in referring t o memory are incremented just prior to use by the contents A of a relocation register, and the incremented values are compared with the
MULTIPROGRAMMING
129
contents B of an upper boundary register. Whenever the addition results in overflow or the comparison indicates that the relocated address exceeds the upper boundary, a program exception interruption occurs and the supervisor is brought into action on this PU. Normally, A is the base address of the problem program. When two PU’s are servicing the same problem program, the values of A and B in effect on one PU are normally equal respectively to the values of A and B in effect on the other PU. Of course, it is certainly possible to have different pairs of values in effect, but the primary need for protection is between, rather than within, problem programs. 6.4.1 Restricted Hardware Operations The majority of operations provided in hardware are freely usable by any program. Certain ones, however, are intended for use by the supervisory program only while others are intended for use by problem programs only. For example, absolute I0 instructions are in the supervisor-only class, while the operation CALL SUPERVISOR is in the problem-program-only class. An attempt by a problem program to issue an operation restricted t o use by the supervisor, or vice versa, is aborted and a nondata-exception interruption occurs. This is realized in hardware by having the PU examine its own interruption state upon receipt of a restricted operation. A table of these restricted operations follow: ~
Supervisor only
Problem program only
CALL PROBLEM PROGRAM
CALL SUPERVISOR
S E T AND WAIT
ENABLE DATA EXCEPTIONS
START OTHER PU SWITCH I 0 INTERRUPTIOh-S
START CHANNEL,
etc.
We now define the first four supervisory operations and the first PP operation in this table. The others need no elaboration. (a) CALL PROBLEM PROGRAM, address p . Let the contents of the specified memory location p be an address b. The executing PU, say PU,, fetches a starting address from memory location b and places it in its instruction counter. PU, then enables its protection system, prepares so that any future nondata-exception interruption will trap t o nonemergency locations, places itself in the on-notice state, and sends a release signal to all PU’s. Prior to issuing this operation, the supervisor fetches the first base
E. F. CODD
130
or second base (whichever is appropriate) of the stream to be started,
and stores this address b in memory location p . It also restores all arithmetic and index registers per b, and sets up the relocation base register and upper boundary register if new values are required. (b) SET AND WAIT.^ This operation places a PU which encounters it in the idle, on-notice state and causes the release signal to be issued to all PU’s including itself. In the idle state, a PU is ready to accept either a start signal from any other PU or an I0 interruption. Of course, the I0 interruption switch must be set to this PU if it is actually to receive an I0 interruption. (c) START OTHER PU, PU number. Let the PU encountering this be PU, and the PU specified by the PU number be PU,. If n = 2, a program exception interruption occurs. If n # z and the operable bit of PU, is off, a program exception interruption occurs. Otherwise, PU, is placed in the waiting-for-supervisor state ready to start execution at a supervisory location associated with leaving the idle state. Actual execution starts on PU, as soon as it is permitted to go into the executing supervisor state by PU,, or some other PU leaving that state. (d) SWITCH 10 INTERRUPTIOXS, PU number. This operation sets the I0 interruption switch to the specified PU. It is permissible, in this case, for the PU encountering this operation and the specified PU to be identical. upon receipt of this operation from a problem (e) CALL SUPERVISOR. program stream, PU, disables its own protection system, traps to a nonemergency location assigned for this kind of interruption, and prepares for any future interruptions to trap to emergency locations. In addition, PU, places itself in the executing supervisor state or the waiting-for-supervisor state according to the availability of the supervisor. 6.5 Special Operations
A small set of special operations is adequate to permit a programmer to express his program so that two or more PU’s can work on it concurrently, if they happen to be available. These special operations, accompanied by appropriate addresses, are essentially instructions to the supervisory program. They enable the problem programmer to start new streams of activity, stop them, regroup them, and whenever necessary, block them. In addition, these operations provide a vehicle of expression which permits An operation similar t o this was defined in 1957 for the IBM STRETCU Computer by F. P. Brooks, Jr.
MULTIPROGRAMMING
131
a program t o be independent of which PU’s, and how many, are available to service the program a t any instant. A list of the operations follows. Processing
Input-Output
START
GET
STOP
PUT
BLOCK UNBLOCK
We now proceed to give an introductory description of these operations, after which we can deal with the queueing system and describe these operations in more detail. A typical format for one of these operations is as follows. Location
m m+l m+2
Contents special op code Slot First Base, Second Base CALL SUPERVISOR,
The slot is a word in which the supervisor can deposit addresses and bits for queueing purposes.
Slot, First Base, Second Base From the user’s viewpoint, this operation calls for continuing the execution of the current stream of instructions and starting the concurrent execution of a second stream a t a start address specified indirectly b y the first base. The index quantities and parameters for this stream are retrievable from a set of consecutive locations starting a t the first base. If status dumping is required a t any time in the execution of the stream now called, i t is to be effected per the second base. From the supervisor’s viewpoint, this operation represents a request for starting concurrent execution of a second stream-a request which may be serviced either now or later, depending on the availability of units and the competing requirements of other programs and of other streams in this program. Accordingly, the supervisor incorporates the request in the queue for processing service. The request is kept in the processing queue while being serviced as well as while waiting for service. Service for this request is not considered complete until the following operation is encountered. 6.5.1
START,
132
E. F.
CODD
6.5.2 STOP No slot or addresses are needed for this operation. The stream in which this operation is encountered is terminated. The supervisory program removes from the processing queue the corresponding request, and scans the queue for new work for the PU which was servicing this request. 6.5.3 BLOCK, Slot No addresses are needed for this operation. From the user’s viewpoint, this operation prevents more than one processing unit at a time from entering the code which immediately follows this operation. Actually, entry of a second PU is only prohibited if it is attempted via this operation itself. This limited form of protectiong is quite adequate for this purpose. The supervisor determines whether entry into the code immediately following is permissible or not. If it is, a bit is set in the slot to prohibit any other entry via this operation until further notice. If this bit (the blocking bit) is already on, indicating that entry is not permissible, the request which was being serviced by this processing unit is re-chained into the processing queue in such a way as to indicate that availability of the code as well as of the unit is awaited. 6.5.4 UNBLOCK, Block Address No slot is needed for this operation. This operation permits a new entry to this section of code at the block address, such entry having been previously prohibited by a BLOCK operation located at this block address. Upon receipt of the UNBLOCK operation, the supervisor ascertains whether there is a request awaiting availability of this section of code. If there is no such request, the blocking bit for this section is turned off. Otherwise, the blocking bit is left on, and that request for this code which is next in line is given a new position in the queue which indicates that availability of a unit only is awaited. 6.5.5 Programming Example Within a section of code denoted A we desire to make two calls for a section B. The resulting executions of B are intended to proceed concurrently with one another and with the continuation of A. Finally, all three calls are to be regrouped on a section C. One method of programming this requirement is shown in Fig, 11. The strings of dots indicate sections of code of any length or complexity. In particular, these sections may contain conditional branches. Another This form of protection should not be confused with interprogram protection.
MULTIPROGRAMMING
133
BLOCK Reduce count by I Test count
BRANCH
UNBLOCK STOP
Reset count to 3 UNBLOCK
J
FIG.11. Three-call programming scheme.
point of interest is that regrouping may be made to depend on any logical combination of states of the three calls by replacing the counting with suitable manipulation of bits.
6.5.6 The I0 Operations: GET a n d PUT As mentioned earlier, problem programs do not issue absolute I0 instructions at all. The compiled (or object) form of these programs contains the pseudo-ops GET and PUT wherever the program is ready to acquire an input record or to dispose of an output record respectively. The I0 unit involved is designated symbolically by a number called the symbolic unit (SU) * A symbolic unit corresponds to an absolute tape unit or an absolute region of disk storage located on one of the disk units. The user specifies which type of storage he needs, but the allocation routine within the supervisory program determines which physical unit and, in the case of disk storage, which absolute region is to be assigned. When the symbolic unit corresponds to a tape unit, the GET operation implies that the next record from tape (i.e., next in arrival sequence) is required, and the PUT operation similarly implies a sequential disposition on tape. When the symbolic unit corresponds to a disk region, the choice between the sequential and nonsequential modes of referencing must be made. For simplicity, we assume that each problem program defines its own buffer areas in core storage and provides a buffer directory for use by the supervisory program. The supervisor attempts to keep read buffers as full as possible and write buffers as empty as possible, but observes an established set of priorities in so doing.
134
E. F. CODD
Thus, when a GET operation is issued from a processing stream belonging to a problem program, the required record may be already available in core storage. In this case, the supervisor plants the base address of this record (relative to the base address of the problem program) in the slot immediately following the GET operation and permits immediate resumption of the stream on the same PU as before. Whenever the supervisor discovers upon receipt of a GET operation that it has not yet acquired the record now needed (this is invariably the case with the nonsequential mode of reading from disk storage), it suspends processing service to the stream in question until that record has been acquired. It determines if retrieval of the record can be initiated without violating established priorities and seeks other work for this processing unit. Eventually, when the record has been read into the appropriate buffer area, the supervisor is activated by the corresponding I0 interruption, and it changes the status of the service request for the suspended stream to indicate that it is merely awaiting availability of a processing unit. If the stream now released for action is of higher processing priority than the lowest priority stream previously being serviced, then the newly released stream obtains service immediately 011 this PU. The PUT operation is treated similarly. 6.6 The Queueing System
Queueing itself has the effect of decoupling timewise the creation of demands by programs on the one hand and their servicing on the other. When symbolic to-absolute translation is incorporated in the queueing system, spacewiselodecoupling is obtained also. The queueing system proposed herein has the following additional properties : (1) Interprogram priorities are assignable by the supervisor independently for all forms of service. ( 2 ) In the case of disk units it is possible for the priorities to reflect the physical location of the assigned regions and, as a result, cause each arm to service the request involving the least movement in a given direction (inward or outward) until all requests in that direction have been serviced and then to change direction. (3) Each problem program may generate any number of requests for processing service, subject only to core storage limitations. (4) While a problem program may through program error mutilate its own request for service, it cannot damage the rest of the queueing structure, unless a malfunction has occurred in the protection system of a P U or in memory itself. 10 In this context, space connotes areas in core and disk storage, also sets of I 0 units of all kinds.
MULTIPROGRAMMING
135
( 5 ) Processing requests which are awaiting availability of (a) a section of code and a PU, (b) a buffer area and a PU, (c) a PU only, and (d) nothing (i.e., the request is being serviced) are all distinguished from one another. The queues to be considered are those for processing service (one queue only), tape channel service (one queue for channel), disk channel service (one queue per channel) and seek service (one queue per disk unit). In describing the structure of the various queues, three core storage areas are of vital interest. The first is the area in which supervisory tables are located. Each queue has its origin or root in this area. The second area is the control area for each problem program. This area contains PP control nodes which contain information necessary to the proper servicing of the corresponding program. Like the supervisory tables, all PP control areas are accessible to the superwisor only. Finally, there is the execution area for each problem program which is freely accessible by that program and by the supervisor, but by no other program. The request nodes for a PP are all located in the corresponding execution area. The queueing structures are illustrated in Figs. 12, 13, and 14. Each queue consists of a set of nodes (marked 0 ) linked together to form a tree. Each node consists of a set of several consecutively located words in core storage. The location of any node is defined to be the location of its first word. A link from node x t o node y is realized by storing in a slot in node x the location of node y.
6.6.1 T h e Processing Service Tree The processing service tree begins in the supervisory tables a t a supervisory node labelled processing service (Fig. 12). Chained from this node is a set of processing control nodes, there being exactly one such node for every problem program. The ordering of these control nodes in the tree determines the priority with which problem programs receive processing service. Attached to each processing control node is a subtree consisting of processing request nodes. Each of these nodes consists of a START operation and its associated slot, first base and second base. Those request nodes which, in the diagram, are aligned horizontally with the corresponding control node represent requests which may be serviced concurrently. For example, in Fig. 12 request nodes tl, ul,v1 belonging to PP2 are aligned horizontally with the PP2 control node for processing. Thus, three distinct processing units may, if available, be assigned t o service these requests concurrently, one PU per request. Those request nodes which are aligiied in a vmtical chain must not be
E. F. CODD
136
PP 4
PP 2
PP 7
PP I
1ICONTROLf-kI 1 ETC
i
EXEC I
I
‘LPROTECTION BOUNDARY P P = PROBLEM PROGRAM
FIG.12. Processing service tree.
serviced concurrently. For example, in Fig. 12, u1 is blocking u2 from using some shared section of code. Accordingly, the stream corresponding to u1 must issue a n UNBLOCK operation before u2 can be serviced. Note that as far as the user is concerned, only two types of precedence constraintsblocked code and unready buffers-are handled within the queueing sys-
137
MULTIPROGRAMMING CHANNEL 3 SERVICE
SUPERVISORY PROGRAM
CHANNEL 3 ASSIGNMENT
p
/
I
P
PP 2
PP I
CONTROL PP 7
EXEC
PP 4
I
EXEC I
I
PROTECTION BOUNDARY
SU = SYMBOLIC UNIT PP = PROBLEM PROGRAM
FIG.13. Tape channel service tree.
tem. More general requirements for precedence constraints between sections of a program may be implemented by means of regrouping, an example of which was illustrated in Paragraph 6.5.6. We have observed that upon receipt of a STOP from some stream the supervisor is required to remove the corresponding request node from the processing queue; also, from time to time the supervisor is required to displace streams temporarily from PU's. Both of these supervisory activities are facilitated by the processing assignment nodes located in the supervisory
E. F. CODD
138
SUPERVISORY PROGRAM
DISK UNIT I SEEK
,/DISK
ARMS
/’
ETC
UNIT 2
SEEK ARMS
SEEK
PP 2
PP 5
I I I
su4
4 I
I
I
L
I
EXEC
I
‘4
su 2
PP 4
I EXEC I
I
L-
PROTECTION BOUNDARY
SU SYMBOLIC UNIT PP = PROBLEM PROGRAM
FIG.14. Disk channel service tree
tables. There is one such node for each PU in the system and it contains two addresses, one pointing to the control node and the other t o the request node currently being serviced by the PU in question. The four types of processing nodes introduced above are now listed with
MULTIPROGRAMMING
139
their contents in Table I; V stands for vertical chain, H for horizontal chain. In Table I, the items marked X in the processing request node are located in the slot associated with every START operation. They are placed in the slot by the supervisory program, not by a problem program. TABLE I Node
Contents
Processing service (one only)
V address V bit
Processing control (one for each PP)
V address V bit H address H bit
Processing request (one for each stream)
Processing assignment (one for each PU)
X X X X X X X
START (Special Operation) V address V bit H address H bit Busy bit Buffer stalled bit Base bit First base Second base
Address of processing control node being serviced Address of processing request node being serviced Operable bit Busy bit
The V and H addresses are in every case the addresses of successor nodes in the service tree, vertically and horizontally respectively. The V and H bits indicate whether or not there is a vertical or horizontal successor respectively. The assigned bit indicates whether or not a PU is currently
assigned, and hence is servicing, this request. The buffer stalled bit is turned on if, in servicing this request, a GET or PUT is encountered and the buffer in question is not ready for use by the problem program. The base bit indicates which base (first or second) is to be used for setting up a PU assigned to service this request. The first set-up following receipt by the supervisor of a START is effected per the first base. All subsequent set-ups and, of course, all dumps for this stream are effected per the second base.
E. F. CODD
1 40
The items in the processing assignment node apply to the corresponding PU and have self-evident definitions.
START on PUn from stream (c,ra) at location rd
F
Obtain c from Pun aksignrnent node and attach request to end of horizontal chain from control node at c.
Entry point 1
Turn off base bit, bdffer-stalled bit and busy bit in this request node.
1
) -
Scan in sequence PUx assignment nodes x = I, 2,3,._. for idle, operable PU
II
None chosen
PUy chosen
ment node
--
Turn on busy bit in request node, issue --START OTHER PU to PUy
-I Re1ea se signal
$.I
Prepare to resume stream (c, ra) on PUn (using second base b 2 of request node for this stream), issue CALL PROBLEM PROGRAM per b2
---------~
I I Prepare to service assigned stream (c, rd)
(see entry point 3 i n STOP)
FIG.15
-F
n -
MULTlPROGRAMMING
141
START
Pun assigned to (c, ro. PUy idle
AFTER
.
C
?
Pun assigned to (c, ro) PUy assigned to (c, rd)
Busy
4 rc
Code Blocked
FIG.16
address of a processing control node address of a processing request node identification of a stream which has a request node a t r chained t o a control node a t c We omit details concerning the manipulation of chain addresses and bits required to couple a node into a chain or uncouple it from a chain, since the reader can with little effort fill in these details for himself. C
r (c, r)
6.6.3 I 0 Service Trees We assume that cross-channel switching is not provided for the tape or disk channels. If it were, only minor changes would be required in the following scheme. The most important of these would be the combination of all trees for individual tape channels into one tree for all tape channel service.
E. F. CODD
142 STOP on P u n from streom (c,rb) at location h
Obtoin c, r b from P u n ossignrnent node and remove corresponding request from processing queue. I f this request node wos the only one ottoched t o the corresponding control node
1
Otherwise
'-{ End of job: remove this control node from the processing queue
Entry point 2
Scan processing queue for new assignment starting from the beginning of the queue ( i . e., per the V address of the processing service node), choose first request found for which both the busy bit ond the buffer -stolled bit ore o f f .
r-----'1 I f none found
Otherwise
P u n ossignment TL f f busy bit node, in
Place c2, rf for chosen request in P u n
issue SET AND WAIT.
ossignment node
Entry point 3
7
1
Prepare to service assigned stream i.e.. load registers of P u n per f i r s t or second base (occording as base bit is off or on), turn base bit on, set relocation and protection addresses per c, issue CALL PROBLEM PROGRAM per first or second base.
FIG.17
Figures 13 and 14 illustrate respectively the tree for a particular tape channel and the trees (one per disk unit) for a disk channel. The channel service node and assignment node are very similar to their processing counterparts in information content and function. The channel control nodes and request nodes are, however, very different from their processing counterparts. We begin by discussing the complete set of control nodes for a single problem program. The single node for processing has already been described. Each of the remaining control nodes corresponds to a symbolic unit (SU) used or ignored by this program. The SU nodes are consecutively
MULTIPROGRAMMING
143
STOP BEFORE
Stalled
Pun assigned
to ( c l r r b )
I.
Code Blocked
c2f----2--2N0, Not Busy
Busy
AFTER
Busy
CI
8
‘d
rC 0 - y
Busy
~3 Buffer Stalled
Pun assigned to ( c 2 , r f )
‘e
bCode Blocked
FIG.18
numbered and are ordered in memory by this number. Thus, the supervisor is able to locate the appropriate SU node quickly whenever it receives a GET or PUT accompanied by a symbolic unit number. The information within the SU node enables the supervisor to identify the absolute unit (and, in the case of disk storage, the region) corresponding
144
E. F. CODD
.
BLOCK on Pun from stream (c,rd) at location h
Pun
Examine blocking bit in BLOCK slot I f off
I
Turn blocking bit bn in BLOCK slot
+
Obtain r d from Pun assignment node and place in BLOCK slot
J.
Resume service to previous stream (c, rd) on Pun
Obtain address rb of request node for blocking stream from BLOCK slot and vertically chain onto i t the current request node on Pun (address rd of this node obtained from Pun assignment node)
J.
Turn off busy bit in request thus vertically chained
t
Scan for new work for Pun (see entry point 2 i n STOP)
to this SU. As usual, this correspondence is set up at loading time by the allocation routine associated with the supervisor. Other items in the SU node identify the mode in which the unit is being operated (sequential or nonsequential) and the state of readiness of the set of buffer areas associated with this SU." The request nodes chained to a given SU node define buffer areas with origins and sizes determined by the programmer (or course, the origins are compiled in relative form). h'ormally, these buffer nodes are chained t o their SU node permanently, i.e., throughout the execution phase of the problem program. I n addition to defining a buffer area and indicating whether its current use is for reading or writing, a buffer node describes the state of this area: Is it ready for use by some stream, is it in use by a stream, is there a stream stalled because this buffer area is not ready and, if so, where is the processing request for this stalled stream? Chain addresses and bits are also included in each buffer node. Their use depends on whether the sequential or nonsequential mode is in effect for this symbolic unit. 6.6.3.1 Sequential Mode. I n the sequential mode a set of records is to be transmitted into or out of core storage preserving the ordering in which l 1 A buffer area is ready for a GET operation if it is full and for a PUT operation if it it3 empty. A set of buffer areas is ready if all members of the set are ready.
MULTIPROGRAMMING
145
BLOCK BEFORE Pun ossigned to (c,rd) BLOCK cf.L+//G Not Busy Busy ‘d
,//
Code Blocked
AFTER IF NOT BLOCKED Note: BLOCK slot changed from 0 to I , rd
Same diagram 0s obove,
AFTER IF BLOCKED BY rb
Block slot unchanged: 1, r b Pun ossigned to (c, ro) Code Blocked ‘d
Code Blocked
FIG.20
they are originally stored or computed. Thus, if a SU has associated with it a buffer consisting of several areas and the sequential mode is in effect, the supervisor services these buffer areas in a fixed, cyclic manner. Further, either all areas of a given buffer are designated as receiving areas for input or all are designated dispatching areas for output. The buffer nodes associated with a SU node in the sequential mode are vertically chained in a cycle. In the special case of a buffer consisting of only one buffer area, this rule requires that the buffer node be chained to itself vertically; i.e., its V address is set equal to its location. As the supervisor completes servicing one buffer area, it prepares to service the next in
E. F. CODD
146
-Pun
Obtain 'b from PU" assignment node, examine V b i t in this node
No other request waiting for this code
f
Turn off blocking bit in BLOCK slot addressed by h
Request waiting far this code
?
Uncouple next waiting request (c, rd) from vertical chain on rb and attoch to end of horizontal chain on c, leaving any other waiting requests [c, re) vertically attached to i t
$.
Place rd in BLOCK slot oddressed by h, look for PU t o service stream (c, rd) (see entry paint I in START)
Resume service to stream (c, rb) on Pun
FIG.21
the cycle by copying the V address of the node just serviced into the SU node. 6.6.3.2 Nonsequential Mode. I n the nonsequential mode the buffer areas belonging to a given buffer may be serviced in any order or concurrently. Concurrent servicefor a given SU is, however, limited to seeking (we assume two or more arms per disk unit, several disk units per transmission channel). Any buffer area associated with a SU in the nonsequential mode may be used for input or output regardless of its immediately previous use and regardless of the use being made of other buffer areas associated with this SU. Each GET or PUT operation issued for a SU in the nonsequential mode is accompanied by a relative disk address. Any stream which issues a GET operation of this type is unconditionally stalled because, even if there is a buffer area immediately available for receiving input, some time must elapse before the desired record has been read into this area. Note that processing activities for this program as a whole are not stalled-other streams may continue to function. Any stream which issues a nonsequential
MULTIPROGRAMMING
147
UNBLOCK, h
Pun assigned to (c, rb ) BEFORE
Buffer Stalled Block Slot: l,rb
f
?ode Blocked
re
Code Blocked
AFTER
Buffer Stalled
Busy
I
Busy
& Code Blocked 'e
operation is stalled only if all buffer areas for the specified SU are now unready for use by the program. The buffer nodes for a SU in the nonsequential mode are chained horizontally from the SU node. The ordering of nodes in this chain has no special significance. If the disk unit to which this SU is allocated has two arms, any two buffer nodes belonging to this SU may be concurrently assigned to the arms. 6.6.3.3 Completion of I 0 Operations. Successful completion of data transmission to or from a tape or disk unit activates the supervisor on some PU, and implies that a buffer area previously unready for program use is now ready. The supervisor finds the buffer node for this area by indirect referencing via the channel assignment node, the arm assignment node (disk PUT
148
E. F. CODD
only), and the SU node, sets the ready bit on, and determines if there is a stream stalled due to this buffer area being unready a t the time a GET or PUT operation was issued. If a stream is waiting for this buffer area, the supervisor obtains from the buffer node the address of the processing request node for the stalled stream, and turns the buffer stalled bit off, thus making that request eligible for further processing service. If the relevant SU node is in the sequential mode, the supervisor now advances an address in this node so that it points to the nest one of its buffer nodes needing supervisory attention. Regardless of mode, the supervisor looks for work for this channel. In the case of a tape channel it can start scanning the corresponding service tree immediately. For a disk channel, however, the completion of a data transmission operation represents an opportunity to put into effect as many outstanding requests for seek service as possible. Accordingly, the supervisor scans the seek service tree for each unit on this channel which has at least one idle arm, and assigns as many of the idle arms as possible to buffer nodes needing service. Then, a disk unit is selected by taking the next unit (in a fixed cycle) which has an arm assignment such that the seeking is complete but the transmission still remains to be done. The channel is then assigned to such a n arm. 6.6.3.4 I 0 Queueing Rules. The queueing rule invoked when a tape channel service tree is scanned is as follows. The first SU node encountered that indicates that there is a stream stalled due to buffer area(s) belonging to this node being unready is selected for service. If no SU node is in this state, the first SU node encountered, which indicates that not all of its buffer areas are ready for program use, is selected. This selection rule can be implemented in such a way that only a single scan is required. The same rule may be applied to selecting a request in a disk seek service tree. However, the incidence of stalled streams may be expected to be higher for disk operations (the majority of which are likely to be nonsequential) than for tape operations (normally sequential). Moreover, the time taken to service a set of seek requests for a given disk unit may be sensitive to the order in which those requests are serviced. Thus it may be profitable to select next that request which entails the least arm movement. If this particular rule were followed, it would be possible for requests for remote areas to be left unserviced for indefinite periods. One simple modification is to service that request which entails the least arm movement in a given direction (inward or outward) until all requests for that direction have been disposed of, and then change the direction. Figure 14 illustrates an implementation of this rule. A bidirectional chain couples together all the SU nodes for a given disk unit in a sequence determined by the physical location of the corresponding
149
MULTIPROGRAMMING
TABLEI1 Node
Contents
Channel service (one per tape channel)
T T
V address V bit
Seek service (one per disk unit)
D D D
Vt address V1 bit
D
Vz bit
SU control (one per SU)
V2 address
V1
D D D D
address
V1 bit. VZaddress V2 bit Absolute channel Absolute unit Disk region base address Disk region upper boundary Mode bit Stream stalled bit Buffer all ready bit, Address of buffer node
D
Chain address (V or H) Chain bit (V or H) Base address of bufler area Stream stalled bit Address of processing request node of stdled stream Ready bit In use bit GET/PUT bit Itelative disk address
Tape channel assignment (one per tape channel)
T T T
Address of SU control node being serviced Operable bit Busy bit
Disk channel assignment (one per disk channel)
D D D
Address of arm assignment node being serviced Operable bit Busy bit
Arm assignment (one per arm)
D D D 11
Address of SU control node being serviced Address of buffer request node being serviced Operable bit Busy bit Ready for transmission bit Inward/outward bit
Buffer request (one per buffer area)
D D
150
E. F. CODD
disk storage regions. This chain is, of course, established and maintained by the allocation routine. When the supervisor is looking for work for an arm, it. can find that outstanding request which is for the nearest region in a given direction by first scanning the buffer nodes belonging to the SU just serviced and, if no work is found, proceeding to the next SU node in the direction currently in force. Should the end of the chain be reached with no work found, the direction of scan is reversed. 6.6.3.5 Summary of I0 Nodes. The seven types of I0 nodes introduced above are now listed in Table I1 with their contents; D and T denote items relevant t o disk only and tape only, respectively. All other items are relevant to both. Two vertical chain addresses and two vertical chain bits are required for the service and control nodes used with disk units. The address and bit denoted VI are used for inward scanning, those denoted Vz for outward. The reader is invited to develop for himself flow charts suitable for the GET and PUT operations, in the sequential and nonsequential modes, and for I0 interruptions which indicate successful completion of data transmission. 7. Concluding Remarks
Very few computer systems in existence today possess two or more processing units sharing a common set of core storage modules and inputoutput channels. The writer’s opinion is that the demand for this type of system will be greater when an adequate solution is found to the problem of exploiting such a system. The proposals in Section 6 represent an attempt to find an adequate solution to this problem. Consider some of the properties of the proposed scheme from the user’s point of view. First, if the user desires to write his program in a conservative way, as if it were to be executed by a machine with only one processing unit, he may do so by creating only one processing stream. This is certainly reasonable if the running time of his program is short. I n fact, whether his single-stream program is short or long, good utilization of the system can very probably be achieved through running other, independent programs concurrently with his-providing his program does not monopolize memory space. Second, if the user’s problem is expected to consume large amounts of processing time or memory space, he may segment his data or instructions or both and create as many streams as he pleases. The special operations for starting, stopping, and blocking these streams are quite simple for the user, even though complicated for the supervisory program. These oper-
MULTIPROGRAMMING
151
ations are, in fact, suitable for use in a problem-oriented source language, since their definition imposes few constraints on the hardware. Note that a user is not required to segment his instructions and data to fit individual memory modules.12 Third, interprogram protection (an example of which was illustrated) provides the individual user with security for his program and data against accidental or fraudulent manipulation. Now, consider some of the properties of the proposed scheme from the iiistallation point of view. First, space and time can be assigned to programs in a n extremely flexible way, thus giving the supervisory program-and hence t,he installation-a large measure of control over the use of the system. I n particular, processing priorities may be determined in any way the installation sees fit, since they are not constrained by the relative speeds of various units. Second, the scheme accommodates real time processing as well as batch processing. (Note, however, that for certain types of real time processing more elaborate protection would be required.) Implementation of the supervisory program does not appear to present any new problems. Most of the logic (and complexity) required in a multiprogramming supervisor for a system with two or more PU’s is already present in a multiprogramming supervisor for a system with but a single
PU. A word of caution is perhaps in order for both the designer and the user. First, the complexities of communication between memory-sharing PU’s are such that this type of system is not suited to low performance PU’s. Second, an over-zealous programmer may over-segment his program. It is importmt to remember that supervisory overhead is incurred in starting and controlling each stream created, no matter whether the supervisor is implemented in hardware or in software. The programmer is therefore advised not to create a new stream unless the set of operations to be performed in this stream is expected to take a t least as long as the average I0 operation. Today, the outstanding problem associated with multiprogramming is that of finding better methods of automatically allocating storage. This problem is now receiving a good deal of attention and its investigation may be expected to lead to a growing body of theory concerning the nature of programming itself. Although a t this time it appears that few computing installations employ anything more than a restricted form of multiprogramming in their daily operations, we can expect a radical change in this situation within the next l2 We assume that (1) the set of memory modules is addressable as a single homogeneous memory, and (2) any location may be used for instructions or data.
152
E. F. CODD
decade. The need to make effective use of machines with vastly increased performance and capacity will lead to widespread adoption of quite general multiprogramming techniques.
8. Acknowledgments
The author wishes to express his appreciation to the many people who have contributed to this article in one form or another. Particular thanks are due to Messrs. E. S. Lowry and R. H. Ramey, Miss E. McDonough, and Messrs. C. A. Scalzi, F. E. Howley and S. F. Grisoff, who have contributed many valuable ideas and suggestions in the course of their experimental work in multiprogramming under the author’s direction. In addition the author wishes to thank Miss E. McDonough for assistance in preparing the flow charts of Section 6 ; Dr. D. S. Henderson for helpful criticisms of this same section; Messrs. J. W. Franklin and P. J. Nelson for their painstaking editing of the first and second halves respectively; and Mr. E. S. T.owry for editorial assistance in the final stages.
Bibliography 1. Alexander, S. N., The National Bureau of Standards Eastern Automatic Computer. PTOC.Joint AIEE-IRE Gonj., Phaladelphia, Pennsylvania. Pp. 84-89, February (1952). 2. Cocke, J., and Kolsky, H. G., The virtual memory in the STRETCH computer. Proc. Eastern Joint Computer Conf., Boston Massachusetts. Pp. 82-93, December (1959). 3. Codd, E. F., Multiprogram scheduling. Communs. Assoc. Computing Machinery 3, 347-350 and 413-418 (1960). 4. Codd, E. F., Lowry, E. S., McDonough, E., and Scalzi, C. A., Multiprogramming STRETCH: feasibility considerations. Communs. Assoc. Computing Machinery 2, 13-17 (1959). 5. Dreyfus, P., System design of GA&iMA 60. Proc. Western Joint Compufer conf., Los Angeles, California. Pp. 130-132, May (1958). 6. Eckert, J. P., Weiner, J. R., Welsh, H. F., and Mitchell, H. F., The UNIVAC system. Proc. Joint AIEE-IRE Conf., Philadelphia, Pennsyleania. pp. 6-14, February (1952). 7. Everett, R. R., Zraket, C. A,, and Benington, H. D., Sage-a data processing system for air defense. Proc. Eastern Joint Computer Conj.,Wnshin&ton,D.C. pp. 148155, December (1957). 8. Frankovich, J. M., and Peterson, H. P., A functional description of the Lincoln TX-2 computer. Proc. Western Joint Compuler Conf., Los Angeles, California. pp. 146-155, February (1957). 9. Gill, S., Parallel programming. Computer J . 1 , 2-10 (1958). 10. Leiner, A. L., System specifications for the DYSEAC. J . Bssoc. Compiiting Machinery 1 , NO.2, 57-81 (1954).
MULTIPROGRAMMING
153
11. Leiner, A. L., and Alexander, S. N., System organization of DYSEAC.IRE Trans. on Electronic Comruters EC-3, 1-10 (1954). 12. Leiner, A. L., Notz, W. A., Smith, J. L., and Weinberger, A., P1LoT-a new multiple computer system. J . Assoc. Computing Machinery 6,313-335 (1959). 13. Lourie, N., Schrimpf, H., Reach, R., and Kahn, W., Arithmetic and control techniques in a multiprogram computer. Proc. Eastern Joint Comp~derConf., Boston, Massachusetts. pp. 75-81, December (1959). 14. Mersel, J., Program interrupt on the UNIVACscientific computer. Proc. Western Joint Computer Conf., S a n Francisco, California. p. 52, February (1956). 15. Plugge, W. R., and Perry, M . N., American Airlines’ “Sabre” electronic reservation system. Proc. Westerns Joint Computer Conf., Los Angeles, California. Pp. 593402, May (1961). 16. Porter, R. E., The RW400-a new polymorphic data system. Datamation pp. 8-14, January-February (1960). 17. Rochester, N., The computer and its peripheral equipment. Proc. Eastern Joint Computer Conf., Boston, Massachusetts. pp. 64-69, November (1955). 18. Teager, H. M., Time-sharing project. M.I.T. Computation Center Semi-Annual Report No. 6 January (1960). 19. Teager, H. M., and McCarthy, J., Time-shared program testing. 14th Nat. Meeting Assoc. Computing Machinery, Cambridge, Massuchuselis. pp. 12-1 and 12-2, September (1959).
This Page Intentionally Left Blank
Recent Developments in Nonlinear Programming PHILIP WOLFE Mathematics Division The R A N D Corporation S a n t a Monica. California
1. Introduction . . . . . . . . . . . . 1.1 The Motivation for Nonlinear Programming . . 1.2 The Mathematical Programming Problem . . 1.3 Some Definitions . . . . . . . . . . 2 . Differential Gradient Methods . . . . . . . 2.1 The General Approach . . . . . . . . 2.2 The Direct Differential Gradient Method . . . 2.3 The Lagrangian Differential Gradient Method . 3 Large-Step Gradient Methods . . . . . . . 3.1 The General Approach . . . . . . . . 3.2 The Simplex Method for Linear Programming . 3.3 The Simplex-Corrected Gradient Method . . . 3.4 Projected-gradient Procedures . . . . . . 4 . Simplicia1 Methods . . . . . . . . . . 4.1 The Roleof the Simplex Method . . . . . 4.2 The Simplex Method for Linear Programming . 4.3 The Simplex Method for Quadratic Programming 5. Columnar Procedures . . . . . . . . . . 5.1 Columnar Procedures in General . . . . . 5.2 Separable Programming . . . . . . . . 5.3 The Decomposition Procedure . . . . . . 6. The Cutting-plane Method . . . . . . . . 7 Initiating an Algorithm . . . . . . . . . 8 Computer Routines and Literature . . . . . . 8.1 Direct Differential Gradient Methods . . . . 8.2 Lagrangian Differential Gradient Methods . . 8.3 The Simplex-corrected Gradient Method . . . 8.4 Projected-gradient Procedures . . . . . . 8.5 Quadratic Programming . . . . . . . . 8.6 Separable Programming . . . . . . . . 8.7 The Decomposition Procedure . . . . . . 8.8 The Cutting-Plane Method . . . . . . . Bibliography . . . . . . . . . . . .
.
. .
155
.
.
.
.
.
.
.
.
.
.
.
.
. . .
. . .
. . .
. . .
. . .
. . .
.
.
.
.
.
.
. . . . . .
. . . . . .
. . . . . . . . . . . . . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
. .
. .
. .
. .
. .
. .
. . . . . . . . . . . . .
.
.
.
.
.
.
.
.
.
.
.
. . .
. . .
. . .
. . .
. . .
. . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. .
. .
. .
. .
. .
. .
. .
. .
.
.
.
.
.
.
. .
. .
. .
. .
. .
. .
.
.
.
.
.
.
. 156 . 156 . 157 . 159 . 161 . 161 . 162 . 163 . 165 . 165 . 166 . 168 . 170 . 172 . 172 . 172 . 174 . 175 . 175 . 177 . 178 . 180 . 183 . 184 . 185 . 185 . 185 . 185 . 186 . 186 . 186 . 186 . 186
156
PHILIP WOLFE
1. Introduction 1.1 The Motivation for Nonlinear Programming
While nonlinear programming has been a topic of discussion among people concerned with allocation problems about as long as linear programming has, not much was done about it until three or four years ago. The recent past has shown a great increase in the amount of attention devoted to this area, however, and some of the reasons for this new interest are readily ascertained. On the theoretical side, it would seem that a large part of the purely mathematical theory of linear programming is now well in hand [ I d ] . While, of course, the subject will never be exhausted for the mathematician, he perhaps no longer feels justified in expecting sweeping new results in that area; but when the hypothesis of linearity is dismissed, it takes away with it many of the known results and intuitions we have about these problems. The resulting gap in our knowledge, together with the great practical interest the resulting nonlinear problems have, offers the theoretician a continuing challenge. Likewise the subject of linear programming seems very well in hand on the computational side. While we may never have computer routines and algorithms capable of solving the largest problems we would like to formulate, we can now solve linear programming problems involving several thousand variables and about 500 equations, problems whose input data may have taken years to collect; and it is fairly clear what must be done to increase this capacity even further. For nonlinear programming, nothing of the sort can be said. Quite a few algorithms for various kinds of nonlinear problems have been proposed-these notes are devoted to describing the majority of them-but very few have ever been put into practice. Some procedures are demonstrably quite inefficient, while others will require much computer programming and experience to test. As will be seen below, there is no lack of information as to how nonlinear programming might be done, but on the other hand there is almost no information on how nonlinear programming should be done. Here, then, is a challenge t o the computational expert; one with which he is beginning to grapple seriously. Finally, the practical value of the solution of these problems is high. Almost no real problem is linear; linearity represents our compromise between reality and the limitations of our tools for dealing with it. The user who has only linear techniques for handling his mathematical programming problems is confronted with one of two expensive alternatives: He must accept the results of a linearization of his problem and bear the expense of their deviation from reality, or undertake the imprecize and laborious task of making the results better by heuristic methods. During
RECENT DEVELOPMENTS IN NONLINEAR PROGRAMMING
157
the last few years, the largest users of linear programming techniques have become impatient with these restrictions. They have trained themselves in the use and interpretation of these methods, and have set u p the elaborate data-collecting agencies which are required by their mathematical models. As soon as effective procedures in this area are devised, they will be usedwhich was not true when linear programming first appeared. As we have said, most problems are really nonlinear. While the petroleum industry, for example, which constitutes the major user of linear programming in the United States, has had extraordinary success with linear techniques, the parameters of interest in the refining and blending processes do not behave in precisely a linear manner. At least one firm is now using a nonlinear programming procedure in its daily production work, despite the priniitiveness of the particular method being used. One simple type of nonlinear problem has been fairly well in hand for about two years: Problems having linear constraints, but with a convex, quadratic cost function, can be solved with reasonable efficiency. An algorithm for this problem has been applied to the minimization of power losses in electrical distribution networks, to the cdculation of investment portfolios so as to minimize risk, and to the scheduling of investment and importation of scarce commodities. (The nonlinearity in this last problem arose from the nonlinearity of import cost as a function of previous purchases. It represents about the largest nonliiienr problem ever solved, having some 200 variables and 100 constraints.) The present paper attempts a survey of the majority of techniques which have been proposed for nonlinear programming problems. Disparate as they are, they may be grouped as we do under several broad headings in such a way that the techniques belonging to one group are similar in concept, arc aimed at a certain class of problem, and may have similar computational effectiveness. Our grouping of the methods presented here is given a t the end of this paper, where the References are cited in connection with that outline rather than in the text. 1.2 The Mathematical Programming Problem
The general mathematical programming problem can be posed this way: Given the objective formula f(z) = f(zl, . . . , 5 , ) and the m constraint functions g 2 ( x ) = g2(z1, . . . , xJ, determine x = (a,. . . , 2,) so as to
hIaxiinizc J(L) under the constraints g,(x)
50
for i
=
1, .
. . ,?)I.
158
PHILIP WOLFE
Naturally, the functions f and gi will have to be restricted in some way, as will be done below. It is important to note that (1.1) comprises all the constraints put upon x, which is otherwise allowed to be any collection of n real numbers. It would be a very serious matter to require besides, for example, that the components of x be integers; and while this kind of restriction is dealt with elsewhere for the case of linear programming, it is inappropriate to the bulk of our work. Incidentally, while the constraints zj 2 0 (for each j ) are usually imposed in a programming problem, there is no need especially to mention them here, since they are just special cases of the constraints (1.1). Figure 1 illustrates this problem in two dimensions (n = 2 ) . The shaded
FIG.1. Nonlinear programming problem:
2' = (31,22);m =
3.
RECENT DEVELOPMENTS IN NONLINEAR PROGRAMMING
159
area is the constraint set-the set of all points x satisfying the relations (1.1). Note that its boundaries are just the places where some constraint function vanishes. These boundaries, as well as the vertices of the constraint set (points, of which there are two in the figure, where so many gi vanish that a unique point is defined), usually play an important role in the problem. A contour of the function f is a set of points on which the function has a constant value: a number of these are sketched. Geometrically stated, the programming problem is that of finding the highest-valued contour having some point in common with the constraint set. 1.3 S o m e Definitions
The gradient at x, denoted by Of (x), has been drawn for a point in the constraint set. Defined by
Vf(x)
=
(F, . . . , - '"'>' ax,
i t is always perpendicular to that countour off which passes through x, and points in the direction of steepest ascent-that is, the direction of maximum rate of change off per unit distance. The gradient plays an essential role, although sometimes a well-concealed one, in most mathematical programming procedures, for it is through the gradient that linear approximations are constructed to nonlinear functions, making them numerically tractable. Specifically, when all the derivatives of f (x) exist, so that Of (2)can be computed, and are continuous, then The equation of the plane tangent to the graph of z point (zo, x") is 2 = 20 Of ($0) . .( - x")
+
= f(x)
a t the (1.2)
(see Fig. 2). Since this tangent plane is the best linear approximation to f in the neighborhood of xo, the formula (1.2) will serve to replace (f(x) where linear computations are to be done. One more assumption will be made about the function f : it is to be concave, which means that the graph of t.he function is to lie below any of its tangent planes (as in Fig. 2). Part of the importance of this requirement lies in the fact that any linear approximation to f by functions like (1.2) will then be one-sided-always give values a t least as high as those sought -so that they place bounds on the possible answers. Another consequence of concavity is the fact that for any number K , the set of all x such that f (2)2 K is a convex set-a set which contains the entire line-segment joining any two of its points (see Fig. 1 for a two-dimensional example). The functions g; will all be assumed to be convex. A convex function is the
PHILIP WOLFE
160
/
Z
FIG.2. Concave function of two v:irinhlcs.
negative of a concave function; its graph lies above any of its tangent planes (see Fig. 3). For any K , the set of all x: such that gl(x:) 5 K is convex. I n particular, each of the inequalities of (1.1) defines a convex set, and thus the constraint Pet itself, being the common part of several convex sets, is convex. The assumptions about f and the g? together give the programming problem a n important property ; any local solution is the proper solution of the problem. A local sclution is a point xo satisfying the constraints such that no constrained point can be found in the immediate neighborhood of x o which gives a higher value off. (The point x = a of Fig. 3 is an example of such a local maximum point which would not be the solution of the maximization problem; there thc objective is convex instead of concave.) If x:l is the solution of the programming problem under the assumptions above on f and gz, then for any other point 2" in the constraint set, all points on the segment will have values of f a t least as high as f (z"), so that zocannot be a local solution without being the proper solution as well. While this "local implies global" propcrty is the most important use of
RECENT DEVELOPMENTS IN NONLINEAR PROGRAMMING
x=a
XO
161
x=b
FIG.3. Convex fiinction of one variable.
convexity in nonlinear programming, and for the simpler procedures its only use, it plays a more subtle, yet vital, role in some of the procedures to be discussed. 2. Differential Gradient Methods 2.1 The General Approach
The contours of the problem of Fig. 1 are commonly thought of as the geodetic contours of a “hill” up which we are trying to move the point 2, as constrained by the “fences” gz(z) 5 0. The ordinary man has no difficulty moving up such a hill, knowing as he does the direction-Vf(x)--of steepest ascent a t the point a t which he is standing. He takes one step a t a time, as quickly as possible, so as always to increase his altitude; when he is constrained by a fence, he moves along it, so long as he keeps going up; and he finajly stops when no step he can take will move him higher. It is simplest to describe his motion in terms of infinitesimal steps dx taken during the elapse of a n infinitesimal time dt, or in terms of his (vector) velocity dxldt. I n the most primitive kind of steepest ascent his motion could be described just by
dx - = Vf(z),
dt
(2.1)
PHILIP WOLFE
162
that is, by
but, of course, this equation takes no account of the constraints of the problem. Unless we are fortunate enough to have a solution of the problem interior to the constraint set, the point x will eventually wander outside it. The two “differential gradient” methods presented here-the “direct” and the “Lagrangian”-adopt different methods for enforcing the problem’s constraints. 2.2 The Direct Differential Gradient Method
If a constraint gi(x) 5 0 is violated, that is so because gi(x) is too big. This function can be reduced by motion in the direction -Vg;(x), just as (2.1) increases f ; and all this can be done at the same time by differential equations dX
- = Vj(x) -
dt
(2.2)
where
K
if gi(x) 5 0 if gi(x) > 0. I n (2.3) the number K is chosen sufficiently large to keep x from leaving the constraint set-for example, larger than the maximum of all lVf(x)l/lVgi(x)[for any x on the boundary. The terms of C& (x)V gi (x) serve to “kick back” x when it tends to leave the constraint set. Of course, the differential equations (2.2) must not be taken too seriously from a n analytic point of view. They will not, in general, have solutions, owing to the discontinuity of the terms &(x). The equations are to be taken rather as a guide t o the formulation of a computational procedure for this problem. I n digital computations, dx and dt would be replaced by finite intervals A x and At; the interval At would be chosen (perhaps) small, and Eq. ( 2 . 2 ) , with dxldt replaced by Ax/At, used to obtain the new point x Ax to replace z in these formulas. Figure 4 sketches the course of x under this procedure for small, nearly uniform steps. Evidently there is a great deal of room for experimentation in the matter of proper step size, decrease of step size as the solution is approached, and in a number of other technical matters. This procedure certainly has the most immediate, intuitive appeal of all those discussed here. While for convex problems it will, of course, find their proper solution, it will also find a local solution for just about any problem, a property that not all the methods share. On the other hand, we suspect
&(x)
+
=
RECENT DEVELOPMENTS IN NONLINEAR PROGRAMMING
163
FIG.4. Direct differential gradient method.
that it is likely to be far less efficient for convex problems than some of the methods below, which may require no more computation to take one very large step toward the solution of the problem than this procedure does to take one of its small steps. 2.3 The Lagrangian Differential Gradient Method
I n this type of procedure the discontinuities of the corrections (2.3) applied to the steepest ascent path are avoided by taking a more relaxed approach to the satisfaction of the constraints. The process is governed by the differential equations
PHILIP WOLFE
164
dx - = Vf(Z) dt
and
- CiuiVgi(.)
if u;> 0 otherwise.
dt
(2.4)
or gi(r)
> 0,
(2.5)
n'ow the right-hand sides of the differential equations are continuous if the derivatives off and g; are, and the equations will possess solutions, although it will still be impractical to try to give them in closed form-the computation must be done pretty much as before. If the point 2: violates constraint i, the number ui will tend to rise, by equation (2.5); and whenever ui is positive, equations (2.4) tend to nudge it back across the boundary of g;(x) I 0. Note that (2.5) prevents ui from becoming negative: there is no penalty attached to having gi(x) < 0. It can be shown that under suitable conditions the above differential equations have solutions xj(t), ui(t) which converge to values (xIo, . . . , zn0,U I " , . . . , urno)= (xo,u0) as t -+ 00. It can then be argued that x 0 solves the programming problem, as follows. Evidently at the point (20, uo)we must have
Supposing that the differential equations were started with all u, 2 0, by (2.5) no u,will ever go negative, so that uto2 0 (all i).
(2.6) Equation (2.5) also make it impossible that u,O > 0 and gt(xO)> 0 a t the same time. so that u,Oy,(z") = 0 (alli). (2.7) Equation (2.4)yields
(2.8) In order to show that xu solves the programming problem, suppose that some other x satisfying the constraints of the problem is given; we will show that f ( r ) 5 f (xo). The equation of thc tangent plane to the graph off a t the point (xo,f(zo)) is 2 = j-(xO) Vf(x"(x - x0) V.f(z0) = xtu;vgt(zo).
+
[see Eq. (1.!2)]. Since f is concave, its graph lies below this plane, so that for any x we have
+ 2 g4xO) + Vgdx0)(x -
f(x) L f(z0) Vf(xO)(z - 2". For the convex functions gl., the reverse is true: we have gd.>
x0)
RECENT DEVELOPMENTS IN NONLINEAR PROGRAMMING
165
for any x and i. These two relations, together with (2.8), give
+ Vf(xO)(l: x*) = fbO) + ~zu,ovg,(xo)(x- zO) < jbO) + C%u*“g%(x) = fbO) + - c~u,ogz(xo).
S(z) 6 j(xO)
-
gE(Z0)l
Czuz0g2(Z)
Since now each g2(x) 5 0, and each u,Og,(zo)
=
0, we have at last
f(.> I f b ” . The Lagrangian differential procedure has the odd property that the point x may wander in and out of the constraint set during the computation; the tcrms uI which eventually force it in do not get large until x has been outside for some time. The final values of the multipliers are, however, of great interest, being the ‘(shadow prices” associated with the constraints of the problem, or the “marginal costs” of the resources whose limited availabilities are asserted by the constraints. They are generally found as by-products in the various solution techniques for these problems, and not introduced explicitly into them as in this procedure. The name “Lagrangian” is given to this method because the u,actually play the role of Lagrange multipliers in the computation. Solving the differential equations has been an elaborate way of solving, for the Lagrangian function
).(S
- CLWd.),
the relations O , [ f ( z > - c&gL(z)l = 0.
Owing to the peculiar nature of the constraints g z ( x ) 5 0, being inequalities instead of equations as in the classical kind of constrained-extremum problem, the multipliers have unusual requirements set upon them : effectively, they are required to satisfy (2.6) and (2.7) above. The formulation of mathematical programming problems in terms of such Lagrangians has been extensively developed, and forms a fruitful and unifying point of view for milch of mathematical theory of these problems.
3. large-Step Gradient Methods 3.1 The General Approach
A “large-step gradient” method is conceived as having the same basic motivation as a differential gradient method; an effort is made to move in the direction of the gradient of the objective function. These methods concentrate, however, on taking as large a step -Ax -in that direction as
166
PHILIP WOLFE
possible, the length of the step being limited only by the constraint boundaries, utter misbehavior of the objective function, or some limitation inherent in the procedure other than the “small step” stipulation of the differential methods. It will be noted that this class is not entirely well-distinguished from the previous class nor those which will be taken up later, the “simplicial” procedures. On the one hand, a differential procedure could certainly be performed with large steps in its initial phases, but ultimately a small-step requirement would have to be imposed to assure convergence, and in any case its underlying reasoning is differential. On the other hand, one of the procedures of this section is certainly simplicial, if anything is-the simplex method for linear programming; nevertheless, we shall exhibit it as a sort of gradient method. (It will also be used within one of the two other procedures described here.) Both of the procedures given here are aimed a t problems having a nonlinear objective function but linear constraints. The ability to take a large step in the direction of the gradient of t.he objective seems to require linear constraints. If the same methods are pushed to cases of nonlinear constraints, it appears that they would spend so much effort dealing with those constraints that they would perform in about the same way that differential gradient methods do. 3.2 The Simplex Method for Linear Programming Figure 5 gives a geometric visualization of the linear programming problem. This one has seven constraints: three of them have the form -zj 5 0 and the other four are given by more complicated linear functions of z. Since the constraints are all linear, the faces of the constraint set are planar. The ith face (i = 1, . . . , 7) is the set of all z for which gi(z) = 0; they have been so labeled in the diagram. The vertices of the constraint set are identified by listing the faces which meet in them: for example, the vertex Pz is identified as lying on the planes gl(z) = gb(z) = gT(s) = 0. The simplex method operates this way: let f(s) = Cjcjx,;
thenvjfx)
=
c,
so Vf(z) is constant. Evidently the solution of the problem will be a point of the constraint set located as far as possible in the direction of the vector c. Take any vertex of the constraint set; the direction numbers of all the edges leading out of the point may be calculated, so that those edges making an acute angle with c can be determined. Following such an edge from the current vertex will yield another having a higher value off. The process is repeated until a vertex is reached none of whose edges make an acute angle with c ; that vertex is the solution of the problem.
RECENT DEVELOPMENTS IN NONLINEAR PROGRAMMING
167
)(3
FIG.5 . Linear progrunlming : the Simples method.
This is sketched in Fig. 5. Beginning at 0, we find the path 01’1P?PZ around the constraint set terminating in a solution. The simplex method constitutes an efficient means for performing the calculations that are necessary for this process, While we shall not discuss it in detail, let us see how it proceeds from the vertex 0 of Fig. 5 to the next vertex. At 0, all the relations of the problem can be described in terms of the three independent variables xl, x2, x3.Moving from 0 to another vertex will be accomplished by increasing one of these variables until a constraint is met. It. is reasonable to choose that variable which will make the greatest increase in the objective: that will be the one for which c j ( j = 1, 2 , 3) is the largest. (In the figure, it is xz.)Retaining z1 = x3 = 0, we move to PI. At PI, it will be again possible to express all the relations of the problem in terms of three independent variables and try again. This time they will be chosen as xl, z3,and, say, x5 = -g5(x), the last choice made so that they will all be zero at P1 and nonnegative inside the constraint set; and the objective function may be re-expressed in terms of them, say as dlxl d3x3 &x5. The cycle may then be repeated. In every case, the simplex method concentrates on one variable in the problem, increasing it when
+
+
PHILIP WOLFE
168
profitable, and altering the others so as to remain on the edges and vertices of the constraint set. It was mentioned above that there is a sense in which the simplex method is a gradient method. Generally speaking, a gradient vector of a function may be defined as a direction in which the directional derivative of the function is maximal: more precisely, as a vector Ax = (Axl, . . . , Ax%)maximizing
and such that \IA.c\l = 1,
where [ IAx[1 denotes the length of Ax. When we take = (Ari)'
4-. . .
+ (AzJ2,
it is easy to show that the vector which does this is indeed proportional to . . . , af/ax,), which is therefore satisfactory to use. The above definition of llAsll is not, however, the only one that can be used: many other notions of "length" are available, and perhaps equally plausible. One of the more iiiteresting would be
Gf(z) = (af/ar,,
IjAzlI
=
IAzII
+ . . . + lAxnl.
If this coiiveiition is used, the maximization problem posed again, a new answer is found: its components must all be zero excepting the jth, where a.f/az, is the maximum of all the partial derivatives, and Axj = sgn (af/ax,). Kow this is precisely the rule of progress of the simplex method, since af/az, = c,; we try only to increase x,. Thus, with this more liberal interpretation of the concept of the gradient, the simplex method is a gradient method. Evidently the bulk of calculation in this method is connected with expressing the data of the problem in terms of a selected set of independent variables, and changing this mode of expression from step to step. Fortunately, because of the linearity of all the relations, this work is of the same kind as is done in handling linear equations; and since the set of independent variables changes in only one member between steps, the work turns out to be very simple. 3.3 The Simplex-Corrected Gradient Method
Figure 6 poses the problem of maximizing a nonlinear objective function under linear constraints; the latter are drawn like those of Fig. 5. The point P of the figure is located outside the constraint set, and the objective function is taken to be the negative of the square of the distance from the point
RECENT DEVELOPMENTS
IN NONLINEAR PROGRAMMING
169
a-P
'X'
Fro. 6. Simplex-corrected gradient method.
x to P. The problem is then that of finding the nearest point to P within the constraint set. The objective is evidently concave, as desired. The simplex-corrected gradient procedure will yield the sequence 20, 21, 2 2 , . . . of points of the constraint set which will converge to the solution of the problem. There will also be formed an auxiliary sequence xo,XI, 22, . . . of vertices of the constraint set which are used in the process; these are produced through use of the simplex method in a certain way. Initially, let xo be any vertex of the constraint set, and set zo = xo. Now suppose that k steps of the procedure have been taken. There will be a t hand a point zk belonging to the const,raint set and a vertex xk of the constraint set. Then Calculate Vf (zk). Using Of(2)as a (temporarily) constant objective vector and xk as an initial extreme point, take one step of the simplex method in the maximization of the linear function Of(zk) obtaining a new extreme point; call this extreme point &+l. Choose the point zk+1 on the segment joining zk to xk+l so as to minimize f on that segment. This sequence of steps defines a recursive process for generating the sequence zol zl, . . . It is assumed that the one-dimensional maximization problem of step (3) is not too difficult to perform. The special simplex method application e x ,
170
PHILIP WOLFE
of steps (1) and ( 2 ) is not difficult; suitably handled, the work of step ( 2 ) is not a great deal more than that involved in performing one step of the simplex method for a problem having permanently fixed costs. It should be mentioned that, in case the constraint set is not bounded, it is possible that the step (2) may result in the taking of an “unbounded” simplex step. Step (3) need only be slightly altered to incorporate this possibility. An estimate of the speed of convergence of the procedure is given by the following result: letting M be the maximum value of f as constrained, there exists a constant K such that
Unfortunately, the procedure is unlikely to terminate in the exact solution of the problem, although it does in the case of a quadratic objective, where other exact methods also exist. On the other hand, this will be no objection if it arrives in the near neighborhood of the solution with sufficient speed. 3.4 Projected-gradient Procedures
Methods of the “projected gradient’’ kind can be viewed as resulting from the attempt to make a differential gradient method take as large steps as possible, while never allowing the point x to leave the constraint set. Figure 7 illustrates such a procedure, beginning a t t,he point zoand generat-
FIG.7. Projected-gradient method.
RECENT DEVELOPMENTS IN NONLINEAR PROGRAMMING
171
ing the sequence of points x’, x2, . . . . Below, by “plane” is meant the entirety of a single hyperplane of the form gt(x) = 0, whose intersection with the constraint set yields, in general, one of its faces. Starting with the point xk in the constraint set, either one or two successors of xk are determined by the following steps. A particular set of planes is associated with x k a t all times; initially, let this be the set of all planes which pass through x k . (1) Calculate Vf(xk). ( 2 ) Find the projection of Vf(&) onto the intersection of all the planes associated with xk. (In case there are no planes-as when x k is interior t o the constraint set, this intersection is the whole space, and thus the projection is V f ( z k ) itself.) (3) If the projection is different from zero, extend a ray from xk in that direction, and define xk+’ to be the farthest point along the ray belonging to the constraint set. (a) If f(xk++’)> f(xk), then the cycle is complete. (b) Otherwise, choose xk+2 so as to maximize the function f on the segment xkxk+l;this completes the cycle. (4) If the projection is equal to zero, then Vf(xk) may be written = XkrkAk
as a linear combination of normals Ak to the planes associated with xk (the A k are chosen to point away from the constraint set). (a) If all rk 2 0, then xk is the solution of the problem. (b) Otherwise, define a new set of planes to be associated with xk b y deleting from the present set some one plane for which T k < 0, and return to step ( 2 ) . As with the gradient-corrected simplex method, it is assumed here that the one-dimensional maximization problem which may have to be solved in step (3b) is not difficult to do, which is the case. I n Figure 7, the points x4 and x6 have been obtained as the result of minimizing on the segments x2x3and a t these minima Vf is, of course, perpendicular to the segment in question. Convergence of the procedure to a solution of the nonlinear problem is not difficult t o show. Unlike the previous gradient methods, this procedure does not completely reduce to the simplex method for a linear problem; but it does so reduce if the points x k are vertices of the constraint set. I n the same way that the simplex method may be looked on as a gradient method, a procedure very closely related to the above, which need not actually use Vf(xk) in the calculation, can be given. The projection of Vj(xk) onto the face in which x k lies turns out to be precisely the direction of steepest ascent for the function f per unit distance in the Euclidean
z;
PHILIP WOLFE
172
metric, if that direction is chosen so as to keep one in the constraint set. If, on the other hand, some other metric were used-as in the discussion of the gradient aspect of the simplex method above-a somewhat different algorithm would be obtained. The metric !/Ax/\= Max {\Axl! , . . . , \Ax,/), for example, changes the work of step (2) from that of finding the projection of V.f(xk)onto the face of xk to that of determining a point y maximizing Vf(xk) - y under the linear constraints of the original problem augmented by the constraints \xik - yjl 5 1; the direction of motion away from xk is then that of the ray from xk through y. (The first reference cited under the heading of projected-gradient methods employs the projection; the second reference employs this latter procedure.) 4. Simplicia1 Methods
4.1 The Role of the Simplex Method
I n the current practice of the art of nonlinear programming, those computational methods which are not essentially gradient methods use the simplex method for linear programming to do their basic computational work. As will be seen below, there are three ways in which this happens. The first way we have called “simplicial”: it is the solution of a nonlinear problem-specifically, the quadratic programming problem-by what is almost exactly the simplex method itself. Once the problem has been set up, no additional data need be generated. This is not the case with the other two types of method; they depend in an essential way on the process of linearization, and make use of the linear programming process to solve linear problems derived from the nonlinear problems which give approximate answers to the real problems, using the results thus obtained to further improve the approximation. They are essentially infinite methods. I n the sense in which the term is used here, there is only one “simplicial” procedure current, that for quadratic programming. 4.2 The Simplex Method for linear Programming
The simplex method for linear programming problems was described briefly in Section 3.2. We return to it here only to permit the development of those features which are used in the nonlinear programming algorithms described later. The usual statement of the linear programming problem is: c,yj subject to Maximize C;’=l
yj
>, O (allj),
Cja,,yj
3 b , (alli).
(4.1)
RECENT DEVELOPMENTS IN NONLINEAR PROGRAMMING 173 The Lagrange multipliers, or “dual variables” u L(i = 1, . . . , m) described in Section 2.3, play an important role in the forms of the simplex method used in calculation. The duality theorem for linear programming states that
y1, UI,
. . . , gm solve the problem . . . , u, > 0 such that
(4.1) if and only if there exist
C1.ular, 3 c, (allj), and
ct u,b, = c,cjy,.
The main features of the so-called primal simplex method caii be de. . . , u, and some subset J of all m i be d in these terms. Suppose that u,, the indices 1, . . . , n are known for which y, = 0 unless j € J . (It is not difficult to satisfy these starting conditions, if they do not obtain, by emFedding the given problem in a certain larger one, as described in Section 7.) If now it happens that inequality (4.2) holds for all o t h e r j as well, then the problcm is solved-by the duality theorem. If, however, it is not, then it is possible to select some j for which
C r u t a 2, c,
<0
(4.4)
(whence necessarily y, = 0 ) , and, by allowing the corresponding y3 to become positive, obtain u and y satisfying (4.2, 4.3) with the index-set J augmented by the index j. Continuing in this way, the simplex method ultimately yields u and y satisfying the relations (4.2, 4.3) for all indices, thus solving the problem. The efficiency of this process is based largely on the fact that the amount of computing that must be done when one index is added is small. I n actual practice, one does not try to maintain the constraints (4.2) throughout the calculation; by choosing instead always to increase that zero variable yJ for which Max, [c, - Czu,aJ (4.5) is achieved, and ensuring that the constraints (4.1) of the original problem remain in force, the same results can be obtained. The dual simplex method can be described in a similar way. I n it, a t the start of a n iteration one has u and y satisfying all the constraints of the form (4.2), but not necessarily satisfying all those of the form (4.1). Then, one by one, the set of indices i for which C , a z j y 36 b, actually holds is increased until it is complete, a t which time, by the duality theorem, the solution is a t hand. The linearization methods that will be discussed in Sections 5.3 and 6 below proceed by augmenting the data of a given linear programming
174
PHILIP WOLFE
problem, representing an approximation to the nonlinear programming problem, with additional data in order to improve the approximation. A columnar method does this by adding data in the form of columns (indexed o n j ) to the matrix a,, of (4.1); thus for these, the primal simplex method is an efficient way of proceeding from the solution of one approximate problem to that of the next. The cutting plane method, on the other hand, adds constraints; for this method, the dual is appropriate. Note that the presence of variables, such as our z, unrestricted by the inequalities of the form y, 3 0 which have been assumed here, does not change the essentials of the