Select a value of a variable during simulations

Use this forum to post Vensim related questions.
Post Reply
claudia
Junior Member
Posts: 13
Joined: Tue Jul 06, 2010 6:55 pm

Select a value of a variable during simulations

Post by claudia »

I Try to select a value of a variable at a specific time, for example, my variable is AREA. At time = 2 , this area becomes positive (the only time it is positive, after time 2, it ll be equal to 0 again like before time =2) and I want to conserve this positive value for the rest of the simulations (from time =2 to final time).
I don't know which function I have to use for it. I hope someone can help me ?
Lee Jones

Post by Lee Jones »

Use the SAMPLE_IF_TRUE function
tomfid
Administrator
Posts: 3995
Joined: Wed May 24, 2006 4:54 am

Post by tomfid »

For example, SAMPLE IF TRUE(AREA>0,AREA,AREA), or SAMPLE IF TRUE(AREA>0,AREA,:NA:) - the 2nd version returns a null result (the special value :NA:) until the AREA value is first defined.
Post Reply