Hi,
Could you let me know how many decimal places vensim calculates to?
Thanks
Precision
Re: Precision
There's no simple answer to this question.
A single precision float is about 7 decimals, and double precision is 15. (Most Vensim versions are now double precision.) However, the precision of the answer also depends on simulation method and specific equation choices.
Fortunately, this rarely matters, because the uncertainties in any social system model are far larger. In most systems it makes sense to talk about more like 2 significant figures.
A single precision float is about 7 decimals, and double precision is 15. (Most Vensim versions are now double precision.) However, the precision of the answer also depends on simulation method and specific equation choices.
Fortunately, this rarely matters, because the uncertainties in any social system model are far larger. In most systems it makes sense to talk about more like 2 significant figures.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: Precision
Thanks Tom. I've tried recreating a model in python (which calculates to 35dp) and I get really different answers - I'm thinking that it's a numerical instability problem
Re: Precision
It seems unlikely that the difference is numerics, unless the model is chaotic, or at least dominant positive feedback, and you're running for a long time. The xmile test suite includes a number of models that yield ~identical results in Vensim, ithink and Python (PySD).
Python storage is normally going to be double precision, which gives you a 53-bit mantissa. 53*log(2)/log(10) is the origin of the ~15 digit precision. But that's unlikely to be realized due to additional limitations from finite time step, integration method, etc.
I'd be looking for a difference in implementation.
Python storage is normally going to be double precision, which gives you a 53-bit mantissa. 53*log(2)/log(10) is the origin of the ~15 digit precision. But that's unlikely to be realized due to additional limitations from finite time step, integration method, etc.
I'd be looking for a difference in implementation.
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/