## 5 Conclusions  
The simulation of Digital Twins of production systems is an important aspect of Industry 4.0, as it allows the support of projects related to the development and implementation of modern manufacturing systems throughout their life cycle.  
The simulation of the manufacturing system is very helpful as it becomes a repository of knowledge about the real system and enables the analysis of its dynamics, but for proper functionality, the model should be closely similar to the physical system so as to constitute a Digital Twin. The main problems are related to unstable human labor and human errors, as well as machine failures, which are difficult to predict but have a major impact on production processes.  
In order to properly simulate the DT model, information about current WIP state is required. This information can be used for model initialization, and it enables us to start the simulation with exactly the same number of queues as in the real system, without the need for a warmup. The main contribution of this work is the detailed methodology of building a Digital Twin for a hybrid human-robot-operated manufacturing system with unstable processes and WIP changes.  
The results show that the initial WIP value has a significant effect on the productivity of the analyzed manufacturing system, as the mean value of production was increased by about 10% when the initial WIP was changed from 0 to 8 pieces. At the same time, better stability of the whole system was observed with decreased dispersion of results by \(-17\%\) and the standard deviation was decreased by \(-26\%\).  
The production effectiveness was measured by the OEE metric. The expected value was 0.80 according to the production plan, however, the obtained OEE values were different for each working day because of failures and quality issues, but low production during the first and second days was recovered in the following days, and the weekly production plan was realized with a total of 850 finished pieces.  
The main problems were related to failures of the welding equipment, and there is still room for improvement of the availability and quality, as a World Class OEE is defined from the level of 85% or higher.  
Database connectivity with SQL access and PLC (Programmable Logic Controller) emulation of simulation software combined with optimization features makes FlexSim a promising choice for experimenting with the DT concept. There is a wide variety of OPC (Open Platform Communications) or ODBC (Open Database Connectivity) software to choose from, and it is relatively easy to set up a connection with a database server including, for example, Oracle, SQL, Microsoft Access, or Excel. Data obtained after simulation can be written to a database similar to data from a real production system and can be used for further analysis.  
The presented method can be also used in similar enterprises from other industries, especially for those with discrete processes, high WIP variability, and for further synchronization of other DT parameters.  
Further research includes a full parameterization of the DT model with the states of all objects (including machines, employees, robots, AGVs, product types, etc.), allowing the simulation to start from the current state of the actual production system.  
The following supporting information can be downloaded at: [[https://www.mdpi.com/article/10.3390/app132212261/s1](https://www.mdpi.com/article/10.3390/app132212261/s1)]([https://www.mdpi.com/article/10.3390/app132212261/s1](https://www.mdpi.com/article/10.3390/app132212261/s1)). File S1: Scenario 1; File S2: Scenario 2.  
This research received no external funding.  
Not applicable.  
Data are contained within the article and supplementary materials.  
The author declares no conflict of interest.