Skip to content

Category: System Dynamics

system dynamics simulation stock

syStockOutput

Provides additional return values from syStock().

Syntax

syStockOutput(Stock, [OutputID])

The syStockOutput function syntax has the following arguments:

  • Stock: required. Reference to a cell with syStock() element.
  • OutputID: optional. Return value ID from syStock(): 1 - outflow quantity in last timestep, 2 - overflow quantity in last timestep, 3 - outflow rate, 4 - overflow rate. 1 if ommited.

Return value is according to one of the options set by OutputID argument.

Remarks

During simulation, syStock() return value is the current quantity on stock. Because syStock() is quite complex element, syStockOutput provides additional outputs for it.

If the material is flowing from syStock() to another syStock(), then the outflow quantity from the first syStock() can be used as DiscreteInflow for the second syStock(). On the other hand, Outflow rate of the first syStock() can be directly used as InflowRate to the second syStock(). Outflow quantity and outflow rate are provided by syStockOutput which should be placed in between two stocks.

Similarly, we can organize overflows which can be collected by other syStock() elements in sequence.

Examples

  • =syStockOutput(firstStock,2) - Element returns the overflow quantity from syStock() in cell with block name firstStock. This overflow quantity can be used in another stock as discrete inflow like this: =syStock(0,0,firstStockOverflow,0,0,A1) where firstStockOverflow is name of the cell with our syStockOutput.