Flow

BPTK API Documentation for the Flow class
Keywords

system dynamics, bptk, bptk-py, python, business prototyping

Flow

Flow in a SD DSL model.

A flow is the rate at which a stock changes in a timestep. It flows into a stock, increasing it, or out of one, decreasing it — the direction comes from the sign it is given in the stock’s equation. A flow is never negative: a rate that comes out below zero counts as 0. For a rate that can go either way, use a Biflow.

Create one through the model: model.flow("births").

Flow Constructor

Flow(model, name, function_string=None)

Create the flow.

Flow.equation

property equation

The rate for one timestep. It may be a constant, or an expression over other elements. Read, it returns the equation as originally set - an SD DSL Element or Operator.

births = model.flow("births")
births.equation = birth_rate * population

Inherited from Element

Everything else — equation, function_string, plot() and the arrayed-element API — comes from Element, where it is documented once for all element types.