new problem

Use this forum to post Vensim related questions.
Post Reply
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

new problem

Post by nikvyas »

Hello again.

I have another query I'm afraid.

I have two outputs - output 1 and output2.

output1 = 11000001100etc (random)
output 2 = 11110001100 etc (random)
What I want to do is as follows:
We start off with output 1 and pulse consecutive 1's. As soon as we hit a zero, output 2 pulses consecutive 1's. We then go back to output 1 and, output the value's of 0's at subsequent time steps (if it is the case) until we come to the next sequence of 1's, when they are output - we then bring in the next sequence of 1's from output 2 as soon as output 1 hits 0 again. The effect of this is to elongate the sequence as follows:
output 3 = 1 1 1 1 1 1 0 1 1 1 1

Hope this is clear.

Thanks

Nik
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

One thing that isn't clear from the above is that output 3 could be elongated if there are 1's at the same time step on output1 and output2. Once a sequence of 1's has started, it needs to be finished. For expample:

output1 = 1111011000100000011
output2 = 111011110110000111
output3 = 1111111111111111011111

So, the first four pulses at output 1 are drawn first. Once a 0 is encoutered, the first sequence of 1's from output 2 is drawn. Next, the second sequence from output 1 is drawn etc.
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

new problem

Post by LAUJJL »

Hi

It is not clear for me.
Logically the way you explain it, there should be only one'1 for output 3.
Regards.
JJ
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Hi JJ - I haven't explained it properly. I can put it another way.

Say we have two outputs as follows:
output 1 = 101110100110011
output 2 = 001111101011010

output 3 = output 1 + output 2
= 102221201121020

Now - we are only allowed to have a value of '1' in each time step. If we have a value of 2 in time step 1, for instance, the next time step (time step 2) will be increased by 1 and the current time step (time step 1) will be reduced to 1. Now the effect of increasing time step 2 by 1 might be to increase it to a value of 3, so the following time step (time step 3) is increased by two and time step 2 reduced to 1. This is continued throughout the sequence, so that we have a series of 1's, but 'stretched' out over a much larger number of time steps. Hope this is a bit clearer.

Thanks

Nik
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

new problem

Post by LAUJJL »

the model attached may eventually do.
Regards.
JJ
Attachments
new_model.mdl
(923 Bytes) Downloaded 313 times
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks JJ - however the model is empty!
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

new problem

Post by LAUJJL »

joined I hope the model
Regards.
JJ
Attachments
new_model.mdl
(2.97 KiB) Downloaded 276 times
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

I am not sure I follow this at all, but if I guess your meaning corectly the solution is simple

output3 = IF THEN ELSE(pending outputs > 0,1,0)
pending outputs = accumulated pending outputs + (output1 + output2) * TIME STEP
accumulated pending outputs = INTEG(output1+output2-output3,0)

this assumes TIME STEP = 1 .
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks a lot Bob and JJ - it was fairly obvious I suppose - it just takes a bit of practice to adapt the brain into working in Vensim mode.

I now have another related query, I'm afraid. I've attached a model which shows aircraft under repair. "Repair Activities To Be performed" shows the number of aircraft under repair at any one time. For instance, at time t=13 (hours), there is one aircraft under maintenance, whereas at time t=15, there are two aircraft under maintenance. According to the model, it takes 5 hours to fix an aircraft. Now, we need 10 technicians to complete the repair on one aircraft per hour and so if we have 10 technicians, but two aircraft are in for maintenance that hour, one of the aircrafts repair will be queued (according to my query earlier in this thread). My problem is this - "repair in progress" shows a cummulative pattern, as opposed to actual aircraft in maintenance that hour. For instance, consider the following:

T1=1, T2=1, T3=1, T4=2, T6=2, T7=1, T8=1, T9=1
This means that there is the SAME aircraft in for repair at T=1, T=2, T=3, T=4 and T=5 and that there is a DIFFERENT aircraft in for repair at T=4, T=6, T=7, T=8 and T=9. That is, it ISN'T cummulative and there isn't one aircraft at T=1, 2 aircraft at T=2 etc, 3 aircraft at T=3 etc.

So my question would be - if you run the model as it is (with the number of technicians at 5), how can I see how many ACTUAL aircraft are in for maintenance at any one hour?

Thanks very much again for your help.


Nik

[Edited on 11-15-2006 by nikvyas]
Attachments
material_support_test.mdl
(64.62 KiB) Downloaded 311 times
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

.

[Edited on 11-16-2006 by nikvyas]

[Edited on 11-16-2006 by nikvyas]
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

The way you have formulated this it is just the minimum of repair capacity and repairs in progress.

As an observation - not using units of measurement and doing units checking has already caused you some problems and things are going to get worse. Even when doing pure difference equations clearly distringuishing between units of measurement is really critical.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks for your comments Bob - I have to admit I'm a bit sloppy when it comes to that sort of thing.

However, are you able to understand the problem I have re: the actual number of aircraft that are awaiting repairs? Unfortunately, the model is solely intended to show the actual aircraft awaiting repairs, so if there isn't a solution, I will need to redesign it.

Thanks

Nik

[Edited on 11-16-2006 by nikvyas]
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

fhe way the mode is set up "repairs in progress" is the actual number of aircraft that are being rapaired (either actively or simply by waiting to be repaired. as you have set it up this does not need to be an integer - which may be fine.

If you want to distinguish active repair from waiting you need repair capacity in Airplanes (not Airplanes/Hour) and repair throughput in Airplanes/Hour then something like

planes waiting repair = INTEG(repair wait starts - repair starts from waiting,0)
repair wait starts = IF THEN ELSE(planes in repair=0 :AND: planes waiting repair = 0,0,planes showing up to be repaired)
repair starts from waiting = IF THEN ELSE(planes in repair-plane repair completions*TIME STEP <=0,1,0)

and so on. The bookkeeping gets a little bit tedious but it shold be doable.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks again Bob..................however I don't think I have explained clearly enough! Before I explain, could I say that we will be having training courses in December and I will be able to ask Lee Jones to clarify a few of my weak points - however I need to demonstate to my leaders that Vensim is the software for us (as opposes to Witness).

The problem is that "repairs in progress" doesn't show the number of aircraft waiting to be repaired. For each hour the aircraft is in for repair, a pulse is generated. So "repairs in progress" is showing the total hours left for repair and not the actual number of aircraft.

An approximate method is to divide the "repairs in progress" by the time to repair an aircraft (which in the model is set to 5 hours). I think this may be sufficient.

Thanks

Nik

[Edited on 11-17-2006 by nikvyas]
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

new problem

Post by LAUJJL »

Hi Nik

As a general rule, I think that you will get better answers to your questions, if you deliver simpler models and with all the checks working correctly. It is easier to understand a model
completely checked, espececially units check.
It should be simplified to its minimum possible, so as to spot easily the root of the problem.
I had a look at the Witness web site.
I think that Vensim and Witness do not do the same job.
Witness is a discreet package and you can find a lot of them in the market, oriented on concrete physical processes, where you find queues, conveyors, stocks etc....
You generally do not find any feed back in these packages, because feed backs need time to have an effect and descreet packages are oriented towards short term processes.
You will not find any tool like reality check in discreet packages either because reality check is more oriented on behaviour over a long time period.
So to understand the difference between the two methods, it may take some time!
Regards.
JJ
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post by bob@vensim.com »

Hi Nik,

You can use something like the following.

planes in repair = INTEG(planes entering repair - planes exiting repair,0) ~ Aircraft~|
planes entering repair = MIN(planes waiting repair/TIME STEP + planes breaking down,
(plane repair capacity - planes in repair)/TIME STEP + planes exiting repair) ~ Aircraft ~|
plane repair capacity = 1 ~ Aircraft ~|
planes exiting repair = MIN(planes in repair/TIME STEP,repair processing capacity) ~ Aircraft/Hour ~|

you definitely need 2 capacities - one for bringing the aircraft in for repair (this might be driven by hanger size) and one for actually repairing them (driven by personnel and equipment availablility).

Hope that is helpful.
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks very much for your help Bob. Could you please give me the equation for "planes waiting repair"? I entered an equation that I thought it should be, but got a simultaneous equation error.

Thanks again.

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

Post by bob@vensim.com »

planes waiting repair = INTEG(planes breaking down - planes entering repair,init planes waiting repair)

note that the equation for planes entering repair takes care of the more complicated case.

[Edited on 2006-11-20 by bob@vensim.com]
nikvyas
Senior Member
Posts: 112
Joined: Mon Apr 24, 2006 3:17 pm

Post by nikvyas »

Thanks Bob.
Post Reply