# Study and Simulation of an Under-Actuated Smart Surface for Material Flow Handling
## 4 Simulations  
In this section, the simulation process carried out with the analytic model implemented in MATLAB is shown. As a first step, this simulation environment permitted verifying in a general way that moving objects with the proposed theory and concept is possible. Second, it allowed several tests to be carried out in order to prove the usability of the system for some common intralogistics applications, such as sorting, orienting, stopping, and slowing down material flows. The simulation takes advantage of an iterative loop (shown in Figure 5a) that involves the following steps: initialization, rotor identification, stopping criteria, contact forces and equilibrium computation, and two steps of integration. The initialization of the problem is made at the beginning by providing data from the object and the surface (example: object mass, base shape, initial position and velocity, friction coefficients, module pattern, inclination of the surface, rotor orientations, etc.). After that, the iterative loop can start. For each step (e.g., the \(\mathrm{s}\)th step), the rotors below the object are identified (thus the contact points as well), knowing the position of the object from the previous iteration (\((s-1)\mathrm{th}\)) and the disposition of the modules (as introduced in Section 3). Once the rotors below the object and their orientation are determined, the object velocity from the previous iteration (\((s-1)\mathrm{th}\)) together with the inclination of the surface are evaluated by the stopping criteria: if \"\(x_{g}\leq 0\) m/s and \(\gamma=0\)\", the object is stopped because of negative velocity and null inclination and the loop ends. This is true assuming, in general, that the initial conditions always provide an input towards positive \(x\) (\(\gamma\geq 0\)\" or \(\dot{x}_{g0}\geq 0\)). When the stopping condition is not reached, the loop continues and the forces in the contact points can be computed (still considering the object velocity from the previous iteration (\((s-1)\mathrm{th}\))). With these forces, the equilibrium of the body and the accelerations are calculated according to Section 3. Finally, in order to obtain the velocity and the position, two integration steps of the acceleration vector are implemented. The derived values are the input of the next iteration (\((s+1)\mathrm{th}\)) of the loop. So far, the model seems to represent the operation of the surface adequately when the body velocity is greater than zero in the \(x\) direction and for the stopping condition. However, when, as an example, the object is about to start from a standstill with rotors and surface inclined, an undesirable phenomena such as reversal of motion (negative \(x\)) can occur. This happens because, in the friction assumptions, the static condition is not initially considered (Equation (2a,b)). However, reverse motion is obviously not possible in reality, then, in practice, when the condition of \(\dot{x}_{g}\leq 0\) m/s is achieved (\(\gamma>0\)\", otherwise the object is stopped as described before), the process needs to be adjusted. The logic instructions to solve this problem and at the same time implement the analytical model of Section 3 are summarized in the block diagram of Figure 5b, which in practice is executed inside \"Friction forces & Object equilibrium\" block of Figure 5a. In detail, the process works as follows: first, the \(N_{i}\) terms are calculated as explained in Section 3, then, since the velocity along \(x\) is known from the previous iteration, the condition \"\(\dot{x}_{g}\leq 0\) m/s\" is verified. If it is false and \"\(\dot{x}_{g}\geq 0\) m/s\", there is no problem of standstill or stopping and the procedure continues as described in Section 3, thus, friction forces calculation (Equation (2a,b)) and equilibrium ((Equations (3a,b) and (4)).