Model Time

Use this forum to post Vensim related questions.
Post Reply
Filipe
Junior Member
Posts: 3
Joined: Sat May 01, 2010 2:17 pm

Model Time

Post by Filipe »

Hello.

I am modelling an acquisition that will be made 3 years after I start running my model. Is there a way of modelling this?

I have a "acquisition variable" that would be set up to 1 after 3 years. Imagined being something like

IF THEN ELSE ( TIME = 3, 1, 0)

but this does not work.
Thank you so much!!
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

If you want it to be 0 until time 3, then 1 thereafter, use STEP(1, acquisition time) with acquistion time = 3

Another option would be to use a level:

AcquisitionIsMade = INTEG( Acquisition Rate, 0) ~ dmnl
AcquisitionRate = PULSE(acquisition time,TIME STEP)/TIME STEP ~ 1/year

Tom
Filipe
Junior Member
Posts: 3
Joined: Sat May 01, 2010 2:17 pm

Post by Filipe »

Tom,

Thank you for your reply.

The idea is to make it 1 only in Time 3, then is set back to 0. I am only investing once.

Thank you!
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

Ahh, OK. Then your IF THEN ELSE should work. If not, it could be due to roundoff error: if Time isn't exactly equal to 3, the equation will fail, even though 3.0001 might be close enough from your perspective. As an alternative, you can do one of two things:

IF THEN ELSE( time > AqTime-TIME STEP/2 :AND: time <= AqTime+TIME STEP/2, 1, 0)

PULSE(AqTime,TIME STEP)

Tom
Filipe
Junior Member
Posts: 3
Joined: Sat May 01, 2010 2:17 pm

Post by Filipe »

Tom,

It's working!

Thank you
Post Reply