Counting the number of pulses

Use this forum to post Vensim related questions.
Post Reply
Gem
Junior Member
Posts: 14
Joined: Thu Mar 30, 2006 9:34 am

Counting the number of pulses

Post by Gem »

Hi there,

I think I'm asking a fairly simple thing here, but I can't think how to actually do it in Vensim.

I would like to count the number of pulses that I have in a period, so say in 24 hours I may have had 5 pulses of 3 hours long. If I add this as a level, it gives me the wrong result - I need it to return 5. Any way that I can do this?

Many thanks,

Gemma
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I don't know what is pulsing - but this discussion has happened before. If it is just 1 variable that is on or off using something like)

total upward change count = INTEG(IF THEN ELSE(value > old value,1,0),0)
old value = INTEG((value - old value)/TIME STEP,value)

Bob Eberlien
Gem
Junior Member
Posts: 14
Joined: Thu Mar 30, 2006 9:34 am

Post by Gem »

Thanks Bob, I'll try that.

Gemma
Post Reply