Pulse function

Use this forum to post Vensim related questions.
Post Reply
asc
Newbie
Posts: 1
Joined: Mon Mar 14, 2011 4:19 pm

Pulse function

Post by asc »

Dear all,

I am looking to create an IF ELSE condition which trigers a single pulse only if a stock exceeds a threshold value. I want to define the magnitude of the pulse using a variable generated by the model with a constant preset time duration.

e.g.

if(valueOfStock > threshold){
pulse(heightVariableY, timeDurationConstant)
} else{
0
}

I am sorry for what I'm sure is a trivial question however I have just moved from another environment and I can't seem to get this to work in Vensim. I would greatly appreciate any help offered.

Kind regards,

A
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: Pulse function

Post by tomfid »

I think the problem with your current formulation is that you're treating the first parameter of PULSE as height. In Vensim, PULSE is a 0-1 switch, so you'd want height*PULSE(timeOfPulse,duration).
Post Reply