different time steps in Vensim do not have the same result, how can this be solved?

435 Views Asked by At

I am making a simple model in Vensim. the model consists of a stock and an out-flow variable:

stock: equations = INTEG (-"out-flow"), initial value: 2.5

out-flow: equations = IF THEN ELSE( stock>0, MIN(stock, 1), 0)

simulation runs for 5 years (initial time = 0 and final time = 5) and the unit of time is year. I need to do the simulation 64 times every year, therefore the time step is set to “0.015625”. the result I get with this time step is not logical and is not what I expect but the desired result is obtained by setting "time step = 1".

as mentioned earlier the simulation needs to run 64 times every year and simulation with time step = 1 is of no use to me. how can I solve this problem? thanks in advance.

2

There are 2 best solutions below

0
On

Start by adding units to the variables in your model. Then make sure it passes the units test.

Now select an appropriate time step (there is guidance on how to select this in the Vensim help system).

Once you have a suitable time step, if you reduce it, results should stay very similar. If they change, it indicates time step is too large, or you have errors in logic in your model.

0
On

To do that you can transform your units of years into days, rounding off the days of the TIME STEP.

Units for Time = Year, INITIAL TIME = 0, FINAL TIME = 5, TIME STEP = 1

IF THEN ELSE( stock > 0, MIN(stock, 1), 0)

before

after transformation

Units for Time = Day, INITIAL TIME = 0, FINAL TIME = 1825, TIME STEP = 6

IF THEN ELSE( stock/365 > 0, MIN(stock/365, 1/365), 0)

after