Research on Modeling and Simulating of Discrete Event System Based on Petri Net

A framework of modeling and simulating a typical artificial system is proposed based on discrete event system and Petri net. Firstly, the system model is constructed based on discrete event system theory. Secondly, the model is described and analyzed by using Petri net. Then, the simulation procedures on Matlab platform are presented in detail. The proposed framework is applied to modeling and simulating a logical control system of a marine diesel engine. The simulation results indicate that this logical control system model can be constructed by the given framework and the proposed method is effective in simulating and analyzing this kind of artificial system.


Introduction
Diesel engine is a typical artificial system, which is widely used in vehicle and watercraft and governed by operational rules designed by humans.The control system plays a vital role in guaranteeing the safety and the reliability of a diesel engine.A certain kind of marine diesel engine is the prime mover of the watercraft.The corresponding control system of this marine diesel engine is a logical control system, which is composed of variable relays and sensors and played a complex logical control.Because of the diversiform configuration and complex control logic of this system, it is difficulty to construct the model and analyze the work procedures of this kind of logical control system in traditional methods, such as differential equations and difference equations [1][2][3].Discrete Event System (DES) is a dynamical system that evolves according to asynchronous occurrence of certain discrete changes, called events.It is widely used in the field of language and automata theory, supervisory control, Petri net theory, Markov chains and queuing theory, discrete-event simulation, and concurrent estimation techniques.It is can be used for modeling and describing this type of artificial system [3,4].
Generally, there are two kinds of modeling formalisms in describing and simulating a discrete event system: automata and Petri net.The two formalisms have in common that they represent the state transition function by specifying what the possible events are in each state of the system.But the lack of structure hierarchy in automata is an obvious shortcoming.Compared with automata, Petri net is conveniently described graphically.It is intuitive and captures a lot of structural information about a system [3][4][5][6][7][8].
In this paper, we will focus on modeling and simulating a discrete event system based on Petri net on Matlab platform.The rest of this paper is organized as follows.The general model of discrete event system and corresponding Petri net is introduced in Section 2. Section 3 provides a framework of simulating a Petri net based on Matlab platform and an example is given to illustrate the proposed method.Simulation results and conclusions are summarized in Section 4.

General Model of a Typical Artificial System
Discrete Event System (DES) Model.Generally, a typical artificial system G can be modeled by discrete event system with [3][4][5]: Where, Σ is the set of events, which happened in G , and a certain event is denoted as σ .
Q is the set of states, which indicates the possible states G may be stayed, and a certain state is denoted as q .
is the state transition function, with ) , ( q σ δ giving the set of next possible states if σ occurs at q .
For an event Σ ∈ σ , we define a partition: Where, is the possible set of states after the event σ occurred.It means that σ Ω partitions Q into two subsets: one with all the possible states after the occurrence of event σ , and the other with all the impossible states after event σ occurred.Petri Net Framework.A Petri net structure is a weighted bipartite graph includes a finite set of places and transitions, the set of arcs from places to transitions and from transitions to places in the graph, and the weight function on the arcs.For the proposed discrete event system model in Eq. 1, the corresponding Petri net structure is as follow [6][7][8]: Where, P is the finite set of places, the counterpart in DES model is states set Q .A certain place is denoted as p , and every place usually contains variable tokens.The number of tokens in a place indicates the information of the place.
T is the finite set of transitions, the counterpart in DES model is events set Σ .When a transition t occurred, the states of the system are updated.The occurrence of a transition is called fire.The fire conditions for a certain transition can be defined as required.
is the set of arcs from places to transitions and from transitions to places in the graph, equal to the state transition function δ in DES model.
is the capacity function of the places.The number of tokens in a place should not exceed the capacity.
is the weighted function of the arcs.Where, + Z is the set of positive integer.
is the marking set of places, the counterpart in DES is the partition Ω , which indicates the token number in the places.Compared to Ω , according to defining different marking sets, such as colored Petri net, M can describe many states partition in a Petri net, while Ω partitions states set only into two subsets in DES: the possible states and impossible states after a certain event σ .
In .There are many Petri net simulation tools, in this paper, we will use the General-Purpose Petri net simulator toolbox (GPenSIM toolbox) based on the Matlab platform, which is developed by Reggie Davidrajuh [9,10].
The procedures of simulating a Petri net graph are as follow: Step 1: Define the static Petri net graph, including places, transitions, and arcs.
Advanced Engineering Forum Vol. 4 Step 2: Initialize the Petri net graph, including state markings, fire conditions and fire times.
Step 4: Output the simulation results.
Transition definition files will be called during simulation.Thus, if we want to inspect the simulation properties a transition definition file can be used as a probe to control and inspect the simulation processes.

Example Analysis of a Marine Diesel Engine Control System
Model Construction.A certain kind of logical control system is used for controlling the work processes of a marine diesel engine, such as start-up, stopping, timing, supervision, alarming, and interlocking protection.Take the start-up process as an example, we will construct the discrete event system model and Petri net graph, and then simulate the starting procedure of this system on Matlab platform.
The control system of this marine diesel engine is a kind of logical control system, composed of variables relays and sensors.The states of these relays and sensors indicate the rotate speed of this marine diesel engine.Thus, we focus on controlling the rotate speed of the diesel engine and simulating the work schedules of the corresponding external sensors and relays in different rotate speed.It is obvious that the continuous rotate speed should be divided into different discrete parts based on the different work parameters of the external sensors and relays.
The discrete event system model of the diesel engine control system is constructed based on Eq. 1, the events and state spaces are as shown in Table 1 and Table 2, respectively.Table 1 Events of the logical control system events meaning 1 σ press the start-up button.
2 σ the fuel pressure sensor worked, which means the rotate speed rising to a certain value (n 1 ) and the fuel pressure is normal.
3 σ the cooling water pressure sensor worked, which means the rotate speed rising to a certain value (n 2 ) and the cooling water pressure is normal.
4 σ the start-up relay power off, which means the processes of starting the diesel engine is completed and the start-up air is cut off.
The events in this system are defined as a button is pressed, relay and sensor are switch-on or switch-off.Where, the sign n 1 denotes the rotate speed when the fuel pressure rising to the normal value, which means the fuel pressure sensor have worked.The sign n 2 denotes the rotate speed when the cooling water pressure rising to the normal value, which means the cooling water pressure sensor have worked, that is n 2 >n 1 .
Then, we can construct the corresponding Petri net, as shown in Fig. 1.
Fig. 1 The Petri net graph of the logical control system Where, in the discrete event system model, respectively.Simulation.After constructing the model of this marine diesel engine control system, we can simulate the work processes of this system on Matlab platform.
Secondly, define the fire conditions of transitions.
To simulate the practical work procedures of this system, we define the fire conditions as Eq. 4.

Table 2
State spaces of the logical control system