Section 1.1 Stocks and Flows
Stock-flow models have the following components:
- Stocks: Stocks are things that accumulate. In the context of modeling with ODEs, these are the dependent variables of the system. Within Insightmaker you can assign units to stocks or leave them dimensionless. When units are assigned, this must be tracked throughout the entire model construction.
- Flows: Flows into a stock contribute positively to the time-derivative of the corresponding state variable. Likewise, outflows contribute negatively. Insightmaker allows one to choose to only allow positive flow rates for a given flow, or positive and negative rates. The downstream direction of a flow is indicated by a filled arrowhead and upstream is indicated by an unfilled arrowhead (as in the figure below). Note: A flow need not have a stock upstream or downstream; this is necessary when accumulation or depletion is comes from or goes to outside the model.
- Variables: Variables are often used as parameters in the context of ODEs. Insightmaker can attach sliders to them so that we can modify them and see the changes to the dynamics. We will also see that variables are useful for creating objective functions in optimization problems.
- Links: Links are arrows between stocks, flows, and variables that allow the linked objects to be used in the formulas for the object that the to which the link points.
Briefly, the key formula to manage a stock-flow model is the following:
\begin{equation*}
\mbox{Time Derivative of a Stock} = \sum\mbox{Inflows} - \sum\mbox{Outflows}
\end{equation*}
