## 3 Methodology
The developed Digital Twin (DT) offers a robust and detailed platform for exploring and resolving inefficiencies within the production system. The Digital Twin (DT) accurately reflects real-world operations and enables production process simulation, analysis, and optimization. The capacity of the Digital Twin (DT) to accurately represent real-world operations and simulate different scenarios also enables an in-depth analysis of operational issues, thereby providing evidence-based decision support. Exploring the potential within the domain of DT enables the identification of current inefficiencies and the anticipation of future problems. Furthermore, it facilitates the continuous optimization of processes. The primary objectives are to enhance operational efficiency, reduce costs, and elevate product quality, establishing a robust foundation for continuous improvement and future innovation. The initial stage of analyzing the causes of inefficiency is to identify the problem areas within the production process. This can be achieved by analyzing data collected in real-time using the DT, which provides a comprehensive overview of the daily operational process. Once the principal causes of inefficiency have been identified, assessing their impacts on the production process is necessary. The Digital Twin enables the simulation of diverse operational scenarios and the assessment of the impact of inefficiencies. Below is the mathematical formalization:  
1. System Representation  
The Digital Twin (DT) is represented as a dynamic system S composed of the following:  
* Physical System (P): The real-world entity being modelled;
* Digital Model (D): A virtual replica of P;
* Data Flow (F): The bidirectional communication between P and D;  
The system can be expressed as follows:  
\[\text{S}=\text{(P,D,F)}\]  
2. Data Integration  
Real-time data from sensors (S) and historical databases (H) feed the DT. The data flow F includes the following:  
* Input data (I\({}_{\text{t}}\)): Current sensor readings at time t;
* Historical data (H\({}_{\text{t}}\)): Aggregated data up to time t.  
\[\text{F}=\text{I}_{\text{t}}+\text{H}_{\text{t}}\]  
3. Process Simulation  
The DT simulates operational metrics such as Overall Equipment Effectiveness (OEE):  
OEE = A\(\cdot\)P\(\cdot\)Qwhere  
* A = Availability (Operational Time/Planned Time);
* P = Performance (Actual Output/Ideal Output);
* Q = Quality (Good Units/Total Units). * 4. Predictive Maintenance  
Using machine learning models, predictive maintenance identifies potential failures (Fpred):  
Fpred = argmax (t\(\in\)T) P(Ft,Dt,Ht)  
where P(Ft,Dt,Ht) is the probability of failure at time t given the Digital Twin's current state Dt and historical data Ht. * 5. Optimization and Decision Making  
The DT optimizes performance by focusing on global objectives such as maximizing Overall Equipment Effectiveness (OEE), throughput, or minimizing total production costs:  
Max \(\Phi\)(x) subject to g(x) \(\leq\) 0  
where  
* x: Decision variables (e.g., machine speed, resource allocation);
* \(\Phi\)(x): Objective function (e.g., maximize throughput, minimize downtime);
* g(x): Constraints derived from system and cost limitations. * 6. Validation and Feedback  
The validation process uses statistical methods like chi-square tests to compare simulated data (Dsim) with real-world data (Dreal):  
\[\chi^{2}=\sum(\text{Dreal}-\text{Dsim})^{2}/\text{Dsim}\]  
Trend analysis ensures the DT reflects accurate temporal patterns by comparing control charts for Dsim and Dreal. Once the impact of inefficiencies has been evaluated, the subsequent phase is the implementation of the solutions that address them. The Digital Twin permits the testing and validation of solutions in a virtual environment before their implementation in the physical world. This approach mitigates the risks associated with operational changes and optimizes solutions before implementation.