## 3 Digital Twin and Physical Twin Integration
### Virtual Prosthesis Dynamic Model and Trackers Interface  
The role of the dynamic model is to accurately reproduce the motion dynamics of the virtual prosthesis, starting from the data of the trackers and the epidermal myoelectric sensors. The whole model can be broken down into two functional subassemblies. The first aims to replicate the dynamics of the arm and forearm on which the prosthesis is attached through an inverse dynamics model starting from the information acquired from the trackers. The second subassembly is needed to manage the movements of the grasping fingers (Figure 3). Figure 3: Schematic overview of the dynamic model of the arm. The locations of the anchor points of the springs connecting the trackers and the body segment are computed during initial calibration. Figure 2: Physical and digital twins of the VR training environment. The physical twin includes the kinematic sensors (trackers), the myoelectric sensors, and the head-mounted display. The digital twin is driven by the multibody dynamic model able to simulate real-time physics including collisions. The first subassembly consists of four rigid bodies. The first two, the main ones, are representative of the arm and forearm. They are connected by a spherical joint that replicates the functionality of the elbow in the distal portion of the arm. Although, from an anatomical point of view, the elbow joint does not have a simple spherical joint behaviour but a more complex elasto-kinematic characteristic [27], this assumption simplifies the complexity of the constraining equations without affecting the model's reliability. This approach can easily be adapted to the presence of the trackers for controlling the relative motion between body segments. The first subassembly then includes two other dummy (fictitious) bodies that are necessary to replicate the presence of trackers and efficiently transfer the information coming from them. These dummy bodies are not connected to the rest of the system by kinematic pairs but only by two elastic bushing elements. This solution has been chosen to obtain a reliable and computationally efficient model. This choice is often used as a smart compromise in overabundant systems [28]. In fact, the direct transfer of information from the trackers to the respective arm and forearm bodies (for example, by means of constraint equations that impose the equality of positions and attitudes) leads to an overabundant system of equations (too many constraining equations with respect to the degrees of freedom). This produces complications in the integration phase, and the solution of the dynamic system may fail or be extremely slow. Considering that a body in a three-dimensional space has 6 degrees of freedom, the number of degrees of freedom of a system composed of two rigid bodies connected by a spherical joint is equal to 9, while the constraint equations from the trackers are 2 \(\times\) 6 = 12. This leads to an overabundant system (12 \(>\) 9). Using bushing elements instead of kinematic constraints does not alter the number of the system's number of degrees of freedom, which remains 9. From a mathematical point of view, a bushing element between two reference systems belonging to two different bodies can be written as  
\[\{F\}=[K]\{\Delta\} \tag{1}\]  
where \(\{F\}\) is the vector of the generalised forces, \([K]\) is a 6 \(\times\) 6 stiffness matrix, and \(\{\Delta\}\) is the vector of the generalised (linear and angular) displacements between the two reference frames. In other words, a bushing element behaves as a multidimensional spring force. By imposing a sufficiently high value on all the elements of the \([K]\) matrix, the bushing element behaves in a similar way to a fixed constraint, ensuring the correct connection between the bodies. However, the intrinsic penalty approach of the bushing element allows the tolerance of slight measurement errors, tracker movements on anatomical segments, skin/cloth artefacts, and slight calibration errors without a significant impact on the solution of the equations.