# IoT-Driven Resilience Monitoring: Case Study of a Cyber-Physical System
## 6 Case Study
### Resilience Quantification and Synthesis Results  
The false position was applied at 9:00 a.m., and as shown in Figure 21, the collected data after the disturbance reveals a decline in voltage starting from 9:00 p.m. Figure 21 provides a clearer depiction of the system's behavior post-disturbance, unveiling its irregular response (Figure 3).  
In the initial phase, we can determine the recovery time using Figure 22 as around 10:20 p.m.; the system's behavior stabilizes again, hovering around a panel voltage value of 22 volts. The observed recovery time of 80 min appears to be lengthy. However, it is essential to note that the test was conducted on a testbed constructed with basic elements, with the primary goal being to assess the functionality of the Digital Twin (DT) and establish a sample process for quantifying resilience. Conducting the test in a facility equipped with industrial hardware would likely result in a shorter recovery time.  
Figure 21: Bus voltage measurement during the disturbance (voltate in volts).  
Figure 22: The irregular behaviour of the system after disturbance.  
The minimum production level the system reached after the disturbance was 16.1 volts. Although the decrease was dramatic, the system quickly initiated the recovery period and did not linger at the minimum level, showcasing a positive characteristic for a critical infrastructure system.  
In this stage, two types of polynomial fitting to the dataset are employed: Support Vector Regression (SVR) and Least Squares. The utilization of these two methods aims to highlight the difference between the straightforward second-degree polynomial least squares calculation and the more intricate SVR, with the objective of overfitting the resilience curve to demonstrate its behavior and calculate the Functionality Loss (Figure 23).  
Even though SVR attempts to fit the curve to the dataset more precisely than least squares, measurements lower than 20.5 volts still do not have an impact on the fitted curve (Figure 23). This is attributed to the closeness of the points and congestion of the measurements above 20.5 volts. However, a more complex solution could involve using the moving average to decrease the density and incorporate the effects of global and local minimums into the fitted curve. Nevertheless, since the system starts to recover very quickly--the global minimum occurs in less than 10 min with values under 19 volts--this additional modification is deemed unnecessary.  
Considering that the stable value before the disturbance was 22 volts and the system stabilized again at 22 volts after 10:30 a.m., a horizontal line is considered on the Bus Voltage Value axis (shown in green), and the area between the fitted curve and the horizontal area is calculated (in the figures the area that shows the Functionality Loss is highlighted in yellow). Figures 24 and 25 depict the results.  
The results of calculating the Functionality Loss for the Least Squares-fitted resilience curve is 6957.07, and for SVR is 5385.83. The Least Squares-fitted resilience curve shows higher Functionality Loss; however, it does not represent the behavior of system. On the other hand, the SVR curve shows less Functionality Loss. Considering the absence of the global minimum voltage in the SVR curve, the the Least Squares-fitted resilience curve sounds closer to reality. However the graphical representation of the behavior is crucial, and in this case, we select the SVR-fitted resilience curve.  
Figure 23: The resilience curve (fitted by SVR).