Pulsing for a varying period of time

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

Pulsing for a varying period of time

Post by Gem »

Hi there,

I'm trying to create a pulse of between 5-30 days to follow after an amalgamation of two previous pulses.

The formula I'm using isn't working as I'd expected, perhaps someone has any ideas?

I've basically got two pulses:

A Check:
PULSE TRAIN( 0, A Time+"Aircraft Wash Pre & Post", A Repeat Time, 5000)

C Check:
PULSE TRAIN( 0, C Time+"Aircraft Wash Pre & Post", C Repeat Time, 5000)

Where A & C Time and A & C Repeat Times are variable.

These pulses work fine as expected.

What I am trying to do is add a pulse train (Testing) that begins when either an A or C Check has finished ie, the pulse goes back to 0. The pulse train should be for a period of between 5 and 30 days.

The formula I'm currently using is:
Testing:
IF THEN ELSE( A Check=0:OR:C Check=0, PULSE TRAIN( 0, Testing Time, A Check=0:OR:C Check=0, 5000), 0)

Where Testing time is the Variable between 5 and 30.

I think I'm falling down on the repeat time part of the Pulse Train. I basically want it to repeat every time an A or C Check has completed.

Any help would be much appreciated, many thanks in advance.

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

Problem with Repeat Time

Post by Gem »

Hi there,

Further to my problem above, I think the main problem I am having is to do with the repeat time.

It seems that at every time step while A or C Check are at 0, the pulse for testing is 1.

I want testing to pulse for a value of 5 when the A or C Check first transitions from 1 to 0. Not for the whole time an A or C Check is 0.

Is there any way round this? I think a solution to this may also solve my duration problem.

Many thanks,

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

Post by bob@vensim.com »

I am not completely following the pattern you want to see but if you have specific conditions to turn on and off things I would recommend you stick to IF THEN ELSE and MODULO and stay away from PULSE and PULSE TRAIN. For example

test = IF THEN ELSE(test condition = 1,
IF THEN ELSE(MODULO(Time - test start time,total cycle time) < pulse on time,
1,0),0)


If you experiement with that you can probably get what you want.
Gem
Junior Member
Posts: 14
Joined: Thu Mar 30, 2006 9:34 am

Post by Gem »

Thanks for your reply, however I'm not sure it's what I'm looking for.

To clarify, an aircraft comes in for a service (A Check) which takes 21 days. Directly following this, it will be tested which will take 5 days.

At the moment, my model incorrectly shows that an aircraft is either in an A Check or testing ie, when A check is 1, testing is 0 and vice versa.

I need the model to produce an output the same as in the excel spreadsheet I have attached. This should help to explain what I am looking for.

Thanks again for your reply.
Attachments
OAM Excel.xls
(18.5 KiB) Downloaded 249 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

You need something like

aircraft to testing = DELAY FIXED(aircraft arrival for checking,checking time)
aircraft returning to duty = DELAY FIXED(aircraft to testing,testing time)
aircraft being checked = INTEG(aircraft arrival for checking - aircraft returning to duty,0)

and so on. Forget all about pulses and pulse trains.
Gem
Junior Member
Posts: 14
Joined: Thu Mar 30, 2006 9:34 am

Post by Gem »

Thanks so much for your reply, it works just as I need!
Post Reply