# Identification of Stochastic Timed Discrete Event Systems with st-IPN

Authors: Doyra Mariela Muñoz; Antonio Correcher; Emilio García; Francisco Morant
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

This paper presents a method for the identification of stochastic timed discrete event systems, based on the analysis of the behavior of the input and output signals, arranged in a timeline. To achieve this goal stochastic timed interpreted Petri nets are defined. These nets link timed discrete event systems modelling with stochastic time modelling. The procedure starts with the observation of the input/output signals; these signals are converted into events, so that the sequence of events is the observed language. This language arrives to an identifier that builds a stochastic timed interpreted Petri net which generates the same language. The identified model is a deterministic generator of the observed language. The identification method also includes an algorithm that determines when the identification process is over.


---

## Body

## 1. Introduction

Industrial systems usually have a sequential evolution, so they behave as discrete event systems (DES). A DES is a discrete-state, event-driven system; that is, its state evolution depends entirely on the occurrence of asynchronously discrete events over time [1]. A DES describes the system behavior by means of the occurrence of events from an initial state. In an industrial system two kinds of events can be observed. Input (I) events are related to control commands or external interactions with the system and output (O) events are related to sensor measures. In this proposal, the external signals not related with control commands define the operating modes, which affects the controller and allows modelling the system under different strategies; in [2] the authors use a similar concept to differentiate production patterns in batch processes, called multimode; they propose to separate the original space of a mode into two different parts (the common and the specific) and a monitoring process is carried out in each block; the multiblock monitoring method proposed is used for fault diagnosis purposes in multimode multivariate continuous processes; some of its proposals could be applied in stochastic DES regarding times identification, so it will probably reduce the sizes of time matrices and the complexity of the identification method.Regarding DES, one problem which is being studied recently is system identification. This problem can be defined as follows: given a set of observed ordered timed I/O signals, determine a model such that, given a set of ordered I signals, the model approximates a set of the observed O signals. When a model of the system is not available, identification can be effectively used to obtain a model that can be then used to formally prove if the system meets the requirements and to improve its dependability [3].Therefore, the first step in an identification process is to define the characteristics and the format of the model to fit. DES modelling starting form I/O signals has been addressed by many authors using different approaches.Petri nets (PNs) have been recognized as a suitable model to describe DES [4], particularly when a system is asynchronous [5–8]. Hiraishi [9] presented an algorithm for the construction of a free labeled Petri net model from the knowledge of a finite set of its firing sequences. In [10], the authors define a class of continuous-time discrete event dynamic systems (DEDS) with two types of discrete-valued I/O signals: conditions signals and event signals called condition/event systems (C/E systems) and they define models of C/E systems too that are based on an extension of PNs (C/E PNs). C/E systems provide an intuitive modelling framework amenable to block diagram representation. The way of thinking and modelling a system is like a set of modules with a particular dynamic behavior and their interconnection via signals. This way of modeling is intuitive, and the modules can be pretailored and used over and over again. Each module is equipped with I/O signals which are of two types: condition I/O carrying state information and event I/O carrying state transition information. This way of system extension with I/O signals clearly reflects the duality of PNs, namely, the clear distinction between states and states transitions with their own graphical representation, semantics, and formal properties.Rausch and Hanisch [11] proposed formalism for composition of I/O PNs to new systems which they called net condition/event systems (NCEs). I/O PNs are coupled by means of condition signals and event signals. The composition is performed in the same way as known from the composition of continuous systems in state space representation. This model can simulate the systems behavior by firing maximal steps and can also compute the complete state graph for the system, similar to the state graph for timed place/transition nets under the maximum firing strategy.The general idea of NCEs is modelling a system as a set of modules with a particular dynamic behavior and their interconnection via signals [12]. Condition and event inputs can be connected with some transitions inside the module by condition and event arcs. Module places can be connected to the condition outputs by condition arcs, and transitions can be connected to the event outputs by event arcs. This concept provides a basis for a compositional approach to build larger models from smaller components [12].Once the model has been defined, the following step is defined as the DES identification method. In the literature there exist a lot proposals related to DES identification methods, these can be compared by their complexity in terms of the system characteristics, identification process, and the model or algorithm applied [13], as well as by the identification model objective. From the theory of DES some identification methods have been developed using different techniques such as finite state machines (FSM), Automata, and PN; currently, the most popular models are PNs and Automata [7, 14].The simplest methods are based on data from I/O, where concurrent states are not identified and its execution is off-line [13]. If the identification process is incremental, then the algorithm must be executed on-line, but its complexity is higher, because it can be polynomial or exponential, depending on the approach used for modeling. Furthermore, if the identification goal is the analysis of the model structure, the model must be developed to verify PN properties like being alive, conservative, achievable, among others. One of the most well-studied PNs problems is estimating the state of a given PN, based on its event sequence observation; in [15] the problem of finding the least-cost transition firing sequence(s) for a given interpreted PN (IPN) based on the observation of labels sequence is addressed. The PN possesses both observable transitions (which are associated with a possibly nonunique label) and unobservable transitions (whose firings do not generate any label observations). This paper assumes that each transition in the given IPN is associated with a nonnegative cost that captures its likelihood (e.g., in terms of the workload or the power amount needed to execute a certain transition). Given the observation of a labels sequence, the task is to find the transition firing sequence which (i) is consistent with both the observed label sequence and the PN structure and (ii) has the least total cost.Recent literature presents results and trends to solve the identification problem. These trends can be grouped according to [13], in three groups: IPN identification by I/O signals (I/O IPN identification), nondeterministic finite automaton (NDFA), and application of integer linear programming (IPL) for IPN identification (ILP + IPN).I/O IPN identification is related to the generation of DES, based on the observation of output signals [16]; an on-line algorithm computes an IPN model Q
i, describing the behavior of an unknown system Q. Every time a cyclic behavior is detected, the previous computed model is updated. This approach considers that each input to the system is reflected in the output. It means that, even if the system is not completely instrumented, the information provided by the sensors is enough to detect any change of state [17]. The algorithm receives a sequence of output signals obtained from observations during the system operation. These output signals must be binary vectors representing the current state of every one of the sensors measuring the output behavior of the system. In [17] the authors present an evolution of the method which is able to deal with concurrent systems by means of detecting concurrent transitions. The identified models are useful for structural diagnosis.Regarding NDFA method, its approach is to build a model that approximates the original system language. The observed language of the closed loop DES is to be translated into a finite state machine by an appropriate identification algorithm. In [18, 19] a nondeterministic autonomous automaton with output (NDAAO) is chosen as an appropriate model to reproduce the observed language of closed loop DES. This approach identifies a closed loop DES based on the interaction of the controller with deterministic behavior and the physical process with nondeterministic behavior, combining internal and external events. It presents a proposal for division of the system into smaller subsystems. Also [20] addresses the problem of identification and diagnosis in DES based on timed Automata; the algorithm identifies and detects failures in the actuators in low complexity systems. An evolution of the method of [20] is proposed by Jarvis in [21]. This paper deals with the identification of timed event systems with timed Automata models. Some disadvantages of this trend are that it does not model the concurrence of states. Moreover, in complex systems there is a combinatorial explosion of states.ILP + IPN uses an ILP approach and it computes an IPN. The model is built by using observed events and the available output vector ([22–26]). The identification problem is to determine a set of places P of cardinality m, a set of transitions T of cardinality n, and the function of labeling and the PN defined as an ILP problem. Silent transitions are those that identify faults. A contribution of these methods is given in [3] that deals with the identification problem for deterministic systems as of timed λ
-
free PN, starting from the timed observed sequences. This method generates a net language, whereas the timer information is used to identify language strings that are not accepted by the net; therefore, the algorithm does not need to know the language of the full net. The solution is based on ILP and knowledge of the timed net structure. It allows, together with the observation of events, determining whether a transition time has expired. The algorithm is carried out through two subroutines, one to observe the language on-line and another for the off-line ILP. Furthermore, [27] contributes with a technique that reduces the number of sets of inequalities and the number of inequalities in each set to identify the IPN as an ILP problem. The other contribution in this area is given in [28], presenting a method that uses ILP with IPN, to prevent exhaustive generation of reachable states; it is considered nondeterminism in the model, since different observable transitions share the same label; it has a timing structure of events leading to the imposition of new restrictions and provides the most accurate diagnosis. It is a very efficient method in small models but to find an optimal solution in complex models has very high computational requirements.These trends can be compared regarding to criteria such as kind of system to identify, resulting model and computational cost, we can say that: The I/O IPN identification cannot be used with timed systems; it can be applied to complex systems; the obtained models are less complex than those obtained using the Automata based methods and computational cost is normal. The NDFA trend applies to timed systems, and it works best on simple systems; it generates nondeterministic models and the computational cost is normal; furthermore, there is a combinatorial explosion of states. And regarding IPL + IPN, some proposals are for timed systems and some present nondeterminism so these methods cannot be applied today to identify real complex DES because of the high computational complexity of the algorithm.Timed event systems identification with output symbols has been also treated in [21] using a technique from computational learning theory in the context of timed Automata and in [3] with free labeled nets; in this paper it is assumed that a delay is associated with each transition and the timer variables are used to determine if a potentially enabled transition; on the basis of the observed firings, a subset of the net language is build, while the timing information is exploited to determine a subset of counterexamples, that is, a set of strings that do not belong to the net language.Considering the advantages and disadvantages of the existing identification methods, this paper proposes an identification method of timed discrete event complex systems, which identifies a deterministic language generator. The language generator is defined as a stochastic timed IPN (st-IPN). The proposal to model a system as st-IPN is inspired in some concepts of the modelling formalism by NCES, specifically on conditions and I/O events with the purpose of labeling the transitions and places. We have added properties to generate a DES modelling approach with the purpose of performing diagnostics on complex systems.This paper is organized as follows. Section2 describes the background on PN; Section 3 defines a st-IPN; Section 4 presents the identification method; Section 5 shows an application case; finally, the concluding remarks and discussion are showed in Section 6.


## 2. Background on PN

Petri nets (PNs) are widely used for modeling DES [29]. PN provides compact models and captures main DES characteristics as concurrence, asynchronism, causal relationships, mutual exclusions, and so forth. This paper will model DES with PN, so some basics of PN are presented.Definition 1 (Petri net (PN)).
A Petri net structureN is a bipartite digraph represented by the five-tuple N
=
(
P
,
TR
,
Pre
,
Post
,
M
0
), where P is a set of places with cardinality n and TR is a set of transitions with cardinality m, and Pre
:
P
×
TR
→
N, Post
:
TR
×
P
→
N are thepre- andpostincidence matrices, respectively, which specify the arcs connecting places and transitions. Matrix I
=
Post
-
Pre is the m
×
n incidence matrix of the net. The marking function M
:
P
→
N represents the number of tokens residing inside each place, and M
0 is the initial marking [26, 30].Forpre- andpost-sets, the dot notation is used. •
tr
⁡
=
{
p
∈
P
:
Pre
(
p
,
tr
⁡
)
>
0
} [26].Definition 2 (Reachability set of a PN).
LetN be a PN. Transition t
r
j is enabled at marking M
k if ∀
p
i
∈
•
t
r
j
,
M
(
p
i
)
≥
I
(
p
i
,
t
r
j
). The enabled transition t
r
j can be fired reaching a new marking M
k
+
1 that can be computed by M
k
+
1
=
M
k
+
I
·
t
r
j
→, where t
r
j
→ is a |
TR
| vector of zeroes, except in entry j, that is equal to 1. An enabled sequence σ
=
t
r
1
t
r
2
⋯
t
r
k is denoted as M
⌈
σ
>
M
k. The reachability set of a PN is the set of all possible reachable markings from M
0, firing only enabled transitions; this set is denoted by R
(
N
,
M
0
) [31].The system inputs will be the control commands and the outputs will be the sensor readings. At each time instant each input will have a particular value and so the outputs. In order to organize the signals, this paper encodes the different I/O vectors using its binary representation; therefore, it is defined an input (output) symbol as the set of control commands (sensor readings) values at a time instant in binary representation.Definition 3 (I/O symbol).
Assuming binary values in input and output signals,u
s is a binary representation of s, s stands for the input symbol, and s
=
0
⋯
|
2
m
|
-
1, with u
0
=
[
0
→
]; …; u
|
2
m
|
-
1
=
[
1
→
], the same applies to y
j, y
j is a binary representation of j, j stands for the output symbol, and j
=
0
⋯
|
2
n
|
-
1, with y
0
=
[
0
→
]; …; y
|
2
n
|
-
1
=
[
1
→
].For example, given a set of control commandsC
c
=
{
c
c
1
,
c
c
2
}; if c
c
1
=
1 and c
c
2
=
0 then the input symbol is represented by u
2.Note that is possible that the controller will not generate all the input symbols, since some control commands cannot be enabled simultaneously. In the same way, the system will not generate all the output symbols if there is no failure.Definition 4 (interpreted Petri net).
An IPN is a tupleQ
=
(
N
,
U
,
Y
,
λ
,
φ
) (see [32]), where N is a PN. U
=
{
u
0
,
u
1
,
…
,
u
|
2
m
|
-
1
} is the input alphabet, u
s is an input symbol, and m is the number of inputs; Y
=
{
y
0
,
y
1
,
…
,
y
|
2
n
|
-
1
} is the output alphabet, y
j is an output symbol, and n is the number of outputs; λ
:
TR
→
U is a labeling transition function that assigns an input symbol to each transition. φ
:
R
(
N
,
M
0
)
→
Y is an output function that assigns an output symbol to each reachable marking.From the definition given in [33], an event is a pair (
u
s
,
y
j
). A new event is generated when there is a change in u
s, in y
j, or in both.The system alphabetΩ relates I/O symbols; that is, Ω
=
U
·
Y; therefore ω
e
=
u
s
y
j
∈
U
·
Y if u
s
∈
U and y
j
∈
Y, where e
=
1
⋯
|
2
m
|
×
|
2
n
|.IfU
·
Y is the system alphabet and U (Y) is the input (output) alphabet, then P
U
:
(
U
·
Y
)
*
→
U
* (resp., P
Y
:
(
U
·
Y
)
*
→
Y
*), where P
U
(
u
s
y
j
)
:
=
u
s
if
u
s
∈
U, P
U
(
u
s
′
y
j
)
:
=
ε if u
s
′
∉
U. (
P
Y
(
u
s
y
j
)
:
=
y
j
if
y
j
∈
Y, P
Y
(
u
s
y
j
′
)
:
=
ε
if
y
j
′
∉
Y
).Definition 5 (timed event).
A timed eventω
i is an I/O symbol at time τ
i,
(1)
ω
i
=
(
u
s
y
j
)
τ
i
,
where u
s
y
j is an I/O symbol at time τ
i. The time elapsed from τ
i to τ
i
-
1 is t
i (see [34]) and t
i
=
|
τ
i
|
-
|
τ
i
-
1
|.Definition 6 (firing language (see [35])).
A firing sequence in an IPN(
Q
) is a transition sequence σ
=
t
r
1
t
r
2
⋯
t
r
k
⋯ such that M
0
→
t
r
1
M
1
→
t
r
2
⋯
M
w
→
t
r
k
⋯. Given a firing sequence σ, a marking M
k
∈
R
(
N
,
M
0
) is reached from M
0 if there exists a σ
i such that M
0
⌈
σ
i
>
M
k. The set of all firing sequences is called the firing language L
(
F
)
=
{
σ
|
σ
=
t
r
1
t
r
2
⋯
t
r
k
⋯
∧
M
0
→
t
r
1
M
1
→
t
r
2
⋯
M
w
→
t
r
k
⋯
|
M
0
,
M
1
,
M
w
∈
R
(
N
,
M
0
)
}. Each transition t
r
j is fired at time τ
j  (
τ
1
≤
τ
2
≤
⋯
≤
τ
k
); therefore σ is an arranged sequence in a timeline, where each transition happens at time τ
i.L
(
F
) generates a timed event sequence (based on Definition 5), called system language L
(
Q
)
=
{
λ
(
t
r
1
)
φ
(
M
1
)
,
λ
(
t
r
2
)
φ
(
M
1
)
,
…
,
λ
(
t
r
k
)
φ
(
M
k
)
} whose events are arranged at the same timeline as L
(
F
).We define the projectionP
U
:
L
(
Q
)
→
L
in
(
Q
) (resp., P
Y
:
L
(
Q
)
→
L
out
(
Q
)), where P
U
(
λ
(
t
r
k
)
φ
(
M
k
)
)
=
λ
(
t
r
k
) if λ
(
t
r
k
)
∈
U and P
U
(
λ
(
t
r
k
′
)
φ
(
M
k
)
)
=
ε if λ
(
t
r
k
′
)
∉
U. (P
Y
(
λ
(
t
r
k
)
φ
(
M
k
)
)
=
φ
(
M
k
) if φ
(
M
k
)
∈
Y and P
Y
(
λ
(
t
r
k
)
φ
(
M
k
′
)
)
=
ε if φ
(
M
k
′
)
∉
Y). Therefore consider the following.(i)
The input language is the generated language by the input symbols, is:(2)
L
in
(
Q
)
=
{
P
U
(
s
)
s
∈
L
(
Q
)
}
Note that there could be several transitions with the same label if λ is not isomorphic.
(ii)
The The output language is the generated language by the output symbols, is:(3)
L
out
(
Q
)
=
{
P
Y
(
s
)
s
∈
L
(
Q
)
}
Note that there could be several places with the same label if φ
(
M
w
) is not isomorphic. For identification purposes, it is convenient to use isomorphic φ functions. Isomorphic mappings will lead to equivalences between output symbols and net markings. Therefore, it will be immediate to infer the net state from a particular combination of output symbols.Note that the evolution on an IPN could be nondeterministic ifφ is nonisomorphic. For example, a nondeterministic evolution will occur if there exists at least one place with at least two transitions with the same label that lead to different places. Nevertheless, the language generated by many systems (see [18]) is represented by a nondeterministic NDA when the system state is described by means of its outputs. For some applications, such as diagnosis, nondeterminism is an undesirable characteristic. Next section will present an extension of IPN that will avoid the nondeterminism in this case.


## 3. Definition of Stochastic Timed Interpreted Petri Net (st-IPN)

This section presents the definition of st-IPN. st-IPN definition includes the concept of “differential of output signals”(
d
y
), which represents the historical behavior of the output signals. This concept will improve the understanding of the process states. For example, in a fluid tank it is possible to differentiate between the filling or emptying tasks. This knowledge takes a great importance for identification purposes.Definition 7 (differential of output symbol,d
y).
Given an output symboly
j
∈
Y and y
j
-
1
∈
Y; d
y
j is defined as
(4)
d
y
j
(
y
j
×
y
j
-
1
)
⟶
{
-
1,0
,
1
}
,
where d
y
j
(
a
,
b
)
=
c, a
∈
Y is an output symbol at time τ
i, b
∈
Y is an output symbol at time τ
i
-
1, and c
∈
{
-
1,0
,
1
}; for an output symbol y
j; c
=
a
-
b, so d
y
j possible values are 0
×
0
→
0; 0
×
1
→
1; 1
×
0
→
-
1; 1
×
1
→
0.st-IPN combines an IPN and a timed PN. IPN is defined in Definition4 and the timing concepts are based on [3] where the authors define a timed PN with a delay associated with each transition, represented by δ
(
tr
⁡
). This delay represents the time that must elapse from the enabling of the transition until it fires. Timer variables are used to determine if a potentially enabled transition tr istimed-out, that is, if its firing time is elapsed and tr has not yet fired. If δ
(
tr
⁡
)
≠
0, then tr is said to betimed, while if δ
(
tr
⁡
)
=
0, then tr is said to beimmediate.Definition 8 (timer variables (based on [3])).
Given a transition sequenceσ
=
t
r
1
t
r
2
⋯
t
r
k
⋯, a timer variable t
t
r
j is associated with each timed transition t
r
j, where t
t
r
j is enabled if M
j
>
pre; t
t
r
j is disabled; that is, t
t
r
j
=
0, before the firing of σ.Moreover, it is important to introduce the concept ofoperation mode which is related to external events signals that affects the controller, such as SCADA commands, operator requirements, among others. The operation modes can be grouped in a set OM
=
{
o
1
,
o
2
,
…
}.A stochastic system is affected by a number of aspects such as the variability in the material flow, the fluctuation of power supply, and the deterioration of machinery and devices. These variations change the enabling and the firing times. It is assumed that each transition time follows a stochastic distribution that can be different for each operation mode.Considering that this variability is not always normally distributed, st-IPN includes a density function of transition firing time for each transition and for each operation mode.Definition 9 (stochastic timed interpreted Petri net (st-IPN)).
A st-IPN is a structure represented by(5)
st
Q
=
(
Q
,
Ω
,
δ
)
,
where Q
=
(
N
,
U
,
Y
,
λ
,
φ
) is an IPN where N
,
U
,
Y have the same meaning as in Definition 4, but input function λ is defined as λ
:
TR
→
U
·
δ (a labeling function that assigns an input symbol and a timer density function to each transition) and φ is defined as φ
:
R
(
N
,
M
0
)
→
y
j
/
d
y
j; φ is isomorphic over y
j
/
d
y
j.
Ω
=
U
·
Y
:
=
{
ω
=
(
u
s
y
j
)
} is the system alphabet.
δ
:
=
TR
×
OM
→
f
(
t
TR
×
OM
) is a density function of transition firing time for each operation mode OM
=
{
o
1
,
o
2
,
…
}.A transitiont
r
j
∈
TR with λ
(
t
r
j
)
=
u
s
·
t
t
r
j is enabled at operation mode o
i if and only if M
j
>
pre and if Prob
(
t
t
r
j
,
o
i
)
≥
(
1
-
α
), where Prob
(
t
t
r
j
)
=
∫
‍
f
(
t
tr
⁡
j
×
O
i
) and 1
-
α is the confidence level. Therefore, a transition is enabled if each input place meets the marking requirements and the time elapsed has reached a certain confidence interval.Whent
r
j is fired, a new marking is reached, such that φ
(
M
k
)
=
y
j
/
d
y
j; thereby, each place of the st-IPN represents not only the current system state, but also includes information about directionality.(i)
Generated language: Stochastic timed event sequence generated from the evolution of a st-IPN, soL
(
st
Q
)
=
{
s
∈
(
U
·
Y
)
*
:
Prob
(
s
∣
φ
(
M
0
)
)
≥
(
1
-
α
)
}, where s
=
ω
0
,
ω
1
,
…
,
ω
k at times τ
0
≤
τ
1
≤
⋯
≤
τ
k. A symbol of the language generated is a concatenation of an input symbol and an output symbol (ω
i
=
u
s
y
j) at time τ
i.


### 3.1. Properties

Given an I/O event sequences, where s
=
(
u
k
y
k
)
,
(
u
x
,
y
x
)
,
(
u
1
,
y
1
)
,
…
,
(
u
v
,
y
v
)
,
(
u
x
y
x
)
,
(
u
1
y
3
), with y
k
≠
y
v, if φ is an isomorphic output function between the set of markings and the set of output symbols, then the net that generates the sequence is nondeterministic because input symbols u
1 can be followed by two different output symbols, y
3 and y
x. One of the consequences of a net nondeterministic is that it generates event sequences that are not part of the system language. The generation of event strings not included in the system language must be avoided if the generator is going to be used as a diagnosis model. The Proposition 10 proof that a st-IPN from s is deterministic.Proposition 10.
Let stQ be a st-IPN defined as in Definition9. If φ is isomorphic, then stQ is deterministic.Proof.
Lets be the sequence described in the previous paragraph. Let us split the symbol y
x into two y
x
′ and y
x
′′; s
=
(
u
k
y
k
)
,
(
u
x
y
x
′
)
,
(
u
1
y
1
)
,
…
,
(
u
v
y
v
)
,
(
u
x
y
x
′′
)
,
(
u
1
y
3
); the differential of output symbols in y
x
′ is d
y
x
′
=
y
x
′
-
y
k and in y
x
′′ is d
y
x
′′
=
y
x
′′
-
y
v; as y
k
≠
y
v then d
y
x
′
≠
d
y
x
′′; therefore, the output function is different in the two states, thus eliminating the nondeterminism and increasing the number of states. So, φ is isomorphic between the set of markings and the set of output symbols y
j
/
d
y
j.The inclusion ofd
y in the model allows the computing of a maximum number of states.Definition 11 (maximum number of states,Q
max
⁡).
The system state is determined by the output symbols and their historical behavior; therefore, the maximum number of identifiable states is related to these output signals; thus(6)
Q
max
⁡
=
2
n
×
3
n
,
where n is the number of output symbols.For example in a system with only one binary sensor,Q
max
⁡
=
|
2
|
1
×
|
3
|
1
=
6; in a system with two binary sensors, Q
max
⁡
=
|
2
|
2
×
|
3
|
2
=
36.Proposition 12.
Let stQ be a st-IPN andL
(
s
t
Q
) the language generated by stQ and let s
=
ω
i
⋯
ω
k at times τ
i
,
…
,
τ
k, (ω
i
=
u
s
y
j) be an event sequence. If s
∈
L
(
s
t
Q
) and φ
(
M
i
)
=
φ
(
M
k
) then s
*
∈
L
(
s
t
Q
).Proof.
Because a st-IPN is deterministic (see Proposition10), if φ
(
M
i
)
=
φ
(
M
k
) then M
i
=
M
k so s can be generated infinitely.Proposition 13.
Lets
t
Q
1, s
t
Q
2 be st-IPNs, with incidence matrices I
1 and I
2 and initial markings M
0
1 and M
0
2, and let L
(
s
t
Q
1
), L
(
s
t
Q
2
) be the language generated by s
t
Q
1 and s
t
Q
2, respectively, with φ
1
(
M
)
=
φ
2
(
M
) and M
0
1
=
M
0
2. L
(
s
t
Q
1
)
=
L
(
s
t
Q
2
) if I
1
=
I
2.Proof.
The system evolves the following PN state equation:(7)
M
k
+
1
=
M
k
+
I
·
σ
k
,
y
k
/
d
y
k
=
φ
(
M
k
)
.
Let us suppose thatL
(
st
Q
1
)
=
L
(
st
Q
2
)
=
L
(
st
Q
) but I
1
≠
I
2.
Let us consider an event sequences
=
ω
0
,
ω
1
,
…
,
ω
k
∈
L
(
s
t
Q
) at times τ
0
≤
τ
1
≤
⋯
≤
τ
k that is generated by a firing sequence σ
=
t
r
1
t
r
2
⋯
t
r
k.
IfI
1
≠
I
2 then ∃
k
>
0
∣
M
0
1
→
t
r
1
M
1
1
→
t
r
2
⋯
→
t
r
k
M
k
1;  M
0
2
→
t
r
1
M
1
2
→
t
r
2
⋯
→
t
r
k
M
k
2, for each st-IPN, respectively, and M
i
1
=
M
i
2 but, M
k
1
≠
M
k
2. As φ is isomorphic then φ
(
M
k
1
)
≠
φ
(
M
k
2
).
AsL
(
st
Q
1
)
=
L
(
st
Q
2
) then L
out
(
st
Q
1
)
=
L
out
(
st
Q
2
).
IfL
out
(
st
Q
1
)
=
{
φ
(
M
0
)
,
φ
(
M
1
1
)
,
…
,
φ
(
M
k
1
)
} and L
out
(
st
Q
2
)
=
{
φ
(
M
0
)
,
φ
(
M
1
2
)
,
…
,
φ
(
M
k
2
)
} by (2) and (3) respectively.
Thenφ
(
M
0
1
)
=
φ
(
M
0
2
)
⋯
φ
(
M
k
1
)
=
φ
(
M
k
2
).
ThereforeM
k
1
=
M
k
2. Whereof I
1
=
I
2, which contradicts the initial condition.It is concluded that the st-IPN that generates a language is unique.Proposition 14.
Letφ
:
R
(
N
,
M
0
)
→
Y
/
d
Y be an output function and let s
∈
L
(
s
t
Q
), s
=
ω
i
⋯
ω
k be a sequence that models a cycle (
φ
(
M
i
)
=
φ
(
M
k
)
); ∑
i
k
‍
d
y
j
=
0, for each, j
=
1
,
…
,
n where n is the number of sensors.Proof.
The system evolves the following st-IPN state. Equation (7) is as follows
s
=
{
ω
i
⋯
ω
k
}
=
{
λ
(
t
r
i
)
φ
(
M
i
)
⋯
λ
(
t
r
k
)
φ
(
M
k
)
} observed at times τ
i
,
⋯
τ
k; then L
out
(
st
Q
)
=
{
φ
(
M
i
)
,
…
,
φ
(
M
k
)
} by (3), that is, L
out
(
stQ
)
=
{
y
i
/
d
y
i
,
…
,
y
k
/
d
y
k
}.
In compliance with the condition that in a cycleφ
(
M
i
)
=
φ
(
M
k
), (
i
≠
k
), the behavior of each output signal can be as follows. (i) It does not change; then, the value of d
y
j is always zero during the cycle; therefore ∑
i
k
‍
d
y
j
=
0; (ii) it changes; therefore the value of φ
(
M
i
) can be 1 or 0, if it starts in 1; the value along the cycle will be 1
→
0
→
1; therefore, d
y
j
:
0
→
-
1
→
1
:
∑
1
3
d
y
j
=
0. If it starts in 0, the value along the cycle will be 0
→
1
→
0; therefore, d
y
j
:
0
→
1
→
-
1
:
∑
1
3
d
y
j
=
0. That is to say, after 2
n
+
1 steps (n: number of outputs whose value has changed), the output values must return at their initial values when reaching M
k.According to their definition st-IPNs are an extension of PNs which include input and output signals in places and transitions (IPNs) and stochastic firing times for each transition (st-IPNs). The link with I/O signals and the capacity of including stochastic time variations make st-IPNs a powerful tool to model real systems.


## 3.1. Properties

Given an I/O event sequences, where s
=
(
u
k
y
k
)
,
(
u
x
,
y
x
)
,
(
u
1
,
y
1
)
,
…
,
(
u
v
,
y
v
)
,
(
u
x
y
x
)
,
(
u
1
y
3
), with y
k
≠
y
v, if φ is an isomorphic output function between the set of markings and the set of output symbols, then the net that generates the sequence is nondeterministic because input symbols u
1 can be followed by two different output symbols, y
3 and y
x. One of the consequences of a net nondeterministic is that it generates event sequences that are not part of the system language. The generation of event strings not included in the system language must be avoided if the generator is going to be used as a diagnosis model. The Proposition 10 proof that a st-IPN from s is deterministic.Proposition 10.
Let stQ be a st-IPN defined as in Definition9. If φ is isomorphic, then stQ is deterministic.Proof.
Lets be the sequence described in the previous paragraph. Let us split the symbol y
x into two y
x
′ and y
x
′′; s
=
(
u
k
y
k
)
,
(
u
x
y
x
′
)
,
(
u
1
y
1
)
,
…
,
(
u
v
y
v
)
,
(
u
x
y
x
′′
)
,
(
u
1
y
3
); the differential of output symbols in y
x
′ is d
y
x
′
=
y
x
′
-
y
k and in y
x
′′ is d
y
x
′′
=
y
x
′′
-
y
v; as y
k
≠
y
v then d
y
x
′
≠
d
y
x
′′; therefore, the output function is different in the two states, thus eliminating the nondeterminism and increasing the number of states. So, φ is isomorphic between the set of markings and the set of output symbols y
j
/
d
y
j.The inclusion ofd
y in the model allows the computing of a maximum number of states.Definition 11 (maximum number of states,Q
max
⁡).
The system state is determined by the output symbols and their historical behavior; therefore, the maximum number of identifiable states is related to these output signals; thus(6)
Q
max
⁡
=
2
n
×
3
n
,
where n is the number of output symbols.For example in a system with only one binary sensor,Q
max
⁡
=
|
2
|
1
×
|
3
|
1
=
6; in a system with two binary sensors, Q
max
⁡
=
|
2
|
2
×
|
3
|
2
=
36.Proposition 12.
Let stQ be a st-IPN andL
(
s
t
Q
) the language generated by stQ and let s
=
ω
i
⋯
ω
k at times τ
i
,
…
,
τ
k, (ω
i
=
u
s
y
j) be an event sequence. If s
∈
L
(
s
t
Q
) and φ
(
M
i
)
=
φ
(
M
k
) then s
*
∈
L
(
s
t
Q
).Proof.
Because a st-IPN is deterministic (see Proposition10), if φ
(
M
i
)
=
φ
(
M
k
) then M
i
=
M
k so s can be generated infinitely.Proposition 13.
Lets
t
Q
1, s
t
Q
2 be st-IPNs, with incidence matrices I
1 and I
2 and initial markings M
0
1 and M
0
2, and let L
(
s
t
Q
1
), L
(
s
t
Q
2
) be the language generated by s
t
Q
1 and s
t
Q
2, respectively, with φ
1
(
M
)
=
φ
2
(
M
) and M
0
1
=
M
0
2. L
(
s
t
Q
1
)
=
L
(
s
t
Q
2
) if I
1
=
I
2.Proof.
The system evolves the following PN state equation:(7)
M
k
+
1
=
M
k
+
I
·
σ
k
,
y
k
/
d
y
k
=
φ
(
M
k
)
.
Let us suppose thatL
(
st
Q
1
)
=
L
(
st
Q
2
)
=
L
(
st
Q
) but I
1
≠
I
2.
Let us consider an event sequences
=
ω
0
,
ω
1
,
…
,
ω
k
∈
L
(
s
t
Q
) at times τ
0
≤
τ
1
≤
⋯
≤
τ
k that is generated by a firing sequence σ
=
t
r
1
t
r
2
⋯
t
r
k.
IfI
1
≠
I
2 then ∃
k
>
0
∣
M
0
1
→
t
r
1
M
1
1
→
t
r
2
⋯
→
t
r
k
M
k
1;  M
0
2
→
t
r
1
M
1
2
→
t
r
2
⋯
→
t
r
k
M
k
2, for each st-IPN, respectively, and M
i
1
=
M
i
2 but, M
k
1
≠
M
k
2. As φ is isomorphic then φ
(
M
k
1
)
≠
φ
(
M
k
2
).
AsL
(
st
Q
1
)
=
L
(
st
Q
2
) then L
out
(
st
Q
1
)
=
L
out
(
st
Q
2
).
IfL
out
(
st
Q
1
)
=
{
φ
(
M
0
)
,
φ
(
M
1
1
)
,
…
,
φ
(
M
k
1
)
} and L
out
(
st
Q
2
)
=
{
φ
(
M
0
)
,
φ
(
M
1
2
)
,
…
,
φ
(
M
k
2
)
} by (2) and (3) respectively.
Thenφ
(
M
0
1
)
=
φ
(
M
0
2
)
⋯
φ
(
M
k
1
)
=
φ
(
M
k
2
).
ThereforeM
k
1
=
M
k
2. Whereof I
1
=
I
2, which contradicts the initial condition.It is concluded that the st-IPN that generates a language is unique.Proposition 14.
Letφ
:
R
(
N
,
M
0
)
→
Y
/
d
Y be an output function and let s
∈
L
(
s
t
Q
), s
=
ω
i
⋯
ω
k be a sequence that models a cycle (
φ
(
M
i
)
=
φ
(
M
k
)
); ∑
i
k
‍
d
y
j
=
0, for each, j
=
1
,
…
,
n where n is the number of sensors.Proof.
The system evolves the following st-IPN state. Equation (7) is as follows
s
=
{
ω
i
⋯
ω
k
}
=
{
λ
(
t
r
i
)
φ
(
M
i
)
⋯
λ
(
t
r
k
)
φ
(
M
k
)
} observed at times τ
i
,
⋯
τ
k; then L
out
(
st
Q
)
=
{
φ
(
M
i
)
,
…
,
φ
(
M
k
)
} by (3), that is, L
out
(
stQ
)
=
{
y
i
/
d
y
i
,
…
,
y
k
/
d
y
k
}.
In compliance with the condition that in a cycleφ
(
M
i
)
=
φ
(
M
k
), (
i
≠
k
), the behavior of each output signal can be as follows. (i) It does not change; then, the value of d
y
j is always zero during the cycle; therefore ∑
i
k
‍
d
y
j
=
0; (ii) it changes; therefore the value of φ
(
M
i
) can be 1 or 0, if it starts in 1; the value along the cycle will be 1
→
0
→
1; therefore, d
y
j
:
0
→
-
1
→
1
:
∑
1
3
d
y
j
=
0. If it starts in 0, the value along the cycle will be 0
→
1
→
0; therefore, d
y
j
:
0
→
1
→
-
1
:
∑
1
3
d
y
j
=
0. That is to say, after 2
n
+
1 steps (n: number of outputs whose value has changed), the output values must return at their initial values when reaching M
k.According to their definition st-IPNs are an extension of PNs which include input and output signals in places and transitions (IPNs) and stochastic firing times for each transition (st-IPNs). The link with I/O signals and the capacity of including stochastic time variations make st-IPNs a powerful tool to model real systems.


## 4. DES Identification Method

### 4.1. System to Identify

The generation of internal and external events in a timeline defines the behavior of the system (see Figure1). A set of external events defines an operation mode that affects the controller and an internal event is the concatenation of control commands and sensor readings in at time instant.Figure 1
Event Generator.The system consists of the closed loop connection of a dynamic system (plant) and a control law (controller). Once the operation mode is defined (by the external events), the controller executes a control strategy by generating a sequence of control commands. This sequence input gets into the plant and activates the actuators. The system reacts and generates a sensor readings sequence (Figure1). Therefore the behavior of the system can be described in terms of event sequences.During a system evolution like a production cycle, it is possible to get information of the system state (by analyzing these sequences), with the language theory ([1]). Each internal event is a letter of the alphabet and a letter sequence is a word that models the system performance. Therefore, the system can be described as a regular language generator.


#### 4.1.1. Definition of a Subsystem

To decrement the complexity of the model, the system is split into subsystems. A subsystem is a part of a system which has a particular behavior. The division into subsystems is carried out according to physical or functional criteria, because the system model to identify is unknown and is not possible to define the subsystems in other ways.For each subsystem the inputs will be the control commands and the outputs will be the sensor readings. Control commands can be classified as global or local. A control command is global when it is applied to more than one subsystem and it is local when it is applied only to one subsystem. Therefore the control commands set isCc
=
C
c
g
∪
C
c
l, where C
c
g
=
{
c
c
1
,
…
,
c
c
m
g
} and m
g is the number of global control commands; C
c
l
=
∪
c
c
l
,
m
l; l
=
1
⋯
c, c is the index of the subsystem and m
l is the number of local control commands in subsystem l.Each sensor reading is assigned to a subsystem, so the set of sensor readings will beSr
=
∪
s
r
l
,
n
l, where n
l is the number of sensors in subsystem l and l
=
1
⋯
c.


#### 4.1.2. Restrictions over the System

The system has the following restrictions.(i)
The system is closed loop controlled and its working is cyclic. Moreover, each subsystem can only be in one state at a time.
(ii)
The exchanged signals between the system and the controller are discrete with only two possible values (binary coding).
(iii)
Its behavior is defined by the generation of internal and external events in a timeline.
(iv)
An external event affects the controller; an internal event is the concatenation of control commands and sensor readings at time instant. An external event sequence is a timed sequence which generates a system operation mode.
(v)
An internal event can only be generated by a subsystem at a time.


#### 4.1.3. System Operation

Given an operation mode, the controller executes a control strategy then a timed internal event sequence is generated; that is, at each time the controller generates a set of control commandsu
s
=
{
c
c
1
,
…
,
c
c
m
g
,
c
c
l
,
1
,
…
,
c
c
l
,
m
l
}. This set is the input set to system which changes its state and generates an output set {
y
j
=
s
r
l
,
1
,
…
,
s
r
l
,
n
l
} containing sensor readings. u
s
∈
U
;
U
=
{
u
0
,
u
1
,
…
,
u
|
2
(
m
g
+
m
)
|
-
1
} and y
j
∈
Y; Y
=
{
y
0
,
y
1
,
…
,
y
|
2
n
|
-
1
}.(a) Event Generator. It is a procedure that concatenates the I/O symbols at time τ
i when any signal changes (control command or sensor reading) from τ
i
-
1 to τ
i and it generates an event as ω
i
=
(
u
s
y
j
)
τ
i.Applying this concept to system defined in definition of Section4.1, an event in a subsystem l will be noted with the subscript l, so an event in a subsystem l is noted as ω
l
i. Consider ω
l
i
=
(
u
l
,
s
y
l
,
j
)
τ
i; u
l
,
s
∈
U
l; U
l
=
{
u
l
,
0
,
u
l
,
1
,
…
,
u
l
,
|
2
(
m
g
+
m
l
)
|
-
1
} and y
l
,
j
∈
Y
l; Y
l
=
{
y
l
,
0
,
y
l
,
1
,
…
,
y
l
,
|
2
n
l
|
-
1
} (see Figure 1).Note that when there are changes in control commands or sensor readings shared by over one subsystem, the event is generated in all the subsystems involved.


### 4.2. Identification Process

This section presents the identification method of the DES presented in Section4.1.Problem 15.
Given an event sequence of sizee, ω
0
ω
1
⋯
ω
e, generated from generator defined in Section 4.1.3(a) in a system defined as in Section 4.1, find the st-IPN that generates the same sequence.The first step in the identification process will be the division of the system into subsystems.Each subsystem will be identified as a st-IPN. For this purpose the identification process requires monitoring the signals exchanged between the system and the controller (I/O signals). These signals enter the event generator, which concatenates the signals and generates an internal event.The event arrives to the identifier, which continuously builds the st-IPN which is able to generate the same event, in the same sequence and at the same time.


### 4.3. Identification Algorithm

The identification algorithm is shown in Figure2. First, the system to identify has to be split into subsystems. Then, the initial conditions must be set, which consist of the initial event and the initial state. Let us assume that the system is split into c subsystems, so each subsystem will be noted with the index l  (
l
=
1
⋯
c
).Figure 2
Identification process.The starting event for each subsystem isω
l
0
=
(
u
l
,
s
y
l
,
j
)
τ
0, where u
l
,
s, y
l
,
j stand for the starting values of control commands and sensor readings, respectively, l
=
1
⋯
c at time τ
0. Therefore each subsystem starts with a st-IPN with one place. The inputs and output functions will be φ
l
(
M
l
,
1
)
=
y
l
,
j
/
0
→, and λ
l
(
t
r
l
,
0
)
=
u
l
,
s
·
t
l
,
0
0 and t
l
,
0
0
=
0 is the initial value of the timer; that is, the subsystem l starts without transitions.Following the establishment of an operation modeo
i  (o
i
∈
OM), the event detection procedure generates events when any change happens in the I/O signals. It reads the input symbol and waits for the sensor setting. The next step is checking if there has been a change in one of the symbols of the I/O pair, in order to generate an event in that case.The st-IPN identification algorithm starts with a new event (see Figure3); then it compares the event with the previous one in order to classify it as a change in an input, in an output, or in both.Figure 3
Algorithm1 flowchart.Figure 4
Update ofPr
e
l; Pos
t
l; φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
).The identification algorithm (Algorithm1) follows the flow diagram presented in Figure 3. It identifies a change in a subsystem state when there is a difference between y
l
,
j
/
d
y
l
,
j and the current output symbol in subsystem l. In this case, the system executes Algorithm 2, (Case 1). This algorithm creates new transitions and places when necessary and it also updates the current st-IPN marking.Algorithm 1:st-IPN Identification.
Inputs:
ω
l
i
=
(
u
l
,
s
y
l
,
j
)
τ
i; ω
l
i
-
1
=
(
u
l
,
s
y
l
,
j
)
τ
i
-
1;  φ
l
(
M
)
λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
); k
l; q
l.
Output
:
Pr
e
l
;
Pos
t
l
;
φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
).
Initial Conditions:
φ
l
(
M
)
=
{
φ
l
(
M
l
,
1
)
}; λ
l
(
tr
⁡
)
=
λ
l
(
t
r
l
,
0
); Pr
e
l
=
[
1
]; Pos
t
l
=
[
0
];
δ
o
i
(
t
r
l
,
q
l
)
=
0; k
l
=
1;
q
l
=
0
readu
l
,
s, y
l
,
j
(1)  If u
l
,
s
i
(
:
)
≠
u
l
,
s
i
-
1
(
:
) and y
l
,
j
i
(
:
)
≠
y
l
,
j
i
-
1
(
:
)
execute Algorithm 2 CASE =
1
(2)  else if u
l
,
s
i
(
:
)
=
u
l
,
s
i
-
1
(
:
) and y
l
,
j
i
(
:
)
≠
y
l
,
j
i
-
1
(
:
)
execute Algorithm 2 CASE =
1
(3)  else if u
l
,
s
i
(
:
)
≠
u
l
,
s
i
-
1
(
:
) and y
l
,
j
i
(
:
)
=
y
l
,
j
i
-
1
(
:
)
execute Algorithm 2 CASE =
2
end ifAlgorithm 2:Subroutine Case.
Inputs:
u
l
,
s; y
l
,
j; k
l; q
l; φ
l
(
M
l
,
k
l
); φ
l
(
M
); λ
l
(
tr
⁡
)
Outputs:
Pr
e
l; Pos
t
l; φ
l
(
M
l
,
k
l
); φ
l
(
M
); λ
l
(
tr
⁡
)
Case  1.
read(
l
)
k
l
′
=
k
l
+
1;
q
l
′
=
q
l
+
1;
u
l
,
s
=
{
c
c
1
,
…
,
c
c
m
g
,
c
c
l
,
1
,
…
,
c
c
l
,
m
l
};
y
l
,
j
=
{
s
r
l
,
1
,
…
,
s
r
l
,
n
l
};
(1) φ
l
(
M
l
,
k
l
′
)
=
y
l
,
j
i
/
(
y
l
,
j
i
-
y
l
,
j
i
-
1
)
=
y
l
,
j
i
/
d
y
l
,
j
(2) t
l
,
q
l
i
=
|
τ
i
|
-
|
τ
i
-
1
|
(3) λ
l
(
t
r
l
,
q
l
′
)
=
u
l
,
s
·
t
l
,
q
l
i
(4) Update Pr
e
l; Pos
t
l; φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
).
Case  2.
read(
l
)
k
l
′
=
k
l;
q
l
′
=
q
l
+
1;
u
l
,
s
=
{
c
c
1
,
…
,
c
c
m
g
,
c
c
l
,
1
,
…
,
c
c
l
,
m
l
};
(1) t
l
,
q
l
i
=
|
τ
i
|
-
|
τ
i
-
1
|
(2) λ
l
(
t
r
l
,
q
l
′
)
=
u
l
,
s
·
t
l
,
q
l
i
(3) Update Pr
e
l; Pos
t
l; φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
)
The updating ofPr
e
l; Pos
t
l; φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
) can be seen in Figure 4.Otherwise, a change only in the input symbol will involve a transition, so Algorithm2, (case 2) includes this new transition (if it does not exist) in the st-IPN and updates the current state of the st-IPN.


### 4.4. Including Time Information

This section explains how to exploit the time to solve the identification problem.Time that must elapse from the enabling of the transition until it fires is accumulated in time data arraysδ
o
i
(
t
r
l
,
q
l
)
=
{
t
l
,
q
l
1
⋯
t
l
,
q
l
k
}, where o
i
∈
OM, q
l, l stand for the indexes of the transition and subsystem, respectively, and k is the number of samples.The goal to monitoring the process data is finding a statistical model that describes statistical behavior of each transition; therefore, the system must be observed for long time to have enough data for the statistical analysis, until the process converges. The convergence criterion is based on finding a reliable estimate.The estimation error of population mean is the estimator we use to study the convergence of the method. It has denoted the maximal accepted difference between the population mean and the sample mean asd
o
p.Sample size determination is the act of choosing the number of times that the process to identify is observed. The sample size is increased until the process has been identified totally and has converged.The number of samples needed for fitting a distribution (n) can be computed as [36–38] n
=
(
s
t
α
/
2
)
2
×
S
2
/
d
2. Moreover, the significance level (α) can be defined as Prob
(
|
X
¯
-
μ
|
≥
d
×
μ
)
=
α,d being the difference between the population mean and the sample mean and S
2 is the sample quasi-variance. α is the risk of having an error larger than d
o
p. Generally α is set in 0.05 [39] and s
t
α
/
2 is the factor determining the length of a confidence interval of population mean.From to equation ofn, d is
(8)
d
=
(
s
t
α
/
2
)
×
S
nAlgorithm3 is executed each time a time array gets a new value, so its size has increased. It computes d and compares it with the defined upper limit (d
o
p). That is, where, if n
≤
30, s
t
α
/
2
=
t
n
-
1 is computed as a Student's t distribution and, if n
>
30, s
t
α
/
2
=
z
α
/
2 is computed as a normal distribution. Once d
o
p is reached, Algorithm 3 is no longer applied to this transition and operation mode, because its distribution can be identified with the available data. Moreover, no more data is included in the time vector.Algorithm 3:Stochastic Identification.
Input:
δ
o
i
(
t
r
l
,
q
l
)
=
{
t
l
,
q
l
1
,
…
,
t
l
,
q
l
k
} with k
≥
5, α, d
op,
Output:
n
l
,
q
l
forl
:
=
1 to c
forq
l
:
=
1 to |
q
l
|
(1) n
l
,
q
l
=
|
δ
o
i
(
t
r
l
,
q
l
)
|;
(2) compute X
-, S;
(3) if n
l
,
q
l
≤
30 compute st
=
t
n
-
1
(i)    else computest
=
z
α
/
2
end if
(4) d
=
(
s
t
α
/
2
)
×
S
/
n
l
,
q
l;
(i)     Ifd
≤
d
op
execute Algorithm4
(ii)   end if
end for
end forAlgorithm3 first determines if there is enough data to fit a distribution, once d
o
p is reached, that is, the size sample is sufficient, then it is necessary to find the probability density function (PDF) that fits the data. The methods of estimating the PDF fall into two main categories. One is parametric method that assumes the form of the PDF of the population which is known a priori and the collected process sample is used to determine the parameters of the assumed PDF and another category is nonparametric methods. In this procedure we analyze a set CD of specific continuous distributions known; CD
=
{
F
0
j
(
x
i
)
}. Among the most commonly used continuous distributions it includes the normal distribution N
(
μ
,
σ
2
), the exponential distribution Exp
(
λ
), and the uniform distribution U
(
a
,
b
)
⋯.Algorithm4 computes the distribution type and its parameters. Algorithm 4 uses the goodness-of-fit test (see [40]) to define the distribution type with a Kolmogorov-Smirnov test. First it computes the distribution parameters using the maximum likelihood method; second, it computes the p-value statistic as
(9)
p
-value
=
sup
⁡
1
≤
i
≤
n
⁡
|
F
^
n
(
x
i
)
-
F
0
(
x
i
)
|
,
where x
i is the ith observed value in the sample (whose values have previously been ordered from the lowest to the highest); F
^
n
(
x
i
) is an estimator of the probability of observing values less than or equal to x
i and F
0
(
x
i
) is the probability of observing values less than or equal to x
i from a specified distribution [41]; that is, F
0
(
x
i
)
∈
CD.Algorithm 4:Data fitting.
Input:
δ
o
i
(
t
r
l
,
q
l
)
=
{
t
l
,
q
l
1
,
…
,
t
l
,
q
l
k
}, (
n
l
,
q
l
), α
ct for contrast
test, CD
Output:
F
0
(
X
)
searchp-valu
e
α
ct in table of Kolmogorov-Smirnov.
forj
=
1
,
…
,
|
CD
|
(i)    Design goodness-of-fit test
H
0
:
F
0
(
X
)
~
F
0
j
(
x
i
);
H
1
:
F
0
(
X
)
≁
F
0
j
(
x
i
).
(ii)   Estimate parameters of F
0
j
(
X
).
(iii)  Apply Kolmogorov-Smirnov test
(a) Compute p-value =  su
p
1
≤
i
≤
n
|
F
^
n
(
x
i
)
-
F
0
j
(
x
i
)
|.
(iv)   If p-value
≤
p-valu
e
α
ct,
then F
0
=
F
0
j
(
X
); break
else j
=
j
+
1.
(v)     end if
end for


#### 4.4.1. Modelling Error

The proposed identification algorithm is a tool for identifying stochastic DES which estimates the probability distributions of transitions times. Because full times population cannot be observed, there will be a modelling error. As the sample mean is the estimator of a population mean, then the modelling error is related to the difference between value estimated and the true value of the mean. The standard error of the mean is the way to measure the modelling error. The standard error of the mean is the standard deviation of sample means over all possible samples (of a given size) drawn from the population. To measure it, the root-mean-square error (RMSE) is used, whereRMSE
=
S
/
n.


### 4.5. Global Language Reconstruction from to Language of the Subsystems

Our objective is to identify the language of global system. It is found from the language of its subsystem.A global system event is obtained by Timed Synchronized Splice so.Definition 16 (operation of timed synchronized splice).
Le LetQ be a system composed by c subsystems. Let ω
l
i with l
=
1
⋯
c be c events at time τ
i, where ω
l
i
=
(
u
l
,
s
y
l
,
j
)
τ
i. A global system event, at time τ
i, can be obtained as:
(10)
ω
i
=
ω
1
i
⊕
⋯
⊕
ω
c
i
where ω
1
i
⊕
⋯
⊕
ω
c
i
=
(
u
1
,
s
y
1
,
j
)
⊕
⋯
⊕
(
u
c
,
s
y
c
,
j
)
=
(
u
1
,
s
⊕
⋯
⊕
u
c
,
s
)
(
y
1
,
j
⊕
⋯
⊕
y
c
,
j
) and (
u
1
,
s
⊕
⋯
⊕
u
c
,
s
)
=
u
s
g where u
s
g is a binary representation of s
g, s
g stands for all input symbols and (
y
1
,
j
⊕
⋯
⊕
y
c
,
j
)
=
y
j
g where y
j
g is a binary representation of j
g, j
g stands for all output symbols.
Then, the global system language can be built from the sequence of synchronized events of its subsystem. Therefore, the global generated language at timesτ
0
≤
…
≤
τ
k is L
(
s
t
Q
)
=
ω
0
⋯
ω
k.Proposition 17.
Given a global systemQ composed by c subsystems, the global system language L
(
s
t
Q
) built by the temporal synchronization of the languages of its subsystems is equal to system language, L
(
s
t
Q
)
=
L
(
Q
).Proof.
LetQ be a complex system with c subsystems. Let L
(
Q
)
=
ω
0
ω
1
⋯
ω
e be an event sequence generated from generator defined in Section 4.1.3(a) and let L
(
s
t
Q
) be the global system language built from a sequence of synchronized events of its subsystems.
Lets
=
ω
0
ω
1
⋯
ω
e be an event sequence such that s
∈
L
(
Q
) and let s
1
=
ω
*
0
⋯
ω
*
e be the sequence of synchronized events of the L
(
s
t
Q
l
) with l
=
1
⋯
c.
Assumingω
e
≠
ω
*
e.
P
U
(
s
)
=
{
u
s
0
⋯
u
s
e
}, u
s
e
=
{
u
1
,
s
,
…
,
u
c
,
s
} and P
Y
(
s
)
=
{
y
j
0
⋯
y
j
e
}, as ω
l
i
=
(
u
l
,
s
y
l
,
j
) for l
=
1
⋯
c. ω
l
e
=
(
u
l
,
s
,
y
l
,
j
); ω
l
e
=
(
u
1
,
s
,
y
1
,
j
)
…
(
u
c
,
s
,
y
c
,
j
). Based on Definition 16
ω
*
e
=
ω
1
e
⊕
⋯
⊕
ω
c
e then ω
e
=
ω
*
e, which contradicts the initial condition.


#### 4.5.1. Synchronous Product of st-IPNs

To find the global system st-IPN we have proposed the operation of synchronous product of st-IPNs defined as follows.Definition 18 (synchronous product of st-IPNs).
Given a setst
Q of c st-IPNs, st
Q
=
{
st
Q
1
,
…
,
st
Q
c
} defined as (5), synchronous product of st
Q is the st-IPN defined as:
(11)
st
Q
s
=
∥
l
=
1
c
st
Q
l
,
st
Q
s
=
(
Q
s
,
Ω
s
,
δ
s
)
,
where Q
s
=
(
N
s
,
U
s
,
Y
s
,
λ
s
,
φ
s
). N
s
=
(
P
s
,
TR
s
,
Pre
,
Pos
,
M
0
) is an ordinary PN, with P
s
=
{
P
1
×
P
2
×
⋯
×
P
c
} set of places, TR
s
=
{
2
|
P
s
|
-
1
} set of system transitions, |
P
s
| is the length set of places, c number of subsystems, Pre
:
P
s
×
TR
s
→
Z
+, Pos
:
P
s
×
TR
s
→
Z
+
), and M
s
0
=
M
1
0
×
M
2
0
×
⋯
×
M
c
0 is the initial marking. U
s
=
{
U
1
∪
U
2
∪
⋯
U
c
} is the set of input to the system. Y
s
=
{
Y
1
∪
Y
2
∪
⋯
Y
c
} is the set of output to the system. λ
s
:
TR
s
→
U
s
·
δ
s (labeling function that assigns an input symbol and a timer density function to each transition) and φ
s is defined as φ
s
:
R
(
N
s
,
M
s
0
)
→
y
l
,
j
/
d
y
l
,
j; φ
s is isomorphic over y
l
,
j
/
d
y
l
,
j.
Ω
s
=
U
s
·
Y
s
:
=
{
ω
s
=
(
u
l
,
s
y
l
,
j
)
} is the system alphabet.
δ
s
:
=
TR
s
×
OM
→
f
(
t
TR
s
×
OM
) is a density function of transition firing time for each operation modes OM
=
{
o
1
,
o
2
,
…
}.In order to verify that the structure of a st-IPN solves Problem15, we define the conditions for a PN which is considered a deterministic generator and the conditions for a system to be considered deterministically identifiable.Definition 19 (α
-Generator).
LetU
·
Y be an alphabet and let L
(
Q
) be a language generated by alphabet; a PN is an α
-Generator for L
(
Q
) if given a set of inputs u
s
∈
P
U
:
(
U
·
Y
)
*
→
U
*, PN generates a set of outputs y
j such that the strings u
s
y
j
∈
L
(
Q
l
)
∀
u
s
∈
U with a probability greeter than 1
-
α.


#### 4.5.2. Assumptions of a System so that It Is a Deterministically Identifiable (DI) System

Definition19 enables us to set the assumptions of a system for it can be a DI system.(i)
LetU and Y be a set of I/O observed signals of system; if given a set of inputs u
s
∈
U associated with a time t, P
y
j
:
(
Y
)
→
y
j is always the same.
(ii)
Moreover, given two identical inputsu
s, but with different length of time and two different projections of outputs, the system can be considered DI, since length of time defines the mark to reach.Proposition 20.
LetL
(
Q
)
=
{
ω
0
ω
1
⋯
ω
k
} be a system observed language, at times τ
0
≤
τ
1
≤
⋯
≤
τ
k; if st-IPN is a PN obtained with proposed identification algorithm then st-IPN is a α
-
G
e
n
e
r
a
t
o
r of L
(
Q
).Proof.
A st-IPN is aα
-Generator of L
(
Q
) if ∀
s
∈
L
(
Q
)
,
s
∈
L
(
P
) and if ∀
s
∈
L
(
P
), s
∈
L
(
Q
).
LetP be a st-IPN obtained by proposed identification algorithm for L
(
Q
).
Assuming thats
s
1 is a string such that s
∈
L
(
Q
)
∧
L
(
P
) but s
1
∈
L
(
Q
)
∧
s
1
∉
L
(
P
), where s
=
ω
0
,
…
,
ω
k, then the postlanguage of s is given by L
(
Q
)
/
s
=
{
s
1
∈
(
U
·
Y
)
*
∣
s
s
1
∈
L
(
Q
)
}. Then given the event s
1 with s
1
=
ω
k
+
1
=
(
u
s
y
j
)
k
+
1 at time τ
k
+
1, applying the Algorithm 1 a new event generates a transition with λ
(
t
r
k
+
1
)
=
u
s
k
+
1
·
t
t
r
k
+
1 and the marking reached by t
r
k
+
1: M
k
→
t
r
k
+
1
M
k
+
1 will be φ
(
M
k
+
1
)
=
y
j
k
+
1
/
y
j
k
+
1
-
y
j
k and as u
s
k
+
1
·
y
j
k
+
1 are signals vectors observed at time τ
k
+
1, (based on description of event generator, Section 4.1.3(a)), then ω
k
+
1
=
(
u
s
y
j
)
k
+
1
∈
L
(
P
) then assumption is rejected.
Now, we assume thats
s
2 is a string such that s
∈
L
(
Q
)
∧
L
(
P
) but s
2
∉
L
(
Q
)
∧
s
2
∈
L
(
P
), where s
=
ω
0
,
…
,
ω
k. Then the postlanguage of s is given by L
(
P
)
/
s
=
{
s
2
∈
(
U
·
Y
)
*
∣
s
s
2
∈
L
(
P
)
}. Then given the event s
2 with s
2
=
ω
k
+
1
=
(
u
s
y
j
)
k
+
1 at time τ
k
+
1, the st-IPN evolves a state from to a transition with λ
(
t
r
k
+
1
)
=
u
s
k
+
1
·
t
t
r
k
+
1 and the marking reached by t
r
k
+
1: M
k
→
t
r
k
+
1
M
k
+
1 will be φ
(
M
k
+
1
)
=
y
j
k
+
1
/
y
j
k
+
1
-
y
j
k, where t
r
k
+
1 has not been observed and reaches states that have not been observed, but according to Algorithm 1 the construction of st-IPN is made based on reached state by the observed language, then ω
k
+
1
=
(
u
s
y
j
)
k
+
1
∉
L
(
P
) and then assumption is rejected and therefore Proposition 20 is proved.Moreover,L
(
Q
)
/
s
=
{
s
1
∈
(
U
·
Y
)
*
∣
s
s
1
∈
L
(
Q
)
} reaches the mark φ
(
M
k
+
1
) if Prob
(
φ
(
M
k
+
1
)
,
ω
k
+
1
/
φ
(
M
k
)
)
≧
(
1
-
α
)
∣
ω
k
+
1
∈
L
(
Q
) and if φ
(
M
k
+
1
)
=
φ
(
M
i
) for some i
=
1
⋯
k, then s
s
1 is a cycle (Proposition 12).Definition 21.
AL
(
Q
), where L
(
Q
)
=
{
s
∈
(
U
·
Y
)
*
:
Prob
(
s
∣
φ
(
M
0
)
)
≧
(
1
-
α
)
} is DI language if ∀
s
∈
L
(
Q
)
,
∧
∀
s
1
,
s
2
∈
L
(
Q
)
/
s, where s
=
ω
0
,
…
,
ω
k, such as P
u
s
:
(
s
s
1
)
=
P
u
s
:
(
s
s
2
) then Prob
(
P
y
j
:
(
s
s
1
)
=
P
y
j
:
(
s
s
2
)
)
≥
1
-
α if they started from the same state φ
(
M
k
).In other words, aL
(
Q
) is DI language, if from a state two equal inputs are given, the output symbol is always the same.Theorem 22.
A languageL
(
Q
) is DI language if and only if  ∃ an α
-
G
e
n
e
r
a
t
o
r for L
(
Q
).Proof.
Necessary condition: ifL
(
Q
) is a DI language, then ∃ an α
-Generator.
A deterministicα
-Generator for L
(
Q
) is a st-IPN. L
(
Q
) is a DI language, if α
-Generator is a st-IPN (see Proposition 20).
Sufficient condition: if∃ an α
-Generator then L
(
Q
) is a DI language.
Assume that theα
-Generator for L
(
Q
) is a st-IPN. Let L
(
P
) be the generated language by α
-Generator. Let s
=
ω
0
,
…
,
ω
k be a string such that L
(
P
)
=
{
s
∈
(
U
·
Y
)
*
:
Prob
(
s
∣
φ
(
M
0
)
)
≧
(
1
-
α
)
}. Then, given the events s
1 and s
2 such that s
1
,
s
2
∈
L
(
P
)
/
s with s
1
,
s
2
=
ω
k
+
1 with Prob
(
φ
(
M
k
+
1
)
,
ω
k
+
1
/
φ
(
M
k
)
)
≧
(
1
-
α
) if P
u
s
:
(
s
s
1
)
=
P
u
s
:
(
s
s
2
), in the event ω
k
+
1 then P
y
j
:
(
s
s
1
)
=
P
y
j
:
(
s
s
2
), based on Definition 21  L
(
P
) is a DI language and according to Proposition 13  L
(
P
)
=
L
(
Q
); therefore L
(
Q
) is a DI language.If a st-IPN is a deterministicα
-Generator for L
(
Q
), then st-IPN generates the same observed language; therefore Problem 15 is solved.


## 4.1. System to Identify

The generation of internal and external events in a timeline defines the behavior of the system (see Figure1). A set of external events defines an operation mode that affects the controller and an internal event is the concatenation of control commands and sensor readings in at time instant.Figure 1
Event Generator.The system consists of the closed loop connection of a dynamic system (plant) and a control law (controller). Once the operation mode is defined (by the external events), the controller executes a control strategy by generating a sequence of control commands. This sequence input gets into the plant and activates the actuators. The system reacts and generates a sensor readings sequence (Figure1). Therefore the behavior of the system can be described in terms of event sequences.During a system evolution like a production cycle, it is possible to get information of the system state (by analyzing these sequences), with the language theory ([1]). Each internal event is a letter of the alphabet and a letter sequence is a word that models the system performance. Therefore, the system can be described as a regular language generator.


### 4.1.1. Definition of a Subsystem

To decrement the complexity of the model, the system is split into subsystems. A subsystem is a part of a system which has a particular behavior. The division into subsystems is carried out according to physical or functional criteria, because the system model to identify is unknown and is not possible to define the subsystems in other ways.For each subsystem the inputs will be the control commands and the outputs will be the sensor readings. Control commands can be classified as global or local. A control command is global when it is applied to more than one subsystem and it is local when it is applied only to one subsystem. Therefore the control commands set isCc
=
C
c
g
∪
C
c
l, where C
c
g
=
{
c
c
1
,
…
,
c
c
m
g
} and m
g is the number of global control commands; C
c
l
=
∪
c
c
l
,
m
l; l
=
1
⋯
c, c is the index of the subsystem and m
l is the number of local control commands in subsystem l.Each sensor reading is assigned to a subsystem, so the set of sensor readings will beSr
=
∪
s
r
l
,
n
l, where n
l is the number of sensors in subsystem l and l
=
1
⋯
c.


### 4.1.2. Restrictions over the System

The system has the following restrictions.(i)
The system is closed loop controlled and its working is cyclic. Moreover, each subsystem can only be in one state at a time.
(ii)
The exchanged signals between the system and the controller are discrete with only two possible values (binary coding).
(iii)
Its behavior is defined by the generation of internal and external events in a timeline.
(iv)
An external event affects the controller; an internal event is the concatenation of control commands and sensor readings at time instant. An external event sequence is a timed sequence which generates a system operation mode.
(v)
An internal event can only be generated by a subsystem at a time.


### 4.1.3. System Operation

Given an operation mode, the controller executes a control strategy then a timed internal event sequence is generated; that is, at each time the controller generates a set of control commandsu
s
=
{
c
c
1
,
…
,
c
c
m
g
,
c
c
l
,
1
,
…
,
c
c
l
,
m
l
}. This set is the input set to system which changes its state and generates an output set {
y
j
=
s
r
l
,
1
,
…
,
s
r
l
,
n
l
} containing sensor readings. u
s
∈
U
;
U
=
{
u
0
,
u
1
,
…
,
u
|
2
(
m
g
+
m
)
|
-
1
} and y
j
∈
Y; Y
=
{
y
0
,
y
1
,
…
,
y
|
2
n
|
-
1
}.(a) Event Generator. It is a procedure that concatenates the I/O symbols at time τ
i when any signal changes (control command or sensor reading) from τ
i
-
1 to τ
i and it generates an event as ω
i
=
(
u
s
y
j
)
τ
i.Applying this concept to system defined in definition of Section4.1, an event in a subsystem l will be noted with the subscript l, so an event in a subsystem l is noted as ω
l
i. Consider ω
l
i
=
(
u
l
,
s
y
l
,
j
)
τ
i; u
l
,
s
∈
U
l; U
l
=
{
u
l
,
0
,
u
l
,
1
,
…
,
u
l
,
|
2
(
m
g
+
m
l
)
|
-
1
} and y
l
,
j
∈
Y
l; Y
l
=
{
y
l
,
0
,
y
l
,
1
,
…
,
y
l
,
|
2
n
l
|
-
1
} (see Figure 1).Note that when there are changes in control commands or sensor readings shared by over one subsystem, the event is generated in all the subsystems involved.


## 4.1.1. Definition of a Subsystem

To decrement the complexity of the model, the system is split into subsystems. A subsystem is a part of a system which has a particular behavior. The division into subsystems is carried out according to physical or functional criteria, because the system model to identify is unknown and is not possible to define the subsystems in other ways.For each subsystem the inputs will be the control commands and the outputs will be the sensor readings. Control commands can be classified as global or local. A control command is global when it is applied to more than one subsystem and it is local when it is applied only to one subsystem. Therefore the control commands set isCc
=
C
c
g
∪
C
c
l, where C
c
g
=
{
c
c
1
,
…
,
c
c
m
g
} and m
g is the number of global control commands; C
c
l
=
∪
c
c
l
,
m
l; l
=
1
⋯
c, c is the index of the subsystem and m
l is the number of local control commands in subsystem l.Each sensor reading is assigned to a subsystem, so the set of sensor readings will beSr
=
∪
s
r
l
,
n
l, where n
l is the number of sensors in subsystem l and l
=
1
⋯
c.


## 4.1.2. Restrictions over the System

The system has the following restrictions.(i)
The system is closed loop controlled and its working is cyclic. Moreover, each subsystem can only be in one state at a time.
(ii)
The exchanged signals between the system and the controller are discrete with only two possible values (binary coding).
(iii)
Its behavior is defined by the generation of internal and external events in a timeline.
(iv)
An external event affects the controller; an internal event is the concatenation of control commands and sensor readings at time instant. An external event sequence is a timed sequence which generates a system operation mode.
(v)
An internal event can only be generated by a subsystem at a time.


## 4.1.3. System Operation

Given an operation mode, the controller executes a control strategy then a timed internal event sequence is generated; that is, at each time the controller generates a set of control commandsu
s
=
{
c
c
1
,
…
,
c
c
m
g
,
c
c
l
,
1
,
…
,
c
c
l
,
m
l
}. This set is the input set to system which changes its state and generates an output set {
y
j
=
s
r
l
,
1
,
…
,
s
r
l
,
n
l
} containing sensor readings. u
s
∈
U
;
U
=
{
u
0
,
u
1
,
…
,
u
|
2
(
m
g
+
m
)
|
-
1
} and y
j
∈
Y; Y
=
{
y
0
,
y
1
,
…
,
y
|
2
n
|
-
1
}.(a) Event Generator. It is a procedure that concatenates the I/O symbols at time τ
i when any signal changes (control command or sensor reading) from τ
i
-
1 to τ
i and it generates an event as ω
i
=
(
u
s
y
j
)
τ
i.Applying this concept to system defined in definition of Section4.1, an event in a subsystem l will be noted with the subscript l, so an event in a subsystem l is noted as ω
l
i. Consider ω
l
i
=
(
u
l
,
s
y
l
,
j
)
τ
i; u
l
,
s
∈
U
l; U
l
=
{
u
l
,
0
,
u
l
,
1
,
…
,
u
l
,
|
2
(
m
g
+
m
l
)
|
-
1
} and y
l
,
j
∈
Y
l; Y
l
=
{
y
l
,
0
,
y
l
,
1
,
…
,
y
l
,
|
2
n
l
|
-
1
} (see Figure 1).Note that when there are changes in control commands or sensor readings shared by over one subsystem, the event is generated in all the subsystems involved.


## 4.2. Identification Process

This section presents the identification method of the DES presented in Section4.1.Problem 15.
Given an event sequence of sizee, ω
0
ω
1
⋯
ω
e, generated from generator defined in Section 4.1.3(a) in a system defined as in Section 4.1, find the st-IPN that generates the same sequence.The first step in the identification process will be the division of the system into subsystems.Each subsystem will be identified as a st-IPN. For this purpose the identification process requires monitoring the signals exchanged between the system and the controller (I/O signals). These signals enter the event generator, which concatenates the signals and generates an internal event.The event arrives to the identifier, which continuously builds the st-IPN which is able to generate the same event, in the same sequence and at the same time.


## 4.3. Identification Algorithm

The identification algorithm is shown in Figure2. First, the system to identify has to be split into subsystems. Then, the initial conditions must be set, which consist of the initial event and the initial state. Let us assume that the system is split into c subsystems, so each subsystem will be noted with the index l  (
l
=
1
⋯
c
).Figure 2
Identification process.The starting event for each subsystem isω
l
0
=
(
u
l
,
s
y
l
,
j
)
τ
0, where u
l
,
s, y
l
,
j stand for the starting values of control commands and sensor readings, respectively, l
=
1
⋯
c at time τ
0. Therefore each subsystem starts with a st-IPN with one place. The inputs and output functions will be φ
l
(
M
l
,
1
)
=
y
l
,
j
/
0
→, and λ
l
(
t
r
l
,
0
)
=
u
l
,
s
·
t
l
,
0
0 and t
l
,
0
0
=
0 is the initial value of the timer; that is, the subsystem l starts without transitions.Following the establishment of an operation modeo
i  (o
i
∈
OM), the event detection procedure generates events when any change happens in the I/O signals. It reads the input symbol and waits for the sensor setting. The next step is checking if there has been a change in one of the symbols of the I/O pair, in order to generate an event in that case.The st-IPN identification algorithm starts with a new event (see Figure3); then it compares the event with the previous one in order to classify it as a change in an input, in an output, or in both.Figure 3
Algorithm1 flowchart.Figure 4
Update ofPr
e
l; Pos
t
l; φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
).The identification algorithm (Algorithm1) follows the flow diagram presented in Figure 3. It identifies a change in a subsystem state when there is a difference between y
l
,
j
/
d
y
l
,
j and the current output symbol in subsystem l. In this case, the system executes Algorithm 2, (Case 1). This algorithm creates new transitions and places when necessary and it also updates the current st-IPN marking.Algorithm 1:st-IPN Identification.
Inputs:
ω
l
i
=
(
u
l
,
s
y
l
,
j
)
τ
i; ω
l
i
-
1
=
(
u
l
,
s
y
l
,
j
)
τ
i
-
1;  φ
l
(
M
)
λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
); k
l; q
l.
Output
:
Pr
e
l
;
Pos
t
l
;
φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
).
Initial Conditions:
φ
l
(
M
)
=
{
φ
l
(
M
l
,
1
)
}; λ
l
(
tr
⁡
)
=
λ
l
(
t
r
l
,
0
); Pr
e
l
=
[
1
]; Pos
t
l
=
[
0
];
δ
o
i
(
t
r
l
,
q
l
)
=
0; k
l
=
1;
q
l
=
0
readu
l
,
s, y
l
,
j
(1)  If u
l
,
s
i
(
:
)
≠
u
l
,
s
i
-
1
(
:
) and y
l
,
j
i
(
:
)
≠
y
l
,
j
i
-
1
(
:
)
execute Algorithm 2 CASE =
1
(2)  else if u
l
,
s
i
(
:
)
=
u
l
,
s
i
-
1
(
:
) and y
l
,
j
i
(
:
)
≠
y
l
,
j
i
-
1
(
:
)
execute Algorithm 2 CASE =
1
(3)  else if u
l
,
s
i
(
:
)
≠
u
l
,
s
i
-
1
(
:
) and y
l
,
j
i
(
:
)
=
y
l
,
j
i
-
1
(
:
)
execute Algorithm 2 CASE =
2
end ifAlgorithm 2:Subroutine Case.
Inputs:
u
l
,
s; y
l
,
j; k
l; q
l; φ
l
(
M
l
,
k
l
); φ
l
(
M
); λ
l
(
tr
⁡
)
Outputs:
Pr
e
l; Pos
t
l; φ
l
(
M
l
,
k
l
); φ
l
(
M
); λ
l
(
tr
⁡
)
Case  1.
read(
l
)
k
l
′
=
k
l
+
1;
q
l
′
=
q
l
+
1;
u
l
,
s
=
{
c
c
1
,
…
,
c
c
m
g
,
c
c
l
,
1
,
…
,
c
c
l
,
m
l
};
y
l
,
j
=
{
s
r
l
,
1
,
…
,
s
r
l
,
n
l
};
(1) φ
l
(
M
l
,
k
l
′
)
=
y
l
,
j
i
/
(
y
l
,
j
i
-
y
l
,
j
i
-
1
)
=
y
l
,
j
i
/
d
y
l
,
j
(2) t
l
,
q
l
i
=
|
τ
i
|
-
|
τ
i
-
1
|
(3) λ
l
(
t
r
l
,
q
l
′
)
=
u
l
,
s
·
t
l
,
q
l
i
(4) Update Pr
e
l; Pos
t
l; φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
).
Case  2.
read(
l
)
k
l
′
=
k
l;
q
l
′
=
q
l
+
1;
u
l
,
s
=
{
c
c
1
,
…
,
c
c
m
g
,
c
c
l
,
1
,
…
,
c
c
l
,
m
l
};
(1) t
l
,
q
l
i
=
|
τ
i
|
-
|
τ
i
-
1
|
(2) λ
l
(
t
r
l
,
q
l
′
)
=
u
l
,
s
·
t
l
,
q
l
i
(3) Update Pr
e
l; Pos
t
l; φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
)
The updating ofPr
e
l; Pos
t
l; φ
l
(
M
); λ
l
(
tr
⁡
); δ
o
i
(
t
r
l
,
q
l
) can be seen in Figure 4.Otherwise, a change only in the input symbol will involve a transition, so Algorithm2, (case 2) includes this new transition (if it does not exist) in the st-IPN and updates the current state of the st-IPN.


## 4.4. Including Time Information

This section explains how to exploit the time to solve the identification problem.Time that must elapse from the enabling of the transition until it fires is accumulated in time data arraysδ
o
i
(
t
r
l
,
q
l
)
=
{
t
l
,
q
l
1
⋯
t
l
,
q
l
k
}, where o
i
∈
OM, q
l, l stand for the indexes of the transition and subsystem, respectively, and k is the number of samples.The goal to monitoring the process data is finding a statistical model that describes statistical behavior of each transition; therefore, the system must be observed for long time to have enough data for the statistical analysis, until the process converges. The convergence criterion is based on finding a reliable estimate.The estimation error of population mean is the estimator we use to study the convergence of the method. It has denoted the maximal accepted difference between the population mean and the sample mean asd
o
p.Sample size determination is the act of choosing the number of times that the process to identify is observed. The sample size is increased until the process has been identified totally and has converged.The number of samples needed for fitting a distribution (n) can be computed as [36–38] n
=
(
s
t
α
/
2
)
2
×
S
2
/
d
2. Moreover, the significance level (α) can be defined as Prob
(
|
X
¯
-
μ
|
≥
d
×
μ
)
=
α,d being the difference between the population mean and the sample mean and S
2 is the sample quasi-variance. α is the risk of having an error larger than d
o
p. Generally α is set in 0.05 [39] and s
t
α
/
2 is the factor determining the length of a confidence interval of population mean.From to equation ofn, d is
(8)
d
=
(
s
t
α
/
2
)
×
S
nAlgorithm3 is executed each time a time array gets a new value, so its size has increased. It computes d and compares it with the defined upper limit (d
o
p). That is, where, if n
≤
30, s
t
α
/
2
=
t
n
-
1 is computed as a Student's t distribution and, if n
>
30, s
t
α
/
2
=
z
α
/
2 is computed as a normal distribution. Once d
o
p is reached, Algorithm 3 is no longer applied to this transition and operation mode, because its distribution can be identified with the available data. Moreover, no more data is included in the time vector.Algorithm 3:Stochastic Identification.
Input:
δ
o
i
(
t
r
l
,
q
l
)
=
{
t
l
,
q
l
1
,
…
,
t
l
,
q
l
k
} with k
≥
5, α, d
op,
Output:
n
l
,
q
l
forl
:
=
1 to c
forq
l
:
=
1 to |
q
l
|
(1) n
l
,
q
l
=
|
δ
o
i
(
t
r
l
,
q
l
)
|;
(2) compute X
-, S;
(3) if n
l
,
q
l
≤
30 compute st
=
t
n
-
1
(i)    else computest
=
z
α
/
2
end if
(4) d
=
(
s
t
α
/
2
)
×
S
/
n
l
,
q
l;
(i)     Ifd
≤
d
op
execute Algorithm4
(ii)   end if
end for
end forAlgorithm3 first determines if there is enough data to fit a distribution, once d
o
p is reached, that is, the size sample is sufficient, then it is necessary to find the probability density function (PDF) that fits the data. The methods of estimating the PDF fall into two main categories. One is parametric method that assumes the form of the PDF of the population which is known a priori and the collected process sample is used to determine the parameters of the assumed PDF and another category is nonparametric methods. In this procedure we analyze a set CD of specific continuous distributions known; CD
=
{
F
0
j
(
x
i
)
}. Among the most commonly used continuous distributions it includes the normal distribution N
(
μ
,
σ
2
), the exponential distribution Exp
(
λ
), and the uniform distribution U
(
a
,
b
)
⋯.Algorithm4 computes the distribution type and its parameters. Algorithm 4 uses the goodness-of-fit test (see [40]) to define the distribution type with a Kolmogorov-Smirnov test. First it computes the distribution parameters using the maximum likelihood method; second, it computes the p-value statistic as
(9)
p
-value
=
sup
⁡
1
≤
i
≤
n
⁡
|
F
^
n
(
x
i
)
-
F
0
(
x
i
)
|
,
where x
i is the ith observed value in the sample (whose values have previously been ordered from the lowest to the highest); F
^
n
(
x
i
) is an estimator of the probability of observing values less than or equal to x
i and F
0
(
x
i
) is the probability of observing values less than or equal to x
i from a specified distribution [41]; that is, F
0
(
x
i
)
∈
CD.Algorithm 4:Data fitting.
Input:
δ
o
i
(
t
r
l
,
q
l
)
=
{
t
l
,
q
l
1
,
…
,
t
l
,
q
l
k
}, (
n
l
,
q
l
), α
ct for contrast
test, CD
Output:
F
0
(
X
)
searchp-valu
e
α
ct in table of Kolmogorov-Smirnov.
forj
=
1
,
…
,
|
CD
|
(i)    Design goodness-of-fit test
H
0
:
F
0
(
X
)
~
F
0
j
(
x
i
);
H
1
:
F
0
(
X
)
≁
F
0
j
(
x
i
).
(ii)   Estimate parameters of F
0
j
(
X
).
(iii)  Apply Kolmogorov-Smirnov test
(a) Compute p-value =  su
p
1
≤
i
≤
n
|
F
^
n
(
x
i
)
-
F
0
j
(
x
i
)
|.
(iv)   If p-value
≤
p-valu
e
α
ct,
then F
0
=
F
0
j
(
X
); break
else j
=
j
+
1.
(v)     end if
end for


### 4.4.1. Modelling Error

The proposed identification algorithm is a tool for identifying stochastic DES which estimates the probability distributions of transitions times. Because full times population cannot be observed, there will be a modelling error. As the sample mean is the estimator of a population mean, then the modelling error is related to the difference between value estimated and the true value of the mean. The standard error of the mean is the way to measure the modelling error. The standard error of the mean is the standard deviation of sample means over all possible samples (of a given size) drawn from the population. To measure it, the root-mean-square error (RMSE) is used, whereRMSE
=
S
/
n.


## 4.4.1. Modelling Error

The proposed identification algorithm is a tool for identifying stochastic DES which estimates the probability distributions of transitions times. Because full times population cannot be observed, there will be a modelling error. As the sample mean is the estimator of a population mean, then the modelling error is related to the difference between value estimated and the true value of the mean. The standard error of the mean is the way to measure the modelling error. The standard error of the mean is the standard deviation of sample means over all possible samples (of a given size) drawn from the population. To measure it, the root-mean-square error (RMSE) is used, whereRMSE
=
S
/
n.


## 4.5. Global Language Reconstruction from to Language of the Subsystems

Our objective is to identify the language of global system. It is found from the language of its subsystem.A global system event is obtained by Timed Synchronized Splice so.Definition 16 (operation of timed synchronized splice).
Le LetQ be a system composed by c subsystems. Let ω
l
i with l
=
1
⋯
c be c events at time τ
i, where ω
l
i
=
(
u
l
,
s
y
l
,
j
)
τ
i. A global system event, at time τ
i, can be obtained as:
(10)
ω
i
=
ω
1
i
⊕
⋯
⊕
ω
c
i
where ω
1
i
⊕
⋯
⊕
ω
c
i
=
(
u
1
,
s
y
1
,
j
)
⊕
⋯
⊕
(
u
c
,
s
y
c
,
j
)
=
(
u
1
,
s
⊕
⋯
⊕
u
c
,
s
)
(
y
1
,
j
⊕
⋯
⊕
y
c
,
j
) and (
u
1
,
s
⊕
⋯
⊕
u
c
,
s
)
=
u
s
g where u
s
g is a binary representation of s
g, s
g stands for all input symbols and (
y
1
,
j
⊕
⋯
⊕
y
c
,
j
)
=
y
j
g where y
j
g is a binary representation of j
g, j
g stands for all output symbols.
Then, the global system language can be built from the sequence of synchronized events of its subsystem. Therefore, the global generated language at timesτ
0
≤
…
≤
τ
k is L
(
s
t
Q
)
=
ω
0
⋯
ω
k.Proposition 17.
Given a global systemQ composed by c subsystems, the global system language L
(
s
t
Q
) built by the temporal synchronization of the languages of its subsystems is equal to system language, L
(
s
t
Q
)
=
L
(
Q
).Proof.
LetQ be a complex system with c subsystems. Let L
(
Q
)
=
ω
0
ω
1
⋯
ω
e be an event sequence generated from generator defined in Section 4.1.3(a) and let L
(
s
t
Q
) be the global system language built from a sequence of synchronized events of its subsystems.
Lets
=
ω
0
ω
1
⋯
ω
e be an event sequence such that s
∈
L
(
Q
) and let s
1
=
ω
*
0
⋯
ω
*
e be the sequence of synchronized events of the L
(
s
t
Q
l
) with l
=
1
⋯
c.
Assumingω
e
≠
ω
*
e.
P
U
(
s
)
=
{
u
s
0
⋯
u
s
e
}, u
s
e
=
{
u
1
,
s
,
…
,
u
c
,
s
} and P
Y
(
s
)
=
{
y
j
0
⋯
y
j
e
}, as ω
l
i
=
(
u
l
,
s
y
l
,
j
) for l
=
1
⋯
c. ω
l
e
=
(
u
l
,
s
,
y
l
,
j
); ω
l
e
=
(
u
1
,
s
,
y
1
,
j
)
…
(
u
c
,
s
,
y
c
,
j
). Based on Definition 16
ω
*
e
=
ω
1
e
⊕
⋯
⊕
ω
c
e then ω
e
=
ω
*
e, which contradicts the initial condition.


### 4.5.1. Synchronous Product of st-IPNs

To find the global system st-IPN we have proposed the operation of synchronous product of st-IPNs defined as follows.Definition 18 (synchronous product of st-IPNs).
Given a setst
Q of c st-IPNs, st
Q
=
{
st
Q
1
,
…
,
st
Q
c
} defined as (5), synchronous product of st
Q is the st-IPN defined as:
(11)
st
Q
s
=
∥
l
=
1
c
st
Q
l
,
st
Q
s
=
(
Q
s
,
Ω
s
,
δ
s
)
,
where Q
s
=
(
N
s
,
U
s
,
Y
s
,
λ
s
,
φ
s
). N
s
=
(
P
s
,
TR
s
,
Pre
,
Pos
,
M
0
) is an ordinary PN, with P
s
=
{
P
1
×
P
2
×
⋯
×
P
c
} set of places, TR
s
=
{
2
|
P
s
|
-
1
} set of system transitions, |
P
s
| is the length set of places, c number of subsystems, Pre
:
P
s
×
TR
s
→
Z
+, Pos
:
P
s
×
TR
s
→
Z
+
), and M
s
0
=
M
1
0
×
M
2
0
×
⋯
×
M
c
0 is the initial marking. U
s
=
{
U
1
∪
U
2
∪
⋯
U
c
} is the set of input to the system. Y
s
=
{
Y
1
∪
Y
2
∪
⋯
Y
c
} is the set of output to the system. λ
s
:
TR
s
→
U
s
·
δ
s (labeling function that assigns an input symbol and a timer density function to each transition) and φ
s is defined as φ
s
:
R
(
N
s
,
M
s
0
)
→
y
l
,
j
/
d
y
l
,
j; φ
s is isomorphic over y
l
,
j
/
d
y
l
,
j.
Ω
s
=
U
s
·
Y
s
:
=
{
ω
s
=
(
u
l
,
s
y
l
,
j
)
} is the system alphabet.
δ
s
:
=
TR
s
×
OM
→
f
(
t
TR
s
×
OM
) is a density function of transition firing time for each operation modes OM
=
{
o
1
,
o
2
,
…
}.In order to verify that the structure of a st-IPN solves Problem15, we define the conditions for a PN which is considered a deterministic generator and the conditions for a system to be considered deterministically identifiable.Definition 19 (α
-Generator).
LetU
·
Y be an alphabet and let L
(
Q
) be a language generated by alphabet; a PN is an α
-Generator for L
(
Q
) if given a set of inputs u
s
∈
P
U
:
(
U
·
Y
)
*
→
U
*, PN generates a set of outputs y
j such that the strings u
s
y
j
∈
L
(
Q
l
)
∀
u
s
∈
U with a probability greeter than 1
-
α.


### 4.5.2. Assumptions of a System so that It Is a Deterministically Identifiable (DI) System

Definition19 enables us to set the assumptions of a system for it can be a DI system.(i)
LetU and Y be a set of I/O observed signals of system; if given a set of inputs u
s
∈
U associated with a time t, P
y
j
:
(
Y
)
→
y
j is always the same.
(ii)
Moreover, given two identical inputsu
s, but with different length of time and two different projections of outputs, the system can be considered DI, since length of time defines the mark to reach.Proposition 20.
LetL
(
Q
)
=
{
ω
0
ω
1
⋯
ω
k
} be a system observed language, at times τ
0
≤
τ
1
≤
⋯
≤
τ
k; if st-IPN is a PN obtained with proposed identification algorithm then st-IPN is a α
-
G
e
n
e
r
a
t
o
r of L
(
Q
).Proof.
A st-IPN is aα
-Generator of L
(
Q
) if ∀
s
∈
L
(
Q
)
,
s
∈
L
(
P
) and if ∀
s
∈
L
(
P
), s
∈
L
(
Q
).
LetP be a st-IPN obtained by proposed identification algorithm for L
(
Q
).
Assuming thats
s
1 is a string such that s
∈
L
(
Q
)
∧
L
(
P
) but s
1
∈
L
(
Q
)
∧
s
1
∉
L
(
P
), where s
=
ω
0
,
…
,
ω
k, then the postlanguage of s is given by L
(
Q
)
/
s
=
{
s
1
∈
(
U
·
Y
)
*
∣
s
s
1
∈
L
(
Q
)
}. Then given the event s
1 with s
1
=
ω
k
+
1
=
(
u
s
y
j
)
k
+
1 at time τ
k
+
1, applying the Algorithm 1 a new event generates a transition with λ
(
t
r
k
+
1
)
=
u
s
k
+
1
·
t
t
r
k
+
1 and the marking reached by t
r
k
+
1: M
k
→
t
r
k
+
1
M
k
+
1 will be φ
(
M
k
+
1
)
=
y
j
k
+
1
/
y
j
k
+
1
-
y
j
k and as u
s
k
+
1
·
y
j
k
+
1 are signals vectors observed at time τ
k
+
1, (based on description of event generator, Section 4.1.3(a)), then ω
k
+
1
=
(
u
s
y
j
)
k
+
1
∈
L
(
P
) then assumption is rejected.
Now, we assume thats
s
2 is a string such that s
∈
L
(
Q
)
∧
L
(
P
) but s
2
∉
L
(
Q
)
∧
s
2
∈
L
(
P
), where s
=
ω
0
,
…
,
ω
k. Then the postlanguage of s is given by L
(
P
)
/
s
=
{
s
2
∈
(
U
·
Y
)
*
∣
s
s
2
∈
L
(
P
)
}. Then given the event s
2 with s
2
=
ω
k
+
1
=
(
u
s
y
j
)
k
+
1 at time τ
k
+
1, the st-IPN evolves a state from to a transition with λ
(
t
r
k
+
1
)
=
u
s
k
+
1
·
t
t
r
k
+
1 and the marking reached by t
r
k
+
1: M
k
→
t
r
k
+
1
M
k
+
1 will be φ
(
M
k
+
1
)
=
y
j
k
+
1
/
y
j
k
+
1
-
y
j
k, where t
r
k
+
1 has not been observed and reaches states that have not been observed, but according to Algorithm 1 the construction of st-IPN is made based on reached state by the observed language, then ω
k
+
1
=
(
u
s
y
j
)
k
+
1
∉
L
(
P
) and then assumption is rejected and therefore Proposition 20 is proved.Moreover,L
(
Q
)
/
s
=
{
s
1
∈
(
U
·
Y
)
*
∣
s
s
1
∈
L
(
Q
)
} reaches the mark φ
(
M
k
+
1
) if Prob
(
φ
(
M
k
+
1
)
,
ω
k
+
1
/
φ
(
M
k
)
)
≧
(
1
-
α
)
∣
ω
k
+
1
∈
L
(
Q
) and if φ
(
M
k
+
1
)
=
φ
(
M
i
) for some i
=
1
⋯
k, then s
s
1 is a cycle (Proposition 12).Definition 21.
AL
(
Q
), where L
(
Q
)
=
{
s
∈
(
U
·
Y
)
*
:
Prob
(
s
∣
φ
(
M
0
)
)
≧
(
1
-
α
)
} is DI language if ∀
s
∈
L
(
Q
)
,
∧
∀
s
1
,
s
2
∈
L
(
Q
)
/
s, where s
=
ω
0
,
…
,
ω
k, such as P
u
s
:
(
s
s
1
)
=
P
u
s
:
(
s
s
2
) then Prob
(
P
y
j
:
(
s
s
1
)
=
P
y
j
:
(
s
s
2
)
)
≥
1
-
α if they started from the same state φ
(
M
k
).In other words, aL
(
Q
) is DI language, if from a state two equal inputs are given, the output symbol is always the same.Theorem 22.
A languageL
(
Q
) is DI language if and only if  ∃ an α
-
G
e
n
e
r
a
t
o
r for L
(
Q
).Proof.
Necessary condition: ifL
(
Q
) is a DI language, then ∃ an α
-Generator.
A deterministicα
-Generator for L
(
Q
) is a st-IPN. L
(
Q
) is a DI language, if α
-Generator is a st-IPN (see Proposition 20).
Sufficient condition: if∃ an α
-Generator then L
(
Q
) is a DI language.
Assume that theα
-Generator for L
(
Q
) is a st-IPN. Let L
(
P
) be the generated language by α
-Generator. Let s
=
ω
0
,
…
,
ω
k be a string such that L
(
P
)
=
{
s
∈
(
U
·
Y
)
*
:
Prob
(
s
∣
φ
(
M
0
)
)
≧
(
1
-
α
)
}. Then, given the events s
1 and s
2 such that s
1
,
s
2
∈
L
(
P
)
/
s with s
1
,
s
2
=
ω
k
+
1 with Prob
(
φ
(
M
k
+
1
)
,
ω
k
+
1
/
φ
(
M
k
)
)
≧
(
1
-
α
) if P
u
s
:
(
s
s
1
)
=
P
u
s
:
(
s
s
2
), in the event ω
k
+
1 then P
y
j
:
(
s
s
1
)
=
P
y
j
:
(
s
s
2
), based on Definition 21  L
(
P
) is a DI language and according to Proposition 13  L
(
P
)
=
L
(
Q
); therefore L
(
Q
) is a DI language.If a st-IPN is a deterministicα
-Generator for L
(
Q
), then st-IPN generates the same observed language; therefore Problem 15 is solved.


## 4.5.1. Synchronous Product of st-IPNs

To find the global system st-IPN we have proposed the operation of synchronous product of st-IPNs defined as follows.Definition 18 (synchronous product of st-IPNs).
Given a setst
Q of c st-IPNs, st
Q
=
{
st
Q
1
,
…
,
st
Q
c
} defined as (5), synchronous product of st
Q is the st-IPN defined as:
(11)
st
Q
s
=
∥
l
=
1
c
st
Q
l
,
st
Q
s
=
(
Q
s
,
Ω
s
,
δ
s
)
,
where Q
s
=
(
N
s
,
U
s
,
Y
s
,
λ
s
,
φ
s
). N
s
=
(
P
s
,
TR
s
,
Pre
,
Pos
,
M
0
) is an ordinary PN, with P
s
=
{
P
1
×
P
2
×
⋯
×
P
c
} set of places, TR
s
=
{
2
|
P
s
|
-
1
} set of system transitions, |
P
s
| is the length set of places, c number of subsystems, Pre
:
P
s
×
TR
s
→
Z
+, Pos
:
P
s
×
TR
s
→
Z
+
), and M
s
0
=
M
1
0
×
M
2
0
×
⋯
×
M
c
0 is the initial marking. U
s
=
{
U
1
∪
U
2
∪
⋯
U
c
} is the set of input to the system. Y
s
=
{
Y
1
∪
Y
2
∪
⋯
Y
c
} is the set of output to the system. λ
s
:
TR
s
→
U
s
·
δ
s (labeling function that assigns an input symbol and a timer density function to each transition) and φ
s is defined as φ
s
:
R
(
N
s
,
M
s
0
)
→
y
l
,
j
/
d
y
l
,
j; φ
s is isomorphic over y
l
,
j
/
d
y
l
,
j.
Ω
s
=
U
s
·
Y
s
:
=
{
ω
s
=
(
u
l
,
s
y
l
,
j
)
} is the system alphabet.
δ
s
:
=
TR
s
×
OM
→
f
(
t
TR
s
×
OM
) is a density function of transition firing time for each operation modes OM
=
{
o
1
,
o
2
,
…
}.In order to verify that the structure of a st-IPN solves Problem15, we define the conditions for a PN which is considered a deterministic generator and the conditions for a system to be considered deterministically identifiable.Definition 19 (α
-Generator).
LetU
·
Y be an alphabet and let L
(
Q
) be a language generated by alphabet; a PN is an α
-Generator for L
(
Q
) if given a set of inputs u
s
∈
P
U
:
(
U
·
Y
)
*
→
U
*, PN generates a set of outputs y
j such that the strings u
s
y
j
∈
L
(
Q
l
)
∀
u
s
∈
U with a probability greeter than 1
-
α.


## 4.5.2. Assumptions of a System so that It Is a Deterministically Identifiable (DI) System

Definition19 enables us to set the assumptions of a system for it can be a DI system.(i)
LetU and Y be a set of I/O observed signals of system; if given a set of inputs u
s
∈
U associated with a time t, P
y
j
:
(
Y
)
→
y
j is always the same.
(ii)
Moreover, given two identical inputsu
s, but with different length of time and two different projections of outputs, the system can be considered DI, since length of time defines the mark to reach.Proposition 20.
LetL
(
Q
)
=
{
ω
0
ω
1
⋯
ω
k
} be a system observed language, at times τ
0
≤
τ
1
≤
⋯
≤
τ
k; if st-IPN is a PN obtained with proposed identification algorithm then st-IPN is a α
-
G
e
n
e
r
a
t
o
r of L
(
Q
).Proof.
A st-IPN is aα
-Generator of L
(
Q
) if ∀
s
∈
L
(
Q
)
,
s
∈
L
(
P
) and if ∀
s
∈
L
(
P
), s
∈
L
(
Q
).
LetP be a st-IPN obtained by proposed identification algorithm for L
(
Q
).
Assuming thats
s
1 is a string such that s
∈
L
(
Q
)
∧
L
(
P
) but s
1
∈
L
(
Q
)
∧
s
1
∉
L
(
P
), where s
=
ω
0
,
…
,
ω
k, then the postlanguage of s is given by L
(
Q
)
/
s
=
{
s
1
∈
(
U
·
Y
)
*
∣
s
s
1
∈
L
(
Q
)
}. Then given the event s
1 with s
1
=
ω
k
+
1
=
(
u
s
y
j
)
k
+
1 at time τ
k
+
1, applying the Algorithm 1 a new event generates a transition with λ
(
t
r
k
+
1
)
=
u
s
k
+
1
·
t
t
r
k
+
1 and the marking reached by t
r
k
+
1: M
k
→
t
r
k
+
1
M
k
+
1 will be φ
(
M
k
+
1
)
=
y
j
k
+
1
/
y
j
k
+
1
-
y
j
k and as u
s
k
+
1
·
y
j
k
+
1 are signals vectors observed at time τ
k
+
1, (based on description of event generator, Section 4.1.3(a)), then ω
k
+
1
=
(
u
s
y
j
)
k
+
1
∈
L
(
P
) then assumption is rejected.
Now, we assume thats
s
2 is a string such that s
∈
L
(
Q
)
∧
L
(
P
) but s
2
∉
L
(
Q
)
∧
s
2
∈
L
(
P
), where s
=
ω
0
,
…
,
ω
k. Then the postlanguage of s is given by L
(
P
)
/
s
=
{
s
2
∈
(
U
·
Y
)
*
∣
s
s
2
∈
L
(
P
)
}. Then given the event s
2 with s
2
=
ω
k
+
1
=
(
u
s
y
j
)
k
+
1 at time τ
k
+
1, the st-IPN evolves a state from to a transition with λ
(
t
r
k
+
1
)
=
u
s
k
+
1
·
t
t
r
k
+
1 and the marking reached by t
r
k
+
1: M
k
→
t
r
k
+
1
M
k
+
1 will be φ
(
M
k
+
1
)
=
y
j
k
+
1
/
y
j
k
+
1
-
y
j
k, where t
r
k
+
1 has not been observed and reaches states that have not been observed, but according to Algorithm 1 the construction of st-IPN is made based on reached state by the observed language, then ω
k
+
1
=
(
u
s
y
j
)
k
+
1
∉
L
(
P
) and then assumption is rejected and therefore Proposition 20 is proved.Moreover,L
(
Q
)
/
s
=
{
s
1
∈
(
U
·
Y
)
*
∣
s
s
1
∈
L
(
Q
)
} reaches the mark φ
(
M
k
+
1
) if Prob
(
φ
(
M
k
+
1
)
,
ω
k
+
1
/
φ
(
M
k
)
)
≧
(
1
-
α
)
∣
ω
k
+
1
∈
L
(
Q
) and if φ
(
M
k
+
1
)
=
φ
(
M
i
) for some i
=
1
⋯
k, then s
s
1 is a cycle (Proposition 12).Definition 21.
AL
(
Q
), where L
(
Q
)
=
{
s
∈
(
U
·
Y
)
*
:
Prob
(
s
∣
φ
(
M
0
)
)
≧
(
1
-
α
)
} is DI language if ∀
s
∈
L
(
Q
)
,
∧
∀
s
1
,
s
2
∈
L
(
Q
)
/
s, where s
=
ω
0
,
…
,
ω
k, such as P
u
s
:
(
s
s
1
)
=
P
u
s
:
(
s
s
2
) then Prob
(
P
y
j
:
(
s
s
1
)
=
P
y
j
:
(
s
s
2
)
)
≥
1
-
α if they started from the same state φ
(
M
k
).In other words, aL
(
Q
) is DI language, if from a state two equal inputs are given, the output symbol is always the same.Theorem 22.
A languageL
(
Q
) is DI language if and only if  ∃ an α
-
G
e
n
e
r
a
t
o
r for L
(
Q
).Proof.
Necessary condition: ifL
(
Q
) is a DI language, then ∃ an α
-Generator.
A deterministicα
-Generator for L
(
Q
) is a st-IPN. L
(
Q
) is a DI language, if α
-Generator is a st-IPN (see Proposition 20).
Sufficient condition: if∃ an α
-Generator then L
(
Q
) is a DI language.
Assume that theα
-Generator for L
(
Q
) is a st-IPN. Let L
(
P
) be the generated language by α
-Generator. Let s
=
ω
0
,
…
,
ω
k be a string such that L
(
P
)
=
{
s
∈
(
U
·
Y
)
*
:
Prob
(
s
∣
φ
(
M
0
)
)
≧
(
1
-
α
)
}. Then, given the events s
1 and s
2 such that s
1
,
s
2
∈
L
(
P
)
/
s with s
1
,
s
2
=
ω
k
+
1 with Prob
(
φ
(
M
k
+
1
)
,
ω
k
+
1
/
φ
(
M
k
)
)
≧
(
1
-
α
) if P
u
s
:
(
s
s
1
)
=
P
u
s
:
(
s
s
2
), in the event ω
k
+
1 then P
y
j
:
(
s
s
1
)
=
P
y
j
:
(
s
s
2
), based on Definition 21  L
(
P
) is a DI language and according to Proposition 13  L
(
P
)
=
L
(
Q
); therefore L
(
Q
) is a DI language.If a st-IPN is a deterministicα
-Generator for L
(
Q
), then st-IPN generates the same observed language; therefore Problem 15 is solved.


## 5. Application Example

Let us illustrate the approach with an example. The proposed example is the centralized air heating system (AHS) in Figure5. The system includes three heating subsystems. Each heating subsystem has a fan creating an air flow that is heated with hot water. The water flow is controlled by pump-valve systems. Moreover, there is a central heater providing hot water to each heating subsystem and two valves (v
c
1 and v
c
2) controlling the water flow through the whole system. The system can be split into five subsystems (1, 2, 3, 4, and 5). Subsystems 3, 4, and 5 are the local heaters, subsystem 2 is the distribution subsystem (v
c
1 and v
c
2), and subsystem 1 is the main heating subsystem (heater, main pump (p
m), and reflux valve (v
r)). The heater works in three modes (0, 1, 2), each state is defined by the number of resistances it has activated, so, modes 0, 1, and 2 will represent no activation of resistance, activation of h
1, and activation of both h
1 and h
2.Figure 5
AHS system.The system is equipped with a set of sensors detailed in Table1. Each subsystem i includes a flow sensor (F
i) that measures the presence or absence of flow in the subsystem. Nevertheless, flow level is affected when other subsystems are activated. So, a software sensor (N
F
i) is designed in order to measure the deviation over a normal operation flow taking into account the activation of other subsystems.Table 1
Sensor Readings.
Sensor
Subs
Readings
Meaning
TemperatureT
1
T
0,  T
1, T
2,
ifT < T
p
1  T
=
T
0, if T
p
1 < T < T
p
2, T
=
T
1, if  T
2 > T
p
2  T
=
T
2
Flow
1
F
1, N
F
1,
Flow, normal flow.
Position
2
P
o
ValveV
c
1 opened or closed
Flow
3
F
2, N
F
2
Flow, normal flow.
Flow
3
F
3, N
F
3
Flow, normal flow.
Flow
4
F
4, N
F
4
Flow, normal flow.
Flow
5
F
5, N
F
5
Flow, normal flow.
Pressure
3
P
3
Pressure.
Pressure
4
P
4
Pressure.
Pressure
5
P
5
Pressure.The system also includes binary temperature sensors, pressure sensors, and a position sensor for valveV
c
1.u
l
,
s
y
l
,
j is an I/O symbol based on Definition 3, where u
l
,
s is a binary representation of s, s stands for the input symbol, y
l
,
j is a binary representation of j, j stands for the output symbol, and l stands the subsystem index. For example, (
u
1,30
y
1,9
) is an I/O symbol in subsystem 1, whose values are [
11110,1001
], that is, [
v
r
p
g
v
g
h
1
h
¯
2
,
T
o
T
¯
1
T
¯
2
F
1
].


### 5.1. System Operation

The system globally starts with the external event “Son”; the heating subsystems are locally started with events “C
a
3," “C
a
4,” and “C
a
5”. These events are external events that change the controller strategy (See in Figure 6). Each combination of external events generates a system operation mode. When event “Son” is generated, the controller opens the reflux valve (v
r) and starts Pm (p
m), the heater starts heating (temperature set point is T
p
1
) and the water flows through the path Heater-Pm-VR-Heater. When any heating subsystem is activated (“C
a
3,” “C
a
4,” or “C
a
5”), subsystem 1 closes reflux valve (v
¯
r) and it changes the temperature set point to T
p
2
(
T
p
2
>
T
p
1
). If “C
a
4” and (or) “C
a
5” are started, then, the corresponding valves 1 and 2 of subsystem 2 are opened (v
c
1
,
v
c
2). Moreover local valves and pumps start their work when necessary (v
3
,
v
4
,
v
5 and p
3
,
p
4
,
p
5). Each heating subsystem is stopped with events “C
a
3
¯,” “C
a
4
¯,” and “C
a
5
¯” (C
a
¯
=
C
a
3
¯
∧
C
a
4
¯
∧
C
a
5
¯). Then, the controller performs the closing actions; it closes the valves (v
¯
c
1
,
v
¯
c
2
,
v
¯
3
,
v
¯
4
,
v
¯
5) and stops the pumps (p
¯
3
,
p
¯
4
,
p
¯
5). When every subsystem is completely stopped, the system can be globally stopped with event “Soff.” Then, the controller closes the reflux valve (v
¯
r), and stops the heater and Pm (p
¯
m).Figure 6
AHS system controller.In order to demonstrate the advantages of the proposed identification method, the system will be identified over two scenarios.The first test presented is the stand alone operation of subsystem 3 and the second test presented simulates all the possible operation modes sequentially. The identification method is additive, so after the identification of a language associated with a particular mode, the identified nets learn new languages by adding them to the previous knowledge.Because the system cannot work ifSon is not activated, there are 9 possible operations modes: OM
=
{
o
0
,
…
,
o
8
}; where o
0
=
Soff
,
C
a
3
¯
,
C
a
4
¯
,
C
a
5
¯, o
1
=
Son
,
C
a
3
¯
,
C
a
4
¯
,
C
a
5
¯, and  o
2
=
Son
,
C
a
3
,
C
a
4
¯
,
C
a
5
¯; so on. Moreover, each test includes the starting and stopping operations. Therefore testing of operation mode o
x includes the sequence (
o
0
-
o
1
-
o
x
-
o
1
-
o
0
).


### 5.2. Identification of Scenario 1

The number of subsystems is 5 and the initial conditions are as follows.(i)
Definition of initial state atτ
0:  ω
0
=
{
ω
1
0
·
ω
2
0
·
ω
3
0
·
ω
4
0
·
ω
5
0
}:
ω
1
0
=
[
v
¯
r
p
¯
g
v
¯
g
h
¯
1
h
¯
2
,
T
o
T
¯
1
T
¯
2
F
¯
1
]
=
[
u
1,0
y
1,8
];
ω
2
0
=
[
v
¯
c
1
v
¯
c
2
,
P
¯
o
F
¯
2
N
F
¯
2
]
=
[
u
2,0
y
2,0
];
ω
3
0
=
[
p
¯
3
v
¯
3
,
F
¯
3
N
F
¯
3
]
=
[
u
3,0
y
3,0
];
ω
4
0
=
[
p
¯
4
v
¯
4
,
F
¯
4
N
F
¯
4
]
=
[
u
4,0
y
4,0
];
ω
5
0
=
[
p
¯
5
v
¯
5
,
F
¯
5
N
F
¯
5
]
=
[
u
5,0
y
5,0
].
(ii)
Initial Output Function:
P
1,1
:
φ
(
M
1,1
)
=
y
1,8
/
0
→;
P
2,1
:
φ
(
M
2,1
)
=
y
2,0
/
0
→;
P
3,1
:
φ
(
M
3,1
)
=
y
3,0
/
0
→;
P
4,1
:
φ
(
M
4,1
)
=
y
4,0
/
0
→;
P
5,1
:
φ
(
M
5,1
)
=
y
5,0
/
0
→. The input vector arranges the control commands based on system operation as described in Section 5.1. The output vector arranges the sensor readings as in Table 1.Once the system starts with “Son”; the controller generates the control commands when the external inputs evolve. Then the system reacts and the event generator starts generating events. (Note that the system starts with operation mode o
0, then it changes to o
1, and, when “C
a
3” is externally activated, it changes to o
2.)With each new event, Algorithm1 creates new places and transitions. After a complete run of the system (S
o
f
f is generated), Algorithm 1 creates the st-IPNs for subsystems 1 and 3 showed in Figure 7(a).st-IPNs system scenario 1.
(a)
Subsystems 1 and 3
(b)
GlobalAt this identification stage, places and transitions are defined and the identified st-IPNs model the expected behavior of the system.Initially, the system works in operation mode 0 (o
0) as Son is not active. Subsystem 1 starts at place P
1,1. Activation of “S
o
n” changes the operation mode to o
1, the controller opens the valves (reflux and main), turns on the main pump, and sets the heater in mode 1 (t
r
1,1). A state change (P
1,2) is generated, because water flows through the path Heater-Pm-VR-Heater (F
1
=
1) (as it is showed in Figure 5). After a time (t
r
1,2) temperature reaches T
p
1 (18°C); therefore, the system evolves to other state (P
1,3). The controller starts the heating actions; it closes the reflux valve and sets heater in mode 2 (t
r
1,3), the state change cannot be measured by absence of sensors that detect the operation of the reflux valve (P
1,4). At this time “C
a
3” is activated, so the system operation mode changes to o
2; then the controller turns on pump 3 and opens valve 3 (t
r
3,1) and subsystem 3 changes its state to P
3,2 because water is flowing through path Heater-Pm-P3-V3-Heater. After a time (t
r
3,2), flow reaches its normal level (N
F
3) and subsystem 3 changes the state to P
3,3. Subsystem 1 continues with the reflux valve closed (t
r
1,4). It waits until reaching T
p
2 (28°C) and, therefore, it evolves to P
1,5. Subsystem 3 remains in P
3,3 until “C
a
3” is externally deactivated (
C
a
3
¯
) and o
1 is reached, then normal flow falls (t
r
3,3) and it changes to (P
3,4). Now, the controller turns off pump 3 and closes valve 3 (t
r
3,4). As a consequence, flow in the subsystem decreases (change to P
3,5) until flow level is low F
1. This transition makes the subsystem return to its initial state (P
3,1). Now, the controller opens the reflux valve and sets the heater in mode 1 (t
r
1,5). Subsystem 1 holds the state (P
1,6) until temperature is below T
p
2, (P
1,7), after the controller turns off the main pump, it closes the main valve and sets the heater in mode 0 (t
r
1,7). Subsystem 1 evolves to P
1,8 and after time (t
r
1,8) to P
1,9. Slightly, temperature decreases until it reaches the initial state (P
1,1). At the end, Son is deactivated (S
o
f
f) and the system operation mode changes to o
0.Nevertheless, the time array for each transition has only one value, so no probability distribution can be fit.As stated in Section4, at least 5 samples are needed to identify the distributions, so scenario 1 will be repeated until each distribution for each transition will be identified.After 5 observations of a transition, Algorithm3 is executed. This paper shows, as an example, the case with the greatest dispersion (t
r
3,2) as it is the worst case.Inputs:δ
o
2
(
t
r
3,2
)
=
{
t
3,2
1
⋯
t
3,2
5
}; α
=
0.05; α
c
t
=
0.05; d
o
p
=
0.05; CD
=
{
F
0
j
(
x
i
)
}
l
=
3, q
l
=
2.
forn
=
5;
δ
o
2
(
t
r
3,2
)
=
{
2.9,2.6,2.8,2.7,2.8
}
X
¯
=
2.76
,
S
=
0.11
,
d
=
0.1027.As d
>
0.05, there is not enough data to fit the distribution.After 20 observations, Algorithm3 gives a positive result: X
¯
=
2.75, S
=
0.09; d
=
0.049. As d
<
0.05, Algorithm 4 is executed and it will compute the distribution type and its parameters.α
c
t
=
0.05. p
-valu
e
α
c
t
=
0.29408 in table of Kolmogorov-Smirnov, with n
=
20.Hypothesis test:
H
0
:
F
0
(
X
)
∽
N
(
μ
,
σ
2
);
H
1
:
F
0
(
X
)
≁
N
(
μ
,
σ
2
).
Parameters estimationF
0
=
N
(
μ
,
σ
2
)
=
N
(
2.75,0.09
) and p
-
v
a
l
u
e
=
0.1621 based on test Kolmogorov-Smirnov.
AcceptH
0 since p
-value
≤
p
-valu
e
α
c
t. Therefore the data is normally distributed.To do a full identification of the process it is necessary to get 20 samples of each transition time.Figure8 shows the mean of the time array collected for t
r
3,2 versus the number of acquired samples in operation mode 2. It can be seen that for 20 samples onwards the mean remains stable.Figure 8
Behavior of transitiont
r
3,2.Thereby, the sequence of operation modeso
0
-
o
1
-
o
2
-
o
1
-
o
0 is fully identified. This identification includes the st-IPNs structures and all the density functions for each transition in the net.


### 5.3. Complete Identification of the System

The last test performed is the sequential generation of all the possible combinations of the external events, so the system must be able to generate a really complex language. Subsystem st-IPNs are showed in Figure9.st-IPNs after the complete identification.
(a)
(b)
(c)
(d)
(e)Results show the advantages of identifying subsystems instead of the global system. Figure7(b) shows the identification of the global system (without splitting in subsystems) in scenario 1. The complexity (number of places and transitions) of this st-IPN is similar to the complexity of the st-IPNs in the case of the subsystem identification. Nevertheless, as the complexity of the system increases, subsystem identification reduces complexity. Table 2 shows a comparison of the number of sates and transitions when identifying with or without splitting the system into subsystems.Table 2
Places and transitions.
Scenario
Sub
Global
Places
Tr.
Places
Tr.
1
7
2
3
2
2
14
14
14
15
3
22
22
22
23
4
28
32
24
31
5
28
32
24
32
6
28
32
24
32
7
28
32
24
32
8
28
32
24
32
9
28
33
33
42
10
28
33
39
52
11
32
41
44
59
12
32
42
50
68
13
32
43
52
71
14
33
43
54
74
15
34
45
57
78
16
35
48
61
83It can be seen that a global system identification increases its complexity with the number of operation modes considered, as a subsystem identification does not.This behavior is related to the number of possible events handled by the st-IPNs. The maximum number of global system states isQ
(
g
)
max
⁡
=
2
n
t
×
3
n
t, (n
t is the total number of output symbols) (6), whereas in identification by subsystem the maximum number of system states is Q
(
split
)
max
⁡
=
Q
max
⁡
,
1
+
Q
max
⁡
,
2
+
⋯
+
Q
max
⁡
,
c; that is, Q
(
split
)
max
⁡
=
2
n
1
×
3
n
1
+
2
n
2
×
3
n
2
+
⋯
+
2
n
c
×
3
n
c, where n
1
+
n
2
+
⋯
+
n
c
=
n
t, it can be seen that Q
(
g
)
max
⁡
>
Q
(
split
).


### 5.4. Language Generation

This section shows how the observed language is generated in both subsystem and global identification approach for scenario 1.The observed language for each subsystem is equal to the one generated by the st-IPNs:L
1
=
(
u
1,0
y
1,8
)
(
u
1,30
y
1,8
)
(
u
1,30
y
1,9
)
(
u
1,30
y
1,13
)
(
u
1,15
y
1,13
)
(
u
1,15
y
1,15
)
(
u
1,30
y
1,15
)
(
u
1,30
y
1,13
)
(
u
1,0
y
1,9
)
(
u
1,0
y
1,8
) at times τ
0
,
τ
1
,
τ
2
,
τ
3
,
τ
6
,
τ
10
,
τ
11
,
τ
12
,
τ
13
,
τ
14.L
3
=
(
u
3,0
y
3,0
)
(
u
3,3
y
3,2
)
(
u
3,3
y
3,3
)
(
u
3,3
y
3,2
)
(
u
3,0
y
3,0
)
(
u
3,0
y
3,0
) at times τ
0
,
τ
4
,
τ
5
,
τ
7
,
τ
8
,
τ
9.Figure7(b) shows the result of the identification process in case that the system is not split into subsystems. The language observed also is equal to the generated.L
g
=
(
u
0
y
4096
)
(
u
7680
y
4608
)
(
u
7680
y
4608
)
(
u
7680
y
6656
)
(
u
3840
y
6688
)
(
u
3888
y
6688
)
(
u
3888
y
6704
)
(
u
3888
y
7728
)
(
u
3888
y
7712
)
(
u
3840
y
7680
)
(
u
7680
y
7680
)
(
u
7680
y
6656
)
(
u
0
y
4608
)
(
u
0
y
4608
)
(
u
0
y
4096
)
(
u
0
y
4096
) at times τ
0
,
…
,
τ
15.A global input symbol is(12)
u
g
=
{
v
r
p
g
v
g
h
1
h
2
︷
u
1
v
c
1
v
c
2
︷
u
2
p
3
v
3
︷
u
3
p
4
v
4
︷
u
4
p
5
v
5
︷
u
5
}
.And a global output symbol is(13)
y
g
=
{
T
0
T
1
T
2
F
1
︷
y
1
P
o
F
2
N
F
2
︷
y
2
F
3
N
F
3
︷
y
3
F
4
N
F
4
︷
y
4
F
5
N
F
5
︷
y
5
}
.Note that, for example, at timeτ
3, the input symbol in the global language is u
7680 and at time τ
4 is u
3840 (see Figure 7(b)). At these times, input symbols in local subsystems are u
1,30 and u
3,3. In this time the output symbol in the global language is y
6656 and at time τ
4 is y
6688 (see Figure 7(b)). Moreover, at these times output symbols in local subsystems are y
1,13 and y
3,2. Table 3 shows these symbols.Table 3
I/O SYMBOL INτ
3 and τ
4.
τ
3
τ
4
τ
3
τ
4
u
g
11110
00
00
00
00
01111
00
11
00
00
y
g
1101
000
00
00
00
1101
000
10
00
00
u
1
11110
01111
y
1
1101
1101
u
2
00
00
y
2
000
000
u
3
00
11
y
3
00
10
u
4
00
00
y
4
00
00
u
5
00
00
y
5
00
00According to Definition16, a global I/O symbol, ω
i, is obtained from splice of ω
i
=
ω
1
i
⊕
ω
2
i
⊕
⋯
⊕
ω
5
i for i
=
3,4. Therefore the global and the subsystem approach represent the same language. Then, time synchronization splice of L
1 and L
3 gives L
g.Therefore, the advantage of using subsystems is that the method identifies only active languages, which allows determining which subsystem is operating.


### 5.5. Timed Transitions Identification in Different Operation Modes

Transition time depends on the operation mode of the system although the device maintains its operation sequence.Table4 shows the parameters of t
r
3,2 distribution for each operation mode. So, although subsystem 3 uses the same net for each operation mode (Figure 9) it uses a different distribution in each transition for each operation mode, so it can model complex behaviors.Table 4
Parameters oft
r
3
,
2.
Operation Mode
Distribution
o
0
NA*
o
1
NA
o
2
N (2.75, 0.094)
o
3
NA
o
4
NA
o
5
N (1.44, 0.0966)
o
6
NA
o
7
N (1.35, 0.085)
o
8
N (0.37, 0.0483)
*“Not applicable” means that the transition not is executed in this operation mode.Note that time changes can be notable with changes from 0.37 seconds to 2.75 seconds.


## 5.1. System Operation

The system globally starts with the external event “Son”; the heating subsystems are locally started with events “C
a
3," “C
a
4,” and “C
a
5”. These events are external events that change the controller strategy (See in Figure 6). Each combination of external events generates a system operation mode. When event “Son” is generated, the controller opens the reflux valve (v
r) and starts Pm (p
m), the heater starts heating (temperature set point is T
p
1
) and the water flows through the path Heater-Pm-VR-Heater. When any heating subsystem is activated (“C
a
3,” “C
a
4,” or “C
a
5”), subsystem 1 closes reflux valve (v
¯
r) and it changes the temperature set point to T
p
2
(
T
p
2
>
T
p
1
). If “C
a
4” and (or) “C
a
5” are started, then, the corresponding valves 1 and 2 of subsystem 2 are opened (v
c
1
,
v
c
2). Moreover local valves and pumps start their work when necessary (v
3
,
v
4
,
v
5 and p
3
,
p
4
,
p
5). Each heating subsystem is stopped with events “C
a
3
¯,” “C
a
4
¯,” and “C
a
5
¯” (C
a
¯
=
C
a
3
¯
∧
C
a
4
¯
∧
C
a
5
¯). Then, the controller performs the closing actions; it closes the valves (v
¯
c
1
,
v
¯
c
2
,
v
¯
3
,
v
¯
4
,
v
¯
5) and stops the pumps (p
¯
3
,
p
¯
4
,
p
¯
5). When every subsystem is completely stopped, the system can be globally stopped with event “Soff.” Then, the controller closes the reflux valve (v
¯
r), and stops the heater and Pm (p
¯
m).Figure 6
AHS system controller.In order to demonstrate the advantages of the proposed identification method, the system will be identified over two scenarios.The first test presented is the stand alone operation of subsystem 3 and the second test presented simulates all the possible operation modes sequentially. The identification method is additive, so after the identification of a language associated with a particular mode, the identified nets learn new languages by adding them to the previous knowledge.Because the system cannot work ifSon is not activated, there are 9 possible operations modes: OM
=
{
o
0
,
…
,
o
8
}; where o
0
=
Soff
,
C
a
3
¯
,
C
a
4
¯
,
C
a
5
¯, o
1
=
Son
,
C
a
3
¯
,
C
a
4
¯
,
C
a
5
¯, and  o
2
=
Son
,
C
a
3
,
C
a
4
¯
,
C
a
5
¯; so on. Moreover, each test includes the starting and stopping operations. Therefore testing of operation mode o
x includes the sequence (
o
0
-
o
1
-
o
x
-
o
1
-
o
0
).


## 5.2. Identification of Scenario 1

The number of subsystems is 5 and the initial conditions are as follows.(i)
Definition of initial state atτ
0:  ω
0
=
{
ω
1
0
·
ω
2
0
·
ω
3
0
·
ω
4
0
·
ω
5
0
}:
ω
1
0
=
[
v
¯
r
p
¯
g
v
¯
g
h
¯
1
h
¯
2
,
T
o
T
¯
1
T
¯
2
F
¯
1
]
=
[
u
1,0
y
1,8
];
ω
2
0
=
[
v
¯
c
1
v
¯
c
2
,
P
¯
o
F
¯
2
N
F
¯
2
]
=
[
u
2,0
y
2,0
];
ω
3
0
=
[
p
¯
3
v
¯
3
,
F
¯
3
N
F
¯
3
]
=
[
u
3,0
y
3,0
];
ω
4
0
=
[
p
¯
4
v
¯
4
,
F
¯
4
N
F
¯
4
]
=
[
u
4,0
y
4,0
];
ω
5
0
=
[
p
¯
5
v
¯
5
,
F
¯
5
N
F
¯
5
]
=
[
u
5,0
y
5,0
].
(ii)
Initial Output Function:
P
1,1
:
φ
(
M
1,1
)
=
y
1,8
/
0
→;
P
2,1
:
φ
(
M
2,1
)
=
y
2,0
/
0
→;
P
3,1
:
φ
(
M
3,1
)
=
y
3,0
/
0
→;
P
4,1
:
φ
(
M
4,1
)
=
y
4,0
/
0
→;
P
5,1
:
φ
(
M
5,1
)
=
y
5,0
/
0
→. The input vector arranges the control commands based on system operation as described in Section 5.1. The output vector arranges the sensor readings as in Table 1.Once the system starts with “Son”; the controller generates the control commands when the external inputs evolve. Then the system reacts and the event generator starts generating events. (Note that the system starts with operation mode o
0, then it changes to o
1, and, when “C
a
3” is externally activated, it changes to o
2.)With each new event, Algorithm1 creates new places and transitions. After a complete run of the system (S
o
f
f is generated), Algorithm 1 creates the st-IPNs for subsystems 1 and 3 showed in Figure 7(a).st-IPNs system scenario 1.
(a)
Subsystems 1 and 3
(b)
GlobalAt this identification stage, places and transitions are defined and the identified st-IPNs model the expected behavior of the system.Initially, the system works in operation mode 0 (o
0) as Son is not active. Subsystem 1 starts at place P
1,1. Activation of “S
o
n” changes the operation mode to o
1, the controller opens the valves (reflux and main), turns on the main pump, and sets the heater in mode 1 (t
r
1,1). A state change (P
1,2) is generated, because water flows through the path Heater-Pm-VR-Heater (F
1
=
1) (as it is showed in Figure 5). After a time (t
r
1,2) temperature reaches T
p
1 (18°C); therefore, the system evolves to other state (P
1,3). The controller starts the heating actions; it closes the reflux valve and sets heater in mode 2 (t
r
1,3), the state change cannot be measured by absence of sensors that detect the operation of the reflux valve (P
1,4). At this time “C
a
3” is activated, so the system operation mode changes to o
2; then the controller turns on pump 3 and opens valve 3 (t
r
3,1) and subsystem 3 changes its state to P
3,2 because water is flowing through path Heater-Pm-P3-V3-Heater. After a time (t
r
3,2), flow reaches its normal level (N
F
3) and subsystem 3 changes the state to P
3,3. Subsystem 1 continues with the reflux valve closed (t
r
1,4). It waits until reaching T
p
2 (28°C) and, therefore, it evolves to P
1,5. Subsystem 3 remains in P
3,3 until “C
a
3” is externally deactivated (
C
a
3
¯
) and o
1 is reached, then normal flow falls (t
r
3,3) and it changes to (P
3,4). Now, the controller turns off pump 3 and closes valve 3 (t
r
3,4). As a consequence, flow in the subsystem decreases (change to P
3,5) until flow level is low F
1. This transition makes the subsystem return to its initial state (P
3,1). Now, the controller opens the reflux valve and sets the heater in mode 1 (t
r
1,5). Subsystem 1 holds the state (P
1,6) until temperature is below T
p
2, (P
1,7), after the controller turns off the main pump, it closes the main valve and sets the heater in mode 0 (t
r
1,7). Subsystem 1 evolves to P
1,8 and after time (t
r
1,8) to P
1,9. Slightly, temperature decreases until it reaches the initial state (P
1,1). At the end, Son is deactivated (S
o
f
f) and the system operation mode changes to o
0.Nevertheless, the time array for each transition has only one value, so no probability distribution can be fit.As stated in Section4, at least 5 samples are needed to identify the distributions, so scenario 1 will be repeated until each distribution for each transition will be identified.After 5 observations of a transition, Algorithm3 is executed. This paper shows, as an example, the case with the greatest dispersion (t
r
3,2) as it is the worst case.Inputs:δ
o
2
(
t
r
3,2
)
=
{
t
3,2
1
⋯
t
3,2
5
}; α
=
0.05; α
c
t
=
0.05; d
o
p
=
0.05; CD
=
{
F
0
j
(
x
i
)
}
l
=
3, q
l
=
2.
forn
=
5;
δ
o
2
(
t
r
3,2
)
=
{
2.9,2.6,2.8,2.7,2.8
}
X
¯
=
2.76
,
S
=
0.11
,
d
=
0.1027.As d
>
0.05, there is not enough data to fit the distribution.After 20 observations, Algorithm3 gives a positive result: X
¯
=
2.75, S
=
0.09; d
=
0.049. As d
<
0.05, Algorithm 4 is executed and it will compute the distribution type and its parameters.α
c
t
=
0.05. p
-valu
e
α
c
t
=
0.29408 in table of Kolmogorov-Smirnov, with n
=
20.Hypothesis test:
H
0
:
F
0
(
X
)
∽
N
(
μ
,
σ
2
);
H
1
:
F
0
(
X
)
≁
N
(
μ
,
σ
2
).
Parameters estimationF
0
=
N
(
μ
,
σ
2
)
=
N
(
2.75,0.09
) and p
-
v
a
l
u
e
=
0.1621 based on test Kolmogorov-Smirnov.
AcceptH
0 since p
-value
≤
p
-valu
e
α
c
t. Therefore the data is normally distributed.To do a full identification of the process it is necessary to get 20 samples of each transition time.Figure8 shows the mean of the time array collected for t
r
3,2 versus the number of acquired samples in operation mode 2. It can be seen that for 20 samples onwards the mean remains stable.Figure 8
Behavior of transitiont
r
3,2.Thereby, the sequence of operation modeso
0
-
o
1
-
o
2
-
o
1
-
o
0 is fully identified. This identification includes the st-IPNs structures and all the density functions for each transition in the net.


## 5.3. Complete Identification of the System

The last test performed is the sequential generation of all the possible combinations of the external events, so the system must be able to generate a really complex language. Subsystem st-IPNs are showed in Figure9.st-IPNs after the complete identification.
(a)
(b)
(c)
(d)
(e)Results show the advantages of identifying subsystems instead of the global system. Figure7(b) shows the identification of the global system (without splitting in subsystems) in scenario 1. The complexity (number of places and transitions) of this st-IPN is similar to the complexity of the st-IPNs in the case of the subsystem identification. Nevertheless, as the complexity of the system increases, subsystem identification reduces complexity. Table 2 shows a comparison of the number of sates and transitions when identifying with or without splitting the system into subsystems.Table 2
Places and transitions.
Scenario
Sub
Global
Places
Tr.
Places
Tr.
1
7
2
3
2
2
14
14
14
15
3
22
22
22
23
4
28
32
24
31
5
28
32
24
32
6
28
32
24
32
7
28
32
24
32
8
28
32
24
32
9
28
33
33
42
10
28
33
39
52
11
32
41
44
59
12
32
42
50
68
13
32
43
52
71
14
33
43
54
74
15
34
45
57
78
16
35
48
61
83It can be seen that a global system identification increases its complexity with the number of operation modes considered, as a subsystem identification does not.This behavior is related to the number of possible events handled by the st-IPNs. The maximum number of global system states isQ
(
g
)
max
⁡
=
2
n
t
×
3
n
t, (n
t is the total number of output symbols) (6), whereas in identification by subsystem the maximum number of system states is Q
(
split
)
max
⁡
=
Q
max
⁡
,
1
+
Q
max
⁡
,
2
+
⋯
+
Q
max
⁡
,
c; that is, Q
(
split
)
max
⁡
=
2
n
1
×
3
n
1
+
2
n
2
×
3
n
2
+
⋯
+
2
n
c
×
3
n
c, where n
1
+
n
2
+
⋯
+
n
c
=
n
t, it can be seen that Q
(
g
)
max
⁡
>
Q
(
split
).


## 5.4. Language Generation

This section shows how the observed language is generated in both subsystem and global identification approach for scenario 1.The observed language for each subsystem is equal to the one generated by the st-IPNs:L
1
=
(
u
1,0
y
1,8
)
(
u
1,30
y
1,8
)
(
u
1,30
y
1,9
)
(
u
1,30
y
1,13
)
(
u
1,15
y
1,13
)
(
u
1,15
y
1,15
)
(
u
1,30
y
1,15
)
(
u
1,30
y
1,13
)
(
u
1,0
y
1,9
)
(
u
1,0
y
1,8
) at times τ
0
,
τ
1
,
τ
2
,
τ
3
,
τ
6
,
τ
10
,
τ
11
,
τ
12
,
τ
13
,
τ
14.L
3
=
(
u
3,0
y
3,0
)
(
u
3,3
y
3,2
)
(
u
3,3
y
3,3
)
(
u
3,3
y
3,2
)
(
u
3,0
y
3,0
)
(
u
3,0
y
3,0
) at times τ
0
,
τ
4
,
τ
5
,
τ
7
,
τ
8
,
τ
9.Figure7(b) shows the result of the identification process in case that the system is not split into subsystems. The language observed also is equal to the generated.L
g
=
(
u
0
y
4096
)
(
u
7680
y
4608
)
(
u
7680
y
4608
)
(
u
7680
y
6656
)
(
u
3840
y
6688
)
(
u
3888
y
6688
)
(
u
3888
y
6704
)
(
u
3888
y
7728
)
(
u
3888
y
7712
)
(
u
3840
y
7680
)
(
u
7680
y
7680
)
(
u
7680
y
6656
)
(
u
0
y
4608
)
(
u
0
y
4608
)
(
u
0
y
4096
)
(
u
0
y
4096
) at times τ
0
,
…
,
τ
15.A global input symbol is(12)
u
g
=
{
v
r
p
g
v
g
h
1
h
2
︷
u
1
v
c
1
v
c
2
︷
u
2
p
3
v
3
︷
u
3
p
4
v
4
︷
u
4
p
5
v
5
︷
u
5
}
.And a global output symbol is(13)
y
g
=
{
T
0
T
1
T
2
F
1
︷
y
1
P
o
F
2
N
F
2
︷
y
2
F
3
N
F
3
︷
y
3
F
4
N
F
4
︷
y
4
F
5
N
F
5
︷
y
5
}
.Note that, for example, at timeτ
3, the input symbol in the global language is u
7680 and at time τ
4 is u
3840 (see Figure 7(b)). At these times, input symbols in local subsystems are u
1,30 and u
3,3. In this time the output symbol in the global language is y
6656 and at time τ
4 is y
6688 (see Figure 7(b)). Moreover, at these times output symbols in local subsystems are y
1,13 and y
3,2. Table 3 shows these symbols.Table 3
I/O SYMBOL INτ
3 and τ
4.
τ
3
τ
4
τ
3
τ
4
u
g
11110
00
00
00
00
01111
00
11
00
00
y
g
1101
000
00
00
00
1101
000
10
00
00
u
1
11110
01111
y
1
1101
1101
u
2
00
00
y
2
000
000
u
3
00
11
y
3
00
10
u
4
00
00
y
4
00
00
u
5
00
00
y
5
00
00According to Definition16, a global I/O symbol, ω
i, is obtained from splice of ω
i
=
ω
1
i
⊕
ω
2
i
⊕
⋯
⊕
ω
5
i for i
=
3,4. Therefore the global and the subsystem approach represent the same language. Then, time synchronization splice of L
1 and L
3 gives L
g.Therefore, the advantage of using subsystems is that the method identifies only active languages, which allows determining which subsystem is operating.


## 5.5. Timed Transitions Identification in Different Operation Modes

Transition time depends on the operation mode of the system although the device maintains its operation sequence.Table4 shows the parameters of t
r
3,2 distribution for each operation mode. So, although subsystem 3 uses the same net for each operation mode (Figure 9) it uses a different distribution in each transition for each operation mode, so it can model complex behaviors.Table 4
Parameters oft
r
3
,
2.
Operation Mode
Distribution
o
0
NA*
o
1
NA
o
2
N (2.75, 0.094)
o
3
NA
o
4
NA
o
5
N (1.44, 0.0966)
o
6
NA
o
7
N (1.35, 0.085)
o
8
N (0.37, 0.0483)
*“Not applicable” means that the transition not is executed in this operation mode.Note that time changes can be notable with changes from 0.37 seconds to 2.75 seconds.


## 6. Conclusions

The proposed method identifies stochastic DES without previous model as a set of st-IPNs modelling the subsystems. The identification algorithm uses on-line I/O data to identify each subsystem, and it defines st-IPNs that generate the same language as the observed one. It has been proved that these st-IPNs are unique and deterministic, a desired feature for applications such as diagnosis. In addition the proposed method identifies systems with stochastic time. This is of great importance in industrial systems because processes are affected by a number of aspects such as the variability in the material flow, the fluctuation of power supply, the deterioration of machinery and devices, among others.The identification methodology is incremental and is directly related to the objective of modeling, that is, modeling the devices that compose the system in a constructivist way. This approach allows identifying all observable behaviors of the devices.Some of the main advantages of the methodology (with respect to the existing ones) are that it handles a lot of inputs and outputs with low computational cost (as they are split into subsystems) and it does not need a previous knowledge of the number of places neither the length of the language. Moreover, it generates reduced size models and it includes timed information. Besides, this proposal includes a process to determine whenever the system is fully identified which has not been proposed in other research.Future research will deal with a forgetting algorithm in order to forget behaviors that will be not more in use.



---

*Source: 835312-2014-07-09.xml*