# Data-Driven Stability Assessment of Multilayer Long Short-Term Memory Networks
## 2 System Dynamic Models
### Nonlinear Model  
The same procedure is applied to the benchmark case of a single DOF nonlinear system, i.e., a pendulum rotating around a fixed point with a planar hinge. For the equation describing the rotational dynamics of the system where the total mass of the swinging rod with the mass attached at its extremity is lumped at the end of the former one,  
Figure 1: Linear system dynamics.  
the damping torque depends on the friction in the hinge, and \(Mg\) represents the gravity force applied to the mass:  
\[J_{z}\ddot{\theta}+d\dot{\theta}+MgL\sin\theta=T \tag{5}\]  
where \(z\) denotes the pendulum rotating axis, exiting from the swinging plane, \(M\) the value of the mass of the swinging system, \(J_{z}\) its moment of inertia around the \(z\)-axis, \(L\) the length of the rod, \(g\) the gravitational constant, \(d\) the damping coefficients, \(T\) the torque applied to the rod and \(\theta\) the pendulum angle, with \(\theta=0\) corresponding to the stable equilibrium of the system. Additionally, it is worthwhile recalling that, based on the assumptions mentioned above, the moment of inertia is computed as \(J_{z}=ML^{2}\). The parameters and sign convention are reported in Figure 2.  
Similarly to the linear case, the state-space form of the pendulum system is described by System (6), with \(x_{1}\) and \(x_{2}\) being the angular position and velocity of the mass, respectively.  
\[\begin{cases}\dot{x_{1}}=-\dfrac{d}{J_{z}}x_{1}-\dfrac{MgL\sin x_{2}}{J_{z}}+ \dfrac{T}{J_{z}}\\ \dot{x_{2}}=x_{1}\end{cases} \tag{6}\]  
The Jacobian evaluated in \(\mathbf{x}=[0,0]^{T}\) is reported in Equation (7).  
\[\mathbf{A}=\begin{bmatrix}-\dfrac{d}{J_{z}}&-\dfrac{MgL\cos x_{2}}{J_{z}}\\ 1&0\end{bmatrix} \tag{7}\]  
The system (6) has two equilibria corresponding to the rod position parallel to the gravity force vector. Analytically, the equilibria correspond to the tuple \((x_{1}^{A},x_{2}^{A})=(0\,\text{(rad)},0\,\text{(rad/s)})\) and \((x_{1}^{B},x_{2}^{B})=(\pi\,\text{(rad)},0\,\text{(rad/s)})\) and are denoted by \(\alpha\) and \(\beta\), respectively. Once more, it is possible to compute the eigenvalues of the system by imposing \(det(\lambda I-A)=0\), with \(A\) evaluated in each equilibrium point. The poles' locations associated with \(\alpha\) and \(\beta\), respectively, are reported hereby.  
\[\lambda_{1,2}=-\dfrac{d}{2J_{z}}\pm\sqrt{\dfrac{d^{2}}{4J_{z}^{2}}-\dfrac{MgL }{J_{z}}} \tag{8}\]  
\[\lambda_{3,4}=-\dfrac{d}{2J_{z}}\pm\sqrt{\dfrac{d^{2}}{4J_{z}^{2}}+\dfrac{MgL }{J_{z}}} \tag{9}\]  
In absence of the damping term \(d\) and recalling that \(M\), \(g\), \(L\) and \(J_{z}\) are always positive, \(\lambda_{1}\) and \(\lambda_{2}\) are complex conjugate, while \(\lambda_{3}\) and \(\lambda_{4}\) are real. It can be inferred that in the undamped case, the eigenvalues associated with \(\alpha\) are on the boundary of stability (being purely complex conjugate with \(\mathbf{R}e=0\)), while the ones corresponding to \(\beta\) are both real, one with \(\mathbf{R}e>0\) and the other with \(\mathbf{R}e<0\). \(\lambda_{1}\) and \(\lambda_{2}\) lead to an oscillating response around the equilibrium point, while \(\lambda_{3}\) and \(\lambda_{4}\) lead to an unstable response. On the other  
Figure 2: Nonlinear system dynamics.  
hand, when \(d\
eq 0\), the location of the poles and their stability assessment depend on the specific values of the system parameters. In Section 4, two cases are analysed in detail, and the associated poles' values are reported for a specific choice of the parameters.