## 2 Kinematics of Grating Device as a Multibody System
### System of Equations of Motion  
In the floating frame of reference formulation, the flexible body's deformation can be defined with respect to its reference [19]. The constraints equation of MBS with rigid and flexible bodies can be written as:  
\[\mathbf{C}(\mathbf{q}_{r},\mathbf{q}_{f},\mathbf{t})=\mathbf{0} \tag{2}\]  
Figure 2: Displacement field of an arbitrary point.  
where \(\mathbf{C}\) is constraint functions vectors, \(\mathbf{q}_{r}\) is rigid bodies coordinates vector, \(\mathbf{q}_{f}\) is flexible bodies coordinates vector and \(\mathbf{t}\) is vector of the time. The MBS equations of motion can be written as [20]:  
\[\left[\begin{array}{ccc}\mathbf{M}_{rr}&\mathbf{M}_{rf}&\mathbf{C}_{qr}^{T}\\ \mathbf{M}_{fr}&\mathbf{M}_{ff}&\mathbf{C}_{qr}^{T}\\ \mathbf{C}_{qr}&\mathbf{C}_{q_{f}}&\mathbf{0}\end{array}\right]\left[\begin{array} []{c}\bar{\mathbf{q}}_{r}\\ \bar{\mathbf{q}}_{r}\\ \lambda\end{array}\right]=\left[\begin{array}{c}\mathbf{Q}_{r}\\ \mathbf{Q}_{f}\\ \mathbf{Q}_{d}\end{array}\right] \tag{3}\]  
where \(\mathbf{M}_{rr}\) and \(\mathbf{M}_{ff}\) is the system mass matrix related to rigid bodies and flexible bodies, respectively. The dynamic coupling among the rigid body movement and the flexible body deformation is described by the matrix \(\mathbf{M}_{rf}\) and the matrix \(\mathbf{M}_{fr}\). The matrices \(\mathbf{C}_{qr}\) and \(\mathbf{C}_{qf}\) are the Jacobian matrices, \(\lambda\) is the Lagrange multipliers vector, \(\mathbf{Q}_{r}=\mathbf{Q}_{ex}\) is the external applied forces vector acting on rigid bodies, \(\mathbf{Q}_{f}\) is the external applied forces vector acting on flexible bodies and \(\mathbf{Q}_{d}\) is the quadratic velocity vector. The constraints Jacobian matrix plays the most important role in kinematic and dynamic analyses of a multibody system. In the case of linear kinematic constraints, the contribution to this matrix can be constant in the coordinates [21].  
Equation (3) yields a system of DAEs. The solution obtained the acceleration vector \(\bar{\mathbf{q}}\) and Lagrange multipliers \(\lambda\). The acceleration vector can be integrated forward to compute system velocities and configurations. The Lagrange multipliers vector is used for calculating the generalized reaction forces that are used for establishing the design stage [22]. Because of the direct numerical solution DAEs associated with the constrained dynamics of a multibody system poses several computational difficulties mainly related to stability [23]. A post-stabilization approach is employed to bring the position and velocity back to the invariant manifold [24]. Position stabilization and velocities stabilization were done for the modeling system. Following the Lagrange multiplier method, the numerical algorithm of the equations of motion may proceed as follows:  
1. An estimate of the preliminary situations that outline the preliminary configuration of the multibody model is formed. The preliminary situations that constitute the preliminary coordinates and velocities should be an excellent approximation of the precise preliminary configuration:
2. Using the preliminary coordinates, the constraint Jacobian matrix is constructed, assemble the global mass matrix and other equation of motion items;
3. Solve the linear set of the equations of motion Equation (3) for a constrained multibody system in order to obtain the accelerations at instant time and the Lagrange multipliers;
4. Integrate the accelerations determined the coordinates and velocities. The vector of Lagrange multipliers can be used to determine the generalized reaction forces using Equation (4);
5. This process is maintained until the preferred give up of the simulation time is reached.