Page 1 of 1

Restricting output from a stock

Posted: Thu Feb 19, 2004 3:46 pm
by Peter
I want to implement the behaviour on a flow draining a stock that allows either a standard amount or the amount actually in the preceding stock, whichever is the lower.

This must be a common issue under the generic heading of "Inventory can not go below zero". I'm sure there is a well documented solution I just can't seem to find it.

Regards

Peter

[Edited on 19-2-2004 by Peter]

Posted: Thu Feb 19, 2004 4:26 pm
by Owain
Try the following:

actual outflow = min( desired outflow , stock / time step).

It should work, so long as there is just the one outflow from the stock.

Owain

Thanks

Posted: Thu Feb 19, 2004 5:30 pm
by Peter
Thanks