Hi
Before I consider purchasing Vensim DSS, could I ask for your opinion on the following error in Vensim PLE Plus for Windows version 7.2 Single Precision (x32)?
I have condensed my model down to a single level with inflow and outflow rates (attached). The order of the level is large (1e5) in comparison to the rates (1e2) and following some disturbance (either not starting at the steady-state value or following a small impulse in the inflow rate), the level does not return to the expected steady-state exactly (0.001% error, which has ramifications for the rest of my more complex model with multiple linked levels). The effect is worse the smaller I make the timestep, no matter the type of integration, which makes me think there's a rounding-off error creeping in due to single precision.
I have run the same differential equations in Octave (although I don't think it's quite the same ODE solver) and there is no steady-state error.
Would double precision solve my problem?
Regards
Robyn
Single precision problem in Vensim PLE Plus?
-
- Junior Member
- Posts: 6
- Joined: Tue Jun 05, 2018 9:32 am
- Vensim version: PLE+
Single precision problem in Vensim PLE Plus?
- Attachments
-
- Test_Vensim.mdl
- Model
- (2.5 KiB) Downloaded 189 times
Re: Single precision problem in Vensim PLE Plus?
It returns to 100,000 in DP Vensim.
Email us for a trial license if you need to do further double-precision testing.
Email us for a trial license if you need to do further double-precision testing.
/*
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: Single precision problem in Vensim PLE Plus?
Hi
The level goes very quicky to 100000, in simple PLE and in Vensim DSS simple precision event starting the level at a 0 value!
I do not see where is the problem.
JJ
The level goes very quicky to 100000, in simple PLE and in Vensim DSS simple precision event starting the level at a 0 value!
I do not see where is the problem.
JJ
Re: Single precision problem in Vensim PLE Plus?
Is this a physical system, like orbital mechanics? Normally an error of .001% is insigificant compared to the noise and uncertainty in a system.
/*
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
*/
-
- Junior Member
- Posts: 6
- Joined: Tue Jun 05, 2018 9:32 am
- Vensim version: PLE+
Re: Single precision problem in Vensim PLE Plus?
Thanks for the responses.
The trouble is that I'm not sure whether the problem is inherent to the system I'm trying to model (a tank reactor with multiple solutes and I've determined that the volume error manifests in the concentration but only at large volumes) or a precision problem.
I would like to do further double-precision testing on the full model to check if this is indeed the problem. Thank you for the offer, I will email Vensim regarding a trial version.
Regards
Robyn
The trouble is that I'm not sure whether the problem is inherent to the system I'm trying to model (a tank reactor with multiple solutes and I've determined that the volume error manifests in the concentration but only at large volumes) or a precision problem.
I would like to do further double-precision testing on the full model to check if this is indeed the problem. Thank you for the offer, I will email Vensim regarding a trial version.
Regards
Robyn
-
- Junior Member
- Posts: 6
- Joined: Tue Jun 05, 2018 9:32 am
- Vensim version: PLE+
Re: Single precision problem in Vensim PLE Plus?
Definitely a precision problem! I have been testing the full model with a trial version of Vensim DSS double-precision and I'm no longer getting a steady-state error at large volumes. That's not to say there are no physical system limitations lurking in my model but at least now they won't be masked by a lack of precision. Thank you.
Re: Single precision problem in Vensim PLE Plus?
I'm not surprised - I don't recall exactly what the single precision epsilon is, but errors on a scale of 10^-5 are plausible, and you'd expect things to get worse for small time steps, because the discrete flow within a step gets smaller relative to the stock. Glad DP works.
/*
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: Single precision problem in Vensim PLE Plus?
Hi
It does not look like a problem of precision.
I have joined the model with an intialization of the level to 100000.
Whatever the format of the table, pretty or scientific and whatever its precision, the value for the level is not printed correctly, already at the beginning. If the value of the steady state volume is
100000 and the value of the table is 100003, the table tool writes 100000, same for the initial volume. It seems that the table does not print correctly some values, but the difference between the steady state volume and the level is correct!
I have tried some ways to print the level with the correct value, but I did not find it.
After different tries, I think that I have understood how it works.
In fact, when the level is 100020 for instance it prints 100000, rounding the value, but if the value is 100050 it prints 100100, rounding again the value.
I have joined a model that shows the process very well.
If one uses the synthesim and one clicks on the initial volume shadow variable below the graphs and one clicks on the right arrow, strange things are happening. The initial value is increased by increment of one, as one can see it with the difference. But on the initial value and level tables the value stays the same, until the real initial value reaches the value of 100050 and the difference 50.
At this stage, the initial value and the level jumps to 100100 etc…
This can be very misleading. The same happens in Vensim PLE, DSS single and double precision.
Regards.
JJ
It does not look like a problem of precision.
I have joined the model with an intialization of the level to 100000.
Whatever the format of the table, pretty or scientific and whatever its precision, the value for the level is not printed correctly, already at the beginning. If the value of the steady state volume is
100000 and the value of the table is 100003, the table tool writes 100000, same for the initial volume. It seems that the table does not print correctly some values, but the difference between the steady state volume and the level is correct!
I have tried some ways to print the level with the correct value, but I did not find it.
After different tries, I think that I have understood how it works.
In fact, when the level is 100020 for instance it prints 100000, rounding the value, but if the value is 100050 it prints 100100, rounding again the value.
I have joined a model that shows the process very well.
If one uses the synthesim and one clicks on the initial volume shadow variable below the graphs and one clicks on the right arrow, strange things are happening. The initial value is increased by increment of one, as one can see it with the difference. But on the initial value and level tables the value stays the same, until the real initial value reaches the value of 100050 and the difference 50.
At this stage, the initial value and the level jumps to 100100 etc…
This can be very misleading. The same happens in Vensim PLE, DSS single and double precision.
Regards.
JJ
- Attachments
-
- Test_Vensim_2.mdl
- (2.85 KiB) Downloaded 186 times
Re: Single precision problem in Vensim PLE Plus?
I'll take a look at the rounding algorithm.
/*
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
*/