Mimic, an alternative programming language for industrial dynamics

Mimic, an alternative programming language for industrial dynamics

So&-&on. Plan. Sci. Vol. 6, pp. 319-327(1972).Pergamon Press. Printed in Great Britain MIMIC, AN ALTERNATIVE PROGRAMMING FOR INDUSTRIAL LANGUAGE ...

649KB Sizes 2 Downloads 51 Views

So&-&on. Plan. Sci. Vol. 6, pp. 319-327(1972).Pergamon Press. Printed in Great Britain

MIMIC, AN ALTERNATIVE

PROGRAMMING

FOR INDUSTRIAL

LANGUAGE

DYNAMICS

NORMAN D. PETERSON Bonneville Power Administration, U.S. Department of the Interior, Portland, Oregon 97208

(Received 27 September

1971)

One of the recent quantitative tools available to economists and planners, in business and government, is a technique known as industrial dynamics (Refs. [2, 3, 5, 81). After briefly describing this technique, this article shows how the MIMIC language can be used as a short-cut to industrial dynamics computations. The intent is to describe this programming language in sufficient detail to allow the reader to judge its capabilities and ease of use.

INDUSTRIAL

DYNAMICS

AS A QUANTITATIVE

TOOL

dynamics is a method of synthesizing time series from a given mathematical model. By this means, the user seeks to evaluate the effect of alternative conditions and policies. The typical model emphasizes the interaction of large numbers of variables and places considerable emphasis on feedback loops, delays and decision rules. Not infrequently the technique yields findings that run counter to what would be concluded intuitively from an examination of only a few variables at a time. Industrial dynamics finds a wide range of possible applications. For example, through this technique, the Sprague Electric Company discovered that violent oscillations in inventory, production, personnel and customer orders were caused largely by the company’s employment and inventory reordering policies [I]. Another application has been to the regional analysis of the Susquehanna River Basin, in which demographic, employment and water sectors were included in the model [6]. Among the most thought provoking is the recent application to urban planning [4, 121. The quantitative approach used in industrial dynamics is the natural outgrowth of the electrical-engineering background of its developer, Jay W. Forrester, now a professor of management at the Massachusetts Institute of Technology. Forrester’s first prominence was as the developer of the ferrite core memory which sparked the growth of the computer industry in the 1950’s. Subsequently, he guided the design of the SAGE continental air defense system. INDUSTRIAL

USE

OF

COMPUTERS

IN INDUSTRIAL

DYNAMICS

Because of the large volume of computations required, a digital computer is generally used in all except the most trivial applications of industrial dynamics. As with many specialized situations, greater simplicity for the computer user is achieved if a processor or programming language oriented particularly toward his problem is available. 319

320

NORMAND. PETERSON

The most widely known programming language for industrial dynamics is undoubtedly the one developed at M.I.T. specifically for this purpose. Indeed, most publications dealing with industrial dynamics, employ the notation of this language, rather than conventional algebra, in presenting mathematical models. This language [9], appropriately named DYNAMO, is available for the IBM 7090, IBM 360, CDC 3600 and Burroughs 5000 computers. Of particular interest to investigators not having access to a computer with DYNAMO capability, an alternate language is available. This language [lo], known as MIMIC, has been implemented on a variety of machines, including the IBM 7040, IBM 7090, CDC 6400, CDC 6600 and GE 635. MIMIC was developed by F. J. Sansom and H. E. Petersen of Wright-Patterson Air Force Base and is widely used for the solution of engineering problems, particularly those involving differential equations [ll]. The language is considerably easier than Fortran, although resembling it in the notational system used. Except for one subroutine in machine language, the entire MIMIC processor is itself written in Fortran and thus is potentially machine-independent. And,like DYNAMO, it provides for time delays, random-number generation and a variety of logical control functions. THE

LANGUAGE

AND

HOW

IT IS USED

As an example of the application of MIMIC to industrial dynamics, the present article uses a tutorial model for regional analysis, provided by Hamilton [6] and shown schematically in Fig. 1. Hamilton may be consulted for those desiring specifics concerning the rationale of the model. The MIMIC program constructed for this model is shown in Figs. 2-4. Each MIMIC program consists of set-up, computation and output sections, submitted in that order. However, since the set-up section is of secondary interest, its consideration is deferred until after the computations (Fig. 3) which are the heart of the model. In Fig. 1, the blocks are numbered to correspond to the program steps in Fig. 3 and lagged relationships are indicated by broken lines. Successive steps in the program are discussed as an illustration of the major features of the language. Specific consideration of certain special quantities such as DELAY, DT, DT1 and DR W. are deferred until discussion of Fig. 2.

FIG. 1. Block diagram of regional model, from Hamilton 161.

MIMIC, An Alternative Programming

Language for Industrial Dynamics

321

4,*,P,O,P,

I

1 ,

I

L I

I

I

,

FIG. 3. Computation

,

I

I

I

2 !

,

I

I

I

.

L 1

section of MIMIC program.

,

2

6

P 2 ;;j

s ?

z

ii

MIMIC, An Alternative Programming

323

Language for lndustrlal Dynamics

4_______________

- t

:,

c : z

-

b

-2

NORMAND. PETERSON

324

MIMIC

COMPUTATIONS

The computation section of the MIMIC program is illustrated in Fig. 3 and begins with an itemization of lagged relationships specified by use of the “ time delay operator”, TDL. Retaining the notation of Hamilton, the suffix J is used to designate lagged variables. Thus, in any time interval, POPJ is the value of the previous population. In computing total workers employed (TWE), two TDL relationships are incorporated into one line (line 7). Total workers employed at any point in time is given as equal to T WE at the previous point in time, plus the interval (DTl) between the two points multiplied by previous growth rate of workers employed (G WE). As with Fortran programming, multiplication is represented by an asterisk. The remainder of the computations are outlined below, with the steps numbered to correspond with line numbers in Figs. 1 and 3. The key requirement* is that every variable appearing in columns 19-72 of the coding sheets must be provided by columns IO-15 of some preceding line of the program. Stated graphically, every arrow in Fig. 1, except for broken lines, must move from a lower-numbered block to a higher-numbered block. Line 8

The eighth line of programming in Fig. 3 specifies that population (POP) at any point in time is equal to population (POPJ) at the preceding point in time, plus the interval (DTl) between the two points, multiplied by the births per year (BRTHJ), deaths per Note that year (DTHSJ) and net inflow of migrants per year (NIMJ) for that interval. POP will be required later in lines 17, 19 and 20 as well as 9. Line 9

Next the total labor force is assumed

to be a constant

fraction

of the population.

Lihe 10

The local unemployment rate is computed from the total labor force and total workers employed, the latter being provided by line 7. Line

11 The national unemployment rate is assumed to be a constant of 0.05 and the difference (DUR) between local and national unemployment rate is computed as shown in line 11.

Line 12 Relative wage is known to respond only gradually to the Therefore, Hamilton imagines an intervening variable known (TRW) which is a certain mathematical function (named FUNC2) language, the operator FUN is used in generating an arbitrary of this function is completed elsewhere in the program- by a later.

forces of unemployment. as “target” relative wage of DUR. In the MIMIC function. The definition CFN operator, described

Line 13 The variable TRW, through the operation of line 13, gradually manifests itself in R W. Note that this expression does not call upon TRW directly, but rather upon the lagged value TR WJ of the preceding time period. * Because of this requirement, formulas provided by Hamilton.

it was not possible to define the variables in the same sequence as the

MIMIC, An Alternative Programming

Line

Language for Industrial Dynamics

325

14

Given relative wage, the program generates fractional growth rate of industry as a function (named FUNCTN) of relative wage. Line 15

Next the growth of workers employed (GWE) is computed by multiplying the total workers employed (TWE from line 7) by the fractional growth rate of industry. This statement completes the employment sector of the model, shown as the right-hand loop of Fig. 1. The program next returns to the demographic sector. Line 16

The migration rate (NMGR) is assumed to be proportional to DUR, given by line 11. The greater the local unemployment relative to the national, the greater the out-migration. Line 17

The net in-migration (positive) or out-migration plying the population by the migration rate.

(negative) is computed by multi-

Line 18

The average life expectancy is assumed to be a linear function of T, the elapsed time since the initial date of the simulation. Line 19

Deaths per year (DTHS) for a given interval of time is assumed to be a function of the average life expectancy and population at the beginning of that interval. Line 20

Births per year (BRTH) is assumed to be a fixed proportion of the population. In line 8, the results of lines 17, 19 and 20 are lagged and contribute to the net change in population at the next point in time. MIMIC

OUTPUT

At the conclusion of the MIMIC program, it is necessary to include steps, illustrated in Fig. 4, to produce output. Tabular output is accomplished by one print operator (PRZ) for each kind of print line desired. The entries enclosed in parentheses indicate the variables, up to six to be printed in each line. At the end of each time interval, as many lines are printed as indicated. Similarly, descriptive column headings can be provided by a HDR operator. A capability for graphical output is also available through MIMIC, The output steps must be followed by an END operator (line 4) and immediately preced.ed by one or more finish operators (FIN, line 1). A finish operator provides a comparison test upon which termination of the computer run is conditioned, in this case being based on T and the total elapsed time (50) that it is desired to simulate. THE

SET-UP

PORTION

OF THE

PROGRAM

As illustrated in Fig. 2, set up of a MIMIC simulation involves the reading of input values required to control or begin the computational process. Most of this input is executed by the “ constant ” input operator, CON. The actual numeric values are placed

326

NoHhm4

D.

PETERSN

on input data cards immediately following the END operator of Fig. 4. Complete directions concerning these data cards, as well as additional input operations, are provided by MTMIC manuals [IO]. Purameters It may be desired to repeat a simulation under alternative choices of conditions or parametric values. Rather than imbed these values as constants scattered throughout a number of lines of MIMIC computations, they can be changed more easily between successive runs if they are read in as at the beginning of Fig. 2. The illustration shows the following brought into the program as parameters in lines l-3: (a) Time interval, DT. (b) Divisor, DRW, for line 13 of Fig. 3. (c) DELAY, lag time* for time delay relationships Initial values As pointed for population, of Fig. 2.

at the beginning

of Fig. 3.

out in Hamilton’s model [6], it is necessary that initial values be provided total workers employed and relative wage. These are read in by line 4

Pseudo initial values In processing industrial dynamics problems, each variable speciiied by a TDL operation must appear as “given” in an earlier line of the program. Hence the inclusion of the five variables in line 5. This, of course, is only a formal requirement, since the values brought in actually have no effect on results and can be chosen arbitrarily. Mathematical functions Through the CFN operator, MIMIC has the capability of providing functions of one or two variables from tabular input, linear interpolation being used for values between tabulated points. Thus the operators CFN of line 6, Fig. 2, and FUN of line 14, Fig. 3, both are necessary to establish the function named FliNCTN which computes FGI from R W. The entry (3) in Fig. 2 indicates that coordinates for three points on the function will be read from three successive input data cards. Special control of time interval In applications to industrial dynamics, the user must adjust for a special feature designed into MIMIC to accommodate the more typical use of the language for differential equations. Because of the interaction between operations of integral calculus in the usual MIMIC application, it was necessary to design the MIMIC processor to execute the main loop of the program more than once for the first point in time. In order to preserve correct values in industrial dynamics simulations, it is necessary to introduce a factor, DTl, in lines 7, 8 and 13 of Fig. 3, that will remain zero until the processor advances beyond the initial point at which time the factor will take on the value of the desired time interval, DT. This special factor is introduced by the “function-switch” expression in line 8, of the form FSW(A,B,C,D), which defines the result DTI as being B for values of A less than TDL subroutine within some MIMIC processors, it may be necessary to a value for time lag other than that desired. In particular. it may be necessary to sptmify a value of 0 to establish a lag of 1.0.

* Because of an error in the

input

MIMIC, An Alternative Programming

Language for Industrial Dynamics

zero, C for A equal to zero and D for A greater within the parentheses are T, 0, 0 and DT. SUMMARY

Investigators, not having access dynamics may well give consideration introduced in these pages, is not well problems in engineering and is more Fortran. In addition to a capability basic operations needed for numerical

AND

than zero.

Thus,

the required

327

entries

CONCLUSIONS

to the primary programming language for industrial to MIMIC as an alternative. Although the latter, known to economists, it is wideIy used for dynamics easily used than general purpose languages such as for differential equations, this language includes the simulation of economic models.

REFERENCES 1. BRUCECARLSON,Industrial dynamics, Mgrnt Services 32-39 (1964). 2. JAY W. FORRESER,Industrial dynamics, a major breakthrough for decision makers, Harvard Business Rev. 37-66 (1958). 3. JAY W. FORRESTER, hdu.crrial Dynumics. M.I.T. Press (1961). 4. JAY W. FOURESTER, Urban Dynanrics. M.I.T. Press (1969). 5. GEOYFKEY GOKDON,Sysfern Simrtlution, Chapters 4 and 5. Prentice-Hall (1969). 6. H. R. HAMILTONet ul., Systems Simulation fbr Regional Analysb, AH Appiirution IO River-3asin Phming, pp. 104-I I I. M.I.T. Press (1969). 7. W. E. JARMAIN,Probhzs in I~l~ii.~tr~~~ Dymznics. M.I.T. Press (1963). 8. R. C. MEIEK ef al., Sinwhtiott in Nusinrss and Economies, Chapters 3 and 7. PrenticeHall ( 1969). 9. A. L. Puw, III, D YNAh40 User’s Manual, 2nd edition. M.I.T. Press (1963). 10. F. J. SAN~OMand H. E. PIXEKSEN,MIMIC Programing Manual, AD-656-301, Defense Documentation Center (1967). I I. MIMIC, making differential equations easy, Electm-Tech. 126-128 (1968). 12. Computer scans urban ills and overrules experts. &‘w York Times, 31 October p. 47 (1969).