Closed enekomartinmartinez closed 3 years ago
Is this a problem with the test model, or with Vensim? Should we pass this along to Ventana?
@JamesPHoughton I think that the problem is with Vensim. While running Vensim the output from INTEG should be rounded taking into account the numerical precision of Vensim to properly compute the MODULO or INTEGER. I have updated the model in a PR, so we can test MODULO and INTEGER without worrying about the numerical error. Maybe, we can keep the old one and inform Ventana.
Great. Sent you an email with contact info. I'd suggest simplifying the test model to show only that issue, and a fresh output, and passing them along to Tom via email.
Fine, I have just noticed that the bug happens only when running vensim in single precision but not in double.
test: rounding
We expect StockA to take values from -5 to 5 in intervals of 0.1. However, Integ sometimes returns non-exact values. For example, we can see in the output that StockA has value 3, but StockA modulo 3 has also value 3 which makes no sense. What is happening is that when running Vensim is taking 2.999999999... instead of 3, which is the expected value.
I will update the model using a variable instead of INTEG to generate the MODULO and INTEGER inputs.