# Prognostics of Electromechanical Actuator with Partial Time Scaling Invariant Temporal Alignment
## 5 Alignment by Successive Displacements
Since no simple theoretical solution can be found for Equation (1), the set \(\Theta_{j}^{h}\) will be determined by an iterative optimization procedure. The principle is to sample the domain of definition of the set \(\Theta\) to find the optimal candidate about Equation (1). Note that the optimization result is not a single direction but rather a set of directions associated with each iteration of the alignment method; hence, \(\Theta_{j}^{h}=(\theta_{1},\theta_{2},\ldots\theta_{K})_{j}^{h}\). In total, there are \(p\times(q-1)\times K\) directions to be found to perform the alignment on the database. The underlying idea is that the movement of the source cloud modifies its shape, and the previously chosen projection direction may no longer be optimal. The same cost function is used for each iteration. To enhance the computational efficiency, the calculation of projection directions \((\theta_{0},\theta_{1})_{j}^{h}\) is limited to two directions, where \(1\leq j\leq p\) and \(1\leq h\leq(q-1)\). Importantly, these projection directions remain constant throughout the iterations of the method, and any changes in direction are contingent upon a condition evaluation based on the current alignment status. Specifically, the direction \(\theta_{0}\) is employed while the source experiences significant movement. As soon as this movement subsides, the direction \(\theta_{1}\) is selected to prevent the source from converging prematurely to  
Figure 7: Illustration of the modified time series alignment method. a local minimum. This strategic decision significantly reduces the number of projection directions required. Consequently, the source series is aligned with the target series using these projection directions. Upon achieving a specified cost threshold, the projection direction is transitioned from \(\theta_{1}\) to \(\theta_{2}\), and the alignment procedure proceeds. Step 2--The assignation function source-target  
This step involves finding the assignment function \(\mathcal{T}_{k}\), recalculated at each iteration \(k\), from the assignment of the nearest neighbors in the projected space between the points of the source cloud \(\tilde{X}_{j}^{l}\) and the points of the target cloud \(\tilde{Y}_{j}^{h}\). To do this, [11] developed an algorithm to solve the complete alignment problem in quadratic time, i.e., \(O(n^{2})\). Algorithm A1 (all the algorithms developed in this article are present in Appendix A section) allows for this quadratic assignment and represents step 2 of Figure 7. It can be divided into three main parts, with the first part, lines 2 to 15, allowing for constructing the first version of the assignment function \(\mathcal{T}_{k}\). The second part, lines 17 to 20, decomposes the initial interval into linear sub-intervals, and the third part solves the assignment problem on the previous sub-intervals. Figure 8 represents the table nnAssignArray in Algorithm A1, which is associated with the assignment function \(\mathcal{T}_{k}\). The assignment function \(\mathcal{T}_{k}\) is obtained by the _Quadratic Assignment_ method of Algorithm A1 from [11]. The method then produces an assignment from the two clouds projected in a direction \(\theta d_{j}^{h}\in\Theta_{j}^{h}\), the number \(n\) of points to align in the source, and the number \(m\) of points to align in the target. The sizes of the segments to be aligned are then stored in a structure param. Note that, in its current state, the segments to be aligned necessarily have \(n\) and \(m\) points, as the starting point index is automatically set to 1. However, extending the method to segments that do not start with the first point in the series is possible. For example, to align a 900-point segment with a 1130-point segment, the structure will be initialized as follows: \(\texttt{param}=\{\text{start}_{0}=0,\text{end}_{0}=900,\text{start}_{1}=0, \text{end}_{1}=1130\}\) in Algorithm A1. After this initialization, the first nearest neighbor assignment is made by the Nearest Neighbor Match function defined by Algorithm A2.