# Prognostics of Electromechanical Actuator with Partial Time Scaling Invariant Temporal Alignment
## 5 Alignment by Successive Displacements
Therefore, the projection direction index is modified to maintain an optimal convergence rate. Consequently, the points of the shifted source cloud will be projected onto the second and last direction of the set \(\Theta_{j}^{h,*}\). As in Algorithm A1, a matrix projection onto a line is translated by matrix multiplication. Indeed, with \(\bar{X}_{j}^{l}\in\mathcal{M}_{n,2}(\mathbb{R})\) and \(\Theta_{j}^{h,*}[i]\in\mathcal{M}_{2,1}(\mathbb{R})\), the operation at line 22 creates a column vector \(\bar{X}_{j}^{l}\Theta_{j}^{h,*}[i]\in\mathcal{M}_{n,1}(\mathbb{R})\) stored in projSrcWIndex with its respective index vector. The same operation is performed in Algorithm A4 at line 26 for the target cloud. The arrays projSrcWIndex and projTargetWIndex are then sorted in ascending order of their values in the first column of these two structures. This step allows the projected points to be sorted while retaining their respective indices and, thus, their positions in the initial cloud. Two new column vectors projSrc and projTarget are created at lines 35 to 38 with the ordered points. The Quadratic Assignment function described in Algorithm A1 is then applied to these vectors to obtain the value of the assignment function \(\mathcal{T}_{k}\) via the nnAssignArray array. Afterward, manually determined hyperparameters are chosen to create two values of a sigmoid function. These two values will weigh the displacement on the two dimensions of the source cloud towards the target cloud. Ranging between 0 and 1, they allow the displacement of the source to be moderated to avoid excessively rapid convergence towards a suboptimal alignment. The Advection function of Algorithm A3 then produces the displaced cloud \(\bar{X}_{\mathcal{T}}\) at line 49. The latter is added to the states of the source \(\mathbb{X}_{j}^{l}\), and the local cost is updated. Repeating these steps until the null displacement of the source towards the target is achieved allows the time series \(X\) and \(Y\) of any size to be aligned. Now that the global time series alignment algorithm has been detailed, it is tested on experimental data. To do so, the source is represented by the Root Mean Square (RMS) descriptor of the LLA actuator, and the same RMS descriptor of the LRA actuator represents the target. The point clouds associated with each of them are denoted, respectively, as \(\bar{X}_{\text{RMS}}^{\text{LLA}}\) and \(\bar{X}_{\text{RMS}}^{\text{LRA}}\). To demonstrate that the method works with series of all sizes, the source will be truncated to 900 cycles, and, from the resulting segment, 10% of the points will be randomly selected to form \(\bar{X}_{\text{RMS}}^{\text{LLA}}\)(0:900:0.10). In contrast, the target of 1130 points will remain unchanged as \(\bar{Y}_{\text{RMS}}^{\text{LRA}}\)(0:1130:1). The alignment results are shown in Figure 10.  
Figure 10 represents 4 different states of the source point cloud during the alignment procedure: \(\hat{X}_{\mathcal{T}|k=0}\), \(\hat{X}_{\mathcal{T}|k=1}\), \(\hat{X}_{\mathcal{T}|k=2}\), and \(\hat{X}_{\mathcal{T}|k=47}\). The spacing of the iterations \(k\) is not constant, to better visualize the displacement of the source towards the target. Indeed, the displacement is more significant during the early iterations of the alignment algorithm. This result demonstrates that the method works even for incomplete series, as long as the number of points in the unknown source series is less than that of the known target series that constitute the database. However, at this stage, it is impossible to quantify the quality of such an alignment. This is why Section 6 details the development of a new cost function \(\mathcal{L}\).