# IoT-Driven Resilience Monitoring: Case Study of a Cyber-Physical System
## 6 Case Study
### Test Procedure  
The smart PV panel is positioned at the position that is in Section 6.1 for evaluating its general functionality. The testing procedure involves comprehensive data collection throughout the day, which is subsequently compared against solar energy availability and prevailing weather conditions. This comparative analysis aims to ascertain whether energy production aligns with daylight patterns and adapts to the dynamic environmental factors such as the cloudiness. Given the system's design to trace the sun's trajectory, the hypothesis posits that the smart PV panel is supposed to achieve peak capacity throughout the day until sunset, coinciding with a general reduction in irradiation. Correspondingly, a decline in energy production is expected along with diminishing irradiation. Conversely, during periods of cloudiness or partial cloud cover, an observable oscillation in energy production is anticipated. The verification of these hypotheses in the experiment involves a visual examination of the dynamic environmental conditions alongside energy production. Future studies to assess production accuracy could involve constructing data-driven or physical models of the system, utilizing tools such as MATLAB Simscape or PVlib Python toolbox. The comparison of actual production against the model-based simulation of production will provide a method for evaluating system performance. Furthermore, these future studies will offer the potential to gain insights into the noise present in data originating from embedded sensors. Therefore, such further exploration can unveil the real-world behavior of the system under dynamic environmental conditions, shedding light on the impact of various sources of noise. In the next subsection, the results of the tests and the collected data are reported and discussed. The test began at 7:46 in the morning and ended at 17:08, involving continuous data collection. Figure 17 illustrates the bus voltage values of the panel in volts. The data were recorded at a frequency of every 30 seconds. In Figure 18, the original dataset is depicted alongside a line plot that incorporates a rolling average (with a window size of 10). This rolling average ensures a smoother curve, facilitating a more nuanced analysis of the data. Figure 17: The voltage of the panel on Monday, 18 December 2023 in Lecce influenced by a dynamic environment including sunrise and sunset Figure 14, cloud cover Figure 15, and temperature Figure 16.  
The sunrise, occurring at 7:04 (Figure 14), leads to an initial surge in voltage as the test begins, eventually stabilizing at 22 volts, albeit with noticeable noise. This gradual increase can be attributed to the soft, ambient light during the early stages of sunrise, characterized by the sun on the horizon and the lingering twilight effect resulting from the sun's rays reflecting in the atmosphere. This stable condition persists until noon. Around 12:00 p.m., cloud cover emerges, introducing a decline in production. By 2:40 p.m., the sky becomes partly cloudy, further impacting the voltage, causing a decrease. As the test progresses towards sunset at 4:22 p.m., and twilight ensues, there is a dramatic effect on production, ultimately stabilizing at 3 volts. The nocturnal production, observed post-sunset, is attributed to light contamination from the building's surroundings. Yet, such a contamination does not yield any significant contribution to the power output and the system, no longer being able to sustain itself, and keeps operating until the residual battery power is no longer sufficient. At that point, observable at about 17:00, the power suddenly drops as an effect of the lack of power to feed the system. This synthesis affirms the system's functionality under real-world dynamic environmental conditions. In a nutshell, the comprehensive analysis of the smart PV panel's functionality under real-world dynamic environmental conditions provides a robust understanding of its behavior throughout the day.