# IoT-Driven Resilience Monitoring: Case Study of a Cyber-Physical System
## 5 Cyber-Physical System
### Energy Digital Twin: Virtual World Interactive Model
#### 5.3.2 Operation Service  
The OS service is driven by the system's functioning based on embedded sensors and real-time data to simulate production and the current state of the physical asset. Such a service carries out a series of tasks such as the following: (1) ensuring the real-time simulation of dynamic environmental conditions by referring to environmental data detected from its deployment location, (2) employing AI methods to forecast the values of environmental parameters, and (3) feeding these predicted values to the ISS to estimate both the ideal state of the system and the corresponding actual production, using real-time data analytics. The OS service represents a central node for the CP system that interfaces with the SPVS's physical components and synthesizes data from various Energy DT services, external APIs, and embedded sensors. The OS service utilizes software modules for implementing system interaction and data visualization. By observing Figure 5, it is possible to note that the OS includes a software module called _Game Engine_ (GE). The GE consists of an instance of Unneal Engine and is responsible for rendering the high-fidelity virtual model. It offers a real-time graphical representation of the physical asset's digital counterpart. This graphical representation is more than a mere visual representation, considering that it enables functional simulations, providing an interactive platform that mirrors the SPVS's physical state and behavior. The GE component plays a pivotal role for the proposed framework because it provides a graphical representation of the DT and the corresponding digital representation of the current state of the physical asset at the same time. It merges field data obtained from the SPVS and data received from other Energy DT's services to process and exhibit the corresponding results, using intuitive dashboards and illustrative charts. These dashboards and charts provide a detailed snapshot of real-time data, enriched by the valuable predictions generated by the Energy DT's services dedicated to the delegated predictive analytics to achieve this goal.  
The OS service operates a convergence between data directly obtained from embedded sensors of the SPVS and data streams coming from other Energy DT's services. It orchestrates this information into detailed analytical visualizations and an accurate representation of the physical state. Among the assimilated data, the OS receives detailed anomaly effects such as shading and soiling on the PV panel. This specific information, coupled with weather-related data retrieved from the DSPM component, prompts the OS service to render an approximate cloud condition and its consequent impact on light physics. Moreover, it utilizes forecast data from the other services of the Energy DT to perform simulations predicting future conditions. This predictive information is effectively used to generate visual comparisons through specialized graphics and dashboards (see Figure 10). These visualizations enable a direct comparison of real-time operational data with predicted outcomes, providing a layered and comprehensive perspective on the system's functionality.  
The OS service establishes a real-time bi-directional communication with the SPVS to facilitate the monitoring of the current state of the physical asset and the manual tuning of a set of parameters. In this way, both the state of the digital and physical assets are synchronized and it is possible to interact with the physical SPVS by executing direct commands through the dashboard made available by the user interface rendered in the Unreal virtual world.  
Finally, the OS service facilitates bidirectional communication with the SPVS, enabling its direct control. In this way, it becomes possible to (1) accentuate the synergy within the CP infrastructure, (2) empower the dynamic interaction with the SPVS, and (3) ensure optimized performance through continuous monitoring and immediate control adjustments, based on the system's data-driven insights.