## 2 Materials and Methods
### Simulation of Manufacturing System and Digital Twin
However, current modeling methods and tools still rely on manual data entry and require human verification of the results. This makes the application of these methods very difficult, especially in the context of the modeling and simulation of bigger and more complex systems, which is one of the main difficulties in this field [65]. Work efficiency and the use of the means of production can be expressed by using the OEE metric that depends on three factors: availability, performance, and quality [15; 41]. \[\text{OEE}=\text{(Availability)}\times\text{(Performance)}\times\text{(Quality)} \tag{3}\]  
Availability is the ratio of the time spent on the realization of a planned task to the available time. Availability is reduced by disruptions at work and machine failures. \[\text{Availability}=\frac{\text{Planned time}-\text{Failure time}}{\text{Available time}} \tag{4}\]  
Figure 3: General scheme of the simulation model. Performance is the ratio of the time to complete a task under ideal conditions compared to the realization in real conditions, or the ratio of the products obtained in reality to the number of possible products to obtain under ideal conditions. Performance is reduced  
Figure 4: Scheme of the modeling and simulation methodology. (loss of working speed) by the occurrence of any disturbances, e.g., transport, machine loading/unloading, etc. \[\text{M}=\{\text{X},\,\Omega,\,\text{R},\,\text{C},\,\text{T},\,\text{Y}\} \tag{1}\]0  
Quality is expressed by the ratio of the number of good products and the total number of products. \[\text{M}=\{\text{X},\,\Omega,\,\text{R},\,\text{C},\,\text{T},\,\text{Y}\} \tag{1}\]1  
The number of good quality products is a random variable, which can be described by a normal distribution with standard deviation sigma. Quality levels are determined for ranges of the standard deviation sigma. In traditional production systems, the level of \(\pm\)3 sigmas is considered to be sufficient as it correspond to about 99.73% good quality products. However, in modern automated and robotic systems, the level of 4-6 sigmas is possible to achieve [15]. The quality factor can vary widely for different processes. The structure of loss of available work time according to OEE is presented in \[\text{M}=\{\text{X},\,\Omega,\,\text{R},\,\text{C},\,\text{T},\,\text{Y}\} \tag{1}\]2  
The need for making a better simulation model leads to the concept of a Digital Twin (DT). The DT is a virtual, dynamic model in the virtual world that is fully compatible with the corresponding physical existence in the real world and can simulate its physicality, characteristics, behavior, life, and performance at the appropriate time [66]. The concept of a DT of a production system is presented in \[\text{M}=\{\text{X},\,\Omega,\,\text{R},\,\text{C},\,\text{T},\,\text{Y}\} \tag{1}\]3 There is a need for an information link between the real system and the digital model. Therefore, an ERP database including all data about the production system and actual processes can be used in order to achieve up-to-date and correct information for the simulation. The simulation results of a DT can be used for decision support at the management level, because it enables a better understanding of the system behavior and prediction of the future state. \[\text{M}=\{\text{X},\,\Omega,\,\text{R},\,\text{C},\,\text{T},\,\text{Y}\} \tag{1}\]4 Loss of available work time according to OEE. \[\text{M}=\{\text{X},\,\Omega,\,\text{R},\,\text{C},\,\text{T},\,\text{Y}\} \tag{1}\]5 The concept of a Digital Twin of a production system. There are different versions of digital models possible, including a simple digital model with manual data flow, a digital shadow with one-way automatic data flow, and a full DT with two-way automatic data flow [66; 67]. In order for a DT model to be properly analyzed, information about the current WIP state is required. This information can be used for model initialization, and it enables the simulation to start without a warmup with exactly the same number of queues as in the real system.