Professional Documents
Culture Documents
02
Copyright © 1996-2005 Jim Hines.
Introduction
Theory
Molecules are the building blocks of good system dynamics models. Molecules, and
their organization, provide a framework for presenting important and commonly
used elements of model structure to novice and experienced model builders. By
having access to tried and true formulations, modelers can review what has been
done before and modify or directly incorporate these formulations into their own
models. Molecules are now implemented in software, making it faster and easier for
novice and experienced modelers to develop high quality system dynamics models.
Background
Developing the skills to create good system dynamics models takes many years.
Few people, unfortunately, have that much time to devote. Once a person has
1
come to grips with the ideas of feedback, structure, and behavior, he/she is often
called upon to use that knowledge by developing a simulation model. Lacking a
breadth of experience, the development of such models is difficult and time
consuming and the resulting model is often of less than acceptable quality.
Molecules
2
These elements of structure are called "molecules." Molecules are made of primitive
stock and flow or auxiliary elements and are, in turn, the building blocks of
complete models. A molecule is an element of substructure that serves a particular
purpose. The analogy with chemistry is not exact, but the name does convey much
of the same spirit. One of the simplest molecules, and one that probably appears in
most models, is the decay process.
For a simple molecule such as this, it is probably easiest to simply check the form
and enter the structure and equations directly. However, for more complicated
molecules, it will be easier to incorporate molecules into a model and make the
appropriate modifications to appearance, naming conventions, and equations.
3
Molecules and Archetypes
It is useful to distinguish between molecules and archetypes (Senge 1990).
Archetypes present dynamics lessons that have been learned from systems having
certain structural characteristics. Molecules are building blocks from which structure
is created. Molecules improve the ability to represent structure, but do not draw
dynamic lessons from particular structures.
A Taxonomy
The following diagram represents a preliminary selection of molecules and their
relationships.
4
The diagram above is presented when the user selects the Vensim menu item
Windows>Molecules. Double clicking on any of the names in the diagram brings up
that molecule. The user can then select the molecule (or a portion of it), copy it to
the clipboard, and insert it into the model they are working on. Once this is done,
the normal Vensim tools are used to rename the model elements, change the units
of measurement, and finish construction of the model.
References
Forrester, Jay W. (1961). Industrial Dynamics. Cambridge MA: MIT Press.
Hines, James H., (1983). "New Coflow Equations." MIT System Dynamics Group
working paper D-3488.
Homer, Jack B. (1983). A Dynamic Model for Analyzing the Emergence of New
Medical Technologies. Ph.D., M. I. T.
5
Myrtveit, Magne (1995). "Models Crossing the Boundaries of Tools." In Toshiro
Shimada & Khalid Saeed (Ed.), System Dynamics '95, 1 (pp. 170-179). Tokyo
Senge, Peter M. (1990). The Fifth Discipline: the Art and Practice of the Learning
Organization. New York: Doubleday/Currency.
While molecules are generic and will eventually be made for use with all system
dynamics software, the current implementation works only with Vensim.
Software Requirements
The molecules addition requires Vensim (PLE, PLE Plus, Professional, or DSS)
version 5 or later.
Getting Ready
Download the molecule installation program if you have not already done so. The
Windows version is called molecule.exe, the Macintosh version is
called molecule.hqx. If your web browser does not automatically do so, you will
need to convert the.hqx file into a Mac executable using a BinHex converter.
Installing—Windows
If Vensim is open close it. From the file manager or explorer, run or double click
on molecule.exe. (the .exe portion will not always be visible). Read the copyright
and license agreement terms. Click on Accept to accept the terms. A dialog box will
appear asking for the directory to install the molecules in. The default directory is
C:\VENSIM\MOLECULE. You can choose another drive and directory if you wish.
Click on Install and the molecules will be installed.
Installing—Macintosh
If Vensim is open close it. Double click on Molecule Installer. Review the Copyright
and license information and click on continue to accept the terms. Choose a folder
to install the molecules into and click on Install. It is probably easiest to install the
molecules into the folder containing the Vensim program file.
6
Configuring Vensim to Use Molecules
If the molecule installation program is successful, you can simply use the menu
item Windows>Molecule command to open the master molecule. If there is a
problem with installation, or if you install Vensim after you install the molecules,
you will need to specify the full path to the molecule directory for Vensim. This path
takes the form C:\VENSIM\MOLECULE\ on the PC (it is important to keep the last \
in place) and :MacintoshHD:Vensim:Molecule: on the Macintosh (it is important to
keep the last : in place).
Adding a Molecule
Start Vensim.
7
Select Windows>Molecules.
Both your new model and the molecule control are open. You can switch between them by holding down the Ctrl key
and pressing the Tab key, or choosing the model or molecules window from the Windows menu.
The Level molecule is displayed. (You can move between the three open windows with Ctrl +
Tab.)
With the Pointer, drag a box to highlight the entire level and rate formulation of
the Levelmolecule. or Select all (Ctrl + A).
Select Edit>Copy (or Ctrl + C).
Select Edit>Paste (Ctrl + V) and Click OK to the Replicate option to add the Level molecule structure and equations to
your model.
We are going to rename the molecule structure so that it represents the model of
interest.
Click once on the variable Level. An editing box opens. Delete the word Level, type in Inventory and press Enter. Click
once on the variable Increasing Quantity. Delete it, type in production and press Enter. Click once on the variable
Decreasing Quantity. Delete it, type in shipments and press Enter.
8
NOTE: When you changed the variable names, the underlying equations were
automatically changed to reflect the new names.
Modifying Equations
In order to simulate the model, we need to add and modify the equations to reflect the changes
made. No change was made to the equations in this molecule. However, this molecule has the
units for time of year; our model has units for time of month (the default in the
Model>Settings>Time Bounds box). We will need to change units of measurement from years to
months for variables throughout the model. (Although if we wanted the model to run in years, we
could change that by selecting Model>Settings>Time Bounds and changing from months to
years.)
Simulation
Double click on Inventory to select it as the workbench variable, then click on the Graph or Causes Strip Graph tool.
You see the behavior of Inventory, staying at zero for the entire simulation
(because it was initialized at zero and the inflow and outflow are both constant and
exactly the same value).
Press Ctrl + Tab to return to the Level molecule. Select File>Close to close the molecule (or exit the window with the
9
close button in the upper right window corner).
Drag a box over the molecule so the entire structure is highlighted (but leave out the text titles).
Click OK to Replicate.
The Workforce molecule is added to your model. The molecule will probably cover some of
the existing structure.
While the molecule is still highlighted, move the Hand tool to the center of the highlighted structure, hold down the left
mouse button, then drag the molecule away from the existing structure (in this case, drag it down). Click the mouse
button with the pointer outside of the highlighted structure (or press Escape).
Connecting Molecules
10
We need to connect the two molecules together to form a complete simulation
model. Causal structure needs to be added between the molecules, and we might
need additional variables. Equations need to be appropriately modified to reflect the
changes in structure, and changes in units of measurement.
Workers produce goods. The average worker in the workforce builds a certain number of goods
per amount of time spent working. This concept is represented by adding a variable called
average productivity. The level of Workforce works at an average productivity to generate
production. The amount of shipments is caused by an amount of customer orders.
Select the Variable tool. Click on the sketch below the rate production (and left of the Workforce structure). Type in the
name average productivity and press Enter.
Click on the sketch above the rate shipments. Type in the name customer orders and press Enter.
Select the Arrow tool. Click once on Workforce and then once on production.
Click once on customer orders and then once on the valve attached to shipments.
Now the two molecules are causally linked together, forming one model. The
structure of the model should appear as below:
Modifying Equations
11
In order to simulate the model, we need to add and modify the equations to reflect the changes
made.
Click on shipments. Delete the number 10 then click on customer orders in the inputs list. The equation should now
appear as:
Units: widgets/Month
Click on customer orders. Add an equation with a STEP function, and add units, as below:
Units: widgets/Month
This equation returns a steady order stream of 10 widgets per month until Time = 10 months,
then a step increase of 5 is added, for a total order stream of 15 widgets per month.
Click on Inventory. The initial inventory is currently zero. Change this to 50 widgets, keeping the rest of the equation, as
below:
Inventory =
Inital Value: 50
Units: widgets
Click on the Supplementary checkbox for Inventory (on the left hand side) to mark this as a variable not currently used
anywhere in the model.
Click on production. Delete the number 10. Click on Workforce in the inputs list, add a multiply sign ( * ), then click on
12
average productivity in the inputs list. The equation should now appear as:
Units: widgets/Month
Units: widgets/Month/person
The inventory structure is now complete. Although the workforce structure has no black
highlights (that would indicate missing or incorrect equations), some equations and units of
measurement need to be modified.
Click on Desired People. Keep the current value of 100, change the units of measurement to person, as below:
DesiredPeople = 100
Units: person
Click on time to hire or fire. Change the constant value to 6. Change the units of measurement to Month, as below:
Units: Month
Make sure that your model has the correct formulation (syntax) by:
13
Select Model>Check. Model (Ctrl + T)
A message box should appear saying that your model is OK. If your model has
syntax problems, the Equation Editor will open at the (first) equation displaying a
problem.
Make sure that your model has the correct units of measurement by:
A message box should appear saying that your model is AOK. If the units do not
match, an output box will appear describing the problems in equations and their
units of measurement.
Simulation
Double click on Inventory to select it as the workbench variable, then click on the Graph or Causes Strip Graph tool.
The behavior of Inventory is irrational. The first 10 months has the equilibrium
value of 50 widgets, but then Inventory falls and becomes highly negative. Clearly
we are missing some feedback. We need to increase production to retain our
Inventory and we do this by raising the number of workers in the Workforce. The
size of the Workforce is driven by Desired People, and that needs to be driven by
shipments, which will signal when we need the increase.
Select the Hand tool and bring average productivity to the center of the model.
Select the Arrow tool and make connections from average productivity to Desired People and from shipments to Desired
People, as shown below:
14
Select the Equation Editor tool on the sketch tool bar.
Now as shipments increase, the variable Desired People will also increase, and after a delay,
Workforce will increase, raising production and increasing Inventory.
Simulation
Click the Control Panel button and select Datasets. Double click on the run names
appearing in the left hand box (inv1 andinv2). This will unload the previous two runs so
that the analysis tools will only operate on the current run.
15
Click the Simulate button
Double click on Workforce to select it as the workbench variable, then click on the Graph or Causes Strip Graph tool.
At Time = 10, Workforce shows a steady increase to a new value, compensating for
the increase in customer orders. The behavior of Inventory is now improved,
although a problem still exists. Inventory falls and stays constant at a lower level
than before. More feedback is needed to compensate for the falling inventory level.
For further information, see the Workforce/Inventory
models wfinv1 and wfinv2 released with the Vensim® software.
Replication
When a molecule (or a portion) is inserted into a model, the menu item Edit>Paste
(Replicate) is used to create new variables, structure and equations. Do not select
Edit>Paste (Picture) to insert molecules because you will only get a picture of the
molecule, not variables, structure or equations. If a variable exists in the model
that has the same name as a variable being inserted, the molecule's variable will be
renamed. For example, if Workforce already exists, a molecule containing this name
will be renamed Workforce 0.
Adding two or more molecules may introduce more structure than you need. If the
structure is redundant, you need to delete it. Use the Delete sketch tool (Pacman),
or highlight it with the pointer and select Edit>Cut, and choose Delete variables….
16
We want to replace the variable Fundamental quantity with the variable New
material; and replace the inflow and outflow of fundamental quantity with Material
flowing in and Material maturing. In this way, we can build a coflow to determine
the average characteristic of the New material.
Because the stock and flow structure is the same, we can either merge the
structures, or delete one and use the other. For this example, we choose the latter
method. First, to preserve our knowledge of the causal connections, we will add
connecting arrows from the structure we want to keep, while still retaining the
structure that we are going to replace.
17
Next, the unnecessary structure will be deleted. Either use the Delete sketch tool or
highlight the three variables (and clouds) and use Edit>Cut and choose Delete
Variables…. Now we have a coflow representation of new material that is flowing
through an aging chain.
18
19