## 3 Key Techniques
### FE Simulation Data Mapping Method
#### 3.3.2 Velocity Mapping Method  
When the FE simulation is converted to the Bullet physics engine simulation at the initial moment of collapse \(T_{\mathrm{c}}\), both displacement and velocity should be consistent between the two simulations. Consequently, velocity mapping is necessary. The velocity mapping method requires both the displacement and the kinematic type keyframes [43]. In Blender, the velocity of an object is defined as follows: At frame \(i\), convert the kinematic type of an object to the animation system and insert the kinematic type as a keyframe. At frame \(j\) (where \(i<j\)), convert the kinematic type of the same object to the physics engine system, and insert the kinematic type as a keyframe again. Consequently, during frame \(i\) and frame \(j\), the movement of the object will be controlled by the linear interpolation of the displacement at frame \(i\) and frame \(j\), respectively. After frame \(j\), the movement of the object will be controlled by the Bullet physics engine, and the object will gain speed \(\overline{v_{j}}\) at frame \(j\), as follows:  
\[\overline{v_{j}}=\frac{x_{j}-x_{i}}{(j-i)\times\mathrm{d}t} \tag{1}\]  
where \(i\) and \(j\) (\(i<j\)) denote the keyframe number; \(\mathrm{d}t\) represents the time interval between two adjacent keyframes, and in Blender, the default value is \(\mathrm{d}t=\frac{1}{24}\mathrm{s}\); \(x_{i}\) and \(x_{j}\) represent the centroid coordinates of an object at frame \(i\) and frame \(j\), respectively. The speed \(\overline{v_{j}}\) is the average velocity represented by the secant line, rather than the actual instantaneous velocity represented by the tangent line, as shown in Figure 5.  
Figure 5: Virtual displacement vector and velocity mapping method. In Blender, the Bullet physics engine adopts the symplectic Euler algorithm to update the motion of a rigid body [50], where the position of the object in the next frame is determined by the velocity, position and force of the adjacent previous frame, as shown in Equations (2) and (3). \[v_{t+\Delta t}=v_{t}+\frac{F_{ext}+F_{c}}{m}\Delta t \tag{2}\]  
\[x_{t+\Delta t}=x_{t}+v_{t+\Delta t}\Delta t \tag{3}\]  
where \(F_{\text{ext}}\) denotes external forces defined by the user; \(F_{\text{c}}\) denotes the constraint forces determined by the position and the velocity of the object in the adjacent previous frame. If the average velocity \(\overline{v_{j}}\) is used instead of the instantaneous velocity \(v_{j}\) at the initial moment of collapse \(T_{c}\), an error due to approximating the velocity will be introduced. To improve the accuracy of the velocity mapping, this work proposes a velocity mapping method that uses a virtual displacement vector \(x_{\text{virtual}}\). The virtual displacement is obtained using Equation (4), based on the velocity and displacement at the collapse keyframe \(j\). The proposed mapping method is shown in Figure 5. The blue curve is the displacement curve simulated by the FE method; \(t_{i}\) and \(t_{j}\) are the times corresponding to the displacement keyframe insertion points; \(x_{i}\) and \(x_{j}\) are the displacements corresponding to the displacement keyframe insertion points; \(v_{j}\) is the instantaneous velocity, and \(x_{\text{virtual}}\) is the virtual displacement vector. Consider the virtual displacement vector:  
\[x_{virtual}=x_{j}-v_{j}\times(j-k)\times\text{d}t \tag{4}\]  
\[k=j-n(n\geq 4) \tag{5}\]  
where \(x_{j}\) and \(v_{j}\) represent the displacement vector of the FE model and the velocity vector of the collapse keyframe \(j\), respectively; \(k\) is the keyframe number of \(x_{virtual}\), and the value of \(k\) is defined by Equation (5). After testing, the velocity cannot be mapped successfully in Blender when \(n\) is less than four. The real instantaneous velocity and displacement of the FE model are mapped in the Bullet physics engine by replacing \(x_{i}\) with the virtual displacement vector \(x_{virtual}\) in Equation (1).