## 5 Experiment
### Experimental Result
#### 5.3.2 Predicted RUL Results  
Different lengths of sliding window settings capture data patterns and features at different scales. Appropriate sliding window settings can enhance the overall accuracy of prediction models. To determine the optimal window length and maximize the performance of the prediction model, this study experimented with sliding window sizes of 10, 20, 30, 40, 50, and 60 for comparison of the experimental results. Figure 8 illustrates the \(RMSE\) values under different sliding window sizes across four datasets. As seen in Figure 8, the \(RMSE\) values of the model were minimized when the sliding window size was 40 for FD001 and FD002 and when it was 50 for FD003 and FD004.  
Figure 9 shows the change in loss function throughout the entire iteration process during training of the SAM-TCN neural network. As seen in Figure 9, it is evident that across all four datasets that as the number of iterations increased, the predictive performance of the SAM-TCN neural network steadily improved. The objective loss function continuously decreased and eventually stabilized.  
Figure 8: Impact of different sliding windows on prediction errors.  
Figure 7: Linear and segmented degradation curves of engine RUL.  
To explore the performance of the proposed Adam-SAM-TCN method across different datasets, the results are shown in Figure 10. In the figure, the horizontal axis represents the engine number, and the vertical axis represents the RUL of the engines. The solid blue line indicates the actual RUL values of the engines, while the dashed red line represents the predicted RUL results using the method proposed in this paper. As seen in Figure 10, it can be observed that the blue solid line fits closely with the red dashed line, indicating a small prediction error and hence a good predictive performance. The predictions for the single operating condition datasets FD001 and FD003 are closer to the actual values, with smaller prediction errors. In contrast, datasets FD002 and FD004, collected under multiple operating conditions, exhibited more complexity and posed greater challenges for prediction, resulting in lower prediction accuracy. Overall, the proposed method demonstrates a generally close alignment between the predicted results and actual values across all datasets.  
Figure 9: Loss function variation of prediction model across four datasets.  
To better analyze the predictive performance of the proposed method on individual engines, RUL predictions were conducted on the engines numbered 20, 185, 1, and 111 from the test set across four datasets. The predicted results are shown in Figure 11, where the actual RUL values of the engines closely align with the predictions, with the majority of predicted values falling within the 95% confidence interval. This indicates that the proposed method demonstrates effective predictive performance.  
Figure 11: _Cont._  
Figure 10: Comparison of actual and predicted RUL values across 4 datasets.  
Figure 12 shows the distribution of prediction errors for the remaining useful life of engines on four datasets. The horizontal axis represents the size of prediction error. The vertical axis shows the frequency of occurrences within each prediction error interval. As seen in Figure 12, it is evident that the majority of prediction errors across all four datasets fell within the range of \([-25,25]\), indicating that the proposed method provides fairly accurate predictions of engine RUL.