# A Comparison of Deep Learning Algorithms for Anomaly Detection in Discrete Mechanical Systems
## 2 System Description
#### Mathematical Model  
The mass of each storey is much larger than the mass of the laminas. For this reason, the system can be modeled through a lumped mass approach, considering four degrees of freedom. According to this, the dynamic model consists of a series of four masses connected by springs, as shown in Figure 1b. In the following sections, a physics-informed neural network (PINN) will be introduced. PINNs are characterized by a custom function loss which takes into account information about the physical laws governing the system. For this reason, the equations of motion describing the dynamics of the tested building are derived as reported in Equation (1) and will be a crucial point for the training of the implemented machine learning algorithm. \[\left[M\right]\,\underline{\mathrm{x}}+\left[C\right]\,\underline{\mathrm{x} }+\left[K\right]\,\underline{\mathrm{x}}=\underline{0} \tag{1}\]  
In particular, the column vector \(\underline{\mathrm{x}}\) represents the absolute horizontal displacement of the storeys:  
\[\underline{\mathrm{x}}=\left[x_{1}\,x_{2}\,x_{3}\,x_{4}\right]^{T} \tag{2}\] \begin{table}
\begin{tabular}{c c} \hline \hline  & **Storeys** \\ \hline Area & \(200\times 200\) mm\({}^{2}\) \\ Thickness & \(20\) mm \\ Mass & \(2.26\) kg \\ \hline \multicolumn{2}{c}{**Pillars**} \\ \hline Area & \(0.5\times 50\) mm\({}^{2}\) \\ Length & \(180\) mm \\ Thickness & Negligible \\ Mass & Negligible \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Data of the system. Figure 1: Real system and lumped mass model. (**a**) A photo of the real system. (**b**) Lumped mass model of the system. The mass matrix of the model is diagonal:  
\[[M]= \begin{bmatrix}m&0&0&0\\ 0&m&0&0\\ 0&0&m&0\\ 0&0&0&m\end{bmatrix}  \tag{3}\]  
where \(m\) takes into account the mass of the accelerometers and the cables. In particular, this additional contribution is evaluated as 0.1 kg per floor. Even if in further studies the following assumption may be relaxed considering a displacement and degree of rotation as the boundary conditions, in this paper, a clamped-clamped beam is considered to compute the stiffness matrix [26]. In particular, being one of the extremities subjected to a transversal displacement, the stiffness value of the equivalent spring can be derived through the force method, as shown in Figure 2:  
\[k_{eq}=4\cdot k=4\cdot\frac{12 EJ}{L^{3}} \tag{4}\]  
Moreover, the weight of each storey has an important effect on the transversal stiffness and, for this reason, it must be taken into account [27]. To do this, the term \(T=m\cdot g/L\) is considered and the final stiffness matrix is reported as:  
\[[K]= \begin{bmatrix}2k_{eq}-7T&-k_{eq}+3T&0&0\\ -k_{eq}+3T&2k_{eq}-5T&-k_{eq}+2T&0\\ 0&-k_{eq}+2T&2k_{eq}-3T&-k_{eq}+T\\ 0&0&-k_{eq}+T&k_{eq}-T\end{bmatrix}  \tag{5}\]  
Regarding damping, [PERSON]'s damping model has been considered. This model allows us to express the damping matrix as a linear combination of the mass matrix and the stiffness matrix [28], as follows:  
\[[C]=\alpha\cdot[M]+\beta\cdot[K] \tag{6}\]  
The coefficients \(\alpha\) and \(\beta\) are computed through a least square minimization process. Indeed, if modal coordinates are adopted, the mass, stiffness, and damping matrices are diagonal matrices, and for each vibration mode \(i\) of a given set, it is possible to write:  
\[c_{i}=\alpha\cdot m_{i}+\beta\cdot k_{i}\Rightarrow\xi_{i}=\frac{c_{i}}{2m_{ i}\omega_{i}}=\frac{\alpha}{2\omega_{i}}+\frac{\beta\omega_{i}}{2} \tag{7}\]  
where \(\xi_{i}\) and \(\omega_{i}\) are the modal damping and the natural frequency associated with the vibration mode \(i\), respectively. Moreover, in general, \(\xi\) and \(\omega_{i}\) are derived by analyzing the  
Figure 2: Force method for computing the equivalent stiffness parameter [25]. vibrational response of the structure via a modal analysis. The following over-determined system of equations can be written:  
\[ \begin{bmatrix}\frac{1}{2\omega_{1}}&\frac{\omega_{1}}{2}\\...&...\\ \frac{1}{2\omega_{i}}&\frac{\omega_{i}}{2}\end{bmatrix} \cdot