Chapter 6. Similarity search based on DTW
6.3. Application example: Situation assessment in a two tank system
As an application example, the proposed approach has been used in a laboratory plant for situation assessment purposes. In this plant (Fig. 6.8), the level in tank A is controlled by means of a PID controller by pumping water from a reservoir (tank B).
Application example: Situation assessment in a two tank system 127
The level in tank A and the control signal (pump) are the monitored process variables. Three valves (V1, V2 and V3) can be manipulated in order to simulate obstructions and leakages. Then, several situations are possible by the appropriate combination of opening and closing valves (Table 6.3). Additionally, the system dynamics can be modified slightly by filling or emptying the reservoir with external water. Then, the input and output of external water also creates interesting situations to be detected. The experiments have been developed under the assumption that two situations cannot be overlapped. Thus, changes in the configuration of valves are only performed when the process is in a steady state.
Table 6.3 List of situations as a result of the combination valve.
Description V1 V2 V3
Normal Behaviour OPEN OPEN CLOSED
Obstruction in pump or input pipe CLOSED OPEN CLOSED
Obstruction in the output pipe OPEN CLOSED CLOSED
Leak in input pipe or pump OPEN OPEN OPEN
The monitoring system will be able to assess such situations and diagnose the origin of abnormal behaviour according to the behaviour of measured signals described by the sequences of episodes. A representation based on a set of 13 types of episodes (Fig. 6.2) is used to represent symptoms in the case definition.
Table 6.4 Local distance between episodes. \ — / 0 .72 .85 .7 .62 .67 .75 .9 .8 .87 .95 1 .67 .72 0 .7 .62 .77 .82 .75 .75 .87 .95 .87 .67 1 .85 .7 0 .52 .8 .85 .6 .27 .9 .82 .65 .8 .87 .7 .62 .52 0 .45 .6 .6 .6 .82 .9 .82 .87 .95 .62 .77 .8 .45 0 .27 .6 .85 .65 .82 .9 .95 .87 \ .67 .82 .85 .6 .27 0 .55 .8 .27 .6 .85 .9 .75 — .75 .75 .6 .6 .6 .55 0 .55 .6 .6 .6 .75 .75 / .9 .75 .27 .6 .85 .8 .55 0 .85 .6 .27 .67 .82 .8 .87 .9 .82 .65 .27 .6 .85 0 .4 .8 .85 .7 .87 .95 .82 .9 .82 .6 .6 .6 .4 0 .45 .7 .62 .95 .87 .65 .82 .9 .85 .6 .27 .8 .45 0 .57 .77 1 .67 .8 .87 .95 .9 .75 .67 .85 .7 .57 0 .72 .67 1 .87 .95 .87 .75 .75 .82 .7 .62 .77 .72 0
128 Similarity search based on DTW
A major benefit of this set of episodes for situation assessment is that discontinuities and stability periods (usual in abnormal and in normal situations respectively) are explicitly represented by means of 5 types of episodes ( — ). Local distances between episodes are defined in Table 6.4. Note that these distances are different to the ones in Table 6.1. The difference in local distances between types of episodes does not affect the global measure of similarity too much, although it allows a finer measure to be obtained. The main difference resides in defining a major or minor distance between those episodes with different behaviour.
A test case base has been built by obtaining the sequence of episodes for the two monitored variables (Fig. 6.9) in a time window of 70 seconds. After testing the most common situations, the case base is composed of 29 cases (Table 6.5) with the description of the situation. This information associated with faults is structured according to three criteria: the part of plant or operation that is being affected, the affected component of the plant and the corresponding diagnosis. This is useful in the final decision about the situation in order to distinguish ambiguous situations when multiple diagnoses are retrieved.
Fig. 6.9 Level and control signals: acquired signal and the corresponding episode-based representation.
In order to test the operability of the EpDTW algorithm, each one of the 29 cases has been compared to the others. Then, 841 similarity measures are carried out taking into account the pattern composed of the level and control signals. The similarity obtained by means of EpDTW gives a normalised value where zero corresponds to identity. Then, similarity between cases is obtained from the average of the similarity for the two signals. From a general point of view, if the 29 cases are analysed by ordering the value
Application example: Situation assessment in a two tank system 129
of similarity obtained in comparison to the rest of cases, it can be deduced that a threshold of 0.1 allows enough cases for a correct situation assessment to be obtained. Thus, this threshold has been applied to consider the K-nearest neighbour symptoms to retrieve.
Table 6.5 The Case Base.
Case Level Control Location Component Situation Diagnosis
1 — \ — — Input tank A Input pipe or pump Obstruction
2 — \ — — — Input tank A Input pipe or pump Obstruction
3 — — — — Input tank A Input pipe or pump Obstruction
4 — — — Input tank A Input pipe or pump Obstruction restored
5 — — — — Input tank A Input pipe or pump Obstruction restored
6 — / — — \ — Input tank A Input pipe or pump Obstruction restored
7 / — — \ — Input tank A Input pipe or pump Obstruction restored
8 — — — — Output tank A Output pipe Obstruction
9 — — — \ — Output tank A Output pipe Obstruction
10 — / \ — — \ — Output tank A Output pipe Obstruction
11 — — — — Output tank A Output pipe Obstruction restored
12 — \ / — — / — Output tank A Output pipe Obstruction restored
13 — — — / — Output tank A Output pipe Obstruction restored
14 — — — / — Input tank A Input pipe or pump Leakage
15 — — — / — Input tank A Input pipe or pump Leakage
16 — / — / — Input tank A Input pipe or pump Leakage
17 — — — Input tank A Input pipe or pump Leakage
18 — \— — \ — Input tank A Input pipe or pump Leakage restored
19 — — — — Input tank A Input pipe or pump Leakage restored
20 \ \— Input tank A Input pipe or pump Leakage restored
21 — — \ — Input tank A Input pipe or pump Leakage restored
22 — — Input tank B External water Input of ext. water
23 — —\ Input tank B External water Input of ext. water
24 — \— Input tank B External water Conclude input
25 — — Input tank B External water Conclude input
26 — — Output tank B External water Output of ext. water
27 — —/ Output tank B External water Output of ext. water
28 — — Output tank B External water Conclude output
130 Similarity search based on DTW
In the following paragraphs, three illustrative examples are presented using this short case base. For this purpose cases 2, 15 and 8 have been used to simulate a new solution (obviously the distance between these cases and themselves is zero). They have been compared to the whole case base and those that have a distance degree inferior to the threshold ( 0.1) have been retrieved. Table 6.6 to Table 6.8 represent the retrieved cases (first row) and the associated distances (second row).
Table 6.6 Retrieved cases and similarity for case 2.
Case 2 3 1
Distance 0 0.0306 0.0516
In Table 6.6 (Case 2), the diagnosis corresponding to each case is the same and therefore the situation assessment is correct. In the assumption that case 2 is a new situation, the similarity to the registered cases does not make the inclusion of this new case in the case base necessary.
Table 6.7 Retrieved cases and similarity for case 15.
Case 15 13 14 11 16 17 3
Distance 0 0.0333 0.0333 0.0639 0.0639 0.0681 0.0806
Case 15 (Table 6.7) yields 6 cases with a distance inferior to 0.1 as result. The two most similar cases (13 and 14) offer different symptoms, nevertheless, case 13 corresponds to a situation obtained by the restoration of a previous obstruction. Considering that two cases cannot take place simultaneously and that in previous instants an obstruction has not been noticed, cases 13 and 11 can be discarded because they give an inconsistent assessment. Finally, the final selection can be decided by a simple frequency analysis: 3 of 4 cases diagnose an input leakage (pump or pipe) in tank A against one different case. Therefore, this would be the diagnosis.
If previous states are not considered, then cases corresponding to restoration of previous obstructions cannot be deleted. Then, evaluating the frequency, 4/6 indicate problems in the input of tank A, while the remaining 2/ 6 indicate problems in the output. From the cases related to input, all the cases indicate that the failure is located in the pump or pipe. So, this would be the assigned diagnosis, with the probability that the failure is caused by leakage. With this incomplete result the case would be stored in the case base.
Online DTW 131
Table 6.8 Retrieved cases and similarity for case 8.
Case 8 19 9 18 21 5
Distance 0 0 0.0306 0.0581 0.0639 0.0917
Finally, in the example of case 8 (Table 6.8), it will be supposed that the registered case exists but the previous states are not considered; therefore the cases corresponding to a restoration of a previous failure are not annulled. So, case 8 offers 5 similar (including case 8) cases but with a different situation assessment; one case is even completely identical but with different symptoms. On evaluating frequency, 4/5 of these cases correspond to problems with the input of tank A, while 1/5 correspond to the output. This would indicate that the problems are with the input of tank A, which is an incorrect diagnosis. This only happens if the previous states are not considered, since cases 19 (perfect matching), 18 and 5 correspond to restoration failure.