Alison's New App is now available on iOS and Android! Download Now

Module 1: Modeling Techniques and Simulation

    Study Reminders
    Support

    The lastclass we discussed about the modelling techniques especially on the behavior modellinghow do I see the dynamics of the system or the behavioral dynamics of the system andhow do we model it using graphical modelling techniques. We discussed about the petrinet, which is one of the important tools for modelling the dynamics of the system and wesaw the basic elements of a place transition and the arc to represent the dynamics and wesaw one simple example also.I will take you through few more lectures were actually will try to see some complexitiesconcurrencies in the system and then activation or some control elements control signalsto start their process or the start their transition. So, we will go through some of theexamples and then show you how the petri nets can be used for complex systems andmodelling the dynamics of complex engineering systems.(Refer Slide Time: 01:14)
    Let me take a simple example. So, before going to that let me just explained you thispoint once again because in petri net we used the petri nets to understand the
    Reachability of a system whether we can reach a particular state from a an initial state.So, what are the transitions needed to reach that state. So, that can be analyzed similarlythe Boundedness of a particular state. So, to what extent we can continue to load thatparticular state or when we do should we actually stop that transition to that particularstate because there may be an overflow of data or information.So, how do we actually check that boundedness of a system with this also can be testedusing petri net then we have this Liveness of a system, whether the system transition willlead to a death of a system in terms of whether system will stop giving an output or theirwill not be an output, when you reach a particular state these are all can be a model usingpetri net.(Refer Slide Time: 02:08)
    Apart from this we can actually see that there are multiple local states which actuallylead to a global state.So, that also can be understood using petri net we can actually model those behaviorsusing this kind of petri nets the states and transitions. So, you need to explain thesesituations I will take a few examples and then show you how petri net can be used for thebehavior modelling of a systems. I will take a very familiar example which is a trafficsignal basically we all know that traffic signals are to be synchronized with other signalssuppose you have a junction.
    (Refer Slide Time: 02:47)
    And then you want to show the signals on both sides so you will be having a signal thispoint and signal here of course, here also. So, this signals need to be a synchronizedbecause then is a green signal here, then this always should be a red signal on both sidesand when this should change this red should not changed to green unless this green haschanged to red. So, this kind of concurrencies and synchronization need to be broughtinto the system and we need to test that synchronization and then the concurrency usingtransition.So, what kind of transition and what kind of control need to be put in place to ensure thatthere will not be any problem with the signals or there will not be any issues ofsynchronization. So, this can be modelled using petri net by showing different states andplaces as well as the transitions. So, we can actually represent the signals.
    (Refer Slide Time: 03:45)
    So, you can show that one side signal that is you have a red signal and you have a greensignal and an orange signal. So, this is the or 3 signals. So, red, green and orange. So,these are the places. So, we put sorry these are orange I will tried it outside because weneed to show the tokens inside. So, this is red this is green and this is a signal one andsimilarly we have a signal 2 also, we have red signal then we have the green signal andthen we have this orange signal. So, red, green and orange and we need to have thetransitions.Because when one to change from red to green you need a transition so we will representthat transition here then green to orange one transition. So, I will let me represent it herebecause it is easy to represent the transitions. So, this is the T 1 a which actually showsthe transition from red to green. So, you have a transition from red to green. So, it will belike this. So, this is the flow of data. So, this is transition a T 1 a over the first signaltransition one for this and then you have a transition here.T1 b which actually shows the transition from green to orange and then you have onemore transition from orange to red. So, let me show this transition here T1 C, whichactually shows this transition from here. So, this actually represents the a transition andthe places of a signal you have a red green and orange and you have this transition one a,one b, and one c, which actually represent the transition from one state to other state andwe can have the tokens to represent the present state of the signal.
    In the same way you can have this transition here also. So, here you have the T2 a andyou have this T2 T2 b which is which in T2 a green 2 this is T 2 b and then you have thisT2 c so this again the transition. So, you have this red to green and then green to orange,then the transition from orange to red. So, these are 2 independent signals. So, this issignal 2 this is signal 1. What we need to do is T 2 show the synchronization of thesignals. So, we cannot have a 2 green signals at the same junction. So, we need to mayensure that when the signal is red here then only that should be green otherwise if thisgreen that should never become a red signal.So, how do we actually represent that situation using the tokens or the place values? So,here this is the transition which actually moves from red to green. So, red to green cannotbe done unless we ensure that this is red. So, we need to have some kind of another inputover here or another place which actually connects to this and when we have tokens onboth these red and the other one then only this can actually change to green. So, we willprovide a another place here is actually connects to this T1 a. So, you can see that this T1 a the transition is connected to 2 places and both are actually coming to this T 1 a; thatmeans, there should be token available at this point and this at this place and this place inorder to activate this transition.So, that is the first condition the same way for this also for T 2 a which actually transfersfrom red to green that also should have to because when this is green this should notchange to green. So, this some red to green it is not happen. So, therefore, we need toensure that this transition has to check what is the status of this particular signal? So, wehave another connection over here. So, this transition has got 2 places connected andthey both should have the tokens in order to make a transition from red to green. Andthen we need to ensure that once this has become red then this has got a value becausewhen this is red then only this can change to green.So, we will have a place value connected to T 2 c also similarly T 1 c which actuallygives a token back to the this particular place, that is whenever this red as this orangesgoing to red when there will be a token available here. Similarly when just becomeoranges become red that token will be available here; that means, the particular when thesignal is red then only there will be a token over here; that means, can have a changefrom red to green the other one.
    So, we will represent this here suppose you have an initial token available here supposethis is the initial situation you have a token available here and the token available here;that means, both are red when you have a token available here; that means, both are redsignal now. So, you have a red signal here and the red signal here. So, you have a tokenover here also now there is a option that you can actually have a T 1 a transition or T 2 atransition. So, one of the signals can actually go to green not both you have this T 1 aactivated suppose you activate this T 1 a the transition is activated then immediately thistoken will be given to green and this token will be released from here.Because this only one output. So, this token will be released from here to this point. Nowthis is green and there is no token over here therefore, T 2 a cannot change. So, T 2 a thatplease transition cannot happen; that means, this red cannot become green unless theytoken comes back to this position. So, now, this green is there. So, the present position isa one signal is red the other one is green. Now we have a transition here suppose we gofor the transition here this token will be move to here; that means, orange will beactivated. So, this place has got a activation now. So, the signal is orange now.Still it cannot change to green because there is no token available here and there will be atoken available only when you have the next transition. So, when we have this transitionsuppose we activate this transition now, then this token will be given here move to hereas well as to this point this place because now you have this transition is connected to anoutput to here. So, whenever there is an input coming to this both this places will begetting a token.Now, this has got a token. So, the token is there and this signal is red. So, at this pointyou can see that there is a token available here and token available here also here alsothere is a token available therefore, we can actually activate this transition. So, this signalis red and therefore, we can activate this transition.
    (Refer Slide Time: 11:42)
    Again this token will be removed and this token will be passed to this one. So, the tokenfrom red will be passed to green you can see that the now one signal is red the othersignal is green. So, you can the same way you will do the transition.(Refer Slide Time: 11:54)
    So, this transition the token will be passed to this and when this transition is made theactivate this transition this token will be moved from here it will go to here as well as tohere. So, when we activate this transition you will be getting the token at here and herenow the both the signals are red and therefore, we can have the next transition from here.
    So, unless this token comes back from here this cannot activate and this red signal cannotchange to green.So, this actually shows that there is a synchronization between these 2 signals in order toensure that there is no issues with the synchronization basically when one signal is redthen only the other will change to green. So, this is one way of representing thissynchronization using petri net. So, this is a traffic signal where we have different signalof course, you can actually have multiple signals if you have more signals here I haveshown only straight direction motions. So, if you have a turning to right or turning to leftand then taking you turn all the signals are there.We can actually incorporate all those scenarios and then see what kind ofsynchronization we need to ensure. So, depending on that we need to include additionalplaces. So, that the tokens can be distributed in such a way that there is propersynchronization and there is no issue of overlapping of signals or there is no otherproblem associated with the concurrency and synchronization. So, this is one way ofmodelling the dynamics of this particular behavioural dynamics of the signal using
    petrinets.The same way you can actually represent many other situations also.(Refer Slide Time: 13:43)
    You can show you another situation where we have a restaurant and customers andbasically people who actually serve, how do we actually synchronize the behaviour ofthis customers and servants and how do we actually optimize the use of these people byhaving proper synchronization of their activities as you can see in the figure over here.So, we have shown that there is a one waiter and the 2 customers waiting for a customerand. So, that is a Waiter free.So, now if you want to represent this situation we can have different situation that thewaiter can actually take the order from one customer and then you can give the order tothe kitchen and then wait for the order to come and then he can serve the customer. Andthen order from the next customer or you can take order from customer one and place theorder to the kitchen and then he can take the order from customer 2 and then place theorder and whenever the food is ready he can serve customer one and customer 2.So, how do we actually represent this kind of scenarios using petri net? So, as Imentioned petri net can actually shows all the dynamic behavioural dynamics and canshow the concurrency and the synchronization the same way we can use the situationalso we can represent using petri net.(Refer Slide Time: 14:58)
    As you can see here so we have 2 scenarios we are representing the scenario one is thatthe waiter takes order from customer one and serves customer 1, takes order fromcustomer 2, serves customer 2, customer 2 will be waiting till the customer one is served.
    The second scenario is the waiter takes order from customer 1, takes order fromcustomer 2, serves customer 2 and then serve customer 1. So, this is the another scenarioof course, you can have many other scenarios of various situation and then try to see howdo we actually get those scenarios represented using petri nets just for example, I amshowing 2 scenarios.(Refer Slide Time: 15:34)
    So, this is the scenario 1. So, initially both the customers are there you can see the tokensat these places. So, you have this token customer 1 and customer 2 and then there is awaiter who is free here.This transition that is taking order is shown by this transition and then this taking orderfrom customer to his first shown by this transition. So, you can see here this transitionhas is connected to 2 places. So, customer one and waiter free. So, this transition cantake place only if this there are tokens in these 2 places that is customer one and waiterthere are tokens available, then only it can be transition can take place similarly for thecustomer 2 also you need to have this transitions and when this transition takes placethere are 2 tokens coming over here. So, when this transition take place as we can see itis connected to 2 places that is wait as well as order taken.So, this 2 places you will be having tokens and once you connect this one you can see theserve food is connected 2 tokens again waiter free and food is available. So, these 2 areneeded for this transition or the customer is waiting and the waiter is free then only the
    transition can take place. So, this the relationships actually what particular relationship isneeded for the transition can be represented using this arrows and the tokens.Now, let us see how this is taking place. So, you can see that the order is taken. So,therefore, the transition is taking place customer is waiting here and the order is taken.So, we have these 2 places with tokens now, because this transition take place you havethis customer waiting here after the order is given and the order is taken from thecustomer that is completed. And now once the order is taken that has to be informed tothe kitchen or it has to be placed to the kitchen. So, that is this transition. So, the waiteryou need to give this order to the kitchen.So, he will be giving this order to the kitchen that is this transition. So, we can see here.So, once you placed the order the actually the token goes back to the waiter.
    So, once he ordered the item to the kitchen then the waiter is free here. So, here now thewaiter is free this customer is free and this customer is waiting. So, the waiter has got anoption either to take the order from customer 2 or to wait for the item to be ready. So,that he can serve food. So, you can see that to serve food for this transition you can seethis is the waiter should be free and then there will be food should be ready.Now, waiter has option to take the customer 2 order or wait for the food to be served. So,here in the first case it is actually serving food.
    (Refer Slide Time: 18:19)
    And the customer is eating for the place is taken the token is given there and therefore,the waiter is again free after the serving of food. So, the customer is free now he can takethe order second order. So, he is taking the second order customer 2.(Refer Slide Time: 18:33)
    And you can see the tokens are moving here order is taken and the customer is waitingorder is taken and then tell the kitchen about the order. So, this is activated. So, he willbe getting the transition and then you will get the serve food and the customer is eatingand the waiter is free now.
    (Refer Slide Time: 18:47)
    So, both the customer is are having food and the waiter is free. So, this is one scenariowhere we can actually represent the dynamics or the behavioral dynamics what ishappening inside the in that particular scenario. So, we can have any number ofcustomers and any number of waiters. So, we can actually show the complexities alsowith some waited arcs that I will explain later, but in this case we can see that is ascenario can be represented using petri nets and the place values and the tokens.(Refer Slide Time: 19:23)
    So, in the scenario 2 it is almost similar except that the situation changes. So, here thewaiter and customers are free and then actually it takes order from customer 1. So,customer is waiting and the order is taken and that is inform to the kitchen and the waiteris free.(Refer Slide Time: 19:38)
    And one customer is waiting for food the other customer is waiting for to place the order.(Refer Slide Time: 19:44)
    Now, you actually take the second situation the waiter is taking order from customer 2.
    (Refer Slide Time: 19:59)
    And then places the order to the kitchen and then both the customers are waiting and thewaiter is free. So, that he can actually serve food.(Refer Slide Time: 20:05)Now, the waiter is free. So, he will serve the food to one customer. So, serve food thecustomer 2 and then serve food to customer 1.
    So, this is way how you actually represent the scenario. So, any scenario can be shownlike this way. So, we can actually show the what kind of concurrency is needed and whatkind of synchronizations are needed, there can actually be represented using this kind ofah petri net. So, that was one example and there are few more example which actuallyshows the complexity of the petri net.(Refer Slide Time: 20:45)
    Here you can see as I mention the petri net can be used for various scenarios. So, you canactually represent a sequence of events as you can see here you can have events e 1 e 2 e
    3 represented and the places and transitions as we have the places and transitions you canactually represent it using in the serial way.(Refer Slide Time: 21:05)
    So, we have these places or the events. So, you can have any event 1 or the places thenyou have a transition then you have an event so this kind of serial activations sorry.So, this is e 1 e 2 and transition one transition 2. So, this is basically a serial sequence ofevents. So, that can actually be represented using this kind of petri nets or you canactually go for the concurrent executions. So, this actually shows the executions how theplace values are changing.
    (Refer Slide Time: 21:36)
    So, if you go back you can actually see this. So, when you have the transition event ishappening the token is transferred to the next one then you have this token next oneTrans happening then again the token is represent transferred using every transition.So, this is one way of showing the sequence of events and then the concurrentexecutions.(Refer Slide Time: 22:05)
    You can see in the picture here the concurrent executions also can take place byconcurrency mean that you have this transition. So, we have actually this concurrent
    activities you can have this kind of transitions and events. So, the place transitions canactually happen like this. So, this actually shows the concurrency of the events.So, you have one event and then you have many events going the same time and ofcourse, you can actually if the come to one state at a later state then actually you canhave the same output from here. So, these events will happen concurrently and oncethese 2 are ready then only this transition will take place and to finally, till in an output.So, that is the sequence or concurrent execution. So, this is the serial one for sequence ofevents and this is the concurrent event.The concurrency of events or concurrency of executions same way this can actually beagain found through the animation you can see the e one happening. So, the tokens aregiven to the next 2 parallel execution change there is a concurrent events and then e 2and e 4 take place.(Refer Slide Time: 23:31)
    Then pass the token then again e 3 happen e 3 and e 5 pass the token. So, like this youcan have concurrency of events.These are the sequence of events and the concurrency of events.
    (Refer Slide Time: 23:41)
    And apart from this we can actually have a nondeterministic events like conflict choiceor decision. So, this also can be represented using this kind of petri nets that this you canhave a choice of either e 1 or e 2 or e 3 or e 4 like that. So, you can actually choose an e1 it is not particular conditions you can actually make a choice also that also can berepresented using petri nets.So, here you can see that you can have a for e 1 or e 3 e one e 2 etcetera or you can gofor e 3 e 4 and that level also. So, this also can be represented. So, in this case if you passthe token to e 1 or e 3 can be executed. So, in this situation what is shown here? So, onlyone of this transition can take place then this will happen e 1 e 2 etcetera will happen orif this is started then e 3 e 4 etcetera will start. So, not the concurrently this will happen itis only one group will be executing. So, as you can see here.
    (Refer Slide Time: 24:37)
    So, if e threes event is happening then e 1 cannot happen, because there is no tokenavailable here. So, e 1 cannot happen unless the token comes back to this position. So, e3 will happen then e 4 will happen and then it will continue like this unless.(Refer Slide Time: 24:48)
    Until when it reaches one point where the token from here is return back to this positione 1 cannot start. So, that is the choice for a particular situation.So, this actually shows the second one. So, once e one is activated.
    (Refer Slide Time: 25:02)
    Then e 3 cannot happen because the token is not available therefore, e 3 will not happenthen e 2 will happen and then continue. So, that is about the structures were you can havechoices and various options to execute.(Refer Slide Time: 25:15)
    Now, there are different other net structures also as you can see here in this case this is asynchronization which I already explained. So, the synchronization will happen onlywhen this e 1 can happen only and there is a tokens are available in all these cases.
    So, if there tokens are not available here e one cannot happened; that means, this e 1 willbe synchronized with the happening of all these 3 incidences all these places should havetoken in order to activate this. So, that is the 3 are ready then only e 1 can be executedand it will be going the token will be move to the next one.(Refer Slide Time: 25:50)
    So, that is the synchronization structure. And the next one is the concurrency sosynchronization we saw then asynchronization concurrency also can be introducedthrough structures. So, this is the synchronization and concurrency structure.(Refer Slide Time: 25:57)
    So, this actually shows the synchronization. So, this e 1 we will synchronize with thehappening of all the 3 and the concurrency
    when e 1 is activated all this will concurrentlystart all this will be having the places. So, that is the synchronization and concurrency ofthe system again you can see here. So, you have the transition e 1.(Refer Slide Time: 26:32)
    This will go to all the places will be having the token value and therefore, you will begetting activation of this and that will be the concurrency of the system.So, that is how the synchronization concurrency can be represented using petri nets.(Refer Slide Time: 26:45)
    Now, we will take another example where we can show all these concurrency sequenceof activation as well as concurrent activation and synchronization. We will take a anotherexample where a producer consumer system which consist of one producer and 2consumers and one storage buffer with the conditions, this case we have a producerconsumer system where we have 1 producer and 2 consumers and 1 storage buffer.So, how do we actually synchronize the activities of the producer the consumer as wellas the storage, we need to ensure that the producers enough for the consumer and the ifthe consumer is not taking it is it going to the storage and a storage is not overflowing.So, how do we actually represent these a concurrency and the synchronization of thisevents that can be represented using petri net. So, the conditions for this are the storagebuffer may contain at most 5 items. So, storage buffer cannot have more than 5 items andthe producer sends 3 items in each production.So, whenever the producer makes one production it will be having 3 items and buffer canhave only 5 items stored and the at most one consumer is able to access the storagebuffer at one time. So, only one consumer will be able to access the storage buffer at onetime and each consumer removes 2 items when accessing the storage buffer. So,whenever a consumer access the storage buffer he can take 2 items, but only oneconsumer can access it at one time and one producer can produce 3 items at a time andthe storage buffer has got a maximum capacity of 5.So, how do we actually ensures that there is no overflow of the buffer as well the storageas well as the producer is not producing more than what can be stored or consumed andhow do we ensure that consumer gets the items whenever it is there or the whenever thecustomer wants he get some item. So, how do we ensure this condition we can actuallyrepresent that kind of a scenario using petri net?
    (Refer Slide Time: 28:45)
    So, the petri net for the system is shown here. So, here you can look at the petri net. So,this is the producer, this is the storage, and this is the consumer. So, we have consumerplace this 1 and this is the consumer 2 and you have this producer then it is a ready fortransferred to the storage.So, this is the storage with the place value of 5. So, here we can see that the storage canhave a maximum 5 items. So, that is why k is given as 5. So, this another kind of petrinet where you have the value for the places as well as for the arcs you can see here theseare the arcs which actually represents the transition from this state to this state. So, thevalues given as 3; that means, you can send a 3 at any time to the storage.Similarly, the consumer can actually take 2 at any time that is why k is equal to 2 in boththe cases. So, here as k is equal to 2 and only 2 can be removed from here by the consumer that is why this value is 2. So, whatever any transition takes place only 2 willbe moved from here though there is a value of 5. So, 3 can come at any time and 2 can beremoved and these 2 can actually take 2 each, but only one at a time and it can beconsumed.Once we consumed again they can take the items. So, this is the situation you have theproducer producing items and then they going to the storage and then it is consumed by
    the consumer. Now look at this how do we actually show the dynamics or behavior of thesystem you can see here. So, there is one producer that is k is equal to 1 it is one