Resetting Levels

Use this forum to post Vensim related questions.
Post Reply
ABridle
Junior Member
Posts: 4
Joined: Fri Aug 20, 2004 2:53 pm

Resetting Levels

Post by ABridle »

I'm building a model with timesteps in months. I want to look at the levels every year and then reset to zero at time = 12, 24 etc. (So I can see the accumulated costs at year end.)
Is there an easy way to do this?
afsinbulbul
Junior Member
Posts: 17
Joined: Thu Jul 29, 2004 8:28 pm

Post by afsinbulbul »

I'd do this using a PULSE function. So basically you can create an additional vaiable (auxiliary) and pulse the content of the level to this variable after every 12 months (so you don't have to reset the content of the level of course).
Although it might cause some unit inconsistency problems, if you don't have such concerns it should work just fine.
Wilson
Administrator
Posts: 51
Joined: Thu Mar 06, 2003 5:05 am

Post by Wilson »

There are many ways to do this. The one I use most often is to create a Level and a new Auxilary. The auxilary has the format:

if then else( MODULO(time,12)=0, 1,0)

which is an "end of year flag" (assuming you are starting them model at the beginning of a year).

The LEVEL equation would then be

LEVEL =
INFLOW - LEVEL * FLAG/TIME STEP

This will create a level giving you a saw tooth kind of output, with each peak being the end of year value.
Post Reply