UBC Theses and Dissertations

UBC Theses Logo

UBC Theses and Dissertations

CAM, a computer-aided modelling program for systems dynamics models Chheda, Dhirendra Padamshi 1974

Your browser doesn't seem to have a PDF viewer, please download the PDF to view this item.

Item Metadata

Download

Media
831-UBC_1974_A6_7 C49_5.pdf [ 7.23MB ]
Metadata
JSON: 831-1.0051757.json
JSON-LD: 831-1.0051757-ld.json
RDF/XML (Pretty): 831-1.0051757-rdf.xml
RDF/JSON: 831-1.0051757-rdf.json
Turtle: 831-1.0051757-turtle.txt
N-Triples: 831-1.0051757-rdf-ntriples.txt
Original Record: 831-1.0051757-source.json
Full Text
831-1.0051757-fulltext.txt
Citation
831-1.0051757.ris

Full Text

CAM, A Coipnter;-Aided Modelling P r c ^ r a j f o r Systems Dynamics McdeIs bj DHIBENDBA PA0AMSHI CP.EIDA B.C.Sc., U n i v e r s i t y of Binnesota, 1972 A THESIS SUBMITTED III PABTIAI FULFIL HINT OF THE REQUIREMENTS FOB THE DEGREE OF MASTER OF SCIENCE i n the department of Computer Science Se accept t h i s t h e s i s as conforming t c the reguired standard THE UNIVERSITY OF BRITISH COLUMBIA A p r i l 1974 In presenting t h i s thesis i n p a r t i a l f u l f i l m e n t of the requirements for an advanced degree at the University of B r i t i s h Columbia, I agree that the Library s h a l l make i t f r e e l y available for reference and study. I further agree that permission for extensive copying of t h i s thesis for scholarly purposes may be granted by the Head of my Department or by h i s representatives. It i s understood that copying or publication of t h i s thesis for f i n a n c i a l gain s h a l l not be allowed without my written permission. Computer Science Department of The University of B r i t i s h Columbia Vancouver 8 , Canada Date A p r i l 25, 197k Computer Aided Modelling ABSTRACT An a r b i t r a r y continuous system model can be constructed on a Graphic Display by i n t e r a c t i n g with a l i g h t pen and d i a l s . The user i s presented with a c o n t r o l language and a lenu cn the Graphic D i s p l a y , which uses pre-defined symbols to design a Continuous System Model. A f t e r c o n s t r u c t i n g the model he wants to si m u l a t e , the user can a s s i g n appropriate v a r i a b l e names and values to the symbols, d i r e c t flow of information or m a t e r i a l between components, can assign mathematical r e l a t i o n s h i p s between the components cf a model, and can sketch g r a p h i c a l f u n c t i o n s (x-y r e l a t i o n s h i p s ) cn the Graphic Display with the help of c r o s s - h a i r s . The model, when b u i l t , can be saved cn disk. l n order tc make m o d i f i c a t i o n s to the model at l a t e r time, a p r e v i o u s l y saved model can be re s t o r e d . Changes such as a l t e r i n g values, mathematical r e l a t i o n s h i p s , and the d e l e t i o n cr a d d i t i o n cf components can be made before rerunning a s i m u l a t i o n . Once the user i s s a t i s f i e d with the model d e s c r i p t i c n phase and when h i s model i s complete, a CSBP program f c r that acdel i s wri t t e n ontc d i s k , which can then te compiled and run i n order to obtain the r e s u l t s f o r the s p e c i f i e d v a r i a b l e s i n tabulated form. As v i s u a l a i d s , p l o t s against Time can also be observed on the Graphic Display or can be p l o t t e d cn an X-y p l o t t e r . The CAB system presented here provides an i n t e r a c t i v e t c c l f o r the desig n , m o d i f i c a t i o n and experimentation with Continuous System Models. As such i t can enhance the modeller's representation and understanding of r e a l i t y . i i i TABLE OF CONTENTS 1 I n t r o d u c t i o n ........1 2 Systems Dynamics Models 9 2.1 Dynamic Systems ..................................9 2.2 Model Structure ..................................11 2.3 System Components ................................15 2.4 G r a p h i c a l Bepresentation Of Model Equations ...... 18 2.5 Equations For System Components ..................21 3 Computer-Aided Modelling ............................. 33 3.1 Aspects Of Display Technology .................... 33 3.2 H i s t o r y Of I n t e r a c t i v e Display ...................35 3.3 I n t e r a c t i v e Modelling ............................38 3.1 An Example Of A Second-Order System .............. 41 3.5 Modelling Phase Dialogue .........................43 3.6 S p e c i f i c a t i o n Phase Dialogue .....................47 3.7 Con t r o l Structure ................................53 i v 4 Programroing Techniques 56 4.1 Graphics For Modelling ...........................56 4.2 Data-Display Beguirements ........................ 58 4.3 Data-Display S t r u c t u r e ...........................60 4.4 Program Implementation ........................... 65 4.5 Production Of The Csmp Program ................... 75 5 Summary ..............................................80 5.1 Program Modularity ............................... 80 5.2 A p p l i c a t i o n s And Simulation ...................... 84 5.3 A d d i t i o n a l Features Of Cam ....................... 81 5.4 P o s s i b l e Extensions ..............................89 5.5 Complete System ....91 5.6 Animation Of Continuous System Models ............92 5.7 Concluding Remarks ...............................93 BIBLIOGRAPHY ., 95 APPENDICES I Model Of F i r s t Order Feedback Loop 100 I I The World Hodel .........107 I I I Program L i s t i n g ....................................118 V TABLE OF FIGOBES 1 A Simple Feedback loop ..............................6 2 The Structure Of A Feedback Loop ....................12 3 Inventory-Control System . . . . . 1 4 4 E f f e c t Of Crowding On Population 20 5 A Graphic Symbol For A Level 24 6 A Graphic Symbol For A Flow Bate 25 7 Graphic Symbols For A u x i l i a r y V a r i a b l e s .............26 8 Graphic Symbols For Constants And Switches . . . . . . . . . . 2 8 9 Graphic Symbols For A Source And A Sink ............. 29 10 Graphic Symbols For Connectors And Flow Lines .......31 11 Second Order Inventory-Control System ...............41 12 A Menu For Modelling Phase .......................... 44 13 Graphic I n t e r a c t i o n - Flow Line Hode ................ 45 14 The Menu Fcr S p e c i f i c a t i o n Phase ....................49 15 Graphic I n t e r a c t i o n - Values Mode ...................50 16 Graphic I n t e r a c t i o n - B e l a t i o n s Mode 51 17 Graphic I n t e r a c t i o n - Functions Mode .........52 18 Drawing A Sketch In Functions Bode .................. 53 19 S p e c i f i c a t i o n Of Output V a r i a b l e s ...................55 20 Data S t r u c t u r e And Display F i l e .....................63 21 Hardware C o n f i g u r a t i o n Cf The System ................65 22 A Data Block 67 23 F i r s t Order Inventory-Control Model ...... 24 Data S t r u c t u r e For Inventory-Control Model v i i flCKNOHLEDGEHENTS I would l i k e to thank a l l those who a s s i s t e d me i n completing t h i s p r o j e c t . In p a r t i c u l a r , the e f f o r t s c f Dr. Douglas Seeley, my t h e s i s s u p e r v i s o r , were appreciated. Net only d i d he provide the i n i t i a l i n s p i r a t i o n f o r t h i s study, but his support and c o n s t r u c t i v e c r i t i c i s m were i n v a l u a b l e throughout. I would a l s o l i k e t c thank Dr. abbe Mcwshowitz who a s s i s t e d i n the reading and c r i t i c i s m of t h i s t h e s i s . 1 | CHAPTER 1 | I I I INTRODUCTION I I I i i Simulation i s a widely used t o o l f o r i n v e s t i g a t i n g phenomena ranging from i n f o r m a t i o n flew i n business o r g a n i z a t i o n s to the dynamic behaviour of complex mechanical and e c o l o g i c a l systems. Many engineers, s c i e n t i s t s , a r c h i t e c t s or people i n v o l v e d i n medical research o f t e n model and simulate continuous systems as part of t h e i r work. T r a d i t i o n a l l y , continuous dynamic systems have been modelled on analogue computers. Though, a convenient and f l e x i b l e t o o l up t c a po i n t , analogue computers have l i m i t a t i o n s and o p e r a t i o n a l d i f f i c u l t i e s f o r complex models. 6s the systems modelled i n c r e a s e i n s i z e and become more complex, one has to switch to s p e c i a l d i g i t a l s i m u l a t i o n languages i n order to obta i n numerically accurate r e s u l t s . Systems l i k e F o r r e s t e r ' s "World Model" [ 2 0 ] have been modelled and simulated on d i g i t a l computers i n an attempt tc understand the dynamic behaviour and i n t e r a c t i o n of system components under various c o n d i t i o n s . T h i s would nearly be impossible without the d i g i t a l s i m u l a t i o n of continuous systems. In order to simulate such complex systems, one must model and write a s i m u l a t i o n INTRODUCTION 2 program for the model, which may often turn out to be a tedious task involving other work l i k e learning a simulation language. With the advent of i n t e r a c t i v e graphic displays, i t i s now posible to d i r e c t l y communicate and i n t e r a c t with computers i n order to d i r e c t the flow of the program i n many computer-aided design applications. Among many applications to computer-aided design, e f f o r t s have also been made towards on-line simulation of continuous systems using d i g i t a l computers and Graphic Displays. Such on-line simulation allows the user to d i r e c t l y formulate his model on the Graphic Display for simulation. "BIOMOD" developed at The Rand Corporation [ 2 1 ] i s an example of such an on-line continuous system simulation. BIOMOD was developed s p e c i a l l y f o r constructing b i o l o g i c a l and pharmaceutical models. It allows the user to represent a model by analogue-computer-like elements, algebraic, d i f f e r e n t i a l or chemical l i k e equations, and Fortran statements. In t h i s thesis a system w i l l mean a grouping of parts, be i t physical or human, that function together i n order to serve a common purpose or for a common goal. Systems can be "discrete" or "continuous". Discrete systems are ones where one perceives the changes in system state with the occurrence of events at discrete points in time. By contrast, the continuous system has some components that change continuously over time. INTRODUCTION 3 Continuous systems can also be c l a s s i f i e d as "open" or "closed". An open system i s one i n which an input to a system i s independent of i t s output. An output of such a system i s solely dependent on i t s input, and does not i n any way, a f f e c t i t s input. An open system may have f i n i t e memory but i t does not form a closed loop structure. An example may be a heating system with just a switch. Turning the switch on results i n generation of heat, but heat produced does not have any automatic control over the heating system. A closed system, more commonly known as a feedback system, has a set goal. Such a system i s influenced by i t s own behaviour over time. I t forms a closed loop structure, (as shown i n Figure 1) where the r e s u l t of a previous action a f f e c t s the current or future actions. Adding a thermostat to the above heating system would form such a feedback system. The thermostat has a regulating temperature, which can be set to a desired l e v e l . It receives the information about current temperature and decides to s t a r t the furnace i n order to decrease a gap between the regulating temperature and the current temperature. This raises the current temperature and the gap i s decreased. When the gap i s closed, the furnace i s stopped. Thus, generation of heat controls the further generation of heat, in a s e l f regulating manner. Feedback loops are of two types: " p o s i t i v e " feedback loops INTRODUCTION 4 and " n e g a t i v e " feedback loops. Systems with n e g a t i v e feedback f u n c t i o n i n order t o achieve a c e r t a i n determined g o a l . The output of such a system, when f e d to the i n p u t , i s compared a g a i n s t the set g o a l . The new a c t i o n i s then generated i n order to f u r t h e r reduce the d i f f e r e n c e between the output and the g o a l . The h e a t i n g system with a thermostat, presented above i s an example of such a negative feedback loop. P o s i t i v e feedback loops on the other hand, generate growth processes. The r e s u l t produced by such a loop i s f e d back and added to the i n p u t i n order to produce an even g r e a t e r a c t i o n . P o p u l a t i o n growth can sometimes be c h a r a c t e r i z e d as a p o s i t i v e feedback loop, where growth i n p o p u l a t i o n f u r t h e r i n c r e a s e s the r a t e of growth of p o p u l a t i o n . In f a c t , i f i t wasn't f o r other negative feedback components, p o p u l a t i o n would grow a t an enormous r a t e . In f a c t , every feedback loop forms a p a r t of even l a r g e r feedback system, where i t s sub-systems may have p o s i t i v e or negative feedback loops and may i n t e r a c t with each other. As these systems become l a r g e r , and more complex, i t becomes very d i f f i c u l t to analyze them mathematically. In such complex systems, cause and e f f e c t r e l a t i o n s h i p s a l s o become obscure and hard to conceive. Going through the process of c o n s t r u c t i n g a formal model of such complex systems c l e a r l y r e v e a l s our p e r c e p t i o n of r e a l i t y . A model i s an a b s t r a c t i o n of r e a l i t y , or a p h y s i c a l INTRODUCTION 5 analogue or s u b s t i t u t e of some system. A model can be of various forms and can serve many purposes. Any set of r u l e s or r e l a t i o n s h i p s that describe the i n t e r a c t i o n of objects i s a model of tha t group of objects. The model i s an attempt to understand some aspects of the i n f i n i t e l y v a r i e d world by s e l e c t i n g from perception and experience a set of general observations a p p l i c a b l e to the problem at hand. To quote Jay 8. F o r r e s t e r : [ 1 7 ] "Mathematical s i m u l a t i o n models belong to the broad c l a s s of abstr a c t models. These a b s t r a c t models inc l u d e mental images, l i t e r a r y d e s c r i p t i o n s , behavior r u l e s f o r games and l e g a l codes. " Many engineers and s c i e n t i s t s often b u i l d such models of continuous systems and simulate them to o b t a i n meaningful r e s u l t s i n much shor t e r time than would be p o s s i b l e without s i m u l a t i o n . Consider the feedback loop s t r u c t u r e that represents dynamic behaviour of population growth as shown i n Figure 1 . The b i r t h loop i s a p o s i t i v e feedback loop and generates population growth. In a population with constant average f e r t i l i t y , the l a r g e r the population, more babies w i l l be born each year. An increase i n population causes an increase i n b i r t h r a t e . The death loop i s negative feedback and i s based upon average m o r t a l i t y . The number of deaths each year i s equal to the t o t a l population times the average m o r t a l i t y . An increase i n population with constant m o r t a l i t y w i l l r e s u l t i n more deaths per year. More deaths, decrease population. INTRODUCTION 6 r e s u l t i n g i n fewer deaths the next year. For constant f e r t i l i t y and m o r t a l i t y , the s i t u a t i o n can be analyzed mathematically. But since every r e a l population experiences both b i r t h s and deaths, as w e l l as varying f e r t i l i t y and m o r t a l i t y (for instance with crowding), the dynamic behaviour of population governed by these two i n t e r l o c k i n g feedback loops can become qu i t e complicated. And by the time one approaches a system of the l i m i t e d scope which has equations of t h i r d and higher order, a general mathematical s o l u t i o n i s nearly impossible £18]. B i r t h s per year POPULATION ( - ) Deaths per yea r P \ Average f e r t i l i t y ( f r a c t i o n o f p o p u l a t i o n g i v i n g b i r t h e a c h y e a r ) Average m o r t a l i t y ( f r a c t i o n o f p o p u l a t i o n d y i n g each y e a r ) / Figure J. - A Simple Feedback Loop When we must deal with such complex systems, where INTRODUCTION 7 a n a l y t i c a l s o l u t i o n s are beyond the reach of today's mathematics, we turn to the process of s i m u l a t i o n . Groner e t . a l . [ 2 1 ] have suggested the f o l l o w i n g steps f o r such process. • Develop a mathematical model based on data and e x p e r i e n c e . • Represent the model i n terms s u i t a b l e f o r an analog, h y b r i d or d i g i t a l computer. • Run a computer s i m u l a t i o n f o r a number of s i t u a t i o n s where the r e a l system behavior i s known. • Adjust the model s t r u c t u r e and parameters u n t i l i t behaves the same as the r e a l system. • Run the s i m u l a t i o n t o p r e d i c t the system behavior i n new s i t u a t i o n s . • Continue to c o l l e c t data and run the s i m u l a t i o n to v e r i f y the model and l e a r n more about the r e a l system. The most e f f e c t i v e way f o r a modeller to accomplish t h i s , i s to have a v a i l a b l e a system with which he can communicate d i r e c t l y , and to use the terminology t h a t i s meaningful to him. Along with t h i s he should have a v a i l a b l e the f a c i l i t i e s f o r s a v i n g the model d e s c r i p t i o n , the p r o v i s i o n f o r r e s t o r i n g such p r e v i o u s l y saved models, and the c a p a c i t y to update the model, by t a k i n g a c t i o n s that are n a t u r a l to him. The r e s u l t s produced from s i m u l a t i o n runs must be n u m e r i c a l l y accurate and presentable i n t a b u l t e d or g r a p h i c a l form. A l l of the above requirements may be met by d i g i t a l o n - l i n e modelling and s i m u l a t i o n . The Computer Aided Modelling (CAM) system has been developed i n order to make t h i s t a s k of modelling continuous systems more convenient f o r users who are u n s o p h i s t i c a t e d i n the use of computers. T h i s i s accomplished INTRODUCTION 8 by p r o v i d i n g a high degree of i n t e r a c t i o n , g r a p h i c a l d i s p l a y s , a user o r i e n t e d m o d e l - d e f i n i t i o n language, and t a k i n g i n t o account man-machine communication and e n g i n e e r i n g f a c t o r s . 9 CHAPTER 2 SYSTEMS DYNAMICS MODELS i j 2s.l DYNAMIC SYSTEMS This Chapter deals with the p r i n c i p l e s and structure of systems, giving special emphasis to systems which are i n d u s t r i a l in nature. The concept of i n d u s t r i a l dynamics emerges from that of systems dynamics. Systems dynamics i s a method of system analysis, dealing with the time-varying i n t e r a c t i o n , between components of a system within the closed loop structure. To describe dynamic behaviour of information-feedback loops of i n d u s t r i a l systems, we use the term i n d u s t r i a l dynamics. A structure i s es s e n t i a l , i f we are to i n t e r - r e l a t e and comprehend our observations and knowledge of such dynamic systems. The laws of physics form a structure to explain our observations of nature, but i n d u s t r i a l , management and b i o l o g i c a l systems are merely descriptive. An unified basic structure to describe such systems did not exist u n t i l recently. An approach to i n d u s t r i a l SYSTEMS DYNAMICS MODELS 10 systems and t h e i r s t r u c t u r e has been w e l l described by J.W. F o r r e s t e r [ 1 4 ] , He s t a t e s . An i n d u s t r i a l dynamic approach to e n t e r p r i s e design progresses through s e v e r a l steps. • I d e n t i f y a problem. • I s o l a t e the f a c t o r s t h a t appear to i n t e r a c t to create the observed symptoms. • Trace the cause-and-effeet information-feedback loops that l i n k d e c i s i o n s to a c t i o n to r e s u l t i n g information changes and to new d e c i s i o n s . ... • Construct a mathematical model of the d e c i s i o n p o l i c i e s , i n f o r m a t i o n sources, and i n t e r a c t i o n s of the system components. • Generate the behavior through time of the system as described by the model (usually with a d i g i t a l computer to execute the lengthy c a l c u l a t i o n s ) . • Compare r e s u l t s against a l l p e r t i n e n t a v a i l a b l e knowledge about the a c t u a l system. ... • Redesign, w i t h i n the model, the o r g a n i z a t i o n a l r e l a t i o n s h i p s and p o l i c i e s which can be a l t e r e d i n the a c t u a l system to f i n d the changes which improve system behavior. The same approach as described above can be taken i n order to analyze many b i o l o g i c a l and mechanical systems. Such systems can a l s o be approximated by bas i c feedback loops. In these systems a problem with many i n t e r a c t i n g components can be i s o l a t e d and a formal model d e s c r i b i n g the i n t e r a c t i o n between components of a problem and t h e i r cause-effect r e l a t i o n s h i p s can be constructed. The r e s u l t s obtained from the model s i m u l a t i o n can be compared with the known r e s u l t s , and the model can be r e s p e c i f i e d i n order to best approximate the known behaviour by the model behaviour. The f o l l o w i n g s e c t i o n s present the theory of information-feedback loops and the b a s i c s t r u c t u r e of such feedback loops. SYSTEMS DYNAMICS MODELS 1 1 Later t h i s w i l l be used to develop a s i m u l a t i o n model and to formulate a s i m u l a t i o n program f o r execution by d i g i t a l computers. 2.2 MODEL STRUCTURE In order to construct a formal model of any i n d u s t r i a l or b i o l o g i c a l system, we need a s t r u c t u r e which can guide us i n organizing the informat i o n of such systems. This s t r u c t u r e should i n c l u d e the d e s c r i p t i o n of cause-effect r e l a t i o n s h i p s and should be synonymous i n nomenclature to these systems. For t h i s purpose a simple model framework w i l l be presented here. We focus our a t t e n t i o n on systems which are closed and have i n t e r l o c k i n g feedback loops, which i n t e r a c t to produce growth, f l u c t u a t i o n s , and changes i n system components. These are a l s o known as inf o r m a t i o n feedback systems. A broad d e f i n i t i o n of an informati o n feedback system i s presented by J.W. F o r r e s t e r [ 1 5 ] . He s t a t e s , An information-feedback system e x i s t s whenever the environment leads to a d e c i s i o n that r e s u l t s i n a c t i o n which a f f e c t s the enviornment and thereby i n f l u e n c e s f u t u r e d e c i s i o n s . The b a s i c s t r u c t u r e of a feedback loop appears i n Figure 2. Such a loop i s a closed path, having an a l t e r n a t i n g s t r u c t u r e of r e s e v o i r s or l e v e l s , interconnected by c o n t r o l l e d flows of SYSTEMS DYNAMICS MODELS 12 m a t e r i a l , and info r m a t i o n flow. i n f o r m a t Ion measurement Y / / SOURCE DECISION PROCESS INFORMATION ( a b o u t l e v e l o f a s y s t e m ) f l o w o f m a t e r i a l LEVEL ( s t a t e o r c o n d i t i o f a s y s t e m ) oh Figure 2 - The Str u c t u r e of a Feedback Loop As shown i n Figure 2, a d e c i s i o n generates an a c t i o n which a f f e c t s the l e v e l or s t a t e of a system. The information about t h i s l e v e l i s measured, a process which may have d i s c r e p a n c i e s and may get d i s t o r t e d over time. The informati o n of t h i s apparent l e v e l i s obtained by the d e c i s i o n process, which i s the ba s i s f o r new a c t i o n . This i s the sim p l e s t form of feedback loop. Other delays or d i s t o r t i o n i n information may be encountered wit h i n l a r g e r feedback loops. SYSTEMS DYNAMICS MODELS 1 3 As an example o f a s i m p l e f e e d b a c k l o o p , F i g u r e 3 p r e s e n t s an e l e m e n t a r y i n v e n t o r y - c o n t r o l s y s t e m . The example and t h e above s t r u c t u r e have been d e s c r i b e d b y F o r r e s t e r [ 1 6 ] . The f e e d b a c k l o o p i n F i g u r e 3 has o n l y one l e v e l , and hence i t i s c l a s s i f i e d a s a " f i r s t - o r d e r " s y s t e m . As w i l l be shewn l a t e r , l e v e l s r e p r e s e n t t h e m a t h e m a t i c a l o p e r a t i o n o f i n t e g r a t i o n . T h e r e f o r e , maximum number o f l e v e l s i n any f e e d b a c k l o o p o f a system p r e s e n t t h e o r d e r o f a s y s t e m . In t h e example shown, a s i n g l e s y s t e m l e v e l ( i n v e n t o r y ) i s c o n t r o l l e d by a s i n g l e d e c i s i o n ( o r d e r r a t e ) . I n t h i s example, t h e a p p a r e n t l e v e l i s assumed t o be the a c t u a l l e v e l s i n c e i t i s assumed t h a t t h e r e i s no d e l a y o r d i s t o r t i o n i n t h e i n f o r m a t i o n c h a n n e l f r o m i n v e n t o r y " I " (number o f u n i t s ) t o o r d e r r a t e "OR" (number o f u n i t s p e r week). A l s o t h e r e i s no d e l a y between t h e d e c i s i o n "OR" and i t s a c t i o n , f l o w of o r d e r e d g o o d s , i n t o i n v e n t o r y . S u p p l y p r e s e n t s an i n f i n i t e s o u r c e , w h i c h i s not a f f e c t e d by s y s t e m b e h a v i o u r and s u p p l i e s a s many go o d s as o r d e r e d by t h e d e c i s i o n "OR" t o f i l l i n v e n t o r y . D e c i s i o n o r d e r r a t e has i n f o r m a t i o n a b o u t d e s i r e d i n v e n t o r y "DI" (number o f u n i t s ) and an a d j u s t m e n t t i m e "AT" (number o f weeks), the assumed time r e q u i r e d t o c o r r e c t i n v e n t o r y . " DI" and "AT" a r e p r e s e n t e d h e r e as c o n s t a n t s , which a r e n o t ch a n g e d by t h e s y s t e m b e h a v i o u r . O r d e r r a t e o b t a i n s an i n f o r m a t i o n a b o u t c u r r e n t i n v e n t o r y l e v e l and g e n e r a t e s an a c t i o n a s a r e s u l t o f t h e d i f f e r e n c e between d e s i r e d i n v e n t o r y and t h e c u r r e n t SYSTEMS DYNAMICS MODELS 1 4 i n v e n t o r y l e v e l . T h i s a c t i o n i s presented as goods ordered "GO", which changes the i n v e n t o r y l e v e l . How the i n v e n t o r y -c o n t r o l loop presented here, would c o r r e c t an i n v e n t o r y d i s c r e p a n c y can be examined by step-by-step c a l c u l a t i o n s of order r a t e and i n v e n t o r y over time. T h i s w i l l be presented i n l a t e r c h a p t e r s . AT a d j u s t m e n t j — | t ime X o r d e r r a t e O R ' i I i DI / d e s i r e d / i n v e n t o r y rk sou rce i n v e n t o r y SYSTEMS DYNAMICS MODELS 15 2.3 SYSTEM COMPONENTS As sh own i n Figures 2 and 3, a feedback loop can be formed from fou r basic components: l e v e l s , flow rates, decision processes and information flow. Levels: Level variables describe the state of a system at any point i n time, and level s continue to exist, even when the system i s at r e s t . Levels accumulate the results of actions produced by decision processes. A present l e v e l i s the resultant accumulation of the net difference between the incoming flow rates to the l e v e l and the outgoing flow rates, over a l l past time. In the inventory-control loop presented above, inventory represents the system state and has only one incoming flow rate - ordered goods. A new value of a l e v e l can be computed from i t s own previous value and the time i n t e r v a l between the computations of a new value and the previous value. The l e v e l s represent the history of a system and perform the mathematical operation of integration. The le v e l s can not change instantaneously. The change i n l e v e l s i s gradual over the time i n t e r v a l and create system continuity between points i n time. The l e v e l variables do not d i r e c t l y depend on one another, in the same way as the height (level) of one growing plant does not d i r e c t l y depend on the height of the another growing plant. Normally, l e v e l variables feed information to rate variables, which cause changes in l e v e l variables. SYSTEMS DYNAMICS MODELS 16 Therefore, l e v e l and r a t e v a r i a b l e s must a l t e r n a t e along any path through a system s t r u c t u r e . Flow Rates: Rates define the present instantaneous flows between the l e v e l s i n a system. Rates r e f l e c t a c t i v i t i e s cr a c t i o n s which change the s t a t e of a system. Rates of flow or a c t i o n s are determined by the l e v e l s of a system, according to the r u l e s defined by the d e c i s i o n processes. In the foregoing example of an i n v e n t o r y - c o n t r o l loop, goods ordered to change the invent o r y l e v e l represent such a c t i v i t y or a c t i o n . Values of a rat e v a r i a b l e can be computed by using the values of i t s as s o c i a t e d l e v e l s and constants (inventory l e v e l ; and de s i r e d inventory "DI" and adjustment time "AT" as i n Figure 3). A r a t e v a r i a b l e neither depends on i t s previous value, nor on the time i n t e r v a l between computations. Rate v a r i a b l e s can only i n t e r a c t through t h e i r i n f l u e n c e on system l e v e l s . In p r a c t i c e , no rat e of flow can be measured instantaneously, s i n c e the instruments used to measure t h i s flow, do require some time f o r t h e i r f u n c t i o n i n g . As some time i n t e r v a l , however s m a l l , i s necessary to measure information about any r a t e , no r a t e v a r i a b l e at one i n s t a n t can depend on other r a t e v a r i a b l e s or l e v e l s at the same i n s t a n t . Decision Processes: A d e c i s i o n process as used here, i n d i c a t e s a process that determines how the a v a i l a b l e i n f o r m a t i o n about the l e v e l s i n a system lead to a new a c t i o n . An a c t i o n generated by a d e c i s i o n process can be expressed as a flow r a t e i n t o a l e v e l . SYSTEMS DYNAMICS MODELS 17 This a c t i o n causes one or more l e v e l s to change. A d e c i s i o n process may appear as a simple equation, that i n some elementary way determines a flow i n response to the s t a t e of a system l e v e l ; or i t may be described by a long and elaborate sequence of computations, i n v o l v i n g a number of intermediate steps. In the foregoing example, the d e c i s i o n can be presented as a simple equation such as : OR = (DI-I)/AT where the order r a t e "OR" (goods ordered per week) i s simply the discrepancy i n the inventory d i v i d e d by the adjustment time "AT". The d e c i s i o n process can simply be a r e g u l a t i n g process as i n a thermostat; or i t can be a complex, governing process as in b i o l o g i c a l development or i n management d e c i s i o n s . The d e c i s i o n process i s always a part of a feedback loop. Information i s obtained, a d e c i s i o n i s made, new a c t i o n i s generated, changes i n system s t a t e occur, new information about a l e v e l or a s t a t e i s produced and used by the d e c i s i o n process, completing the feedback loop. The d e c i s i o n process may be e p i s o d i c or p e r i o d i c as i n the i n d u s t r i a l systems, or may be continuous as i n the b i o l o g i c a l processes. A feedback loop may in c l u d e many l e v e l s and d e c i s i o n processes as i n large o r g a n i z a t i o n s , or i t may be a simple loop as i n Figure 3 which has only one l e v e l and a d e c i s i o n p o i n t . I M2 E i a i i 2 2 : I n Figures 2 and 3 i t i s shown t h a t the d e c i s i o n f u n c t i o n s determining the r a t e s are dependent only on SYSTEMS DYNAMICS MODELS 18 information about the l e v e l s . In p r a c t i c e , t h i s i n f o r m a t i o n leading to a new d e c i s i o n , may not present the true s t a t e of a system. The i n f o r m a t i o n may a l s o be d i s t o r t e d or delayed i n time. By making the time span s u f f i c i e n t l y s m a l l , we can i n p r i n c i p l e , make a p a r t i c u l a r d e c i s i o n independent of some other present d e c i s i o n that i s being determined at the same i n s t a n t i n another part of the system. 2J± GRAPHICAL REPRESENTATION OF MODEL EQUATIONS The behaviour of some systems can be described by models comprised of verbal statements or b e l i e f s , or by equations describing the separate component interactions of a system. The former i s awkward, hard to communicate and lacks precision. Though equations precisely describe the behaviour of system components, they do not convey the d e t a i l s of model structure. In order to get a broader perspective of a model and at the same time f u l l y understand the dynamic time varying behaviour of a model, both equations and flowcharts are necessary. This section describes the form of equations and the block diagram structure of the components needed to construct a model of a system having a basic structure presented i n the l a s t section. Let us f i r s t present an example which i l l u s t r a t e s the block SYSTEMS DYNAMICS MODELS 19 structure. Consider the population example presented e a r l i e r in Chapter 1. Figure 4 presents the same example with few additional components. The general function of these a u x i l i a r y components w i l l be described l a t e r i n the section. The example of Figure 4 has three negative feedback loops and one positive feedback loop. I t i s s t i l l a " f i r s t - o r d e r " system, having only one l e v e l , population "P". Population has an incoming flow, b i r t h rate "BR" and an outgoing flow, death rate "DR". Population l e v e l at any time i s the net accumulation of the difference between the two rates, b i r t h rate and death rate. Birth rate i s a decision process, which acquires information about population and an additional information about how crowding r a t i o "CR" a f f e c t s b i r t h rate. This information along with a known f e r t i l i t y rate (birth rate normal "BRN") i s u t i l i z e d in order to produce growth i n population. Death rate, in a s i m i l a r fashion obtains information about population and the e f f e c t s of the crowding r a t i o . This information along with a known mortality rate (death rate normal "DRN") controls population growth. Crowding r a t i o "CR" represents the e f f e c t of population on crowding i n a fixed land area "LA". Crowding r a t i o i s then used to compute the b i r t h rate crowding multiplier "BRCM" and the death rate crowding multiplier "DRCM". As population increases, the r a t i o of population to land area increases. "BRCM" i s a function of crowding r a t i o . As crowding r a t i o increases, "BRCM" SYSTEMS DYNAMICS MODELS 20 decreases. This information about "BRCM" reduces b i r t h rate. S i m i l a r l y "DRCM" increases with increase in crowding r a t i o , thereby increasing the death rate. Thus, the a d d i t i o n a l e f f e c t s of population and land area can be combined to better approximate population behaviour. In fact, the model presented here i s only a small part of a large model known as a "World flodel" developed by J.W. Forrester [20]. , Now l e t us turn to show how the model structure can be used to formulate eguations. BR o Y DR tr 1/ > BRCM 7?T 'LR CR i i S c i SYSTEMS DYNAMICS MODELS 2.5 EQUATIONS FOB SYSTEM COMPONENTS 21 In order to formulate equations, we need v a r i a b l e s (symbols) and constants. These symbols and constants can be represented by v a r i a b l e names. P r a c t i c a l c o n s i d e r a t i o n s make i t d e s i r a b l e to adopt a standardized convention f o r v a r i a b l e names. Names should allow a wide v a r i e t y , so as to present mnemonic s i g n i f i c a n c e of the q u a n t i t i e s they represent. Programming c o n s i d e r a t i o n s impose a f i x e d maximum length f o r such v a r i a b l e names. To s a t i s f y these computational demands and yet provide a wide v a r i e t y , v a r i a b l e names i n t h i s t h e s i s w i l l c o n s i s t of s i x or fewer alphanumeric 1 c h a r a c t e r s , the f i r s t of which must be a l p h a b e t i c 2 . V a r i a b l e names used i n the previous example of population growth were, f- P ,BR, DB,BRN ,DRN, CS, BRCM ,DRCM, and LA -I. Equations are formed using these v a r i a b l e names and mathematical operations, which are then formulated i n a si m u l a t i o n program f o r execution on d i g i t a l computers. The si m u l a t i o n language used i n t h i s t h e s i s f o r t h i s purpose i s S/360 CSMP (Continuous System Modelling Program) [ 4 1 ]. This 1 Alphanumeric characters are c h a r a c t e r s from a group of c a p i t a l E n g l i s h l e t t e r s and Arabic numerals 2 A r e s t r i c t i o n imposed by most continuous system programming languages SYSTEMS DYNAMICS MODELS 22 program i s an advanced version of DSL/90 [40] and was developed by IBM. Another such programming language that has been in use i s DYNAMO [33]. DYNAMO was developed by the Ind u s t r i a l Dynamics group at M.I.T. to simulate models of i n d u s t r i a l systems. Though DYNAMO has been widely used i n i n d u s t r i a l systems by J.W. Forrester [19] and others, i t has notational d i f f i c u l t i e s and i s awkward to program i n . S/360 CSMP incorporates a number of advanced features [ 4 ] . I t can, f o r example, conveniently calculate i n i t i a l and terminal conditions to place the entire simulation under programming control. Its FORTRAN l i k e structure allows equations to be written i n equivalent of mathematical notations. In addition, i t provides block modelling capability shared with digital-analogue simulators. A l l these provide a s i g n i f i c a n t l y more powerful and sophisticated tool for simulation. Equations presented henceforth w i l l be i n the context of CSMP, and, wherever possible, i t s equivalent i n DYNAMO w i l l be presented in footnotes, should the reader need to translate from one to the other. The system of equations described below d i r e c t l y originates from the basic structure presented in the previous section. I t gives r i s e to two basic types of equations: l e v e l equations and rate equations, with other a u x i l i a r y equations which add convenience and c l a r i t y i n representing complex systems. The few conventions adopted in t h i s thesis for c l a r i t y are given i n SYSTEMS DYNAMICS MODELS 23 the following. The terminology adopted was o r i g i n a l l y expressed by J.W. Forrester [19]. LeveIs and Level Equations: A l l l e v e l variables and any other spe c i a l variables which involve the process of integration w i l l be graphically represented by a rectangle as shown i n Figure 5 , which i s a part of an example presented in Figure 4. A l e v e l equation represents the accumulation of the rates of flow that change the l e v e l . The value of a l e v e l at any time i s calculated by knowing i t s i n i t i a l or previous value, the current rates of incoming flows and outgoing flows, and the time i n t e r v a l between computations. Mathematically, i t resembles integration process and can be represented as fellows (see Figure 5) P (t) = P (t f l ) + j (BR-DH) dt where P(t 0) i s the known value at some previous time t c and the integration i s performed over an i n t e r v a l from time t e to current time t. Its CSMP1 formulation has the form 1 Its DYNAMO counterpart, though si m i l a r in nature, imposes an extra burden of specifying time components by J, K, and time i n t e r v a l JK, as i n : P.K = P.J + (DT) (BR. JK-DR. JK) meaning - P at time K can be computed by adding P at time J (where J i s the previous time and K i s the new time), to the product of time i n t e r v a l DT with the net difference in flow rates computed for the time i n t e r v a l JK. CSMP automatically takes care of these time components i n an INTGRL function SYSTEMS DYNAMICS MODELS 24 P = INTGBL(PIC,BR-DR) where P denotes the new value to be computed at any time t, PIC the I n i t i a l value of P, BR the Incoming flow, and DR the Outgoing flow Any number of rates can be adding to or subtracting from a l e v e l . The example shown has a simple structure of only one inflow and one outflow. The l e v e l equation i s the only equation type which d i r e c t l y involves a time component. BIRTH RATE ( B R ) DEATH RATE Figure 5 - A Graphic Symbol for a Level Rates and Rate Equations: Rates are decision statements that define the flows i n a system. Rate equations receive information as input, and control a rate of flow into or out of a l e v e l . The Rate i s graphically represented by a valve li k e structure as shown in Figure 6 . The inputs to a rate equation are system l e v e l s and constants. The value of a rate variable i s computed by the given function or relat i o n s h i p between the SYSTEMS DYNAMICS MODELS 25 input l e v e l s and constants. I t may be a simple function involving the product of a l l inputs as shown i n Figure 6 , or may be a complex function involving number of mathematical operations. In CSMP* the equation i s presented in a simi l a r form. A simple product equation has the form BR = BRN*P*BRCM The Rate equations describe how the surrounding circumstances or fluctuations in system l e v e l s a f f e c t r e a l system decisions. b i r t h r a t e norma 1 (BRN) p o p u l a t i o n (P) — * b i r t h r a t e crowd i n g • ^  mu 1 t i p i i e r (BRCM) Fiqure 6 - A Graphic Symbol for a Flow Rate Auxiliary Variables and Auxiliary Equations: The a u x i l i a r y variables are the mu l t i p l i e r s used for convenience i n systems where the decision process involves a number of intermediate 1 The same equation in DYNAMO looks as follows: BR.KL = BRN * P.K * BRCM. K once again, time component must be spe c i f i e d as shown above. The Rate for the i n t e r v a l KL i s computed by using values of P and BRCM at time K, and constants which have no time component SYSTEMS DYNAMICS MODELS 26 steps. Information about d i f f e r e n t l e v e l s and r a t e s i s (LA) l a n d a r e a b i r t h r a t e crowd i n g _ (BRCM) 7" mul t i p l i e r (CR) BRCM (BRN) ^ b i r t h r a t e norma 1 Rate M u l t i p l i e r F u n c t i o n M u l t i p l i e r Ficjure 7 - Graphic Symbols f o r A u x i l i a r y V a r i a b l e s processed through these a u x i l i a r y v a r i a b l e s , which then feed t h i s i n f o r m a t i o n to d i f f e r e n t d e c i s i o n processes i n order to generate new a c t i o n . Figure 7 shows two types of a u x i l i a r y symbols that w i l l be used to formulate complex models. An octagon, (resembling a c i r c l e ) l a t e r r e f e r r e d to as a r a t e M u l t i p l i e r g enerally forms a product of i t s i n p u t s . Any other type of r e l a t i o n can be formed by a s s i g n i n g the p a r t i c u l a r r e l a t i o n s h i p . A square with a recta n g l e bar, l a t e r r e f e r r e d t o as f u n c t i o n m u l t i p l i e r , i s another type of a u x i l i a r y v a r i a b l e that w i l l be used i n models. I t has one input, and i t s output i s computed from an a r b i t r a r y f u n c t i o n of one v a r i a b l e . I t i s of the form Y = F (X) where X i s the input and Y the output. F (X) can be e x p l i c i t l y assigned by p a i r s of (X,Y) values or by i n t e r a c t i v e l y drawing an e x p l i c i t curve. SYSTEMS DYNAMICS MODELS 27 The example shown i n F i g u r e 7, i s a p a r t of the example presented e a r l i e r i n F i g u r e 4. The crowding r a t i o " C B " i s used as a r a t e m u l t i p l i e r , and has two i n p u t s , p o p u l a t i o n l e v e l " P " and a c o n s t a n t " L A " . I t s CSMP 1 e q u a t i o n i s f o r m u l a t e d as shown below: CR = P / L A where c rowding r a t i o i s the r a t i o of p o p u l a t i o n to l a n d a r e a . A f u n c t i o n m u l t i p l i e r p r e s e n t e d i n the example i s " B R C M " . I t has crowding r a t i o as i t s i n p u t , and i t s o u t p u t i s some v a l u e computed from i t s f u n c t i o n . In CSMP 2 a f u n c t i o n m u l t i p l i e r i s r e p r e s e n t e d by two e q u a t i o n s , and an a d d i t i o n a l v a r i a b l e name f o r a f u n c t i o n d e s c r i b i n g the i n t e r p o l a t i o n v a l u e s as shown below: BRCM = AFGEN (ZBRCM, CR) FUNCTION ZBRCM = (0, 1 . 05) , (1 ,1) , (2 , 0 .9 ) , (3 , 0 . 7) , (4 , 0 . 6 ) , (5 ,0 . 55) where the f i r s t e q u a t i o n s p e c i f i e s t h e dependency on i n p u t v a r i a b l e " C R " , w i t h the i n t e r p o l a t i o n d e s c r i b e d by the FUNCTION ZBRCM. AFGEN i s a s p e c i a l f u n c t i o n used i n CSMP f o r t h i s 1 In DYNAMO the e q u a t i o n l o o k s as f o l l o w s : CR.K = P . K / L A 2 In DYNAMO an e q u i v a l e n t form i s : BRCM.K = TABLE(ZBRCM,CR.K,0 ,5,1) ZBRCM = 1 . 0 5/1 / 0 . 9 / 0.7 / 0 . 6 / 0 . 5 5 where f i r s t e q u a t i o n g i v e s the i n p u t v a r i a b l e and f u n c t i o n name with t h r e e v a l u e s f o r i n p u t which s p e c i f y t h e X c o - o r d i n a t e s of i n p u t v a l u e s . F i r s t v a l u e i s the s t a r t v a l u e , second the l a s t v a l u e and t h i r d the increment f o r subsequent p o i n t s s t a r t i n g w i t h f i r s t v a l u e . Second e q u a t i o n p r e s e n t s the c o r r e s p o n d i n q Y (output) v a l u e s f o r a f u n c t i o n i n t e r p o l a t i o n SYSTEMS DYNAMICS MODELS 28 purpose. The second equation s p e c i f i e s the set of points (X-Y pairs) f o r i n t e r p o l a t i o n of a curve. Figure 8 - Graphic Symbols f o r Constants and Switches Constants and Switches: Constants are the values which remain f i x e d during a s i m u l a t i o n run. These values can be changed a t the beginning of a new s i m u l a t i o n run. These values are independent of the system behaviour and remain unchanged, with dynamic changes i n the system. Constants do net have any inpu t s . They have outputs which are used with r a t e s and l e v e l s . There are two types of constant symbols that w i l l be used i n t h i s t h e s i s , f o r convenience and f l e x i b i l i t y . Both symbols are presented i n Figure 8. The f i r s t symbol i s a simple constant g r a p h i c a l l y represented by a s m a l l c i r c l e with a l i n e through i t . I t has a f i x e d value. The other type of constant shown i n Figure 8 w i l l be r e f e r r e d to as a "switch". I t i s a constant which has an i n i t i a l constant value, and i t assumes a new value at a s p e c i f i e d time i n a s i m u l a t i o n . In other words, i t has three parameters, i n i t i a l value, new value, and a time value s p e c i f y i n g when a switch from an i n i t i a l value to a new value i s LA ( l a n d a r e a ) BRN ( b i r t h r a t e n o r m a l ) C o n s t a n t Swi t c h SYSTEMS DYNAMICS MODELS 29 to occur. f low ra te f low rate Figure 9 - Graphic Symbols f o r a Source and a Sink Sources and Sinks: Sources and s i n k s l i e outside the closed boundary of a system. Closed boundary of a system i s such that nothing from w i t h i n the system flows across that boundary, which may a f f e c t system behaviour. Any behaviour must be produced by a combination of i n t e r a c t i n g components which l i e w i t h i n a closed boundary. An i n f i n i t e source, such as shown i n Figure 9, l i e s outside the closed boundary. I t does not a f f e c t the behaviour of a system w i t h i n the closed boundary and i t provides any flow that i s reg u i r e d by model eguations. Conversely, an i n f i n i t e s i n k , such as shown i n Figure 9, absorbs any flow that i s put out by a system. I t al s o l i e s outside the closed boundary and does not a f f e c t system behaviour. These sources and s i n k s are associated with f l o w - r a t e s when the f l o w - l i n e s cross the closed boundary of a system. In the example shown i n Figure 9, a source provides f o r as much growth i n population as SYSTEMS DYNAMICS MODELS 30 required by the b i r t h r a t e BR, conversely the sink shown, absorbs the population required by the death r a t e DR. Connectors: Connectors are intermediate points of flow i n a network or a model. They are used to minimize the cross overs of flow l i n e s i n a planar view of a flow diagram. Two types of connectors are used i n t h i s t h e s i s t o f a c i l i t a t e drawing b e t t e r flow diagrams. The graphic r e p r e s e n t a t i o n f o r these connectors i s shown i n Figure 10(a). The f i r s t w i l l be c a l l e d a planar £2il£S£i2£ a n d 1 S g r a p h i c a l l y represented as a small square. I t has only one input coming i n from, and as many outputs going out to, any symbols described above. I t does not play any part i n system behaviour. The second w i l l be r e f e r r e d to as a subnet connector and i s g r a p h i c a l l y represented as a sm a l l t r i a n g l e . These allow a user to b u i l d up large models, c o n s i s t i n g of s e v e r a l smaller segments which can be interconnected by these subnet connectors. Due to the small s i z e of a d i s p l a y screen, b u i l d i n g a l a r g e model (as f o r example, the "World Model"), i n a s i n g l e network can get c l u t t e r e d and confusing on the screen. With the a i d of subnet connectors, a user can d i v i d e up h i s model i n t o small subnetworks or segments. Then he may draw or b u i l d one segment at a time on a d i s p l a y screen and set up subnet connectors to d i r e c t flows from one subnet to the other. Subnets interconnected i n t h i s manner, allow a user to concentrate on SYSTEMS DYNAMICS MODELS ' 3 1 different submodels of a model. These subnets form a sing l e large model i n the data structure. Subnet connectors are currently r e s t r i c t e d to only one input or output, in order to distinguish flows from d i f f e r e n t components and to prompt the user f o r proper flow connections. Also, a maximum of ten subnets are currently allowed, but the program can be modified to incorporate more subnets. The "world Model" was build on the display screen using these connectors, in four subnets (see Appendix I I ) . P l a n a r C o n n e c t o r M a t e r i a l f l o w — - > • : " - ^ " A Subnet C o n n e c t o r I n f o r m a t i o n f l o w -.-sA---* > CONNECTORS FLOW LINES (a) (b) Figure JO - Graphic Symbols f o r Connectors and Flow Lines Flow Lines: There are two d i f f e r e n t types of flow l i n e s that w i l l be used i n organizing information. Material flow w i l l be represented by s o l i d l i n e s as shown i n Figure 10 (b). Material flow occurs when an action generated by a flow rate or decision process i s fed into or out of a l e v e l to change the l e v e l . Information flow, graphically represented by dashed l i n e i s shown in Figure 10(b). It i s used to measure the information SYSTEMS DYNAMICS MODELS 32 flow of a l e v e l by a d e c i s i o n process. Information can be copied as many times (for as many d e c i s i o n processes) as needed without a f f e c t i n g i t s source, or exhausting a l e v e l . The next Chapter deals with man-machine i n t e r a c t i o n . I t describes how the bas i c s t r u c t u r e , i t s graphic symbols, and equation forms can be used i n t e r a c t i v e l y to b u i l d a continuous system model on a graphics t e r m i n a l . I t a l s o shows how the l i g h t pen, d i a l s , and pre-defined symbols can be used to form a feedback loop s t r u c t u r e and to as s i g n mathematical r e l a t i o n s h i p s and numerical values to the system components, In a d d i t i o n , a d e s c r i p t i o n i s given of how a p a r t i c u l a r f u n c t i o n may be i n t e r a c t i v e l y sketched to assi g n a f u n c t i o n a l r e l a t i o n to a fu n c t i o n m u l t i p l i e r . A model, thus formulated by such man-machine i n t e r a c t i o n and communication, i s then used to c o n s t r u c t a CSMP program f o r s i m u l a t i o n . 33 CHAPTER 3 COMPUTER-AIDED MODELLING i 3*1 ASPECTS OF DISPLAY TECHNOLOGY The primary means of describing a problem in many design d i s c i p l i n e s i s by flow diagrams that are drawn i n order to be descriptive and readable to users i n those d i s c i p l i n e s . These diagrams serve as a primary vehicle for communication between designer and user. Such symbol diagrams can be implemented on a man-machine interface, in order that they can be ea s i l y interpreted by a computer while they are being drawn. This can enable a designer to test a hypothesis rapidly in order to see i t s e f f e c t and to modify the hypothesis i n a multiple pass optimization process. Man-computer interaction has been considerably improved during the past few years by new developments in graphics display technology [29]. It i s now possible, for a non-computer expert to d i r e c t l y i n t e r a c t with large data processing systems COMPUTER-AIDED MODELLING 34 v i a computer-generated d i s p l a y s . S o l u t i o n s of complex problems can be displayed i n g r a p h i c a l or tabulated forms, and compared and adjusted d i r e c t l y on a graphics t e r m i n a l . The term "Computer Graphics" over the years has become an accepted term to denote a set of computer techniques and a p p l i c a t i o n s wherein data i s e i t h e r presented or accepted by a computer i n the form of graphs or l i n e drawings. Computer-aided design i s another term that denotes the use of a computer as an a s s i s t a n t i n the design process of some e n t i t y . A designer describes h i s model t o a computer program which d i s p l a y s the r e s u l t s of h i s model, the designer may intervene i n order to a l t e r and r e s p e c i f y parts of the model. This can be a continuous and i t e r a t i v e process which often r e s u l t s i n a superior design than without a computer i n t e r a c t i o n , w i t h i n l i m i t e d time and budget. I n the same context, the term computer-aided modelling i s used i n t h i s t h e s i s to describe an i t e r a t i v e process wherein an i n t e r a c t i v e or c o n v e r s a t i o n a l approach to the modelling of a continuous system i s c a r r i e d out. Computer-aided modelling i n v o l v e s a c l o s e i n t e r a c t i o n between a modeller and a computer through the use of v i s u a l d i s p l a y s , t y p e w r i t e r keyboards, s p e c i a l computer languages and other man-machine i n t e r f a c e s . A modeller i s able to "converse" with a computer program and t o receive a d i r e c t response from i t , the conversation being g r a p h i c a l or p i c t o r i a l i n nature. A COMPUTER-ftIDED MODELLING 35 t y p i c a l conversation could be: moving the c r o s s - h a i r d i a l s i n order to s e l e c t a l o c a t i o n f o r a symbol on a d i s p l a y scope, and then using a l i g h t pen i n order to s e l e c t the d e s i r e d component from a menu; whence the program i n t e r p r e t s t h i s and responds with a copy of that component on a s p e c i f i e d l o c a t i o n on the screen. Computer-aided modelling a l l o w s a user to represent h i s ideas i n a g r a p h i c a l form, i n order to observe the r e s u l t s of the behaviour of the model, and to modify h i s ideas i n an i t e r a t i v e loop i n order to best approximate h i s perception of the r e a l world. ls .2 HISTORY OF INTERACTIVE DISPLAY For s e v e r a l years the cathode-ray-tube (CRT) d i s p l a y console, or t e r m i n a l , has been used as a computer output device i n order to d i s p l a y r e s u l t s of computations. The f i r s t s i g n i f i c a n t use of a d i s p l a y t e r m i n a l as an i n t e r a c t i v e input/output device, f o r a p p l i c a t i o n s r e l a t e d to computer-aided design was demonstrated by the SKETCHPAD program [39]. This was designed and implemented by I.E. Sutherland. The SKETCHPAD program i l l u s t r a t e d the use of a CRT d i s p l a y and a l i g h t pen i n drawing p i c t u r e s on the d i s p l a y screen while the computer monitored the operator's a c t i o n s at the d i s p l a y and b u i l t a s t r u c t u r e d set of data representing the p i c t u r e being drawn. In COMPUTER-AIDED MODELLING 36 the data s t r u c t u r e used, a l l the blocks used were c o l l e c t e d together by a s t r i n g of p o i n t e r s forming a r i n g s t r u c t u r e . A lso, f o r quick r e t r e i v a l of i n f o r m a t i o n , a l l o b j e c t s of one type were c o l l e c t e d i n a r i n g under a generic heading. Each of the generic headings contained the informat i o n that d i s t i n g u i s h e d i t from another generic type. The program also allowed the user to extend the data s t r u c t u r e to i n c l u d e numerical or other n o n - p i c t o r i a l a t t r i b u t e s of an element by p o i n t i n g at the desired element and typing i n the a d d i t i o n a l information. T.E. Johnson extended t h i s concept with SKETCHPAD I I I [ 2 3 ] , which provided the user with a c a p a b i l i t y to describe three-dimensional o b j e c t s by drawing them i n any one of the three orthogonal views. The s e r i e s of SKETCHPAD programs demonstrated two important f u n c t i o n s of the i n t e r a c t i v e d i s p l a y console. F i r s t , i t was used as an input/output device that could accept or e x h i b i t data i n both alphanumeric and p i c t o r i a l forms. Second, i t was used to c o n t r o l the execution seguence of the program. The l a t t e r i s not unique to graphics programs but i s common to o n - l i n e programs i n general. However, a graphics console provides a more e f f i c i e n t means f o r d i r e c t i n g the progress of a program than does a t y p i c a l o n - l i n e t y p e w r i t e r . For example, at any given point i n a program, the p o s s i b l e a c t i o n s t h a t can be requested of the program may be shown as a l i s t of words on a d i s p l a y ( r e f e r r e d t o as " l i g h t keys" or more COMPOTES-AIDED MODELLING 37 commonly as a "menu") pr o v i d i n g some d i r e c t i o n to the user of the program. By p o i n t i n g with a l i g h t pen at the d e s i r e d "key" the user may, simply and q u i c k l y , i n d i c a t e that the program should perform a p a r t i c u l a r operation. Thus drawing or sketching i s not the only use of a l i g h t pen and a CRT combination. Much a t t e n t i o n has been focused on t h i s o n - l i n e aspect of i n t e r a c t i v e graphics. The range of a p p l i c a t i o n s implemented with the use of a graphics d i s p l a y i n c l u d e : c o n v e r s a t i o n a l mathematics programs [35,36], execution t r a c e s of programs as dynamic f l o w c h a r t s [ 3 8 ] , input to system si m u l a t o r s [ 3 ] , monitoring the a c t i o n s of multiprogrammed and time shared operating systems [ 6 ] , as w e l l as design a p p l i c a t i o n s such as c i r c u i t layout [ 9 , 2 4 ] , mechanical design [ 3 7 ] , s t r u c t u r a l a n a l y s i s [13,30], and more r e c e n t l y a p p l i c a t i o n s to o n - l i n e modelling [1,21]. COMPUTER-AIDED MODELLING 38 ls.3 INTERACTIVE MODELLING A generalized a p p l i c a t i o n methodology to a design problem may be described by the f o l l o w i n g four phases. I. V i s u a l i z a t i o n of the problem I I . Modelling of the problem I I I . S p e c i f i c a t i o n of the model IV. Display of model behaviour The f i r s t phase i n v o l v e s the a b s t r a c t decomposition of the relevan t aspects of the phenomena under i n v e s t i g a t i o n . This means s e l e c t i n g the important behaviour from the r e a l world, deciding s p e c i f i c a l l y which components are r e l e v a n t , and s e l e c t i n g the major l i n e s of cause-and-effect from the many po s s i b l e l i n e s of i n f l u e n c e . The next step i s to interconnect these s e l e c t e d aspects by a set of u n i d i r e c t i o n a l cause-effect or f u n c t i o n a l r e l a t i o n s h i p s . The modelling phase r e q u i r e s the development of an interconnected set of f u n c t i o n a l blocks i n a model as a representation of the ab s t r a c t v i s u a l i z a t i o n . This may be done by using flow diagrams of p a r t i c u l a r symbols which can a l s o be thought of as connectors, operations, blocks or model p r i m i t i v e s . A p a r t i c u l a r s et of p r i m i t i v e s i s chosen to s u i t the a p p l i c a t i o n , and the information about these p r i m i t i v e s i s communicated to the computer, once these p r i m i t i v e s or symbols COMPUTEH-AIDED MODELLING 3 9 have been defined i n t h i s manner, a modeller can then connect them i n the formulation of a schematic diagram. This process of c r e a t i n g symbolic diagrams using predefined symbols i s what i s r e f e r r e d to here as the modelling phase. The p r i m i t i v e s to be used i n t h i s t h e s i s were described i n Chapter 2. In the s p e c i f i c a t i o n phase, the user v i s u a l i z e s the model he has c o n s t r u c t e d , and assigns various constant values, i n i t i a l c o n d i t i o n s , mathematical r e l a t i o n s , and sketches f u n c t i o n s f o r f u n c t i o n m u l t i p l i e r s i n the model, i n order to analyze the model i n a s p e c i f i c environment. He may also be required to s p e c i f y values such as i n t e r v a l of i n t e g r a t i o n , and period of time to be simulated. I t i s apparent at t h i s point that the above two phases i n v o l v e a modeller i n an extensive i n t e r a c t i v e exchange with a computer. The f o u r t h phase of problem s o l v i n g i s the output phase. In t h i s phase the r e s u l t s of the s p e c i f i c a t i o n phase of a problem model are fed back to a modeller. Here again, i t w i l l be necessary f o r a user to s p e c i f y what he wants displayed as an output and i n what manner. Let us now turn to a d i s c u s s i o n of the a n t i c i p a t e d use of such an i n t e r a c t i v e system. The f a c i l i t i e s described here are COMPUTER-AIDED MODELLING 40 primarily aimed at amplifying the c a p a b i l i t i e s of a modeller during the period when he i s tryin g out his tentative ideas about a r e a l s i t u a t i o n . The CAM system presented here makes i t easier for him to describe and modify his ideas by allowing him to communicate to and from a computer i n a "natural form". A modeller uses the CAM system via an in t e r a c t i v e graphics display, comprising a t e l e v i s i o n screen and the keyboard of an IBM 3270 terminal. He may communicate with the system by typing from the keyboard and by pointing with the l i g h t pen. CAM responds immediately with i t s interpretation of user actions. The user can v e r i f y the echo produced by the program and proceed further. This quick response and echo v e r i f i c a t i o n i s present in the system at several l e v e l s . For example, when a user points at a component in the menu, the system instantly displays that component at the position s p e c i f i e d by cross-hairs on the screen; when he forms an equation (mathematical r e l a t i o n ) , the system responds with an equation or provides an error diagnosis. When he completes the description of his model, the system generates an executable CSMP program for simulation. The next sections demonstrate CAM by presenting a simple example of how a user might describe (and simulate) a simple but important model. The i l l u s t r a t i o n also demonstrates the p o s s i b i l i t i e s of more sophisticated applications. COMPUTER-AIDED MODELLING 3^4 AN EXAMPLE OF A SECONpzORDER SYSTEM The example presented here i s an extension to the inventory-control problem presented e a r l i e r in Chapter 2. An inventory control system with a delay in ordered goods presents a second order system as shown i n Figure 11. It has two le v e l s , inventory " I " and goods on order "GO". An addition of an extra level (goods on order "GO") and a flow rate (receiving rate "RR") introduces a delay, as i n a r e a l system, between the order rate "OR" and the inventory l e v e l . 4 2 or, r 1 \ i m 0 -B-00 », la) i • M1 DC- - - -{T j Figure XI - Second Order Inventory-Control System COMPUTEH-AIDED MODELLING 42 An order f o r goods i s placed, according to a d e c i s i o n r u l e (order r a t e "OR"), a f t e r r e c e i v i n g the i n f o r m a t i o n about the current i n v e n t o r y l e v e l . Goods on order i s a l e v e l or accumulation of the d i f f e r e n c e i n the goods that have come i n from order rate and the goods that have gone out t c the r e c e i v i n g r a t e . In a r e a l s i t u a t i o n not a l l goods may be received as soon as they are ordered. Assuming, f o r s i m p l i c i t y , that a constant f r a c t i o n of goods ordered i s received every week, we can present t h i s by a constant delay i n ordering "DO". The inventory i s simply the accumulation of the goods received. Here the information received by the order r a t e about inventory represents an apparent l e v e l . This i s due to the delay between ordering r a t e and r e c e i v i n g r a t e . Given t h i s d e s c r i p t i o n , together with the required constant and i n i t i a l values, CAM can be used to b u i l d and simulate the model as described below. A considerable amount of information i s required during the modelling and s p e c i f i c a t i o n phase, and s e v e r a l techniques are used to keep t h i s from becoming a slow, tedious task [ 2 7 ] . Note that the f o l l o w i n g dialogue describes only one of many p o s s i b l e ways of reaching the same goal and that CAM does not f o r c e . the user to take a c t i o n s i n any p a r t i c u l a r order. COMPUTER-AIDED MODELLING 43 3.. 5 MODELLING PHASE DIALOGUE In order to create the model, the user f i r s t signs onto the Michigan Time Sharing (MTS) operating system at the 3270 keyboard terminal and begins execution of the program (see Appendix I ) . He then interacts with the program at the 3270 or by using the l i g h t pen, d i a l s or function buttons at the Adage display scope (see next Chapter). Once the program has been loaded into the 370 i t prompts the user to enter a "command" or "HELP". Typing in HELP r e s u l t s i n a l i s t i n g of commands available to the user along with their interpretations. Usually the user may want to build a new model. In order to create a model he can enter CREATE . CAM immediately responds with a "menu" which i s displayed on the graphics display scope as shown in Figure 12. The menu contains the symbols described i n Chapter 2 and keywords such as DELETE and SPECIFY. The use of these keywords i s explained below. The command structure f o r communicating information about a model i s i n the form of a set of "modes" (see Figures 12 and 14) that the user can enter or re-enter as needed. The mode names are arranged in the recommended order of use i n a menu on the screen. The l i g h t pen i s a f a i r l y natural input medium for entering any mode or selecting p a r t i c u l a r e n t i t i e s . It avoids a reliance on names and l a b e l s . COMPUTER-AIDED MODELLING 44 In order to create symbols on the screen, the user s e l e c t s the p o s i t i o n on the screen by using d i a l s l a b e l l e d X-hair and I-hair, and then points at the desired symbol i n the menu. CAM responds by creating a copy of that symbol at the selected p o s i t i o n . In this fashion the user "converses" with the graphics display u n t i l a l l the required symbols for the model have been created. SET X-HflIRS THEN CHOOSE WITH LIGHT PEN • o • o — -> DELETE SPECIFr Figure Y2 - A Menu for Modelling phase The next task i s to draw the l i n e s for information flow and material flow i n the model. For material flow the user selects a s o l i d directed l i n e from the menu, and enters the material COMPUTER-AIDED MODELLING flow mode. When a mode i s entered by a l i g h t pen h i t on i t s name (or symbol), the menu disappears and a short prompting., message appears at the bottom of the screen. In a l l cases the user i s reminded what to do next and i s told (or can see on the picture of a model) that his requested action has been completed. Yet the screen i s never cluttered with extraneous information. Blinking has also proved very e f f e c t i v e as an acknowledgement and as a prompting device. In the flow l i n e mode, the user i s f i r s t prompted with a o END TO WHERE ? Figure 22 ~ Graph i c 1 n te rac t ion - 11°.". Line Mode message "FROM WHERE ? ". The user may respond by pointing at COMPUTER-AIDED MODELLING 46 any component i n the model. The system acknowledges t h i s by b l i n k i n g that symbol and changing the message to read "TO WHERE ? " (see Figure 13). P o i n t i n g at another component r e s u l t s i n an u n i d i r e c t i o n a l flow l i n e being drawn from the b l i n k i n g component to the component j u s t pointed. Repeating t h i s c y c l e , a l l the flows may be assigned. In a l i k e manner, dotted l i n e s may be drawn i n order to assign information flows, by entering the mode represented on the menu by a dotted d i r e c t i o n a l l i n e . At any point to terminate the mode, the user can simply point a t "END". DELETE mode can be used to remove any component or a flow l i n e by p o i n t i n g at i t with the l i g h t pen a f t e r e n t e r i n g DELETE mode. The user can s e l e c t or terminate any mode without any r e s t r i c t i o n . By using the l i g h t pen, d i a l s and the menu i n t h i s way, the user can b u i l d a representation of a model on the screen. Figure 11 i s a hard copy of the model which was b u i l t on the graphics terminal as described above. COMPUTER-AIDED MODELLING 47 li£ SPECIFICATION PHASE DIALOGUE Once the model has been b u i l t in the above manner, the user can specify other non-pictorial attributes with which to analyze the model. To do so, proper variable names (la b e l s ) , values and mathematical r e l a t i o n s must be assigned to the components. This can be achieved by pointing at SPECIFY in the menu. This r e s u l t s i n the display of the second phase of the menu as shown in Figure 14. It has six keywords (or modes): LABELS, VALUES, RELATIONS, FUNCTIONS, REDEFINE and END. LABELS mode can be used to assign labels to the components. VALUES mode can be entered i n order to assign values to the constants and i n t e g r a l s ( l e v e l s ) . RELATIONS mode allows one to specify a mathematical relationship for components i n terms of other model components using the labels assigned i n LABELS mode. FUNCTIONS can be used to sketch graphs (curves) for function m u l t i p l i e r s . REDEFINE switches on the f i r s t part of the menu i n order to add or delete symbols or flow l i n e s . END terminates the user interaction with the graphics display and the mode of i n t e r a c t i o n i s switched to the keyboard. If one selects any of the f i r s t four modes by the l i g h t pen, the system responds by prompting the user with a message " ALL OR SELECT ? This i s to ask the user whether he wants to choose s p e c i f i c components for assigning labels, values, equations or functions. He may do so by pointing at SELECT COMPUTER-AIDED MODELLING 4 8 In case of ALL, the user i s lead by the program to assign the selected s p e c i f i c a t i o n to a l l the required components. This i s done by blinking each component i n turn and then prompting the user to take action, u n t i l a l l the components have been assigned the selected s p e c i f i c a t i o n s . In SELECT mode when the user selects the component, the program checks to see, whether i t needs to be assigned the p a r t i c u l a r s p e c i f i c a t i o n , and then either presents the user with an error diagnosis, or acknowledges by blinking the symbol and prompting him to take a c t i o n 1 . Once again the user can terminate any of the selected modes by pointing at END. In order to assign values the user has two options. The user can either enter the values (numbers) from the keyboard (the 3270), or he can form a number on the graphics display by pointing at numerals, + or - sign, and E for exponent of 10, from the symbols displayed in the VALUES mode (see Figure 15). The end of a formation of a number i s sign a l l e d by pointing at END. The number thus formed on the graphics display i s also echoed above the symbol. The program also prints the current value of the variable, along with i t s current name on the 3270 1 For example, i f the user picks a flow rate to assign the value, the program produces an error diagnosis stating that "Flow rates do not require values to be assigned to them". I f instead he picks a constant to assign the value, the program, after checking the proper type, blinks that symbol in an acknowledgement. COMPUTEfi-AIDED MODELLING 49 ? • LABELS WLUES RELBT10NS FUNCTIONS REDEFINE ENO Figure J4 - The Menu f o r S p e c i f i c a t i o n Phase t e r m i n a l . P o i n t i n g at END or en t e r i n g a n u l l l i n e leaves the value unchanged i n t h i s mode. Labels or v a r i a b l e names must be entered by typing i n from the 3270 keyboard. This i s to allow the user to enter the name of symbols along with t h e i r d e f i n i t i o n s , i f the user so wishes. D e f i n i t i o n does not add any information to the model r e p r e s e n t a t i o n , but i s s t r i c t l y f o r the user's convenience, should he need to describe each symbol i n d e t a i l f o r documentation of the model. These d e f i n i t i o n s along with t h e i r v a r i a b l e names can be p r i n t e d by ent e r i n g the command ENAMES i n COMPUTER-AIDED MODELLING 50 7^ • 1 • FORM NUMBER 0 1 2 3 4 5 6 7 8 9 . E + - f N O ? Figure J_5 - Graphic I n t e r a c t i o n - Values Mode the command mode. The program i n t h i s mode a l s o p r i n t s the current l a t e l of a v a r i a b l e on the 3270 t e r m i n a l . Entering a n u l l l i n e leaves the l a b e l and i t s d e f i n i t i o n unchanged. Entering only the v a r i a b l e name changes the l a b e l , but leaves the d e f i n i t i o n unchanged. In RELATIONS mode the user i s presented with mathematical operation symbols (see Figure 16), and he may form equations by po i n t i n g at the components and the operators. The program guides him i n t h i s by prompting him to s e l e c t a symbol or an operation f o r c o r r e c t syntax. The program also d i s p l a y s the COMPUTER-AIDED MODELLING 51 Figure J[6 - Graphic I n t e r a c t i o n - R e l a t i o n s Mode associated v a r i a b l e names on the screen f o r the user's convenience. I f the user makes an e r r o r i n syntax, the program presents him with an e r r o r d i a g n o s i s . For example, he may have l e f t out the matching parenthesis, i n which case the program presents a message "unmatched parenthesis". In FUNCTIONS mode, the user i s presented with X and Y s c a l e s , and a g r i d (see Figure 17). The name of a f u n c t i o n m u l t i p l i e r appears at the top of the screen. The user may change the scale m u l t i p l i e r s i n order to get proper co-ordiante values. Then by moving c r o s s - h a i r s by d i a l s , and s i g n a l l i n g the COMPUTER-AIDED MODELLING 52 Figure Y]_ - Graphic I n t e r a c t i o n - Functions Mode p o s i t i o n b j pressing button 1 on the f u n c t i o n box, the user can construct a desired sketch or a graph (see Figure 18). He may s i g n a l the end of a sketch by p o i n t i n g at END. COMPUTER-AIDED MODELLING 53 Figure Jl 8 - Draw ing a Sketch in Functions Mode 3.7 CONTROL STRUCTURE A l l the information thus presented by the user i s stored i n t e r n a l l y in the data structure with each component. When the model i s completed by the above described i n t e r a c t i o n , and when the user is s a t i s f i e d with the model representation and sp e c i f i c a t i o n , he can terminate the graphic in t e r a c t i o n by pointing at END i n the menu. Now the user i s in the command mode where he describes his actions on the 3270 by typing i n the proper commands or HELP when prompted to do so. COMPUTER-AIDED MODELLING 54 He has available to him various commands such as: HELP - To describe commands and their interpretations. SAVE - To save the model being displayed, on disk f o r r e t r e i v a l at l a t e r time. RESTORE - To restore previously saved model from disk. EDIT - To a l t e r the model being displayed on the screen. PLOT - To get a hard-copy of the picture being displayed. NAMES - To display names of a l l components on the screen. SCALE - To view the same model with a di f f e r e n t scale by entering a scale value between 0.0 and 1. CSMP - To obtain the CSMP program for the model. SUBNET - To view or a l t e r previously defined subnets or to create a new subnet. In order to simulate the model the user may enter CSMP to obtain the CSMP executable program of the model, which can then be compiled and run under a CSMP compiler. This command also prompts the user to pick variables (symbols) that he would l i k e tabulated and sketched from a simulation run (see Figure 19). He i s also interrogated to enter the i n t e r v a l of integration, time duration for a simulation run, time i n t e r v a l for the output of variables to be sketched and tabulated. In order to use the PREPAR option of CSMP the user can run the program YLEM:CSMP.GRAPH which produces DYNAMO l i k e plots (see Appendices I and II) . COMPUTER-AIDED MODELLING 5 5 F_igure J9 - Spe c i f i c a t i o n of Output variables By entering STOP or END, the execution of the program i s terminated. At this point the program prompts the user whether he wants a CSMP program for the model being displayed, i f he has not already done so. Thus, the control language and the menu provide the user with a powerful tool for building a model of a continuous system with feedback loops. The modes of model d e f i n i t i o n break up the long task into a f l e x i b l e set of more basic interaction and provide for a smooth, easy dialogue to build a systems dynamics model. 56 CHAPTER 4 PROGRAMMING TECHNIQUES fixl GRAPHICS FOR MODELLING The ba s i c f u n c t i o n s of a computer-aided modelling system are: to represent the p h y s i c a l system under i n v e s t i g a t i o n by a model, to d i s p l a y a r e p r e s e n t a t i o n c f the model, to d i s p l a y the output c a l c u l a t i o n s based on i t , and t c a l t e r or r e s p e c i f y the model. The model of the p h y s i c a l system may be i n any depth and i n any d e t a i l d e s i r e d ; however, one attempts t o model only the e s s e n t i a l c h a r a c t e r i s t i c s of a system. For example, i f we st o r e i n f o r m a t i o n on the number of goods ordered f o r the inventory by means of mathematical equations, we may net need t c store information as to type of goods, or t h e i r weight, or volume. The d e t a i l s l e f t out would, of course, be such that they do net a f f e c t the model behaviour s u b t a n t i a l l y when compared with i t s p h y s i c a l analogue. The concept of modelling i n a computer i s completely analogous to modelling concepts used everyday i n design and engineering. PBCGBAEHIHG TECBBIQUiS 57 The a b i l i t y to analyze the model i s an important fundamental concept, and d i s t i n g u i s h e s the true computer-aided modelling system from merely a computerized drawing system. This c a p a b i l i t y r e q u i r e s t h a t the program have a mathematical r e p r e s e n t a t i o n of the model i n order that i t can subseguently analyze a model by eguations or algorithms. I t r e q u i r e s t h a t the machine have the a b i l i t y to perform changes i n the model, as c a l l e d f o r by a modeller. The a b i l i t y to d i s p l a y a model i s , cf course, b a s i c tc the use of graphics. The d i s p l a y r e p r e s e n t a t i o n may be much simpler than a model i t s e l f . For example, a computer may d i s p l a y the inventory model by simple symbols even though components themselves are represented by p r e c i s e equations stored i n a computer. I t i s a l s o necessary t h a t a computer be capable of c r e a t i n g , modifying and r e s p e c i f y i n g a model at the option cf a modeller. This c a p a b i l i t y touches on the basic concept of design, which i n v o l v e s the gradual refinement and enrichment c f the model as various options are exercised and explored. The f o l l o w i n g s e c t i o n s describe the basic concepts of d i s p l a y f i l e s , and data and d i s p l a y s t r u c t u r e s with p a r t i c u l a r reference t o the design of an i n t e r a c t i v e g r a p h i c a l system f o r computer-aided modelling. PROGRAMING TECHNIQUES 5 8 JU2 DATA-DISPLAJ ]&£jHB£ BESTS The f i r s t step i n programming d i s p l a y equipment i n order to produce a p i c t u r e on a screen, i s to generate a stream cf binary words. These form a s e r i e s of commands to the d i s p l a y that c a r r y out one of i t s f u n c t i o n s such as p o s i t i o n i n g the beam, or moving i t l i n e a r l y drawing a l i n e . Thus, a seguence of these command words correspond t c a p i c t u r e which i s a g r a p h i c a l r e p r e s e n t a t i o n of a system described by a user up to tha t i n s t a n t . The l i s t cf these command words or i n s t r u c t i o n s that c o n t r o l the movement cf a pen or an e l e c t r o n beam i s c a l l e d a d i s p l a y l i s t . In order t c produce a steady p i c t u r e t h i s d i s p l a y l i s t must be scanned continuously by a d i s p l a y scanner or c o n t r o l l e r . In any s o p h i s t i c a t e d computer graphics a p p l i c a t i o n , the semantic and g r a p h i c a l p r o p e r t i e s of a model must te sto r e d i n order to perform various operations on the model, as c a l l e d f o r by a user. The d i s p l a y l i s t i s used only to d i s p l a y a p i c t u r e cf the model as a v i s u a l a i d , and can be created ty generating the d i s p l a y i n s t r u c t i o n s d i r e c t l y from the semantic and the gr a p h i c a l p r o p e r t i e s of the model. I f any s e r i o u s computation i s to be done on the system represented on the screen, some other form of storage or "data s t r u c t u r e " i s reguired as w e l l . The d i s p l a y l i s t i s not a convenient form of re p r e s e n t a t i o n PBOGBAEHIHG TECHNIQUES 59 except to the d i s p l a y scanner i t s e l f . A data s t r u c t u r e forms a model of a system and nay contain more information than the d i s p l a y could show at any one time and may be of greater accuracy. I t i s p o s s i b l e , from one data s t r u c t u r e , to produce many d i f f e r e n t d i s p l a y f i l e s {and therefore d i f f e r e n t p i c t u r e s ) . Each would be a d i f f e r e n t v i s u a l r e p r e s e n t a t i o n of the same ob j e c t . Thus, a d i s p l a y f i l e i s a p i c t o r i a l r e p r e s e n t a t i o n of, and a data s t r u c t u r e i s a model o f, a system that a user i s t r y i n g to describe to a computer or a computer to a user. The basic f u n c t i o n s of computer-aided modelling as described above generate a set of programming requirements which d i f f e r i n important respects from conventional batch computer programming. I t i s these c h a r a c t e r i s t i c s that bave l e d t c a number of s p e c i a l i z e d software concepts, such as ccipcund data s t r u c t u r e s and l i s t processing. Conventional batch programming i s c h a r a c t e r i z e d by a b a s i c r i g i d i t y of format, s t r u c t u r e and s i z e of storage requirements. As a r u l e , a program i s processed i n a s p e c i f i e d seguence, and the number of v a r i a b l e s and amount of storage space r e g u i r e d by each v a r i a b l e must be s p e c i f i e d ahead of time. In c o n t r a s t to conventional batch computer programming, computer-aided modelling or computer-aided design i s PROGRAMMING TECHNIQUES 60 c h a r a c t e r i z e d by i t s requirement f o r f l e x i b i l i t y i n a l l aspects of program design. The designer i s not r e s t r i c t e d t c take a c t i o n s i n any s p e c i f i e d order. He i s net r e s t r i c t e d tc enter data i n any r i g i d format. In case of e r r o r s the user i s provided with proper e r r o r messages, and he can take immediate a c t i o n a f t e r observing the response to h i s a c t i o n s . He can a l t e r or r e s p e c i f y any parts of the model i n any order. The modeller u s u a l l y does not know, ahead of time, the extent or s i z e of a model; or the i n t e r c o n n e c t i o n s cf components i n a model. These evolve as the modelling proceeds. The d e s c r i p t i o n of such a system with regard to a l l r e l e v a n t aspects can be stored i n a compound data s t r u c t u r e . This compound data s t r u c t u r e must include i n f o r m a t i o n about g r a p h i c a l p r o p e r t i e s ( p o s i t i o n on the screen, b r i g h t n e s s , s e n s i t i v i t y t c a l i g h t pen h i t and so on), and semantic p r o p e r t i e s of a l l objects i n a system as w e l l as a l l of the t o p o l o g i c a l p r o p e r t i e s of a system. U_. 3 DATA-DISPLAY STRUCTURE A compound data s t r u c t u r e i s a c o l l e c t i o n of o b j e c t s , each with some associated data, arranged i n such a way that the r e l a t i o n s h i p between the objects i s e x p l i c i t . The p h y s i c a l objects to be.modelled by t h i s data s t r u c t u r e are represented by data blocks. A data block i s a f i x e d number cf storage words PBOGHAMMING TECHNIQUES 61 set aside f o r d e s c r i b i n g a p a r t i c u l a r object or e n t i t y . The format of a data block i s standardized w i t h i n a given program and i s a part of the design of the data s t r u c t u r e . However, i n the same program d i f f e r e n t types of objects may have data blocks cf d i f f e r e n t format and length. The b a s i c r e l a t i o n s h i p s between the o b j e c t s or the data blocks are s p e c i f i e d by means of p o i n t e r s . A pointer i s a word placed i n a s p e c i f i c l o c a t i o n i n a data block g i v i n g the address of a r e l a t e d data block. Data blocks can be interconnected i n many d i f f e r e n t ways depending on the type of data s t r u c t u r e r e g u i r e d [ 3 2 ] . During the i n t e r a c t i v e use of a program, data blocks can be created at w i l l , so long as the storage space f o r them i s a v a i l a b l e somewhere i n the system storage. A new data block can be l i n k e d to the e x i s t i n g data blocks by means of p o i n t e r s . A data block can al s o be deleted by u n l i n k i n g i t frcm any other e x i s t i n g data b l o c k s , thus f r e e i n g i t s storage space. Algorithms f o r p r o v i d i n g these c a p a b i l i t i e s , a l t e r i n g any e x i s t i n g data blocks, and reading data i n t o these data blocks are reguired w i t h i n the data s t r u c t u r e . This data s t r u c t u r e i s then used to generate the desired d i s p l a y p i c t u r e . For t h i s purpose the data s t r u c t u r e i s "dcjjn-comjjiled" [ 2 6 ] , i . e . i t i s analyzed and a l l information concerning the p i c t o r i a l r e p r e s e n t a t i o n c f the part of a p i c t u r e to be displayed i s e x t r a c t e d and compiled i n t o the d i s p l a y PBCGBABMI8G TECHNIQUES 62 i n s t r u c t i o n s to produce the d i s p l a y f i l e . In seme programs a temporary d i s p l a y f i l e i s used. I t i s a short f i l e s e r v i n g as an extension of the d i s p l a y f i l e . I t may be "up-comailed/ 1 [ 2 6 ] , i . e . the d i s p l a y i n s t r u c t i o n s i n the temporary d i s p l a y f i l e , created during the l a s t amendment of the p i c t u r e , are i n t e r p r e t e d and the r e s u l t i n g i n f o r m a t i o n about the changes i n the d i s p l a y p i c t u r e i s used to update the compound data s t r u c t u r e (see Figure 20). Many d i f f e r e n t v a r i a t i o n s of the d i s p l a y f i l e and data s t r u c t u r e have been used i n previous work. In the program PIXIE developed by N.E. Wiseman and h i s colleagues [ 4 3 ] , a f t e r every change i n the di s p l a y e d p i c t u r e , the temporary d i s p l a y f i l e i s f i r s t up-compiled to amend the data s t r u c t u r e and then i t i s down-compiled t o produce the d i s p l a y l i s t . Since t h i s normally takes a few seconds, i t leads to a f l i c k of the dis p l a y e d p i c t u r e at every up-and-down co m p i l a t i o n . The SLAP program wri t t e n by A.J. Drew [11] uses a short f i l e which contains d i s p l a y i n s t r u c t i o n s to d i s p l a y any one object at a time. To d i s p l a y a number of o b j e c t s , the d i s p l a y code f o r next object i s generated while the previous object i s being d i s p l a y e d . This introduces short dark i n t e r v a l s i n the elapsed time between when one object has been d i s p l a y e d and the display;code f o r the next one i s being generated. Other d i f f e r e n t versions cf the data s t r u c t u r e and the d i s p l a y s t r u c t u r e have been used i n ether systems such as graphics program SELMA b u i l t by J.H. Jackson K-3 L O C K 1 cUvAijCu.J' i-U-SL UP - C O M P I L I N G , " "j)OLS> iJ - C O M P l L ltvtV' DAT A Miotic ^ Co-tit-- Cr| a F i g u r e 20 - Data S t r u c t u r e and D i s p l a y F i l e J—> PBOGBAMMING TECHNIQUES 64 [ 2 2 ] , multipurpose graphics system b u i l t by C. Chri s t e n s e n , e t . a l . [ 5 ] , DIH developed by B.H. B i c k e r t , e t . a l . [ 3 4 ] , GBAIL developed by T.O. E l l i s , e t . a l . [ 1 2 ] , and CASE developed by G.A. Korn [ 2 5 ] . Consideration of previous work and requirements stated i n previous s e c t i o n , l e d to the d i s p l a y and data s t r u c t u r e c l o s e to that described by N. Marovac [ 2 6 ] . 1. P i c t u r e displayed should be performed independently of a computer processor. This means that the d i s p l a y f i l e or s t r u c t u r e should be a s e l f - c o n t a i n e d e n t i t y which does not r e q u i r e c y c l i c a l generation i n the computer processor. 2. E d i t i n g , i . e . adding new obj e c t s to or d e l e t i n g o bjects from the p i c t u r e , should be c a r r i e d out d i r e c t l y on the d i s p l a y f i l e or s t r u c t u r e and i n u n l i m i t e d p o r t i o n s a t any one time. 3. The nature of the d i s p l a y f i l e or s t r u c t u r e , and the r e l a t i o n s h i p between i t and the data s t r u c t u r e , should be such as to ensure quick i d e n t i f i c a t i o n of any p i c t u r e object which i s the subject c f a l i g h t pen h i t f l a g or any other g r a p h i c a l type i n t e r r u p t . The r e l a t i o n s h i p should a l s c enable quick l o c a t i o n of a block i n the data s t r u c t u r e corresponding to the block i n the the d i s p l a y f i l e or s t r u c t u r e (and v i c e v e r s a ) . 4. D u p l i c a t i o n of the inf o r m a t i o n i n the d i s p l a y f i l e or s t r u c t u r e and that i n the data s t r u c t u r e should be minimal. 5. Both the d i s p l a y f i l e or s t r u c t u r e , and the data s t r u c t u r e , should enable the s t o r i n g and r e s t o r i n g cf the network they represent. PROGRAMMING TECHNIQUES 65 i i i i PROGRAM IMPLEMENTATION The CAM system was developed on an IBM system/370 model 168 under the MTS (Michigan Time Sharing) operating sytem. I t i s dependent upon the software and the hardware f a c i l i t i e s available at the University of B r i t i s h Columbia, The hardware configuration i s shown i n Figure 21. D i a l s A B C © o o o IBM 370/168 Adage g r a p h icsj termiina 1 D f u n c t i o n E | . . . « [ box F tt e •« *- e • P * OC* * 0 • # 1 i g h t pen s c r a a n IBM 3278 t e r m i n a 1 \|/ Keyboard Adage Computer T e l e t y p e D i s p l a y c o n t r o l pane 1 Figure 21. - Hardware Configuration of the System The program i s run under MTS u t i l i z i n g a p a r t i t i o n of approximately 250,000 bytes. It operates in p a r a l l e l to an Adage AGT-10 graphics computer which i s monitored by a graph PBOGBAMMING TECHNIQUES 66 supervisor program [ 7 ] , loaded i n t o the Adage. A 6000 word d i s p l a y b u f f e r i s scanned 40 times per second i n order t c produce the d i s p l a y vectors f o r the scope. The program i n the 370 makes use of a package of subroutines t h a t communicate with the monitor i n the Adage. This communication (and the r e s t cf the 370 a c t i v i t y ) i s done i n p a r a l l e l with the scanning and di s p l a y processes. The d i s p l a y f i l e c o n s i s t s both of i n s t r u c t i o n s to draw v e c t o r s , and command words t c f u r t h e r c o n t r o l the d i s p l a y , i t s i n t e n s i t y , i t s displacement e t c . As a r e s u l t of the foregoing c o n s i d e r a t i o n s and requirements, and other f a c i l i t y c o n s t r a i n t s , the program i s written i n ALGOLW. Hence, the data s t r u c t u r e developed r e l i e s h e a v i l y on ALGOLW records, MTS f i l e sharing and f i l e handling. Adage d i s p l a y b u f f e r c h a r a c t e r i s t i c s and I/O f a c i l i t i e s , the graphics monitor and the " B a s i c " subroutine communications package implemented by the Computing Center S t a f f at the U n i v e r s i t y c f B r i t i s h Columbia [ 8 ] , The data s t r u c t u r e used i s a compound data s t r u c t u r e using data blocks as described e a r l i e r . Each data block corresponds to an ALGOLW record. These records or data blocks are used t c store a l l the information about the e n t i t i e s or objects displayed on the screen. B e l a t i o n a l - l i n k a g e p o i n t e r s are used to l i n k blocks whose corresponding objects are p a r t i c i p a t i n g i n diverse types of r e l a t i o n s h i p s . I d e n t i f i e r s are associated with PROGRAMMING TECHNIQUES 67 each d i f f e r e n t data block (see F i g u r e 22) to d e s c r i b e the block, and f o r f a s t i d e n t i f i c a t i o n of blocks when i n t e r r u p t s are handled to e x t r a c t i n f o r m a t i o n about t h a t symbol. ( a ) (b ) ( c ) TdT ( e ) ( f ) (g ) (h ) (I ) ( j ) ( k ) -5>-NULL o r ( e ) p o i n t e r t o ( f ) n e x t d a t a \ r e c o r d (g ) NULL o r p o i n t e r NULL o r p o i n t e r NULL o r p o i n t e r NULL o r p o i n t e r I d e n t i f i e r s N u m e r a l s p e c i f y i n g the t y p e o f s ymbo l S e r i a l number f o r t h a t symbo1 ( s e r i a l n u m b e r s s t a r t w i t h o n e f o r e a c h d i f f e r e n t t y p e ) P o i n t e r * tn d i s p l a y f i l e p o i n t s t o t h e f i r s t d i s p l a y i n s t r u c t i o n f o r t h i s s y m b o l i n t h e d i s p l a y f i l e p o i n t s to t h e l a s t d i s p l a y i n s t r u c t i o n f o r t h i s symbol i n t h e d i s p l a y f i l e X p o s i t i o n o f t h e symbol Y p o s i t i o n o f t h e s y m b o l t h r o u g h ( k ) a r e p o i n t e r s t o FROM r e c o r d t o TO r e c o r d t o NAME r e c o r d t o VALUE r e c o r d F i g u r e 22 - A Data Block Each of the nine d i f f e r e n t symbols used i n the f o r m u l a t i o n of a model (see Chapter 2) use the same b a s i c data block with d i f f e r e n t i d e n t i f i c a t i o n tags. Each one has a d i f f e r e n t PROGRAMMING TECHNIQUES 68 a t t r i b u t e l i s t . The i d e n t i f i e r i s the f i r s t component of a data block (see Figure 22). The second component of a block assigns a unique s e r i a l number to the symbol i t represents i n that symbol group 1. The next two components s t o r e the p o i n t e r s to the d i s p l a y l i s t f o r t h a t symbol. They point t c the f i r s t and the l a s t d i s p l a y i n s t r u c t i o n s f o r that symbol i n the d i s p l a y l i s t . These are stored i n order to speed up search of any e n t i t y when i n t e r r u p t by the l i g h t pen occurs t o a l t e r or delete that e n t i t y . The next two l o c a t i o n s of an object block s p e c i f y i t s X and Y co-ordinates on the screen. This speeds up computations f o r drawing c o n n e c t i v i t y l i n e s (flow l i n e s ) . In a d d i t i o n t c t h i s , each one has a pointer to the next data block of the same s t r u c t u r e (be i t a d i f f e r e n t type of symbol or the same). Thus, a l l data blocks are s e r i a l l y connected. The data block a l s o has up to four more p o i n t e r s to the data blocks of d i f f e r e n t s t r u c t u r e s i n order to store various other non-p i c t o r i a l (but semantic) i n f o r m a t i o n (see Figures 22 and 24) about a symbol such as i t s name, i t s values i f needed, i t s equation, and c o n n e c t i v i t y i n f o r m a t i o n . Since each of the symbols has d i f f e r e n t c h a r a c t e r i s t i c s , d i f f e r e n t types of a d d i t i o n a l data blocks are r e q u i r e d i n order 1 In other words, two d i f f e r e n t types of symbols may have same s e r i a l number, though d i f f e r e n t type number; but two symbols c f the same type (same f i r s t component) number cannot have the same s e r i a l number. PBCGBA8HING TECHNIQUES 69 to s t o r e these c h a r a c t e r i s t i c s . The four a d d i t i o n a l p o i n t e r s i n the b a s i c data block point to these s p e c i a l data b l o c k s . These four d i f f e r e n t types of data blocks or record c l a s s e s are: Value record JValue block],: This i s used to stor e the i n i t i a l or constant values of the v a r i a b l e s represented by the symbols. Same record (Name b l o c k ) : This i s used to s t o r e the name (label) and d e f i n i t i o n of the symbol. I t a l s c has a po i n t e r to i t s Equation record which contains the s p e c i f i c mathematical r e l a t i o n assigned by a user. From record (From b l o c k ) : This i s used t c describe the c o n n e c t i v i t y of a model. I t points to the bas i c data block of a symbol, from which there i s a flow to t h i s symbol. 1 2 S§cord JTo b l o c k ] : This i s al s o used to describe the c o n n e c t i v i t y of a model. I t points to the basic data block of a symbol t o which there i s a flow from t h i s symbol. Both the c o n n e c t i v i t y records describe u n i d i r e c t i o n a l flows from one e n t i t y to another i n a model. Both the records have same s t r u c t u r e . Both the record types a l s c have an a d d i t i o n a l component which i s NULL (empty) f o r s i n g l e c o n n e c t i v i t y . In case of m u l t i p l e c o n n e c t i v i t y t h i s component po i n t s to the record of the same type (see Figure 24) . Let us look c l o s e l y i n t o t h i s with an example. Consider PROGRAMMING TECHNIQUES 70 the f i r s t order i n v e n t o r y - c o n t r o l system presented e a r l i e r as shown i n F i g u r e 23. When these symbols are c r e a t e d on the screen, the program c r e a t e s a b a s i c data block f o r each symbol. The f i r s t component of these r e c o r d s or data blocks i d e n t i f y the type of t h a t symbol by a numeral 1. The other components are assigned other i n f o r m a t i o n as d e s c r i b e d e a r l i e r . OR o r d e r V r a t e / ^ 01 desI red i nventory I I I I 6ir- — source nventory F i g u r e 23 - F i r s t Order I n v e n t o r y - C o n t r o l Model 1 Symbols are numbered as f o l l o w s : 1 - l e v e l s , 2 - flow r a t e s , 3 - r a t e m u l t i p l i e r s , 4 - f u n c t i o n m u l t i p l i e r s , 5 - c o n s t a n t s , 6 - swi t c h e s , 7 - subnet connectors, 8 - sources or s i n k s , and 9 - planar connectors PBCGRAKHING TECHNIQUES 71 A constant, s w i t c h , or a l e v e l record also has an a d d i t i o n a l Value record, and a p o i n t e r t c t h i s Value record from the basic data block. This Value record contains a value assigned to a constant, or an i n i t i a l value assigned t c the l e v e l f o r i n t e g r a t i o n , or three values ( i n i t i a l , new and switch time) assigned to a sw i t c h . A l l the values are i n i t i a l l y s et to zero, u n t i l changed by a user. Function m u l t i p l i e r s a l s o have a Value r e c o r d , but i n t h i s case there are two values which point to the f i r s t and the l a s t X-I p a i r s f o r that f u n c t i o n i n the fu n c t i o n l i s t (COBD a r r a y ) . Other symbols do not have the value record and t h e i r corresponding storage space i n a basic data block p o i n t s to NOLL (see Figure 24). A l l of the symbols except sources, s i n k s , and connectors a l s o have associated with them an a d d i t i o n a l data block c a l l e d the Name record. The Name record i s used t c store a s i x character name of a symbol, and i t s d e f i n i t i o n up to 100 ch a r a c t e r s . I t al s o has a po i n t e r to i t s corresponding b a s i c data block. In the case of l e v e l s , r a t e s , and rate m u l t i p l i e r s i t a l s o has a p o i n t e r to i t s eguation r e c o r d . An equation record i s used i n order to s t o r e the s p e c i f i c r e l a t i o n or equation f o r the symbol as assigned by a user. I t sto r e s a 72 character s t r i n g . I f e x t r a space i s needed t c stor e t h i s eguation, i t creates an a d d i t i o n a l eguation record of the same type, with a po i n t e r from the f i r s t to the next, and so on. 72 T6 KG urt'J. SOU Ret N U L L - r e fO'U<-L-Supply 0.0 O K 4-p 11- & T Value-0, 0 \ 1 1 X y l \ ) 4 L L "to ft" 0,0 o.c l J U L l F i g u r e 2U - Data S t r u c t u r e f o r I n v e n t o r y - C o n t r o l Model PROGRAMMING TECHNIQUES 73 This makes i t e a s i e r to write CSMP statements since the CSMP program must be w r i t t e n i n 72 character f i e l d width. The b a s i c data block a l s o has two a d d i t i o n a l p o i n t e r s s p e c i f y i n g c o n n e c t i v i t y t o ether components i n a system. Whenever a flow i s assigned from one component to another, these c o n n e c t i v i t y records are a u t o m a t i c a l l y created by the data s t r u c t u r e , with proper p o i n t e r s . For example, when a flow from order r a t e "OR" to inventory " I " (see Figures 23 and 24) i s assigned, the program dees the f o l l o w i n g . F i r s t i t creates a From record. This record has three components. One component points t c the data block of n0R", another points to the d i s p l a y f i l e where the d i s p l a y i n s t r u c t i o n s f o r t h i s flow l i n e are stored. The t h i r d component w i l l be NULL and w i l l be changed to point at the same type of data block, i f there i s another flow coming i n to the same symbol ( m u l t i p l e c o n n e c t i v i t y ) . Now the pointer i n the bas i c data block of inventory i s set to point to t h i s From record. S i m i l a r l y , a To record i s created f o r order r a t e to point t c invent o r y , and a To poi n t e r of order rate points to t h i s Tc record j u s t created. The s t r u c t u r e of From and To records i s the same. Any time a new symbol or a flow l i n e i s drawn, i n a d d i t i o n to c r e a t i n g records, d i s p l a y i n s t r u c t i o n s are a l s o generated f o r PROGRAMMING TECHNIQUES 74 a p a r t i c u l a r e n t i t y . The d i s p l a y i n s t r u c t i o n s of a symbol are copied from a pre-defined s t r u c t u r e , and c o n t r o l words s t a t i n g i t s displacements i n X and Y co-ordinates are computed. For flow l i n e s , a new set of d i s p l a y i n s t r u c t i o n s i s computed, using the co-ordinates of the two symbols i n question. These words are placed i n the d i s p l a y f i l e , which i s then sent tc- the d i s p l a y scope, where i t i s scanned and d i s p l a y e d as a p i c t u r e . Whenever a l i g h t pen h i t occurs on any flow l i n e or a symbol to a l t e r i t or delete i t , the d i s p l a y returns the l o c a t i o n of a word (a d i s p l a y i n s t r u c t i o n f o r the vector which was pointed to by the l i g h t pen) , i n the d i s p l a y f i l e tc the program. The program searches through the basic records i n order to f i n d the data block which p o i n t s to t h a t segment of the d i s p l a y f i l e (see Figure 20). Once t h i s data block has been found, a l l the information about the p a r t i c u l a r e n t i t y can be simply and q u i c k l y r e t r e i v e d by the use of p o i n t e r s . In order to delete t h i s e n t i t y , the corresponding data block i s deleted from the data blocks by changing the p o i n t e r s . Also, whenever a flow l i n e or a symbol i s added or d e l e t e d , the program e i t h e r adds a few i n s t r u c t i o n s to the d i s p l a y l i s t , or i n order to d e l e t e , i t generates a c o n t r o l word (jump i n s t r u c t i o n ) to s k i p the corresponding s e c t i o n of the d i s p l a y l i s t . Thus, a l l a l t e r a t i o n s i n the p i c t u r e are c a r r i e d out on the d i s p l a y f i l e without having to recompile the whole d i s p l a y f i l e . PROGRAMMING TECHNIQUES 75 A l s o , only the d i s p l a y i n s t r u c t i o n s are contained i n the d i s p l a y f i l e , whereas only g r a p h i c a l and semantical p r o p e r t i e s are stored i n the data b l o c k s ; thus, avoiding the d u p l i c a t i o n c f infor m a t i o n . C o n n e c t i v i t y i n f o r m a t i o n i n the data blocks i s used i n order to guide a user while he i s forming eguations. I f the modeller does not assign any s p e c i f i c r e l a t i o n s h i p , then t h i s flow c o n n e c t i v i t y information i s used to form the basic d e f a u l t eguations when w r i t i n g the CSMP program. This information i s als o used to remind a user of proper connections t o other subnets i f the model c o n s i s t s of more than one subnet. These subnets allow the user t o b u i l d up a l a r g e model and concentrate on any one part of a system, by v i s u a l i z i n g one subnet at a time. A l l subnets i n t e r n a l l y form one la r g e model. 4.5 PRODUCTION OF THE CSMP PROGRAM The various g r a p h i c a l and semantic information of the model i s stored i n d i f f e r e n t data blocks associated with each symbol, as described e a r l i e r . The information about each symbol i s used i n order to formulate a CSMP program f o r that model. The CSMP program has three segments: INITIAL, DYNAMIC and TERMINAL. PROGRAMMING TECBNIQOES 7 6 The INITIAL segment c o n s i s t s of i n i t i a l values for l e v e l s , and values f o r constants and switches. The CSMP statements f o r t h i s segment are formed i n three passes through the bas i c data b l o c k s . During the f i r s t pass, f o r each l e v e l i n the model, i t s value i s found from i t s Value r e c o r d , and a dummy v a r i a b l e name i s formed by adding "IC" at the t a i l c f the v a r i a b l e name f o r that l e v e l 1 . Then a CSMP program i s formed by s t r i n g manipulation i n the form: Dummy v a r i a b l e = Value of the l e v e l . Each CSMP statement may include more than one such assignments. In a s i m i l a r f a s hion during the second pass, CSMP statements are formed f o r a l l constants by f e t c h i n g t h e i r values from corresponding Value records, and v a r i a b l e names from t h e i r Name records. In the t h i r d pass, CSMP statements are formed f o r a l l switches. Eut f o r each s w i t c h , there are three value assignments: the i n i t i a l value, the new value and the time value fo r the switch to occur. Twc dummy v a r i a b l e names are formed fo r t h i s purpose. The v a r i a b l e name of a switch i s assigned the i n i t i a l value. The f i r s t dummy v a r i a b l e i s formed by adding a l e t t e r "1 n at the t a i l of the switch name, and i t i s assigned the new value. The second dummy v a r i a b l e i s l a b e l l e d "SWT" 1 For example, i f the v a r i a b l e name of a l e v e l i s MP" then the dummy v a r i a b l e formed i s " P I C PROGRAMMING TECBNIQOES 77 followed by a s e r i a l number of the s w i t c h , and i t i s assigned the time value. The DYNAMIC segment con t a i n s the eguations i n CSMP de s c r i b i n g the dynamic time-varying behaviour c f the model. Once again three passes are made through the data blocks i n order to form t h i s segment. In the f i r s t pass CSMP eguations are formed f o r a l l f u n c t i o n m u l t i p l i e r s . Each f u n c t i o n m u l t i p l i e r gets t r a n s l a t e d i n t o two CSMP eguaticns. The f i r s t equation i s formed by i t s v a r i a b l e name, the v a r i a b l e name c f a symbol from where the flow i s coming i n t o the f u n c t i o n m u l t i p l i e r ( t h i s i s found by using the poi n t e r from i t s From r e c o r d ) , and a dummy f u n c t i o n v a r i a b l e name. The second equation uses the dummy f u n c t i o n v a r i a b l e name, and i t s p e c i f i e s X-Y p a i r s of the f u n c t i o n . These p a i r s are obtained from the "COBD" array which i s used i n order to stor e a l l X-Y p a i r s f c r a l l user drawn sketches. The Value record of the f u n c t i o n m u l t i p l i e r has two p o i n t e r s which point to the f i r s t and the l a s t X-Y p a i r f o r that f u n c t i o n i n the CORD ar r a y . The dummy fun c t i o n v a r i a b l e name i s formed by preceding i t s v a r i a b l e name with the l e t t e r "Z" (see s e c t i o n 2.5). During the second pass CSMP equations f o r a l l switches are formed. Once again each switch r e q u i r e s twc CSMP equations. The f i r s t eguation i s used to c a l c u l a t e the time d i f f e r e n c e between the current time and the time value of the switch. Twc PBCGBABBIBG TECHSICUES 7 8 a d d i t i o n a l dummy v a r i a b l e s are generated f o r t h i s , the f i r s t of which i s l a b e l l e d M x n followed by the s e r i a l number cf the sw i t c h , and the second i s l a b e l l e d "YES" followed by the s e r i a l number. The f i r s t equation i s of the form X i = TIHE - SWTi where i i s the s e r i a l number of the switch and TIME i s the reserved CS BP v a r i a b l e s p e c i f y i n g the current time during s i m u l a t i o n . The second equation i s c f the form YFNi = FCSSH (Xi,Var,Var1) where FCBSfl i s a s p e c i a l CSMP switch f u n c t i o n . Var i s the v a r i a b l e name of the swi t c h , and Var1 i s the dummy name generated f o r the new value of the switch (as described i n INITIAL segment). The t h i r d and the l a s t pass i s made through the data b l o c k s , i n order t o generate CSMP equations s p e c i f y i n g the dynamic behaviour of l e v e l s , flow r a t e s and r a t e m u l t i p l i e r s . Data blocks f o r these three symbols are scanned i n order t c check i f t h e i r a s s o c i a t e d equation records contain any user-assigned eguations. I f so, t h i s equation i s copied as a CSMP equation. I f the user has not assigned an eguation f o r any cf these symbols, then a CSMP equation i s formulated as product of a l l incoming flows t o that symbol, by t r a c i n g through p o i n t e r s from From records. This i s done f o r a l l flow rates and rate m u l t i p l i e r s that are not assigned s p e c i f i c r e l a t i o n s by the user. The d e f a u l t equation f o r a l e v e l i s formed as the i n t e g r a t i o n of the net flow coming i n t o the l e v e l which i s determined by adding a l l incoming flows and s u b t r a c t i n g a l l PROGRAMMING TECHNIQUES 79 outgoing flows. The incoming flows and outgoing flows to the l e v e l are traced with the p o i n t e r s from the corresponding From and To records. F i n a l l y , f o r the TERMINAL segment the user i s prompted t c s e l e c t the symbols he would l i k e to be tabulated and/or p l o t t e d during s i m u l a t i o n . These form PRINT and PR EEAB statements i n CSMP. The former s p e c i f i e s the v a r i a b l e s to be tabulated, and the l a t t e r s p e c i f i e s the v a r i a b l e s to be p l o t t e d . A CSMP TIMER card i s formed by prompting the user to s p e c i f y values such as: time d u r a t i o n f o r s i m u l a t i o n , time i n t e r v a l f o r t a b u l a t i o n output, time i n t e r v a l f o r g r a p h i c a l output, and the step i n t e r v a l f o r i n t e g r a t i o n . The user i s provided with d e f a u l t values f o r these, and he may a l t e r them by s p e c i f y i n g new values. The CSMP program l i s t i n g i s terminated by generating three end statements: END, STOP and ENDJOB which s i g n i f y the end of the CSMP program (see Appendices I and I I for the models and t h e i r complete CSMP programs). 80 CHAPTER 5 SUBHARY 5_.J PROGRAM HODJJIARITY The human b r a i n seems to be w e l l adapted to comprehending informat i o n when presented i n g r a p h i c a l form. A l s o , information i s more r a p i d l j digested by humans when i t i s presented i n g r a p h i c a l cr p i c t o r i a l form, than when i t i s i n tabulated form. I t i s p o s s i b l e to s o l v e mathematical problems, or even design s t r u c t u r e s without having to draw p i c t u r e s . But i n most design d i s c i p l i n e s , most people would f e e l something l a c k i n g i n t h e i r understanding without any diagrams. Often problems and d e s c r i p t i o n s are i l l u s t r a t e d by means of diagrams, even when they are net s t r i c t l y necessary. A d i s p l a y u n i t that accepts g r a p h i c a l data d i r e c t l y and r e d i s p l a y s i t i n a manner that both a man and a computer can r e a d i l y comprehend represents a very powerful medium f o r holding a dialogue with a computer. The CAB system described i n t h i s t h e s i s has been developed SUBKAHY 81 with t h i s observation i n mind. I t represents an e f f o r t to provide a user with a t o o l : a) To describe h i s a b s t r a c t concepts and observations of r e a l i t y i n terms of some d e f i n i t e s t r u c t u r e , b) To describe the cause-and-effect r e l a t i o n s h i p s i n the s t r u c t u r e , c) To v i s u a l i z e and review h i s mental a b s t r a c t i o n s of r e a l i t y , d) To get some feedback of the simulated behaviour of components i n the model, e) To compare the r e s u l t s obtained with the a v a i l a b l e data, and f) To r e s p e c i f y the model i n order to t r y out new ideas. The design problems which can be e a s i l y j u s t i f i e d f o r conversion to graphics are those t h a t have an i t e r a t i v e nature, and those that need to be modified repeatedly i n approaching the s o l u t i o n . Hot only can graphics c o n s i d e r a b l y reduce turn-arcund time i n these instances but a l s o can provide a designer with greater f l e x i b i l i t y i n manipulation and s e l e c t i o n of h i s model. In order t c provide a user with such a t o o l , CAH was designed i n a modular f a s h i o n . Each of the d i f f e r e n t modes s p e c i f i e d i n the l a s t chapter form a separate module cr a procedure (see Appendix I I I ) . Each module processes data independently of other procedures. A l l modules have complete SUMMARY 82 access to a l l data b l o c k s , and can a l t e r any p a r t of any data block. This provides each module with the l a t e s t data about any component of a model. This modularity along with the most n a t u r a l form of communication provide the user with freedom to s t a r t or terminate any process. The user i s provided with a keyboard and a l i g h t pen as convenient media to communicate h i s ideas and to d i r e c t the flow of the program. For example, the user i s provided with numerals with other symbols on the d i s p l a y to form a number (as shown i n Figure 15). Be does not have to go back to the keyboard and r e l y on h i s typing. He can simply point at the numerals i n seguence, with the l i g h t pen to form any r e a l number. The same kind of i n t e r a c t i o n i s provided when a user i s forming eguations. The user does not have to r e l y cn typing out a l l v a r i a b l e names and s y n t a c t i c a l l y c o r r e c t equation. A l s o , the user does not have to switch from one medium to another ( f c r example, from the l i g h t pen to the keyboard) f o r coimunicating information about the model. He can simply point at the desired components (rather than l a b e l s ) of the model and at the mathematical operators, by only a touch cf the l i g h t pen. This allows the user to v i s u a l i z e on the screen which components take part i n diverse r e l a t i o n s h i p s . The program a l s o guides the user i n forming a s y n t a c t i c a l l y c o r r e c t eguaticn by presenting him with appropriate e r r o r messages. SUHBABX 83 The inherent modularity of the system provides the user with the freedom to stop or s t a r t any process a t almost any time. Users can make mistakes, and i t would te very inconvenient and i n e f f i c i e n t i f they had to s t a r t a l l over for a small e r r o r on t h e i r p a r t . Hence, modularity i s almost e s s e n t i a l i f the user i s to have the c o n t r o l over the sequence of steps he wants to take. The CAB program a l l o w s him t c s e l e c t and terminate any process simply and q u i c k l y with the touch of a l i g h t pen. This can be exemplified as f o l l o w s . & modeller using the program, may begin by c r e a t i n g few symbols on the screen from the menu. He may then assign flows to these symbols. A f t e r t h i s he may enter the SPECIFICATIONS phase. In t h i s phase he may l a b e l these symbols with appropriate v a r i a b l e names and assi g n values wherever necessary. He may then enter BEIATICJS mode i n order to assign a s p e c i f i c equation to a s p e c i f i c component of the model. At t h i s point he may r e a l i z e that he needs an a d d i t i o n a l component to form a complete equation. He can simply terminate BELAT1CNS mcde by poi n t i n g at "END" on the d i s p l a y screen, without destroying any information assigned so f a r . He can then enter modelling phase, create an a d d i t i o n a l component which he p r e v i o u s l y did not a n t i c i p a t e using, assign a flow from t h a t symbcl and re-enter BELATIONS mode i n order to continue where he had l e f t o f f . I t i s with t h i s f r e e form of movement from one phase t c SUBBABI 8 4 another, almost without any apparent r e s t r i c t i o n , that modellers can formulate t h e i r a b s t r a c t ideas. Also i t i s necessary that the users be provided with r a p i d responses from a computer i f the program i s t o help overcome the "boundary problems" between a man and a machine. In order to provide the users with r a p i d responses to h i s g u e r i e s , the data s t r u c t u r e must be kept as simple as p o s s i b l e i n order that the information can be organized and manipulated i n r e a l time. On the other hand, i n order to provide the users with complete freedom over the flow cf the program r e g u i r e s guite a complex data s t r u c t u r e i n order that any process can be executed or terminated at the user's w i l l without destroying any i n f o r m a t i o n . The data s t r u c t u r e s e l e c t e d f o r CAB was kept simple enough to provide the users with f a s t response times, and yet providing complete freedom over the execution sequence of the program. 5_5_2 APPLICATIONS AND SIMULATION The program has teen used to formulate many d i f f e r e n t models, and response times were found to be considerably f a s t e r than necessary f o r man-machine conversation. Examples i l l u s t r a t e d throughout the t e x t were b u i l t using the CAM program and were simulated to obtain the dynamic time-varying behaviour of components i n a model. Appendices I and I I i l l u s t r a t e the SUMMARY 85 a b i l i t y of CAM to b u i l d simple as w e l l as complex mcdels. Appendix I presents a simple second order system. The model presented i n the f i g u r e was b u i l t on the d i s p l a y screen using the CAM program. A CSMP program f o r the model was obtained, and the graphs represented i n Appendix I were obtained by running t h i s CSMP program. Appendix I I i l l u s t r a t e s how subnets can be e f f e c t i v e l y used to d i v i d e up a larg e model i n t o s m all segments. The "world model" [20,28] was div i d e d up i n t o four segments and then each of the segments were constructed on the d i s p l a y screen. The four subnets were interconnected using subnet connectors t c form a complete model. Figures f o r a l l the four subnets appear i n the Appendix. A f t e r s p e c i f y i n g a l l the v a r i a b l e names, va l u e s , eguations, and f u n c t i o n s i n form of sketches, f o r a l l four subnets, a CSMP program was obtained. The l i s t i n g cf t h i s CSMP program i s a l s o included i n the Appendix. This CSMP program was compiled and run s u c c e s s f u l l y t o obtain the g r a p h i c a l r e s u l t s . The CSMP program obtained as a r e s u l t of b u i l d i n g a model, can be se p a r a t e l y compiled under the standard CSMP/360 processor. The CSMP processor s o r t s CSMP program statements t c produce a FORTRAN program that describes the same model. This FORTRAN program can then be compiled by a FORTRAN compiler ana l i n k e d i t e d to obtain an executable program code. The r e s u l t i n g SUMMARY 86 program code can be run under CSMP c o n t r o l . The user can a l s o run another program* which allows him to run the same CSMP program code with d i f f e r e n t parameter values or output s p e c i f i c a t i o n s , and to obtain graphs. This program al s o allows the user to obtain (EYKAMO l i k e ) graphs f c r d i f f e r e n t components of a model with d i f f e r e n t parameter values, without having to r e s p e c i f y the model and t o recompile i t (see examples i n Appendices I and I I ) . Since the CSMP program can be run i n batch, the user can make minor changes to the program before running i t , i f he sc wishes. A l s o , r a p i d responses to programs which perform only numerical computations are not e s s e n t i a l , and these programs can be n o n - i n t e r a c t i v e or non-graphic. I t i s the c o n v e r s a t i o n a l part (as i n the man-computer dialogue i n modelling) that must provide r a p i d responses. 1 This program i s c u r r e n t l y a v a i l a b l e i n the f i l e YLEM:CSMP.GRAPH. I t was w r i t t e n and implemented by the author SUMMABY 87 5j.3 ADDITIONAL FJATUBES CF CAM The examples described i n the e a r l i e r chapters i l l u s t r a t e v a r i o u s , but not a l l of CAH*s f e a t u r e s . The user, when he i s s a t i s f i e d with h i s model, can save the model be has b u i l t cn secondary storage ( d i s k ) . This can be copied to obtain m u l t i p l e copies of the same model. These copies can then be restored and modified i n order to b u i l d up a fa m i l y of r e l a t e d but d i f f e r e n t models. When drawing a block diagram of a model, i f the user runs cut of space on the d i s p l a y screen, he can set up subnet connectors and can enter a command SUBNET i n order to i n t e r n a l l y s t o r e the d i s p l a y of the current segment of a model, and to "turn the page" to s t a r t with a f r e s h screen, i n order to b u i l d a new connecting segment or subnet. The program a l s o checks and prompts the user to d i r e c t flows from one subnet t c another. Simply by entering another command he can " f l i p the pages" to view or modify already b u i l t subnets, thus, e f f e c t i v e l y p roviding the user with more than one d i s p l a y screen. The program a l s o has a command EfiNS that can be used to d i s p l a y or view a l l the current mathematical r e l a t i o n s f o r each component that i s being d i s p l a y e d . In a l l s p e c i f i c a t i o n modes, the program presents the user SDHHAEY 88 with the current s t a t u s or s p e c i f i c a t i o n cf the component the user wants to modify. The user has an option cf leavi n g the current s t a t u s unchanged or a l t e r i n g i t by assigning a new s p e c i f i c a t i o n . For example, to a l t e r the equation f o r any component, the program p r i n t s out the current eguaticn of that component on the 3270 d i s p l a y , i f an equation had been pr e v i o u s l y assigned to that component. The user can point at "END" to leave i t unchanged a f t e r viewing the eguaticn, or el s e he can r e s p e c i f y a new equation. This i s p a r t i c u l a r l y u s e f u l i n sketching f u n c t i o n s . In FONCTIONS mode, the program a u t o m a t i c a l l y d i s p l a y s the pre v i o u s l y sketched curve on the d i s p l a y . The user can c o n t r o l the brightness of t h i s displayed curve and the new curve he wants to sketch by two d i f f e r e n t d i a l s ( d i a l s 5 and 6). In order to redraw the same curve with few changes, he may simply overlay the new curve, using the displayed curve as a guide (see Figure 18). The user can conveniently manipulate desired graphs i n t h i s way. SOHHABi 89 5jJ» POSSIELE EXTEHSIONS The a b i l i t y to d i s p l a y complex p i c t u r e s , curves, graphs along with i n t e r a c t i v e devices f o r input i n the n a t u r a l and convenient form, makes a graphic d i s p l a y console a use f u l and powerful t o o l which can combine the computational power cf a computer with the c r e a t i v e t a l e n t s and ideas cf a user i n order to e f f e c t i v e l y a r r i v e a t the s o l u t i o n s of problems imposed by a user. I t also serves as a s o l u t i o n to many graphic i n t e r a c t i o n problems. However, i t does not n e c e s s a r i l y s a t i s f y the needs of a l l users. There i s always room f o r improvement, and a d e s i r e to extend the s t r u c t u r e and f a c i l i t i e s to provide even more s o p h i s t i c a t e d machine f u n c t i o n s . There are few l i m i t a t i o n s imposed by the current s t a t u s of the CAM program. For example, i t does not have an a b i l i t y to detect cross-overs of l i n e s drawn by the user to d i r e c t flows. I t can not process and analyze the s t r u c t u r e of the p i c t u r e , i n order to regenerate a p i c t u r e , which would be isomorphic with i t s o r i g i n a l drawing, while at the same time i t would have minimum number of cross-overs of l i n e s . Such an a d d i t i o n a l f u n c t i o n or f a c i l i t y would r e q u i r e processing cf a complete p i c t u r e with i t s c o n n e c t i v i t y information stored i n a s p e c i a l way i n a connection matrix. Such o n - l i n e p i c t u r e processing has been described by H.A. D i G i u l i o and P.C. Tuan [ 1 0 ] . SUMMARY 90 Another feature t h a t could i n c r e a s e the v i s u a l e f f e c t and modeller's understanding of a model would be to center the model or d i s p l a c e the model i n s p e c i f i e d d i r e c t i o n cn the d i s p l a y screen; a f t e r which the model can be r e s c a l e d , and more than one subnet can be presented on the d i s p l a y . C u r r e n t l y , the program can only s c a l e each component on i t s center, without moving the whole d i s p l a y . In order to move the whole d i s p l a y , the complete d i s p l a y f i l e must be "down-compiled" using new co-ordinates, e i t h e r s p e c i f i e d by the user or computed by the program by some algorithm. This can then be extended to d i s p l a y more than one subnet s e p a r a t e l y b u i l t , as one p i c t u r e , by d i s p l a c i n g and s c a l i n g each subnet to avoid o v e r l a y s . A l s o , i n FUNCTIONS mode i n order to change a point i n the p r e v i o u s l y sketched graph, the user must redraw a complete new sketch. The user, c u r r e n t l y , can not simply change a point i n the sketch already drawn. This f e a t u r e can be added by p r o v i d i n g the user with two a d d i t i o n a l c o n t r o l s on the f u n c t i o n box, i n order to i n d i c a t e t o the program which points he wants to leave unchanged, and f o r a d d i t i o n s or d e l e t i o n s of extra p o i n t s . This can become complex depending cc how f l e x i b l e one wants to be. Other s t r u c t u r e f u n c t i o n minor things can be added by extending the c o n t r o l and by i n c o r p o r a t i n g a d d i t i o n a l procedures and modules. P r o v i s i o n s f o r e n t e r i n g a d d i t i o n a l SUBBABY 91 mathematical equations and CSBP statements d i r e c t l y from the keyboard, may increase f l e x i b i l i t y . 5.. 5 COMPLETE SYSTEM As described e a r l i e r , the CSBP program obtained using the CAM program, must be compiled and executed separately i n order to o b t a i n g r a p h i c a l or tabulated output. The CAM system dees not provide f o r d i r e c t i n t e r a c t i o n between the p r o g r a i modules which compile and run the program, and those which d i s p l a y the output on the graphics d i s p l a y . This would r e q u i r e i n t e r f a c i n g three d i f f e r e n t l e v e l s of programs, the ALGOLS program for CAM, the CSMP program, and the " B a s i c " subroutines i n order to d i s p l a y the output obtained from the CSBP program execution. This i n i t s e l f i s another major task r e q u i r i n g considerable systems implementation knowledge. SUMMARY 92 5.6 ANIMATION OF CONTINUOUS SYSTEM MOCFLS T r a d i t i o n a l s i m u l a t i o n programs run f o r a predetermined period and then p r i n t out the r e s u l t s i n the form of t a b l e s , f i g u r e s , and sometimes graphs. Graphical animation cf s i m u l a t i o n allows the user to v i s u a l i z e the behaviour i n r e a l time, and to observe the motion of s e l e c t e d e n t i t i e s during execution of s i m u l a t i o n . A l s o , the user can i n t e r r u p t s i m u l a t i o n , d i s p l a y or a l t e r v a r i a b l e s of the model, and r e s t a r t the s i m u l a t i o n from any saved s t a t e . Such o n - l i n e i n t e r a c t i o n can provide the user with a b e t t e r understanding of h i s model. This o n - l i n e i n t e r a c t i o n can be used to monitor the s i m u l a t i o n . A few s i m u l a t i o n monitor systems have teen w r i t t e n and implemented f o r d i s c r e t e event models as w e l l as continuous system models. The program SELBA w r i t t e n by J.E.Jackson £22] i s an example of such d i s c r e t e event animation. The author a l s c p a r t i c i p a t e d i n the p r o j e c t f o r g r a p h i c a l animation of d i s c r e t e event s i m u l a t i o n f o r queuing networks [ 4 2 ] . The animation of continuous systems i s another i n t e r e s t i n g area which needs to be explored. There are many d i f f e r e n t ways to represent the animation of continuous systems. Most c f the systems implemented f o r o n - l i n e continuous system s i m u l a t i o n allow the user to e i t h e r v i s u a l i z e the system behaviour i n the form of numbers or at best the g r a p h i c a l sketches or curves [25,34], Many other approaches can be taken i n order to provide SUHKABY 93 a user with i n s i g h t i n t o the dynamic behaviour of a model by many d i f f e r e n t v i s u a l a i d s . One of the approaches might be t c represent each symbol i n some s p e c i a l manner and then animate these symbols by c o n t r a c t i n g or expanding t h e i r s i z e s , depending on t h e i r values from a s i m u l a t i o n . Another approach might be to present each l e v e l with a r e s e r v o i r l i k e s t r u c t u r e (as i n case of a water l e v e l i n a tank), l e v e l s of which may f l u c t u a t e or change i n some manner as si m u l a t i o n proceeds. This provides a user with an e f f e c t or a sta t u s of each l e v e l i n r e l a t i o n to other l e v e l s of a model. There i s l o t of room f o r e x p l o r a t i o n and improvement of g r a p h i c a l sketches i n continuous-system animation. 5^7 CONCLUDING REMARKS The value of man-machine i n t e r a c t i o n i n modelling may be seen from the f a c t that the modelling process u s u a l l y i n v o l v e s repeated c y c l e s of s p e c i f i c a t i o n of a model ( i t s parameter values and f u n c t i o n s ) , a n a l y s i s of a model, and computation of r e s u l t s . The use of models i s al s o c h a r a c t e r i z e d by many i t e r a t i o n s . F i r s t , the modeller attempts t c model a known phenomenon, the output of which i s compared with the a v a i l a b l e i n f o r m a t i o n about the model behaviour. The model i s then SUMMARY. 9U r e s p e c i f i e d . The model i s s u c c e s s i v e l y r e f i n e d i n t h i s manner u n t i l i t c l o s e l y approximates the data a v a i l a b l e f or the behaviour i n the r e a l world. The same model can then be manipulated i n order to l e a r n more atcut i t s behaviour i n s i t u a t i o n s f o r which the data i s not a v a i l a b l e . Using CAM i n the design refinement process enables the user to t e s t and modify h i s t e n t a t i v e ideas r a p i d l y i n order t c see t h e i r r e s u l t s . This may save considerable time and ma t e r i a l otherwise used to p h y s i c a l l y model and experiment the system under study. 95 BIBLIOGRAPHY [ 1 ] Aus, H.M. ; Korn, G.A. ; •The f u t u r e o n - l i n e continuous-system s i m u l a t i o n * AFIPS Conference Proceedings, 1971, FJCC, V o l . 39, pp 379-386 [ 2 ] Baskin, H. B. ; »A comprehensive a p p l i c a t i o n methodology f o r symbolic computer graphics* [ 3] B a s k i n , H.B.; Morse, S.P.; 'A m u l t i l e v e l modeling s t r u c t u r e f o r i n t e r a c t i v e graphic design * IBM Systems J o u r n a l , 1968, V o l . 7, Nos.. 3 and 4, pp 218-229 [ 4 ] Buxton, J. N. ; Ed. Simulation Programming Languages Proceedings of the IFIP working conference on S i m u l a t i o n Programming Languages, Oslo, May 1967, North-Holland P u b l i s h i n g Company - Amsterdam - 1968, pp 371-388 [ 5 3 Christensen, C. ; Pinson, E. N. ; • M u l t i f u n c t i o n graphics f o r a l a r g e computer system* AFIPS Conference Proceedings, 1967, FJCC, V o l . 31, pp 697-711 [ 6 ] Clayton, B. B. ; Dorff, E. K. ; Fagen, R.E.; •An operating system and programming system f o r the 6600* AFIPS Conference Proceedings, 1964, FJCC, V o l . 26, part II,? pp 41-57 [ 7 ] Coulthard, H.J.; •UBC:GRAPH - A simple i n t e r a c t i v e graphics package* Computing Center, U n i v e r s i t y of B r i t i s h Columbia, 1973 [ 8 ] Coulthard, W.J.; Dekleer, J . ; »UBC:AGTBASIC - Basic communications package f o r the Adage graphics t e r m i n a l * Computing Center, U n i v e r s i t y of B r i t i s h Columbia, 1973 [ 9 ] Dertouzos, M. L. ; •CIRCAL - On-line c i r c u i t design* Proceedings of the IEEE, May 1967, V o l . 55, No. 5, pp 637-654 96 [10] D i G i u l i o , H. A. ; Tuan, P. L. ; •A graph manipulator f o r o n - l i n e network p i c t u r e processing * AFIPS Conference Proceedings, 1969, FJCC, V o l . 35, pp 387-398 [11] Drew, A.J.; •SLAP - Small l i n e a r a n a l y s i s program f o r AC steady s t a t e a n a l y s i s using computer i n t e r a c t i v e graphics* Imperial C o l l e g e , London [12] E l l i s , T.O. ; Heafner, J.F. ; S i l b e y , W.L. ; •GRAIL - An experiment i n man-machine communication* Proceedings of the S o c i e t y f o r i n f o r m a t i o n D i s p l a y , 1970, V o l . 11, So. 3, pp 121-129 [13] Eshlemap, A.L.; Meriwether, H.B.; •Graphic a p p l i c a t i o n s to aerospace s t r u c t u r a l design problems^ Proceedings of the SHARE Design Automation Workshop, 1967 [14] F o r r e s t e r , J.W.; I n d u s t r i a l Dynamics 5Tl.T. "pre s s , 1961, p. 13 [.15] I b i d p. 14 [16] F o r r e s t e r , J.W.; £EiH£i£le§ £f Systems Wright-Allen Press,~1968, pp 1-9 to 2-4 [17] I b i d p. 3-1 [18] I b i d pp 3-9 to 3-11 [19] I b i d pp 7-1 to 7-6 [20] F o r r e s t e r , J. W. ; World Dynamics Wright-Allen"*Press, 1971 [21] Groner, G. F.; Clark, R.L. ; Berman, R.A.; DeLand, E.C.; •BIOMOD - An i n t e r a c t i v e computer graphics system f o r modeling* AFIPS Conference Proceedings, 1971, FJCC, V o l . 39, pp 369-378 97 [22] Jackson, J.H.; •SELMA - A c o n v e r s a t i o n a l system f o r the g r a p h i c a l s p e c i f i c a t i o n of Harkovian Queueing Networks* Department of E l e c t r i c a l Engineering, System Engineering l a b . , U n i v e r s i t y of Michigan, Ann Arbor, Oct. 1969 [23 ] Johnson, T. E. ; * SKETCHPAD I I I - A computer program f o r drawing i n three dimensions * AFIPS Conference Proceedings, 1963, SJCC, Vo l . 23, pp 347-353 [24] Koford, J.S.; e t . A l . 'Dsing a graphic data processing system f o r design artwork f o r manufacturing hybrid i n t e g r a t e d c i r c u i t s * AFIPS Conference Proceedings, 1966, FJCC, V o l . 29, pp 229-246 [25 ] Korn, G. A. ; * DARE - D i f f e r e n t i a l analyzer replacement by o n - l i n e d i g i t a l s i m u l a t i o n * AFIPS Conference Proceedings, 1969, FJCC, V o l . 35, pp 247-254 [26] Marovac, N.; *A s i n g l e data d i s p l a y s t r u c t u r e : A new view on i n t e r a c t i v e computer graphics i n CAD* The Computer J o u r n a l , V o l . , 16, No. 2, pp 152-156 [27] M a r t i n , J. ; Design of Man-Computer Dialogues P r e n t i c e - H a l l Book Company, 1973 [28] Meadows, D.H.; Meadows, D.L. ; Randers, J . ; Behrens, W.W. I l l ; The L i m i t s To Growth A r e p o r t f o r the club of Rome*s p r o j e c t on the predicament of mankind. Universe Books P u b l i s h e r s , 1972 [29] Newman, W.M.; S p r o u l l , R. F.; P r i n c i p l e s of I n t e r a c t i v e Computer Graphics McGraw-Hill Book Company, 1973 [30] Parmalee, R. P.; 'Three dimensional s t r e s s a n a l y s i s f o r computer-aided design * Ph.D. t h e s i s , Department of Mechanical Engineering, M.I.T. , 1966, pp 51-58 98 [31] Parslow, R.D.; Prowse, R.W.; Green, R. E. ; Eds. Computer. Graphics x technique and A p p l i c a t i o n s F i r s t I n t e r n a t i o n a l Computer Graphic Symposium, Brunei U n i v e r s i t y , Uxbridge, J u l y 1968, Plenum Press 1969 [32 ] P r i n c e , M. D. ; I n t e r a c t i v e Graphics f o r Computer-Aided Design Addison-Wesley P u b l i s h i n g Company, 1971, pp 114-121 [33] Pugh, A. L. . I l l ; DYNAMO— User's Manual, t h i r d e d i t i o n M.I.T. Press, Cambridge, Massachusetts, 1970 [34] R i c k e r t , R.H.; Lieberman, D.V.; •DIM - A l o w - l e v e l modelling system f o r c o n v e r s a t i o n a l graphics' IBM Research Report BC-1981, IBM T.J. Watson Research Center, Yorktown, New York, 1968 [35 ] Ruyle, A.; 'Development of systems f o r o n - l i n e mathematics at Harvard* P r o j e c t TACT Memorandum 71, Aiken Computation Laboratory, Harvard U n i v e r s i t y , Cambridge, Massachusetts, 1967 [36] Ruyle, A.; B r a c k e t t , J.W. ; Kaplow, R. ; •The s t a t u s of system f o r o n - l i n e mathematical a s s i s t a n c e ' Proceedings of the 22nd N a t i o n a l Conference of the A s s o c i a t i o n f o r Computing Machinery, 1967, P-67, pp 151-167 [37] Savage, G.J.; Andrews, G.C.; * DYNIS - A dynamic i n t e r a c t i v e s i m u l a t i o n program f o r three dimensional mechanical system* U n i v e r s i t y of Waterloo [38] Stockham, T.G. J r . ; •Some method of g r a p h i c a l debugging* Proceedings of the IBM S c i e n t i f i c Computing Symposium on Man-Machine Communication, 1965, pp 57-72 [39] Sutherland, I.E.; •SKETCHPAD - A man machine g r a p h i c a l communication system' AFIPS Conference Proceedings, 1963, SJCC, V o l . 23, pp 329-346 [40] Syn, W.M.; Linebarger, R.N.; •DSL/90 - A d i g i t a l s i m u l a t i o n program f o r continuous system modeling' AFIPS Conference Proceedings, 1966, SJCC, Vol.29, pp 99 [41] System/360 Continuous System Modeling Program (360A-CX-16X) A p p l i c a t i o n d e s c r i p t i o n IBM c o r p o r a t i o n form no. H20-0240-2, August 1968 [42] Walker, W. ; Alemparte, M. ; Chheda, D.; Seeley, D. ; " I n t e r a c t i n g with d i s c r e t e s i m u l a t i o n s by graphic animation" To be published i n the Proceedings of the SIGGRAPH Conference on Computer Graphics and I n t e r a c t i v e Techniques, Boulder, Colorado, J u l y 1974 [43] Wiseman, N.E. ; Lemke, H. 0. ; H i l e s , J.O.; •PIXIE - A new approach to g r a p h i c a l man^machine communication• I n t e r n a t i o n a l Conference on CAD, 15-18 A p r i l 1969, The U n i v e r s i t y of Southampton (conference p u b l i c a t i o n ) 100 APPENDIX I MODEL OF FIRST ORDER FEEDBACK LOOP The second order i n v e n t o r y - c o n t r o l system presented i n v a l i d c o n t r o l ca 3, was b u i l t on the graphics d i s p l a y using CAM. The f o l l o w i n g pages i n c l u d e 1. The user dialogue with the CAM program on the IBM 3270 t e r m i n a l which was used i n order to b u i l d the model, to compile the CSMP program, and to execute the compiled CSMP program i n order to obtain DYNAMO li k e ! p l o t s . 2. The hard copy as obtained by en t e r i n g the PLOT command, a f t e r b u i l d i n g the model on the graphics d i s p l a y . 3. The CSMP program as obtained by en t e r i n g the CSMP command a f t e r the model i s completely s p e c i f i e d . 4. The graph of the dynamic behaviour of the model components, obtained by running YLEM:CSMP.GRAPH a f t e r CSMP program has been s u c c e s s f u l l y compiled. 101 I n v e n t o r y - C o n t r o l Model 102 THE USER DIALOGUE ON THE 3270 # $SIG DHIR # ENTER USEE PASSWORD. f • # **LAST SIGNON WAS: 08:58:57 # USER "DHIR" SIGNED ON AT 12:34:34 OH HON APR 22/74 # $COP AGT: GRAPH >AGTI # $RUN DHIR :CAM PAB=SIZE=250K, NOCC # EXECUTION BEGINS ENTER COMMAND OR HELP > HELP FOLLOWING COMMANDS ARE CURRENTLY AVAILABLE CREATE TO CREATE THE MODEL EDIT TO MAKE CHANGES TO THE MODEL SAVE TO SAVE THE CREATED MODEL ON THE DISK RESTORE TO RESTORE THE MODEL FBOM THE DISK RESET TO RESET THE DISPLAY SUBNET * TO CREATE NEW SUBNET OR TO DISPLAY SPECIFIED SUBNET SYMBOLS FOB DESCBIPTION OF EACH SYMBOL USED IN THE MENU NAMES TO GET LIST OF VARIABLES USED IN THE MODEL ENAMES TO GET LIST OF VARIABLES AND THEIR DEFINITION EQNS TO GET EQUATIONS OF THE MODEL BEING DISPLAYED SCALE * TO CHANGE THE SCALE OF THE DISPLAY (0.0<*<1.0) CSMP TO GET CSMP PROGRAM FOR THE MODEL PLOT TO GET A HARDCOPY OF THE MODEL STOP OR END TO STOP THE PROGRAM EXECUTION ENTER COM SYMBOLS FOLLOWING STARTING SYMBOL 1 SYMBOL 2 SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL SYMBOL 3 4 5 6 7 8 9 MAND OR HELP IS THE DESCBIPTION OF SYMBOLS USED IN MENU, FROM TOP DOWN ON THE TOP (A RECTANGLE) IS FOR LEVEL (VALVE) PRESENTS A FLOW BATE (OCTAGON) IS FOR RATE MULTIPLIEBS (SQUARE WITH HAT) IS FOB FUNCTIONAL MULTIPLIERS (SMALL SQUARE WITH BAB) IS FOR A CONSTANT (SMALL HEXAGONE) IS FOB A TIME SWITCH (SMALL TRIANGLE) IS FOR A SUBNET CONNECTOR (A BLOB) IS FOR A SOURCE OR SINK (TINY SQUARE) CAN BE USED AS A CONNECTOR FOR PLANARIT In the above conversation l i n e s marked with > i n d i c a t e the user input THE USER DIALOGUE OH THE 3270 1 0 3 ARROWS ARE TO SIGNIFY. THE DIRECTIONAL RELATION ENTER COMMAND OR HELP > CREATE ENTER COMMAND OR HELP > PLOT ENTER COMMAND OR HELP > CSMP ENTER THE FILE NAME TO BE CREATED > 02 WITH LIGHT PEN, POINT THE VARIABLES TO BE TABULATED DURING SIMULATION RUN WITH LIGHT PEN, POINT THE VARIABLES TO BE PLOTTED FROM SIMULATION RUN ENTER TOTAL RUN TIME FOR SIMULATION DEFAULT VALUE IS 100.0000 > ENTER INTERVAL FOR OUTPUT OF VALUES DURING SIMULATION DEFAULT VALUE IS 1.000000 > 2 ENTER INTERVAL FOR PLOT OUTPUT OF VALUES DURING SIMULATION DEFAULT VALUE IS 2.000000 > ENTER STEP INTERVAL FOR INTEGRATION DEFAULT VALUE IS 0.1250000 > 0.5 CSMP PROGRAM COMPLETED ENTER COMMAND OR HELP > STOP DO YOU WANT A CSMP PROGRAM FOR THE MODEL ? ENTER YES OR NO > NO # $RUN PLOT:Q PAR=-PLOT# # EXECUTION BEGINS PLOT IN SYSTEM, TOTAL PLOT TIME 3 MINUTES 20 SECONDS # EXECUTION TERMINATED # $RUN *CSMPTRAN SCARDS=02 5^-5 7=-7 SPRINT=-A1 # EXECUTION BEGINS # EXECUTION TERMINATED # $RUN *FORTRAN SCARDS=-7 SPUNCH=-0 SPRINT=-A2 # EXECUTION BEGINS t EXECUTION TERMINATED # ED -5 i L *L 10 STOP D -1 9 END D MT THE OSES DIALOGUE OH THE 3270 104 # $RON YLEM:CSHP,GRAPH . WARNING: AN OCCORRENCE OF "MAIN " LONGER THAN THE FIRST DE AT LINE +01000.000 # EXECUTION BEGINS FILES -IG1 THRU • -IG7 (SCRATCH FILES) WILL BE USED FOR THIS RUN. IF YOU NEED TO SAVE THESE FILES ENTER "STOP" ELSE ENTER "CONTINUE"., > CONTINUE ENTER NAME OF CSMP OBJECT CODE FILE (MAX 13 CHARS, LEFT JUSTIFIED) > -0 ENTER NAME OF DATA FILE FOR CSMP UNIT 5 (MAX 13 CHARS, LEFT JUSTIFIED) NOTE: FILE SHOULD NOT HAVE "STOP" AND "END" LINES AT THE END OF FILE, IF NOT SO INTERRUPT,EDIT AND RESTART > -5 # $RESTART SPRINT=-IG7 # SSOURCE -IG7 # $SET ECHO=OFF # EXECUTION BEGINS * * * * * » D o YOU WISH TO SPECIFY INITIAL CONDITIONS? •********TYPE "YES" OR "NO" > NO •DO YOU WISH THE TIMER CARD TO DEFAULT* •REPLY "YES" OR "NOM* > YES •ENTER PREPAR CARD IN CSMP FORMAT* > PREPAR GO,RR,OR,I ••ENTER # OF GRAPHS DESIRED IN 12 FORMAT 1<=#GRAPH<=10 > 1 ••ENTER #VARIABLES TO BE PLOTTED ON GRAPHt 1 IN 12 FORMAT 1<=#VAR<=10**:**** > 4 ••••ENTER VARIABLES TO BE PLOTTED ON GRAPH # 1 IN FREE FORMAT WITH EACH NAME SEPARATED B l A COMMA > OR,GO,RR,I •DO YOU WISH TO SPECIFY THE UPPER AND LOWER BOUNDS •ANSWER "TRUE" OR "FALSE" > FALSE STOP 0 # EXECUTION TERMINATED # EXECUTION BEGINS # EXECUTION TERMINATED # EXECUTION BEGINS # EXECUTION TERMINATED # EXECUTION BEGINS STOP 0 # EXECUTION TERMINATED # SCOMMENT GRAPHS ARE IN FILE -IG5 105 THE CSMP PROGRAM LISTING * INITIAL INCON IIC=1000-,GOIC=10000. * CONSTANT DO=10.,AT=5.,DI=6000. * DYNAMIC I=INTGRL (IIC, RR) RR=GO/DO OR= (DI-I)/AT GO=INTGRL(GOIC,OR^RR) TERMINAL TIMER FINTIM-100.,PRDEL=2.,OUTDEL=2.,DELT=0.5 PRINT GO PREPAR OR,GO,RS,DI,I END STOP ENDJOB Output for Inventory-Control Model INT EGR AT I UN METHCD=RKS KT ITLE = 1 NJSYMS* l h KG°.APH= 5 TITLE*=CSMP PANGFS OF ALL PLOTTED VARIABLES VARIABLE TIME CR GO RR 1 MINIMUM 0.0 -0.67B3E 03 -0.30AbE OA -0.30AHE 03 O.1C00E OA TIME 0.0 O.1A00E 02 0.2ACCE 0? O.2A0OE 02 0. 0 MAXIMUM O.IOOOE 03 O.IOOOE 04 O.ICOOE.05 O.IOOOE OA 0.939AE OA TIME O.IOOOE 03 0.0 0.0 0.0 O.IAOOE 02 106 DEPENDENT VARI ABLE S PLUT SYMBOL OR (GP-HZK £f\-^ 0 * GO (GctTL cv; c.l~Xf-> B RR (_il'.Zi**H(r r*fit£ ) C I ITN.VC rit'cH } 0 INDEPENDENT VARIABLE = TI^E LOWER POUND UPPER BOUND -C.ICOOt 0* O.IOOOE 04 -O.VJOOE OA C.1500E 05 -0.10306 OA O.IOOOE OA 0.0 0.2000E 05 0.0 2. CO A. CO 6.00 8.00 10.CO 12.00 1A.C0 16. CO 18.00 20.CO 22. CO 2A.C0 26.00 28.CO 30.00 32.00 34. CO 36. CO 38.00 40.00 42. CO 44.00 46.00 48. CO 50.00 52.00 54. CO 56.00 58.CO 60.00 62.00 64.00 , 66. CO 68.CO 70.00 72. CO 74.CO 76.CO 78. CO 80. CO 82.00 8A.C0 86. CO 88.00 90.CO 92. CO 94. CO 96. CO 9F.C0 100.CC . A C . . B O , . B D , . A C , . A C , • A C , . A C . . A C , P l o t Symbols A . B C D V a r 1 a b l e s ORDER RATE GOODS ON ORDER RECEIVING RATE INVENTORY P l o t f o r I n v e n t o r y - C o n t r o l Model 107 APPENDIX I I SSI WQRLD MODEL The model presented i n t h i s appendix i l l u s t r a t e s t h i n v a l i d subnet connectors i n order to b u i l d a l a r g e model using caM. The model s e l e c t e d f o r t h i s purpose was the "World Model" which was b u i l t and i l l u s t r a t e d by F o r r e s t e r [ 2 0 ] . The model was d i v i d e d i n to four segments f o r convenience and c l a r i t y . Each of the segment was b u i l t by entering SUBNET command. a l l four subnets were interconnected by subnet connectors (represented by s m a l l t r i a n g l e s ) . When the model was completely s p e c i f i e d , hard copies of a l l four segments were obtained, a CSMP program f o r the complete model was obtained and s u c c e s s f u l l y executed t o obtaine two p l o t s s i m i l a r to t h a t presented by F o r r e s t e r . Following pages i n c l u d e 1. Hard copies of a l l four subnets. 2. The CSMP program l i s t i n g f o r the model. 3. Two p l o t s showing the dynamic behaviour of s e l e c t e d v a r i a b l e s . 108 - e -8 R & BRM B R A " M S L M 5 L W P O L 6 A^ of I D R M H - - ^ 1 D R B R C M B R P B R F A -0 DRN IV ?A A Q L C P O L R A F C M P O L R P D N D R P H A FR iFR 6- t j < _ __r  D R F 1 Subnet 1 - Population Submodel 109 Subnet -2 - Capital Investment and Natural Resources Submodel 110 A - -CIR ^ BRPM DRPM D < Subnet 3 - P o l l u t i o n Submodel I l l A CR\ -e-?FM •1 FCM FC \ ,./ / F N A A * ' \ ^ \ FPC - A CIRfl QLP FPM CFI rR r K • QLF QRfjno CIQR- CJflF ClflFT E C I R C I R R Subnet k - F o o d and Q u a l i t y o f l i f e Submodel 112 THE CSMP PROGRAM LISTING * INITIAL INCON PIC=0,165E + 10 * CONSTANT PDN=26.5,LA=0.135E+09 * RATE CHANGING SWITCHES: * OLD VALUE, NEW VALUE, AND TIME CONSTANT BRN=0.4E-01,BRN1=0.4E-01,SWT1=70.,... DRN=0. 28E-01,DRN1=0.28E-01,SWT2=70., INCON CIIC=0.UE*09,NRIC=0.89999E+12 * CONSTANT NRI=0.89999E+12,CIAFK=0.3,ONE=1.,ECIRN=1. * * RATE CHANGING SWITCHES: * OLD VALUE, NEW VALUE, AND TIME CONSTANT CIGN=,0.5E-01,CIGN1 = 0.5E-01,SWT6=70.,... CIDN=0.25E-01,CIDN1=0.25E-01,SWT7=70.,... NRUN=1.,NRUN1=1.,SWT4=70. * INCON POLIC=0.2E+09 * CONSTANT POLS=0»36E+10 * * RATE CHANGING SWITCHES: * OLD VALUE, NEW VALUE, AND TIME CONSTANT POLN-1.,POLN1=1.,SWT9=70., * INCON CIAFIC=0.2 CONSTANT QLS=1.,FN=1.,CIAFT=15. * •RATE CHANGING SWITCHES: * OLD VALUE, NEW . VALDE, AND TIME CONSTANT FC= 1.,FC1=1.,SWT10=70. * DOAMIC DRFM=AFGEN(ZDRFH,FR) FUNCTION ZDRFM= (0. ,0. ) , (0. 1E-06, 10.00072) , (0.25122, 2.988215) (0.52448,1.981926) , (0.75274,1.376199) , (1.021006,0. 9854) , (1.259495,0.69231) , (1.507755,0.58484), (1.755784,0.48714) (2.014654,0.48714) • BRFM^AFGEN(ZBRFM,FR) FUNCTION ZBRFM= (0. ,0. ) , (1.024486,0. 9854) , (2.011235, 1. 581365) ,. . . (3.017525,1.893998) , (4^024424, 2. 001466) THE CSMP PROGRAM LISTING 113 BRPM=AFGEN(ZBRPM,POLR) FUNCTION ZBRPM= (0.,0.) , (0. 1 E-05, 1. 015388) , {10.14716,0.90303),... (20.11235,0.69298), (30.07755,0.39989) , (40.14655,0.24845) (49.91634,0.14587), ( 6 0 . 0 7 6 9 2 , 0 . 9 7 0 2 6 E - 0 1 ) BRCM= AFGEN (ZBRCM,CR) FUNCTION ZBRCM= (0. ,0.) , (0. 1E-06 , 1.0 39811) , (1.034256,0.99096) , ... . (2.021006,0.89815) , (3.007755,0.69786), (4.014654,0. 5904) , (5.020943,0.54155) * BRMM==AFGEN (ZBRMH,MSL) FUNCTION ZBRMM=(0.,0.) , (0.1E-06,1.180802), (1.014716,0.9854),... (2.001466,0.83886) , (3.017525,0.74116) , (4.004885,0.69231) (5.001404,0.69231) * DRPM= AFGEN (ZDRPM, POLR) FUNCTION ZDRPM= (0.,0.) , (0. 1 E-06 , 0. 91705) , (10. 14716, 1.286928) (20.21005, 1.970814) , (30.07755,3.182269) , (40. 14655,4.8040 (49.91634,6.797094), (60.07692,9.201683) * DRCM=AFGEN (ZDRCM,CR) FUNCTION ZDRCM=(0.,0.), (0.1E-06,0.89747), (1.014716, 1 . 0 0 4 9 4 7 ) , (2.001466,1.200342), (3.007755, 1.493436) , (4. 014654, 1 .8939 (5.020943,2.988215) * DRMM= AFGEN (ZDRMM, MSL) FUNCTION ZDRMMs= (0.,0.) , (0. 1E-07 , 2. 988215) , (0. 52622, 1. 7963) (1. 014716,0.9854) , (1.512976,0.79978) , (2.001466,0.70208) , (2.509495,0.59461), (3.007755,0.53599) , (3.515784,0.48714) (5.020943,0.48714) * X1=TIME-SWT1 YFN1=FCNSW(X1,BRN,BRN,BRN1) X2=TIME-SWT2 YFN2=FCNS8 (X2,DRN,DRN,DRN1) CR=P/(LA*PDN) DR=DRFM*DRPH*DRCM*YFN2*DRMM*P BR= BRFM*BRPM*BRCM*BRMM*YFN1*P P=INTGRL (PIC,BR-DR) NREM=iAFGEN (ZNREM, NRFR) FUNCTION ZNREM=(0.,0.) ,(0.25311 ,0.14587), (0.51712,0.4927) (0.75648,0.83953), (1.010502,0.99584) CIM=AFGEN(ZCIM,MSL) FUNCTION ZCIM= (0. ,0. ) , (0. 1E-08, 0. 96354E-01) , (1.024486,1.004947),. (2.011235,1.78653), (3.027294,2. 402027) , (4.024424,2.80258 (5.020943,2.988215) * NRMM= AFGEN (ZNRMM, MSL) FUNCTION ZNRMK= (0.,0.) ,(1.032912,0.99517) ,(2.029433, 1.77676) THE CSHP PROGRAM LISTING 114 (3.006413,2.402027) , (4.042011 ,2.900287) , (5.05807,3.28130 (6.035049,3.593943) , (7.031569,3.799109) , (8.029305,3.9065 (9.025826,3.935885) , (10.04188,3.994504) X6=TIME-SWT6 YFN6=FCNSH (X6 ,CIGN, CIGN, CIGN 1) X7=TIME-SWT7 YFN7=FCNSW (X7,CIDN, CIDN, CIDN 1) X4=TIME-SWT4 YFN4=FCNSW (X4 , NRON, NRUN, NRON 1) CIRA=CIR*CIAF/CIAFN ECIR=CIR* (ONE-CIAF) *NREM/ (ONE-CIAFH) MSL=ECIR/ECIRN CIR=CI/P CID=YFN7*CI CIG=Y,FN6*CIM*P CI=INTGRL(CIIC , (CIG-CID)) NRFR= NR/NRI NRUR=P*YFN4*NRMM NR=INTGRL(NRIC , -NROR) POLCM=AFGEN(ZPOLCH,CIR) FUNCTION ZPOLCM= (0.,0.), (0. 1E-07, 0. 47505E-0 1) , (1.014716,0.9854) ,. (2.030775,2.988215) , (3.017525,5.392196) , (4.024424,7.3852 (4.991633,8.000725) • POLAT=AFGEN(ZPOLAT,POLR) FONCTION ZPOLAT= (0. ,0. ) , (0.8E-06, 0.58177) , (10.24485,2.484584),... (20.01465,4.9 27034), (30.27293,8.00 4517) , (40. 14655,11.521 (50.20943,15.42956),(60.07692,19.97252) * X9=TIME-SMT9 Y FH 9=FCNSH (X9 ,POLN,POLN,POLN1) POLA=POL/POLAT POLR=POL/POLS POLG=POLCM*YFN9*P POL=INTGRL(POLIC,POLG-POLA) QLC=AFGEN (ZQLC,CR) FUNCTION ZQLC=(0.,0.),(0.59999E-07,2.089223), (0.51645,1.298711),. (1.014716,0.99096), (1.512976,0.74671) , (2.021006,0.53666) (2.499725,0.44873) , (3.007755,0.37058) , (3.525554,0. 30219) (4.014654,0.24357), (4.522684,0.21914), (5.02 0943,0. 1996) * QLP= AFGEH (ZQLP, POLR) FONCTION ZQLP=: (0. ,0.) , (0.1E-06, 1 .039359) , (10.24485,0.84982) (20.01465,0.59764) , (30.27293,0.29868) , (40.24423,0. 14823) (50.30713,0.46626E-01) , (60.07692,0. 1927E-01) FCM=AFGEN (ZFCM,CR) FONCTION ZFCM=,(0. ,0. ) , (0.5E-06, 2. 393233) , (1.004947,0.99096) (2.011235,0.5904) , (3.017525,0.39989) , (4.014654,0.29242) , (5.020943,0.19472) THE CSMP PROGRAM LISTING 115 FPCI=AFGEN(ZFPCI,CIRA) FUNCTION ZFPCI= (0.,0.) , (0.8E-07, 0. 49758) , (1.004947, 1.000732),... (2.011235,1.396409), (3.027294, 1.699 273) , (4. 014654, 1. 8946 (5.020943,2.056175), (6.007693,2.197838) FPM= AFGEN (ZFPM, POLR) FUNCTION ZFPH-(O.,0.) , (0.5E-05, 1. 02 1773) , (10.34256,0.89867) (20.01465,0.64453),(30.07755,0.34753), (40. 14655,0. 19903) (50.20943,0.97429E-01) , (60.07692,0.44672E-01) QLM=AFGEN(ZQLM, HSL) FUNCTION ZQLB= (0.,0.) , (0 . 4 E-07, 0. 20451) , (1.034256,1.004947) (2.011235,1.679063) , (3.017525, 2.28479) , (4. 014654, 2. 6951 2 (5.020943,2.900287) * QLF= AFGEN (ZQLF, FR) FUNCTION ZQLF=, (0.,0.) , (1 .010502, 1.000732) , (2.007326, 1.79697) (3.003846,2.403003) , (4.005248,2.691212) * CFIFR=AFGEN(ZCFIFR,FR) FUNCTION ZCFIFR= (0. ,0.) , (0. 87999E-07,0.99096) , (0.50735,0.59528) ,. (1. 010502,0.29242), (1.498992,0.14587) , (2. Q12211 ,0. 9214 1 E * CIQR= AFGEN (ZCIQR, QRATIO) FUNCTION ZCIQR= (0.,0.) , (0.25E-06,0.69298),(0.51712,0.79068), (1.015388,0.99584) , (1.513647,1.498992), (2.012211,1.99725 * X10=TIME-SWT10 YFN10=FCNSW(X10,FC,FC,FC1) QL=QLC*QLS*QLP*QLM*QLF FR=YFN 10*FCM*FPM*FPCI/FN QBATIO= QLH/QLF CIAF=INTGRL (CIAFIC, ( (CFIFR*CIQR-CIAF)/CIAFT)) TERMINAL TIMER FINTIM=100.,PRDEL=5.;OUTDEL=4.,DELT=0.5 PRINT DRFM, NR, POLAT, QL, FR PREPAR BR,DR,P,CIRA,CI,NR,POLR,POL,QL,FR,QRATIO END STOP ENDJOB INTEGRATION METHCD=R*S Output for the "World Model" KT 1T L E- 1 NCSY»B=127 KGRAPH= 13 116' TITLE=CSMP RANGES OF ALL PLOTTED VARIABLES VARI ABLE TIME ER OR P CIRA CI NR PCLR PCL OL FR ORATIO NRUR 03 08 10 00 MINIMUM 0.0 0.7559E 0.6290E 0.1f>06E 0.1616E 0.40C0E 09 0.3052E 12 O-SiSac-Ol 0.2000E 09 0.5905E 00 0.9854E 00 0-4083E 00 0.435eE 09 TIME 0.0 C.4CC0E 01 0.220CF 0? 0.7000E 01 C O C O C.2C0OE 03 0.0 C O 0.2000E 03 C.1160E 03 0.0 0.0 MAXIMUM 0.2000E 03 0.1S17E 09 0.2003E 09 0.5086E 10 0.1618E 01 0.82S2E 10 0.9000E 12 0.445BE 01 0.1605E 11 0.1U3E 01 0.1155E 01 , 0.1065E 01 0.4914E 10 TIME 0.2000E 03 0.1360E 03 0.1520E 03 0.1240E 03 0.1400E 03 0.1440E 03 0.0 0.152OE 03 0.1520E 03 0.4600E 02 0.2400E 02 0.9600E 02 0.1120E 03 CEPENOENT VARIABLES PLOT SYMrtOL NR A NRUR 6 . INDEPENDENT VARIABLE = TIME LOWFR ROUND 0.0 0.0 UPPER BOUND O.IOOOE 13 -0-6990E-76 0.0 4. CO e.co 12.00 16.00 20. CO 24.00 28.00 32. CO 36.00 4C.00 44. CO 48.CO 52.00 56. CO 60.00 64.00 68.C0 72.00 76.00 80. CO 84. CO 68.CO 92. CO 96.00 100.00 104.CO 108.CO 112.00 116.CO 120.CO 124.00 128.00 132.CO 136.00 140.00 144. CO 148.CO 152.00 156.00 160.CO 164.00 lfrS.CO 172.00 176.00 1?0.C0 If4.CO 188.00 192.00 i<»6. ro 200.00 .AB .BC ENO CF PLOT. Plot Symbols A B Var i ables NATURAL RESOURCES NATURAL RESOURCES REMAINING O'.tput (graph #1) for the "World Model" 117 DEPENDENT V4RI4IUES PLOT SYMBOL p ( Si: LtT'Cw) A POLR / PeLL'jricN). E OL ( i u H « | cc J D NP f.tV— e U i ) E 1NDEPEN0ENT VSRIA9LE LOWER nOL'NO 0.0 0.0 O.C 0.0 O.C I I ME UPPER BP'JND 0.2000E 11 0.8C0CE 10 0. 1Q00E 13 -0.6990E-76 0.1000E 13 0.0 .4. CO e.co 12.CO 16. CO 20. CO 2*.CO 28.CO 32. CO 36. CO 40.CO 44. CO 48.00 52.00 56.00 60. CO 64.CO 66.00 72. CO 76.00 80. CO 84. CO 88.00 92.00 96. CO 100.CO 104.CO 108.CO 112.CO 116.00 120.CO 124.CO 128.00 132.CO 136.CO 140.CO 144.CO 148.CO 152.CO 156.CO 16C.C0 164.20 lfcf 3 172.CD 17o.CD 18C.O0 184.CO 18?.CO 19?.CO 196.CC 20C.CO .CE, .CE. .CE, • CD. P l o t Symbol s V a r I a b l e s A POPULATION B POLLUTION C CAPITAL INVESTMENT D QUALITY OF L IFE E NATURAL RESOURCES O u t p u t ( g r a p h #2) f o r the " W o r l d M o d e l " 118 APPENDIX I I I THE PROGRAM DESCRIPTION DHIR:CAM•SOURCE and the object code i s i n the f i n DHIR:CAM. The program a l s o uses e x t e r n a l procedures., This run time l i b r a r y i s a u t o m a t i c a l l y loaded from three d i f f e r e n t f i l e s . These procedures are c u r r e n t l y r e s i d e n t on the f i l e s CS:AWLIB, DHIR:CAM.ADD, and AGT:BASIC. CS:AWLIB contains the run time l i b r a r y f o r ALGOLH with some a d d i t i o n a l input/output f e a t u r e s . DHIR:CAMADD has e x t e r n a l procedures f o r MTS f i l e handling; the source code f o r t h i s i s i n the f i l e DHIR:CAMADD.SOURCE., AST:BASIC s u p p l i e s the program with " B a s i c " subroutine package i n order t o communicate with the graphics computer. The f i r s t p art of the program has the g l o b a l d e c l a r a t i o n s of the data s t r u c t u r e . I t i n c l u d e s d e c l a r a t i o n s f o r v a r i o u s records and the d i s p l a y f i l e (DISP array) i n order to s t o r e the g r a p h i c a l as w e l l as semantic i n f o r m a t i o n of a model. The program i s di v i d e d i n to many modules or procedures. A l l procedures have complete access to the g l o b a l data s t r u c t u r e . A l l of the modes described throughout the t h e s i s form d i f f e r e n t procedures. The f o l l o w i n g i s a b r i e f d e s c r i p t i o n of most of the procedures. SETUP: t h i s procedure i s only executed i n i t i a l l y . I t sets up the s t r u c t u r e of a l l symbols t o be used f o r b u i l d i n g a continuous system model. I t generates d i s p l a y i n s t r u c t i o n s f o r the menu, f o r a l l symbols, and f o r a l l prompting messages. NODES: t h i s procedure i s used t o create the symbols s p e c i f i e d by a l i g h t pen h i t on the menu a t the p o s i t i o n s p e c i f i e d by the cross h a i r s . I t scans through the menu b u f f e r i n order t o loc a t e the l i g h t pen h i t by using the menu b u f f e r p o i n t e r s . Once the proper symbol i s found, i t obtains the screen co-ordinates from the c r o s s - h a i r d i a l s . Then i t r e c r e a t e s that symbol at the s p e c i f i e d p o s i t i o n by forming two d i s p l a y c o n t r o l words f o r X and I displacements and by copying the standard d i s p l a y i n s t r u c t i o n s of the symbol i n t o the d i s p l a y f i l e . I t a l s o c r e a t e s the necessary data records f o r each new symbol created. LINKS: t h i s procedure allows the user t o draw flow l i n e s between symbols. The l i g h t pen h i t s on two symbols are detected and the symbols are found by scanning through the node records (basic THE PROGRAM DESCRIPTION data b l o c k s ) . The procedure checks f o r proper 1 flows and e i t h e r d i s p l a y s a flow l i n e between the two d i f f e r e n t symbols pointed or p r i n t s out an e r r o r message. I t a l s o generates the proper From and To records f o r c o n n e c t i v i t y i n f o r m a t i o n . DELETE: t h i s procedure i s used to delete symbols or flow l i n e s pointed to by the l i g h t pen. I t detects the l i g h t pen h i t and searches through Node records and Neighbor records (From and To records) i n order t o l o c a t e a symbol or a flow l i n e . In order to d e l e t e the symbol i t deletes i t s Node record by changing node poi n t e r s and by generating a jump i n s t r u c t i o n f o r the d i s p l a y f i l e t o s k i p d i s p l a y i n g t h a t symbol. I t a l s o d e l e t e s the flow l i n e s a s s o c i a t e d with t h a t symbol by d e l e t i n g t h e i r From and To records. In order to d e l e t e a flow l i n e i t only d e l e t e s the From and To records a s s o c i a t e d with that flow l i n e . Also, a jump i n s t r u c t i o n i s generated f o r the d i s p l a y f i l e i n order to s k i p the d i s p l a y i n s t r u c t i o n s f o r that flow l i n e . SIGNVALUES: t h i s procedure i s used to assign the values t o constants, switches, and l e v e l s , I t checks f o r proper symbol and e i t h e r reads i n the value from the 3270 t e r m i n a l or forms a s t r i n g of numerals and symbols from the d i s p l a y screen, and converts the s t r i n g t o a r e a l number. ftSSIGNLABELS: the l a b e l s can be assigned to the symbols using t h i s procedure. I t reads i n two l i n e s of i n p u t f o r each symbol. The f i r s t word of the f i r s t l i n e i s assigned as the l a b e l . I f the word i s longer than s i x c h a r a c t e r s then i t i s truncated to the f i r s t s i x c h a r a c t e r s before a s s i g n i n g i t to the symbol. The r e s t of the s t r i n g i s packed i n order to d e l e t e e x t r a blanks, and the f i r s t 100 c h a r a c t e r s are assigned as the d e f i n i t i o n f o r that symbol. The l a b e l and the d e f i n i t i o n are stored i n the DEFINAHE record. ASSIGNEQOATIONS: t h i s procedure allows the user t o form mathematical r e l a t i o n s h i p s f o r the components of a model. I t d i s p l a y s the l a b e l s of the symbol f o r which the equation i s t o be formed, and the symbols from where there i s flow coming i n to t h i s symbol. I t checks f o r proper syntax every time the l i g h t pen h i t i s detected and e i t h e r p r i n t s the e r r o r message or responds with the equation formed up to that p o i n t . ASSIGNFDNOTIONS: t h i s procedure a l l o w s the user t o sketch the g r a p h i c a l r e l a t i o n s h i p s on the screen f o r f u n c t i o n m u l t i p l i e r s . The user i s f i r s t prompted to s e l e c t the s c a l e m u l t i p l i e r s f o r X 1 For example, sources can only have flows going i n to flow r a t e s THE PROGRAM DESCRIPTION 120 and I s c a l e s . The s e l e c t e d s c a l e f a c t o r s are then d i s p l a y e d , and the user i s prompted to sketch a graph. The user can s e l e c t the points with the c r o s s - h a i r s and s i g n a l the p o s i t i o n by pressing button 1 on the f u n c t i o n box. The d i s p l a y i n s t r u c t i o n i s generated to d i s p l a y the l i n e j o i n i n g the current p o i n t and the l a s t p o s i t i o n . The end of a sketch i s i n d i c a t e d by p o i n t i n g at END. The values of the co-ordinates are stored i n the CORD arra y and the Value record of the f u n c t i o n m u l t i p l i e r i s assigned the p o i n t e r s f o r the f i r s t and the l a s t p o i n t s f o r that sketch i n the CORD array. Whenever a f u n c t i o n m u l t i p l i e r i s to be assigned a new f u n c t i o n , the program a u t o m a t i c a l l y d i s p l a y s the l a s t assigned sketch on the screen. BUILD: a l l seven of the above procedures are part of t h i s procedure which i s invoked by the command processor whenever the command CREATE i s processed. S e l e c t i n g any p a r t i c u l a r mode from the menu invokes the proper procedure from the above. SAVEMODEL: t h i s procedure i s invoked i n order to save the data s t r u c t u r e of the model on disk . I t w r i t e s out a l l the necessary i n f o r m a t i o n about a model i n a compact form from the data s t r u c t u r e . For more than one subnet, i t w r i t e s out the information about each subnet i n t u r n . RESTORE: models saved by the SAVE command can be restored by ent e r i n g the command RESTORE which invokes t h i s procedure. I t reads i n the inf o r m a t i o n from the s p e c i f i e d d i s k and assigns i t to the data s t r u c t u r e . CSMPPROGRAM: i t i s invoked by e n t e r i n g the command CSMP. I t f i r s t prompts the user to s p e c i f y the output v a r i a b l e s on the graphics d i s p l a y with the l i g h t pen. I t a l s o reads i n the values f o r s i m u l a t i o n time p e r i o d ; output time i n t e r v a l , and i n t e g r a t i o n i n t e r v a l . Then i t c a l l s three d i f f e r e n t procedures to w r i t e three d i f f e r e n t segments of a CSMP program. These are as f o l l o w s . IS3!3Mi££Sl* i t forms the INITIAL part of the CSMP program.. I t searches through the Node records f o r records of l e v e l s , constants and switches. For each symbol of these symbols i t forms CSMP equations. FUNCTIONPART: t h i s forms the dynamic equations f o r the f u n c t i o n m u l t i p l i e r s of the model. JP*2ASI2S£iS2 : i t f i r s t forms the equations f o r a l l switches and then i t forms equations f o r a l l l e v e l s , flow r a t e s , and r a t e m u l t i p l i e r s . To do t h i s , i t f i r s t checks to see i f t h e i r Equation record has any user assigned equation. I f so, i t simply copies that equation e l s e i t forms a proper equation f o r the symbol by e i t h e r c a l l i n g LEVELPART f o r l e v e l s or MULTPART THE PROGRAM DESCRIPTION 121 f o r flow r a t e s and r a t e m u l t i p l i e r s . There are other procedures which are mainly invoked by one of the above procedures t o c a r r y out c e r t a i n common f u n c t i o n s . One more important procedure i s DOMPSTATE which was w r i t t e n f o r debugging the program. This procedure can be invoked by the PRINT command though the a v a i l a b i l i t y of the PRINT command i s not d i s p l a y e d through HELP. T h i s procedure i s s t r i c t l y f o r debugging purposes and hence the user i s not recommended to use i t as i t can produce pages and pages of output. The PRINT command followed by various codes can be used to p r i n t out the info r m a t i o n about d i f f e r e n t data records, or the d i f f e r e n t p a r t s of the d i s p l a y b u f f e r . The output can be obtained e i t h e r on the 3270 t e r m i n a l or on the s p e c i f i e d f i l e . The command has the form PRINT *1 *2 I f *2 i s blank or zero the output i s produced on the 3270 t e r m i n a l , whereas i f *2 i s non-zero numeral then the user i s prompted t o enter the f i l e name on which the output i s to be wr i t t e n . D i f f e r e n t codes f o r *1 r e s u l t i n the output of d i f f e r e n t i n f o r m a t i o n . The user i s suggested to look at the program l i s t i n g f o r these codes. 122 THE PROGRAM STRUCTURE SETUP BU I LP COMMAND PROCESSOR OR MAIN BODY OF THE PROGRAM SAVEMODEL RESTORE CSMPPROGRAM DUMPSTATE LI NKS NODES DELETE MAKELABELS MAKEFUNCT.I ON: ASSIGNVALUES MAKEEQUATIONS I N I T I AL PART EQUATION PART FUNCT!ONPART EQUATIONSWITCH MULTPART LEVELPART 

Cite

Citation Scheme:

        

Citations by CSL (citeproc-js)

Usage Statistics

Share

Embed

Customize your widget with the following options, then copy and paste the code below into the HTML of your page to embed this item in your website.
                        
                            <div id="ubcOpenCollectionsWidgetDisplay">
                            <script id="ubcOpenCollectionsWidget"
                            src="{[{embed.src}]}"
                            data-item="{[{embed.item}]}"
                            data-collection="{[{embed.collection}]}"
                            data-metadata="{[{embed.showMetadata}]}"
                            data-width="{[{embed.width}]}"
                            async >
                            </script>
                            </div>
                        
                    
IIIF logo Our image viewer uses the IIIF 2.0 standard. To load this item in other compatible viewers, use this url:
http://iiif.library.ubc.ca/presentation/dsp.831.1-0051757/manifest

Comment

Related Items