Page 1 of 1

Working with Levels in Vensim

Posted: Wed Aug 21, 2019 1:51 pm
by Omar ZOUHIR
Hi,
I noticed, while I was working on a Vensim Model, that levels (even when changing the integrators) calculate and shows the stock variation in a specific day n up till the day n-1.
Let me explain, if a rate pointing towards a level with a certain value x in a specific day n, this value will appear in the level the next day (n+1).

Now I need to change this a little bit. I need the changes (in production for my own model) to appear and be considered in the calculation for the same day.
I have been stuck with this detail fore some time. Can you suggest a solution?

Thank you in advance :)

Re: Working with Levels in Vensim

Posted: Wed Aug 21, 2019 6:05 pm
by tomfid
Levels can't literally reflect flows instantaneously - that would be a violation of causality. However, if your model is essentially running in discrete time, and you want end-of-period levels instead of start-of-period, you can use the Diff integration method (instead of Euler) to shift the reporting of results.

Another option is to use a sufficiently small time step (not 1). https://metasd.com/2017/11/discrete-time-stinks/

Re: Working with Levels in Vensim

Posted: Thu Aug 22, 2019 4:16 pm
by tomfid
Another possibility is to create a reporting variable that reflects the stock+current flow.