How to set extremely low stock to be exactly zero and ensure reasonable co-flow results?

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 extremely low stock to be exactly zero and ensure reasonable co-flow results?

Post by WayneZhou2009 »

Hi,

Sometimes a stock reaches extremely low level. For example, it remains positive but is as low as something like 3e-12. This might not be a critical issue when only the stock is of interest. However, when a coflow is involved in the model and the stock level is used as the denominator in the calculation of average attribute, then some extremely high and obviously unreasonably value is returned.

Average attribute = Total attribute / Stock

How could this issue be solved properly? If such low level of stock is set to be zero using IF THEN ELSE and then the average attribute is calculated using ZIDZ, then this may lead to some results that mistakenly make the average attribute become zero. This is because sometimes both the total attribute and the underlying stock are low (but not extremely low) but their ratio still gives the correct result of average attribute. For example, total attribute (0.3) and stock (0.03) gives the correct average attribute (10). But over time, the total attribute becomes 3e-5 and the stock unproportionately becomes something like 5e-9, then the resultant average attribute apparently does not make sense.

Is there a good way to solve such problem? Thank you so much.
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: How to set extremely low stock to be exactly zero and ensure reasonable co-flow results?

Post by tomfid »

I'm not sure there's a good general solution that's problem-independent, other than switching to double precision Vensim DSS.

What's your use case for this?
Post Reply