Step 5. Defining Initial
Values of Stocks
Now we are ready to specify initial values of stocks.
We want to set total population (our TotalPopulation
parameter) as the initial value of PotentialAdopters
When you mention some
element in initial value of a stock, you should first connect it
to this stock with a link. Link is used to define a
dependency between elements of a stock and flow diagram.
create a link
- Double-click the Link element in the System Dynamics palette so that
its icon turns into .
- Right after that, go to the graphical editor and click the
element that is mentioned in initial value (TotalPopulation).
- Finally, click the stock PotentialAdopters.
note that it is important to
draw the link in the right direction - from the independent variable to
- You will see the link in the graphical editor.
to the flow, when it is selected, its end
points should be indicated with little green circles. Otherwise, if
there is a white
circle on some its end, it means that this particular end point was not
connected correctly. To establish the valid connection, please
drag this end point onto the variable you want to connect.
Now, when you created the link, you can specify the initial value
mentioning the connected parameter.
the initial number of
- Select the stock PotentialAdopters.
- In the stock's Properties,
type TotalPopulation in the Initial
box. Use code completion master to
avoid typing the whole names of variables and functions. To open the
master, click at the
in the edit box, and then press Ctrl+space
(Alt+space on Mac).
The list of model variables
available in the current context appears. Scroll to the name you want
to add, or type the first letters
of the name until it becomes visible in the list. Finally, press
Enter to insert the name.
Finally you should get TotalPopulation
specified as the stock's initial value:
We do not need to set up the initial value for the Adopters stock explicitly since there are no
adopters initially and the stock is already initialized
with zero by default.
Step 4. Adding constants
Step 6. Adding dynamic variables