**4.3 Demonstration case**

To demonstrate the two approaches of time position index identification, we consider a typical univariate time-dependent process:

$$\mathbf{x}(t) = -\frac{1}{200,000}t^2 + \mathbf{8} + \mathbf{g}(t). \tag{38}$$

where *g t*ð Þ is assumed to be an independent and normally distributed Gaussian noise at present time, *t* with mean equal to zero and standard deviation, 0.08. For simplicity of demonstration, a memory dataset, **X**, consisting of 50 samples (with *t* = 1–50 s at constant time intervals of *η* ¼ 1*s*), has been generated from the above process. By setting the window size, *r* = 10, a query input of length *r* is, then, generated. The actual location of the query input within the memory data is from *t* = 36–45 s, where the time position index of the current data point is at time *t* = 45 s. The goal is to automatically locate this index using the proposed methods. The generated memory data is plotted as shown in **Figure 5**, where the location of the query input is indicated in blue color.

With respect to the first approach, the global matrices, **G**s, between the query observations and each of the subsequences of the memory data, are first computed and visualized in **Figure 6** for the case of fault-free data. Next, a fault is added to the data point at present time *t* (*t* = 45 s) within the query data pattern and, then, the global matrices are recomputed as depicted in **Figure 7**. The DTW distances from global matrices are presented in **Figure 8** for both cases of fault and no fault. It can be seen that, the index at which the present data point is closest to has been identified in both fault-free and faulty cases. From **Figure 8** and by using Eq. (33), the time position index is *ε* ¼ 36 þ ð Þ¼ 10 � 1 45.

With respect to the second approach, the global matrix between the query observation and memory data is first computed and visualized in **Figure 9** for the fault-free case. Next, a fault is added to the data point at present time *t* (*t* = 45 s) within the query data pattern and, then, the global matrix is recomputed as shown in **Figure 10**. Finally, the last row of the global matrix is used to determine the index

**Figure 5.** *Memory data (in red) and query input (in blue, located at* t *= 36–45 s).*

**Figure 6.** *Global matrices, G, between X\* <sup>q</sup> and subsequences of X (fault-free case).*

**Figure 7.** *Global matrices, G, between X\* <sup>q</sup> and subsequences of X (fault case).*

in both cases of fault and no fault, using Eq. (37). The locations identified in both cases (*ε* ¼ 45) are marked in red square box as shown in **Figures 9** and **10**.

We observe that if the fault deviation intensity increases, the identification accuracy of the second approach decreases and the time position index would not be identified correctly, whereas, the first approach would still identify the time position index correctly but with high computational demand. That is, the second approach is less computationally demanding than the first approach but it is less accurate.

*Fault Detection by Signal Reconstruction in Nuclear Power Plants DOI: http://dx.doi.org/10.5772/intechopen.101276*

**Figure 8.** *DTW distances between X\* <sup>q</sup> and subsequences of X. (a) Fault-free case and (b) faulty case.*

**Figure 9.** *Global matrix, G, between X\* <sup>q</sup> and memory data, X (fault-free case).*

**Figure 10.** *Global matrix, G, between X\* <sup>q</sup> and memory data, X (fault case).*
