# The Euler-Type Universal Numerical Integrator (E-TUNI) with Backward Integration
## 7 Results and Analysis
The acceleration values due to gravity constants and the pendulum's length are, respectively, given by \(g=9.81\ m/s^{2}\) and \(l=0.30\ m\). The variable \(\theta\) was trained on the range \([-1.2,1.2]\) rad and the variable \(\dot{\theta}\) was trained on the range \([-5.2,\ +5.2]\ \frac{rad}{s}\)._\[ \begin{array}{l}\dot{\theta}=w\\ \dot{w}=-\frac{\dot{\xi}}{\xi}sin\theta\end{array}  \tag{36}\]  
**Example 3**. : _Do the same for the non-linear inverted pendulum problem described by the system of differential Equations (37). The constants adopted for this problem were \(M=1.0\,[kg]\), \(m=0.4\,[kg]\), \(l=0.5\,[m]\), \(l=0.05\,[kg\cdot m^{2}]\), \(b=0.1\,[\frac{N}{m/s}]\), \(g=9.81\,[frac{rad}{s}]\), \(e=F=1[N]\). This problem has four state variables (\(x_{1}=x\), \(x_{2}=\dot{x}\), \(x_{3}=\theta\), and \(x_{4}=\dot{\theta}\)) and a constant control (\(u_{1}=F=1[N]\)). The state variables were trained on the intervals \(x_{1}\) between \([-1,+35][m]\), \(x_{2}\) between \([-1,+7][m/s]\), \(x_{3}\) between \([-1,+1][rad]\), and \(x_{4}\) between \([-1.2,+1.2][rad/s]\)._  
\[ \begin{array}{l}x_{1}=x_{2}\\ \dot{x}_{2}=\frac{[F-bx_{2}+nlx_{3}^{2}sin(x_{1})(1+m^{2})^{2}sin(x_{3})cos(x_ {3})}{(1+m^{2})^{2}(M(M(M)-|m|cos(x_{3})|^{2}}\\ \dot{x}_{3}=x_{4}\end{array}  \tag{37}\]  
\[ \begin{array}{l}x_{4}=\frac{[(F-bx_{2}+nlx_{3}^{2}sin(x_{3}))cos(x_{3})+(M+m )sin(x_{3})]ml}{(mcos(x_{3})|^{2}-(1+m^{2})(M+m)}\end{array} \]  
Figure 9 graphically illustrates the numerical simulation obtained for Example 1. This figure is not yet the result obtained by E-TUNI, but by Runge-Kutta 4-5, available in Matlab, to numerically solve Equation (35). Therefore, the result obtained by E-TUNI will be compared later, numerically and graphically, with the graphic result of this figure. Also, in Figure 9, the following convention was used: (i) the blue dots in \"x\" represent the forward propagation, in high precision, of Runge-Kutta 4-5 over the dynamics of Equation (35), (ii) the blue dots in \"o\" represent the high precision backward propagation of Runge-Kutta 4-5 over the same dynamics, and (iii) the solid red lines represent the slope of the mean derivatives functions between two consecutive points. Note that the integration step, as graphically presented, was \(\Delta t=0.1\). However, it is essential to notice that the Runge-Kutta 4-5 works internally with a varied integration step much smaller than this one to achieve the high numerical accuracy shown in Figure 9. So, both forward and backward integration were performed from \(t_{0}=0\) to \(t_{f}=5\). In this case, as can be seen, the result obtained is perfect, as the points obtained by backward integration overlapped perfectly over the points with forward integration. Figure 10 presents the first graphic result of E-TUNI, for the dynamics given by Equation (35). The blue dots represent the results obtained by E-TUNI and follow the same convention as in the previous figure. The green dots represent the results obtained by the  
Figure 9: The dynamics of Example 1 solved with Runge–Kutta 4-5, available in Matlab with step automation through the “ode45.m” function, using forward and backward integrations. conventional Euler Integrator, using the instantaneous derivative functions, also given by Equation (35). The two black dash-dot horizontal lines delimit the E-TUNI training range. Note that within the training range, the E-TUNI result was perfect, with both forward and backward integration. The line in Table 1 with the \(Number=1\) indicates the training data obtained for this case. In this way, 400 training patterns were generated, and 80% of them, 320 patterns, were effectively left for training. Note that in Table 1 the symbols \((MSE_{F})\) and \((MSE_{B})\) represent, respectively, the mean square error of forward integration and the mean square error of backward integration. Note that outside the training region, E-TUNI has become inaccurate. However, to solve this problem, the training domain of the state variable should be increased.