Page 1 of 1

What PLE could do with cummulative values???

Posted: Fri Sep 13, 2013 9:42 am
by yanet288
Hi all
My question is related to whether or not I can modelling with the Free version of vensim (Vensim PLE) using a value that will feed later on the same variable

Here is the BIG question:
Is it possible to use one variable (stock - level) on Vensim PLE that could store the previous value of the variable and use it to estimate the next value, when I have already declared an initial value, for instance, the equation inside the stock - level is as follow:

Variable name: Aquifer Pollutant Load
Equation: =INTEG(Aquifer Pollutant Load - Pollutant Load OUT + New pollutant Load IN)
- initial value = 100

In order to get the second value of this variable "aquifer pollutant load", which in an excel spread sheet it will be = previous value of the variable "aquifer pollutant load" + new pollutant load IN - pollutant load OUT, which function/type of variable/equation/trick could allow me to accumulate always the previous value of the "aquifer pollutant load" in order to use it for the next simulation?

I have done it on Excel but it seems it could not be reproduced in vensim PLE. I have tried with the CUMULATE function but it indicates this function is not supported by vensim PLE.

Any suggestion/comments/advise are more than welcome!

Re: What PLE could do with cummulative values???

Posted: Fri Sep 13, 2013 10:06 am
by Administrator
DELAY FIXED will do what you need. Just delay by one time step (or whatever time you need the previous value from).

Re: What PLE could do with cummulative values???

Posted: Mon Sep 16, 2013 9:36 pm
by tomfid
Typically you want to avoid this kind of discrete time formulation though. Much better to free yourself of the limits of Excel and rethink your model in continuous terms.

Re: What PLE could do with cummulative values???

Posted: Fri Sep 20, 2013 10:36 am
by yanet288
Administrator wrote:DELAY FIXED will do what you need. Just delay by one time step (or whatever time you need the previous value from).
Thank you for your advise
I have used the function DELAY FIXED as follow:
Aquifer concentration (aquifer accumulate, TIME STEP, INITIAL TIME)
but I do get the following error
ERROR: Floating point error computing - AQUIFER Concentration - at time = 14.000000.
Trying to save the results anyway
do you have any idea what I am doing wrong?

Re: What PLE could do with cummulative values???

Posted: Fri Sep 20, 2013 11:58 am
by Administrator
Have a look at the numerical values using the table tool and see what is going wrong.

Most likely your levels are going too big.

Re: What PLE could do with cummulative values???

Posted: Fri Sep 20, 2013 3:12 pm
by tomfid
For an aquifer, it would be more typical to model it continuously, e.g.

water in aquifer = INTEG( recharge rate - withdrawal rate, initial water in aquifer )