How to set "bidirectional" flow for a stock

Use this forum to post Vensim related questions.
Post Reply
WayneZhou2009
Senior Member
Posts: 105
Joined: Wed Oct 25, 2017 3:52 pm
Vensim version: PRO

How to set "bidirectional" flow for a stock

Post by WayneZhou2009 »

Hi,
For a stock with just one flow, how to set the flow to be "bidirectional", so that the flow can sometimes be an inflow and sometimes be an outflow of the stock, depending upon the stock level as compared with an exogenously changing target?

Many thanks.
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: How to set "bidirectional" flow for a stock

Post by tomfid »

Vensim flows are always bidirectional, unless you explicitly constrain the equation with a MAX(0,...) or similar.

For example,
expected price = INTEG( expectation adj rate, initial price ) ~ $/kg
expectation adj rate = ( actual price - expected price )/adj time ~ $/kg/week

On the diagram you'd show the expectation adj rate as an inflow (arrow into stock), but when actual price < expected price, it will be negative, and therefore serve as an outflow.
WayneZhou2009
Senior Member
Posts: 105
Joined: Wed Oct 25, 2017 3:52 pm
Vensim version: PRO

Re: How to set "bidirectional" flow for a stock

Post by WayneZhou2009 »

Thanks a lot, Tom.

So there is no need to explicitly showing two arrows for one flow, i.e. one arrow of the flow going into the stock and the other arrow going into the cloud? Or maybe this is simply not realisable graphically?
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: How to set "bidirectional" flow for a stock

Post by tomfid »

You can turn on the second arrow by right-clicking the pipe, but I don't find it helpful.
Post Reply