Skip to main content
Skip table of contents

Translating Stock and Flow Diagrams to Valsight Models

Stock and Flow diagrams can be mapped to Valsight models with simple basic building blocks.

Consider the following, basic example of a stock and flow diagram, adapted from Sterman – Business Dynamics, page 209.

The equivalent Valsight model would look like

Assuming a monthly Inflow of 10 pieces and an Outflow of 9 pieces the formulas may look like this:

InflowEXPAND(10,"Month")You may connect data via the DATA call, make the node simulatable, and use multiple dimensions (products, countries...)
OutflowEXPAND(9,"Month")same as Inflow
Net Change in Stock'Inflow' - 'Outflow'The delta between Inflow and Outflow. (this node is actually optional, you may as well use the formula directly in the Stock.
StockRUNNINGSUM('Net Change in Stock')Accumulate the Net Change in Stock. This node must be set to aggregation type "Closing Sum" to show the right end of period value when displayed at e.g. Year level.

Explanation / Details

To understand how this works, let's see which numbers are in each node & month for the first 3 month of 2019.

Month / Node2019-012019-022019-03
Net Change in Stock111

If we now change Inflow and Outflow in a simulation (shown in red), the table may look like this:

Month / Node2019-012019-022019-03
Inflow1010+4 = 1410
Outflow9-1 =899
Net Change in Stock251

Final Model in Valsight

Setting the aggregation type:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.