Simulation with AnyLogic/System Dynamics/Step 3. Adding stocks

From Wikibooks, open books for an open world
< Simulation with AnyLogic‎ | System Dynamics
Jump to: navigation, search

Step 3. Adding Stocks

Now we will add two stocks to model adopter and potential adopter populations.

Step 1. Creating a new model1.gif Add a stock to model potential adopter population

  1. Drag the Stock Variable Adding stocks 1.gif element from the System Dynamics page of the Palette view onto the diagram of active object class (right to the place where you want to locate a variable). A new variable appears on the diagram, displayed as a little blue rectangle.
    Adding stocks 2.png
  2. Once you have placed the element onto the diagram, it becomes selected and its properties are displayed in the Properties view. You can adjust element properties here as your model requires.

    Please note that the Properties view is a context-sensitive view and it displays the properties of the currently selected element of the model. To adjust properties at a later time, first select the element (e.g. by clicking on the element in the graphical editor) and then modify the required properties.
    Adding stocks 3.png
    Properties view. At the moment view displays the properties of the currently selected stock variable.
  3. Change the name of the stock. On the General page of the Properties view, type PotentialAdopters in the Name edit box.
    Adding stocks 4.png

Step 1. Creating a new model1.gif Add a stock to model adopter population

  1. Add another stock in the same way. Place it to the right of the PotentialAdopters stock as shown in the figure below.
    Adding stocks 5.png
  2. Name this stock Adopters.
  3. Move text labels of the stocks above stocks' icons. Do it in the following way: first select a variable by clicking on it (if selected, it is drawn in a blue outline and its label is underlined) and then drag the label wherever you like. Place labels as on the figure below:
    Adding stocks 6.png
    We need this since otherwise later these labels will be painted over with arrows pointing from one stock to other.

At this point, the stocks are not defined properly. We have not defined integral functions and initial values for our stocks yet. But we will create the adoption flow first.