# Data-Driven Stability Assessment of Multilayer Long Short-Term Memory Networks
## 4 Results and Discussion
### Unstable Model Identification  
The procedure has so far been applied to stable models. In this section, the framework is tested in the presence of data generated by an unstable process. The chosen model is a second order system with a pole lying in the right-hand side of the complex plane and described by the following transfer function:  
\[\frac{1}{(s+10)(s-0.01)} \tag{11}\]  
The unstable pole is defined as \(\lambda=0.01\), while the stable one is set as \(\lambda=-10\). Additionally, _tfest_ assumes by default that the time series used for the identification procedure are generated by stable processes. This implies that, without modifying its settings, the poles are identified in the interval \((-\infty,0]\). This issue can be overcome by modifying the stability threshold, normally set as \(s=0\) for continuous-time systems and \(z=1\) for discrete-time ones.  
In this example, the corresponding parameter to be modified is set as _tfestOptions_. _Advanced_._Stability_Threshold.\(s=10^{3}\). Once more, the model is simulated and the corresponding DNN trained and tested. The distribution of the identified poles is reported in Figure 10. It can be seen that out of 4000 runs, 2693 times (0.67%), the real part of the unstable poles was correctly identified in the right-hand side of the complex plane. The framework was capable of recognizing that an unstable dynamics arises in the model generating the data and flagging the behaviour accordingly. As described in Section 1, this framework can be used to detect instabilities linked to any NN architecture, even the ones whose weights evolve over time (e.g., the ones associated with Reinforcement Learning  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Damping** & **Pole 1 (rad/s)** & **Pole 2 (rad/s)** \\ \hline linear & underdamped & \(-0.50+0.87j\) & \(-0.50-0.87j\) \\ linear & overdamped & \(-0.10\) & \(-9.90\) \\ nonlinear & underdamped & \(-1.00+2.97j\) & \(-1.00-2.97j\) \\ nonlinear & overdamped & \(-1.94\) & \(-5.06\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Theoretical poles’ locations.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dynamics** & **Model** & **Slow Pole** & **Fast Pole** \\ \hline linear & Simulink & 50.01\% & 15.57\% \\ \cline{2-4} overdamped & LSTM & 34.77\% & 92.08\% \\ \hline nonlinear & Simulink & 7.67\% & 21.99\% \\ \cline{2-4} overdamped & LSTM & 43.29\% & 47.89\% \\ \hline \hline \end{tabular}
\end{table}
Table 2: Poles’ location statistics: overdamped models.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dynamics** & **Model** & **R\(e\)** & **I\(m\)** \\ \hline linear & Simulink & 0.17\% & 1.64\% \\ \cline{2-4} underdamped & LSTM & 74.2\% & 26.5\% \\ \hline nonlinear & Simulink & 4.38\% & 4.38\% \\ \cline{2-4} underdamped & LSTM & 50.86\% & 3.93\% \\ \hline \hline \end{tabular}
\end{table}
Table 3: Poles’ location statistics: underdamped models.  
(RL) algorithms). The process generating the data in this example, i.e., Equation (11), is time-invariant, but the same procedure applied to time-variant systems would be able to detect an arising instability online. In fact, any single pole identified as unstable is enough to trigger the detection algorithm and the corresponding notification that the process generation is no longer stable. To conclude, the poles wrongly detected as stable are the ones associated with runs where ramp signals are provided as inputs: the ramps are in fact the signals generating the slowest dynamic responses and not always triggering an unstable behaviour fast enough to be identified. Additional considerations on the issue are detailed in Section 4.6.