# Flows

A flow transports a material from one stock to another. As a model designer, you must enter the rate of the flow. So, for instance, in our river example the magnitude of the flow could be a million gallons of water and the period over which it flows could be one day: in effect a million gallons per day. Flows may connect two stocks together. Alternatively, a flow can lack a start or an end. In this case, the unconnected end acts as an unlimited stock of material.

As with the initial value of a stock, the rate of a flow can be a simple number or a more complex equation. The equation can be based on many factors including the values of the stocks the flow is connected to and the current time. For example, if we had a stock representing the population of rabbits (called Rabbit Population), we could make the flow into the stock be the number of rabbits times a constant birthrate. This equation would result in geometric growth in the rabbit population:

`[Rabbit Population] * 0.01`

Alternatively, if we had a flow representing rainfall, we could set the flow rate to be based on the current time of the year. Rainfall over the course of a year can be approximated using a sinusoidal function like the following:

`sin(2 * pi * (Weeks() + 10) / 52) * 30 + 35`

Where weeks is an Insight Maker function that automatically takes on the value of the current simulation time measured in weeks, pi is the constant 3.14159, and sin is another Insight Maker function that applies the trigonometric sine function to an angle inputted using radians.

A flow can be restricted to positive flows only. In this case, the flow will only be applied if the calculated magnitude of the flow rate is positive. This restriction would be applicable for both our rabbit and rain examples. We know that neither of the flows should ever be negative (you cannot have negative births or negative rain) so we might want to set them to only allow positive flows just to ensure that such an impossible event never happens (though it never will in any event given the equations we specified).

Every flow has two special properties that may be referenced in its equations. The first is Alpha which refers to the stock at the start of the flow. The second is Omega which refers to the stock at the end of the flow. In your equations you may use either of these instead of needing to know the actual names of a flow’s start or end stocks. For instance if you wanted 5% of the water from a lake to evaporate out of it each time period, you could use the following statement for the rate of a flow whose beginning was the lake:

`[Alpha] * 0.05`