## 3 Numerical Model  
The simulation of the motion of a cylindrical part on a vibrating plane is not a simple task due to the non-linear phenomena that take place, e.g., the frequent transition between states of motion and the impacts with the stop plate. In order to address the problem, a combination of a MATLAB (R2019b, MathWorks Inc., Natick, MA, USA, 2020) script and its simulation environment Simulink was adopted. The simulations are started from a main MATLAB script which initializes the variables at the initial conditions: the cylinder is touching the track and in contact with the stop plate, as depicted in Figure 1b. The cylinder is supposed to start with a pure rolling motion; therefore, the main script launches a Simulink simulation, which implements this case. When a proper dynamic condition is met, the simulation is stopped and the simulation of rolling with sliding motion is started by the main script. Such simulation is stopped when particular kinematic and dynamic conditions are met. The process is iterated until the desired simulation duration is reached.  
The block diagram of the simulation is represented in Figure 5. The two transition conditions require special attention, because they rule the simulation. The transition from pure rolling to rolling with sliding is ruled by a dynamic condition. When the tangential reaction force \(R_{x}\) needed to guarantee the equilibrium of the pure rolling motion (Equation (17)) is larger than the maximum static friction force, the MATLAB main script stops the Simulink rolling model and starts the Simulink sliding model.  
The MATLAB main script stops the Simulink sliding model when a dynamic and a kinematic condition are satisfied at the same time. The kinematic condition is the pure rolling condition, which is given by Equation (26).  
\[v_{x}-V_{x}=-\psi\cdot R \tag{26}\]  
This equation shows when there is a possible switching from rolling with sliding to pure rolling, but a dynamic condition is to be satisfied as well. This condition states that the tangential reaction force has to be smaller than the maximum static friction force.  
One of the novelties of this numerical model with respect to previous papers [15] is the introduction of the impacts with the stop plate, which makes the integration of the equations more complex. Impact forces are calculated representing contact stiffness by means of a lumped spring, which is compressed only if the distance between the cylinder and the stop plate is smaller than a fixed threshold. For this reason, the simulation environment Simulink was chosen, which proved to be very intuitive for the integration of single sets of equations. Then, the problem was moved to the transition between the two cases. The development of a model entirely programmed in Simulink showed problems of flickering between different states and was not very effective. Therefore, it was decided to exploit the versatility of a simulation managed by a MATLAB script at the highest level with the power of the Simulink simulation environment at a lower level. The results lived up to expectations, although troubleshooting and a fine tuning of the parameters of the Simulink solver was needed.