Using Stella Online for Population Dynamic Modeling
Building Your First Model Using Stella Online
Background: To explore questions involving change over time, we need to develop models that can show dynamics. Take a moment to read this background information on dynamic systems and different types of behavior over time (parts 6 and 7 of the background page).
This kind of model will contain details about the relationships or interactions between the system components. The network models you have been creating contain nodes and edges. In the new model, the nodes becomes stocks and some of the edges become flows.
In the models that you will build in this activity, the stocks are the components that can be seen, counted, weighed, or otherwise measured. As an informal definition, stocks are what you can see in a photograph. However, not all stocks have to be physical. They can be a force like gravity or they can be something like information or data, or even beauty.
1. Open Stella Online
Search "Stella Online" on a browser or go directly to https://iseesystems.com/store/products/stella-online.aspx. Stella Online is a system dynamics software package from isee Systems. The software is free to download and use, but is limited in its capabilities. For most classroom situations you will not need more than the capabilities offered in the free version.
Once you have created an account, log in to the isee Exchange and click the "Start building a model using Stella® Online™" option. Then click the and give the model a name. You will see that the name becomes part of the URL address. Agree to the conditions and click the “Add Model” button. We will be creating our own model, so choose the “Use an empty model” button. We now have a model workspace to edit and create models.
2. Become familiar with the parts of a model
A Stock is a collection of the stuff being modeled; it can be anything from a population to the amount of money in your bank account. Stocks are added using the rectangle icon. Click icon then place the stock on the model workspace. The rectangle that appears will have its name (Stock 1) highlighted. You can rename the stock by typing while the name is highlighted. Placing a stock in the workspace will open a panel called the Attributes Panel (or Attribute Panel) at the right of the workspace window. It is in this panel that you can define what the stock represents in the "Enter equation" box.
A Flow can add or subtract from the value of a stock. To add a flow, click on the arrow with a valve icon and model workspace and click to place it. You can click and drag the “cloud” bubbles attached to the flow to change where the flow starts and ends, or to join it to a stock. Flows can start or end in either a stock or empty space, but at least one end must be connected to a stock. When you place a flow its name will be highlighted and can be renamed by typing. Flow attributes will appear in the Attributes Panel and equations for the flow can be created there.
A Converter is used to modify rates of change of the object it is attached to. This can include flows and other converters. Use the circle icon to click and place a converter. Converters can have a constant or an equation assigned to them.
A Link can tell the program how to connect the stocks, flows, and converters. The red arrow button is used to add links. Click and hold where the link should begin and drag the mouse to the end of the link. Links must connect two elements of the diagram.
3. Let's build a model!
To practice using the program, let’s make a very simple model of a growing population with unlimited resources starting with a clean model workspace. If you have been playing around and already placed some elements in the model workspace that you now want to delete, you can delete them separately, or click and drag the mouse over any portion to select a group or all of them, then press the delete key.
1. First you will need a stock to represent your population. Add one and give it the name of the animal you want to use. For example, an octopus stock will represent an octopus population. Give it an initial value by entering 10 in the Attribute Panel box where it says "Enter Equation". Doing this will remove the warning triangle in the “Octopus” stock.
2. Now you need a way to change the number of octopuses in your population. Add a flow into the octopus population called octopus births. Click the flow icon (arrow with a valve) and then click to the left of the Octopus stock. Hold down the mouse button and drag the cursor into the Octopus stock, releasing the button when a connection is made. Notice how the arrow on the flow comes from nothing (the cloud) and goes into the stock. This means the flow will pull values from outside our system and add them to the stock.
3. Name the flow octopus births. You don't need to enter anything into the “Equation” box yet. The flow will contain a caution triangle until something is entered, but don't worry about this for now.
4. To tell the model how quickly to add to the population, you will need to add a converter. Call it octopus birth rate.
5. Give the converter a value of 20. This tells the computer to add 20 octopuses to the population each time period.
6. Now connect the converter to the flow with a link. Make sure it points from the converter to the flow.
7. You now have a converter that will affect the flow of octopuses into the stock, but you still need to tell the program how that relationship works. Click once on the flow to open its Attribute Panel, then enter octopus_birth_rate into the Equation box. You can type this directly (notice the underlines), or by finding the box called "Required Inputs" and clicking once on "octopus birth rate". Doing this will place octopus_birth_rate in the Enter equation box for you. Finally, click once on the green check to verify your entry.
8. Congratulations! You have created your first simple model! Before moving on and learning how to simulate the model, take some time answering the following questions.
Which direction is your flow array pointing? Does it go from empty space into the stock, or is it the other way around? Why is this important? What would happen if it were pointed the other way?
Since you now have a map of your first model, let's review what you have learned. A stock is a noun and represents something that accumulates such as a population, biomass, nutrients, water, enzyme concentrations, or money. Stocks can also be completely non-physical accumulations such as knowledge or fear. Stocks can only change as a result of flows into or out of them. Flows can be controlled by other flows, converters, or stocks connected to them by links.
4. Simulating (running) your model
1. Click anywhere in the model workspace window.
2. The first thing to do is to set up the simulation for the model. This is done in the simulation view of the Model Settings Panel. To begin, make sure that no components are selected in the model window. If you do not see a Model Settings Panel, try refreshing your page.
3. Set the simulation to run for 50 time units by making the start time at 0 and the stop time at 50. You can also set other simulation options in this window as well, but the default settings will suffice for now. The time units will default to "months". This is probably appropriate, but it is something to think about if you know details about the time frame of your model and want to use more appropriate units.
4. Next, create a graph so that you can see the model output. Click on the "graph" icon in the menu bar at the top of the model.
5. Move the cursor into the model window by clicking once or dragging the selected icon into the window. A blank set of axes will appear with the X-axis labeled as your chosen time unit (see below image). You can resize and move the axes to any location in the model window by selecting, (click once anywhere in the graph), then click to place the graph in the desired location. Resizing can be done by dragging any of the resizing boxes along the edges of the graph.
6. In the graph, the Y-axis has yet to be defined with a dependent variable. In this simulation we will be interested in tracking the population of octopuses. Click once on the graph and notice that a new panel appears to the right of the model window. These are the graph options which are indicated by a wrench together with the graph icon.
7. To choose octopuses as the dependent variable, first be sure that "Series 1" is selected in the Series List of the Options panel. Choose octopuses as the variable by clicking on the "Choose" dropdown menu. All components in your model will be displayed as a list. Choose "octopuses" from the list and Octopuses will replace "Series 1" in the Series List.
8. Your model workspace should now look something like the one pictured below, with a simple model map and blank graph.
Use the blank graph below to draw a graph of how you expect the population to change over the period of 50 months. Imagine the octopuses being introduced to a part of the ocean with no predators and unlimited food, space, and water. How would their population change? This sort of graph is called a "Behavior Over Time Graph" or BOTG (pronounced botchi). It represents a baseline hypothesis of how you think this system works in real time.
After you have drawn your BOTG, simulate your model by clicking on the run button (right facing triangle) at the bottom of the model window. How did your model compare to your prediction? Record your results on the graph below. If you want to run the model again, click the reset (curved) arrow to clear the previous run first.
Did your BOTG match your results? How were they similar? How were they different?
Do your results match the way populations with unlimited resources really grow?
How could you improve your model? What could you add to make the model match the growth that you would expect? Remember that you are dealing only with growth without constraints for the moment.
5. Adding a Changing Birthrate
One problem with the current model is that the population of octopuses does not affect the rate at which octopuses are being born. The more octopuses there are the more octopus eggs will be laid! Can you fix the model to produce exponential growth? If you can't figure it out, look at the next few steps.
Return to the map you of your model in the Stella Online modeling workspace.
The flow rate needs to be dependent on both the octopus birth rate and the number of octopuses in the population. This means you will need to link each of those elements to the flow.
Be sure that the X2 is selected in the Settings panel. then click once on the flow to change the expression to octopus birth rate * octopuses. To include each variable in the expression, find it listed in the "Required Inputs" box and click on it. The variable name will appear in the equation box.
Change the value of octopus birthrate from 20 to 0.2. This will tell the model to add 20% of the total octopus population to the octopus stock each year.
Run your model again and record your results below:
How does this new graph compare to your original BOTG? Is it exponential growth?
This is a big improvement on the linear line you graphed earlier, but it is still missing an essential element. Octopuses don't live forever, in fact, most live less than a year. Let's add a death rate to the model to fix the problem. Use the method as above, but move octopuses out of the stock. If you need help, look at the instructions below.
6. Adding a Death-rate
Adding a death rate means that octopuses are being removed from the population. To remove octopi, you can add another flow, this time out of the stock. Name it octopus deaths. You don't need to give it an initial value yet.
Add a converter called octopus death rate and give it a value of 0.1.
Use links to connect the Octopus population stock and the variable to your new flow.
Enter the expression octopus death rate * Octopuses into the Equation box for the octopuses deaths flow. You can do this by clicking on octopus death rate and Octopuses in the Required Inputs window of the flow's Attribute Panel. If the Attribute Panel is not visible, select the flow by clicking once on it.
Play around with running your model! Change the value of the death-rate. How does the octopus population change? Try setting the death-rate and birth-rate to the same value. What if the death-rate is greater than the birth-rate? Record the results of a few different combinations on the next page.
Population in 50 months:
Population in 50 months:
Population in 50 months:
Which of your tests do you believe best represents the real way octopus populations vary in the wild? Why?
How could you figure out which test was actually most representative?
You used your model to generate a hypothesis about the birth and death rate of octopus populations in the wild. Scientists often use computer models this way as well. What are some other things that can be modeled but are much harder to study in real life?
What might be missing that would make this model more accurate?
7. Carrying Capacity
Remember, you started this model by saying that the octopuses were in an ocean with no predators and unlimited food, water, and space. Of course such an ocean does not exist. The octopus population is going to run up against limits. Those limits are the carrying capacity of the ocean. When the population runs up against those limits, the death rate will increase, sometimes greatly. Let's build a model with a carrying capacity of 1000.
1. First you need to add a converter called carrying capacity. Set its expression to Octopuses/1000.
2. Now you need to link the Octopuses stock to the converter and the converter to the octopus death rate.
Describe why it makes sense to connect the stock and converter this way.
3. Adjust the expression for octopus death rate to carrying capacity * 0.2. Make sure that your Octopus birth rate is reset to 0.2.
Look closely at your model. What will happen to the carrying capacity variable when the octopus population reaches 1000? What will that mean for the death rate? Will the population decrease or increase?
Before you click start, sketch a BOTG of what you think will happen to population.
Now run the model. Does your graph look something like this?
This model produced a graph that referred to as an sigmoidal “S” or logistic curve. Because our model is very simple, the curve is nice and smooth. The octopuses grow at an accelerating rate for a short period of time and then the population levels off close to the environmental carrying capacity.
What factors might set the environmental carrying capacity for octopuses in the wild?
How would the curve be different for a real-world population?
Extensions - Option 1: Simulating "randomness" in a model
In the natural world, growth rate is rarely a fixed constant. Growth rate will depend on many different factors such as weather, food, and shelter. These factors vary, giving the population varying growth rates. How can you change our model to account for this variation? One possibility is to make the growth rate random.
You can read about different types of systems, including stochastic systems, with random elements, on the background information page.
Change the expression for octopus birth rate to RANDOM(.1, .3, .2). This will select a random number as the octopus birth rate during each time step of the simulation. The first rate will be .2 and the following rates will be between .1 and .3. What happens when you run your program now? You will see that now the population can actually rise above the carrying capacity but it will always drop back down.
You may have noticed that the Y-axis of this graph extends to 2000 (2k). Stella Online will automatically scale the axis when output values go beyond the graph’s limit. In this case, the original Y-axis topped out at 1000. With a random birth rate the population sometimes exceeds 1000 and the axis is adjusted to 2000 to allow the bigger numbers to be plotted.
Extensions - Option 2: The Logistic Equation
In 1845, Pierre Verhulst published an equation that produces population growth on a curve similar to the one you created. It is called the Logistic Equation, and the curve it produces is called a logistic, or s-shaped curve.
His equation is written ∆N=r*N*(K-N)/K
where 𝑁 is the population, ∆N (delta N) is the change in the population, 𝐾 is the carrying capacity or maximum possible population, and 𝑟 is the reproductive rate or birth rate of the population. Try to build a model from this equation.
How is this model different from your earlier model? Is the curve the same or are there slight differences?
What surprises you about this comparison? Or what is remarkable? Can you think of any other equations that might be modeled as connected stock(s) and flow(s)?
Adding Complexity: Predator-Prey Relationship
We have now created a good simple model of a growing population; however, there are very few populations that exist in isolation. One thing our environment is missing is another organism. Before we move forward, try to add a predator to your Stella model. Consider what relationships the predator population would have with the prey population. In the next activity, you will be guided through the details of building such a model.
As you do so, it is important to remember the following points:
A. A model is a visual statement of a hypothesis. It is the statement: “This is how I think this system works”.
B. A model is never completely correct.
C. Models should be as simple as possible.
What are some possible implications of point A?
Explain why point B is true.
How does point C contradict point B?
What do modelers need to do to make sure all these points are accounted for when they make models?
Next Step: Systems with multiple organisms
Now that you are familiar with Stella Online, you can continue on to Stella Online - Predator-Prey Dynamics where you can learn how to model dynamics between species.
Students, please take this 1-minute survey, now that you've completed this activity. We are interested in learning about your experience so we can improve these resources. All responses to this survey are anonymous, all questions are optional, and your feedback is much appreciated.
Curriculum Contributors and Supporters
Students Anna Farrell-Sherman, William Wick, Michael Huang and Andrew Liu collaboratively created this resource with ISB scholars.
Funding to support the development of this lesson was provided by National Science Foundation Award DBI-1565166 & 0640950. The content of these pages was created by students for students with the help of teachers and scientists. The views expressed herein are those of the authors and do not necessarily reflect the views of NSF or ISB.