Page 1 of 1

Floating Point Error

Posted: Sat Mar 23, 2024 1:58 pm
by TheJusticeAvenger
Hi,
I'm using Vensim for a University course and am currently facing some urgent issues.
In the model below, I'm facing a floating point error whenever I try to run SyntheSim, with the error seemingly being the Death Rate. However, when I attempt to diagnose the error, the equations and units seem to be accurate.
Any help would be greatly appreciated!

Re: Floating Point Error

Posted: Sat Mar 23, 2024 3:08 pm
by LAUJJL
Hi
Checking the units and equation does not prove that your model is correct.
The floating-point error comes from the environmental pollution index strange values, getting beyond the values that Vensim can handle.
There must be some wrong equations formulations in your model.
To understand them, put the final time to say 0.5, less than 1.125, and run the synthesim. It will then work.
Then study the behavior of your model, step by step, starting at time 0, and verify the results and see if they make sense. probably not.
You can too, launch a simple simulation, setting too the final time to 0.5 or something less than 1.125.
By the way, you can too, set the units testing to strict testing and you will seem some additional unit errors appearing.
Regards.
JJ

Re: Floating Point Error

Posted: Sat Mar 23, 2024 6:24 pm
by Administrator
You do have units errors in your model.

Start with "base burning rate". That should not be measured in 1/year, I'm pretty certain it will be tonnes/year. Same for "base discovery rate". Correct the units for these, and you'll see where the error is.

Re: Floating Point Error

Posted: Sat Mar 23, 2024 6:27 pm
by Administrator
To give you a little more help, try this

burning of coal = min ( available coal resources / time step , base burning rate )

This equation burns the "base burning rate" until all the "available coal resources" are used up. This equation takes "base burning rate" from the stock, or everything in the stock ( available coal resources / time step ) which will prevent it going negative.