## 6 Simulation Examples
: _Consider the following uncertain nonlinear systems_  
\[\hat{x}(t)=\!\left[ \begin{array}{cc}1&1\\ -1&-2\end{array} \right]\!\left[ \begin{array}{c}x_{1}\\ x_{2}\end{array} \right]+\left[ \begin{array}{c}0\\ 2x_{1}^{2}cos^{2}(x_{2})\end{array} \right]+\left[ \begin{array}{c}0\\ p_{1}x_{2}cos^{2}(x_{1})\end{array} \right]+\left[ \begin{array}{c}0\\ 1+p_{2}x_{2}^{2}\end{array} \right]\!u \tag{55}\]  
_where \(x=[x_{1},x_{2}]^{T}\) is the system state, \(\Delta f(x)=\left[ \begin{array}{c}0\\ p_{1}x_{2}cos^{2}(x_{1})\end{array} \right]\) is the uncertain disturbance function of the system, \(\Delta g(x)=\left[ \begin{array}{c}0\\ p_{2}x_{2}^{2}\end{array} \right]\) is input uncertainty function, \(p_{1}\in[-2,2]\), \(p_{2}\in[0,2]\)._  
_Obviously,_  
\[\Delta f(x)=g(x)h(x),\Delta g(x)=g(x)m(x) \tag{56}\]  
_where \(g(x)=\left[ \begin{array}{c}0\\ 1\end{array} \right]\), \(h(x)=p_{1}x_{2}cos^{2}(x_{1})\), \(m(x)=p_{2}x_{2}^{2}\). Moreover, \(|h(x)|\leq|2x_{2}|=f_{max}(x)\). Thus, the original robust control problem is converted into calculating optimal control law. For nominal system_  
\[\dot{x}(t)=\left[ \begin{array}{cc}1&1\\ -1&-2\end{array} \right]\!\left[ \begin{array}{c}x_{1}\\ x_{2}\end{array} \right]+\left[ \begin{array}{c}0\\ 2x_{1}^{2}cos^{2}(x_{2})\end{array} \right]+\left[ \begin{array}{c}0\\ 1\end{array} \right]\!u, \tag{57}\]  
_find the control function \(u\), such that the performance index_  
\[ \begin{split} J(x,u)&=\int_{0}^{\infty}[f_{max}^{2}(x)+x^{T}x+u^ {T}u]dt\\ &=\int_{0}^{\infty}[x_{1}^{2}+5x_{2}^{2}+u^{2}]dt\end{split}  \tag{58}\]  
_is minimized._  
_In order to solve the robust control problem by using Algorithm 1, it is assumed that the optimal cost function \(V^{*}(x)\) has a neural network structure: \(V^{*}(x)=W^{T}\phi(x)\), where \(W=[W_{1},W_{2},W_{3}]^{T}\), \(\phi(x)=[x_{1}^{2},x_{1}x_{2},x_{2}^{2}]^{T}\). The initial weight is taken as \(W_{0}=[-2,5,0.5]^{T}\), and the initial state of system \(x_{0}=[2,-0.5]^{T}\). The neural network weights are calculated iteratively by MATLAB. In each iteration, 10 sets of data samples are collected along the nominal system trajectory to perform the batch least squares problem. After five iterations, the weight converges to \([25.5830,12.5830,2.6458]\). The robust control law of uncertain system (55) is \(u^{*}=-6.2915x_{1}-2.6458x_{2}\). The convergence process of neural network weight is shown in Figure 13, while the changing process of control signal is shown in Figure 14. The uncertain parameter \(p_{1}\) and \(p_{2}\) in uncertain system (55) take different values, the state trajectories of the closed-loop system are obtained by the robust control law. Figure 15 shows the trajectory of the closed-loop system when \(p_{1}=1\), \(p_{2}=0.8\). Figure 16 shows the trajectory of the closed-loop system when \(p_{1}=-0.5\), \(p_{2}=1\). Figure 17 shows the trajectory of the closed-loop system when \(p_{1}=1\), \(p_{2}=2\). Figure 18 shows the trajectory of the closed-loop system is \(p_{1}=2\)Figure 14: Robust control signal. Figure 13: Neural network weight. Figure 15: Closed loop system trajectory, \(p_{1}=1\), \(p_{2}=0.8\). Figure 16: Closed loop system trajectory, \(p_{1}=-0.5\), \(p_{2}=1\). Figure 17: Closed loop system trajectory, \(p_{1}=1\), \(p_{2}=2\). Figure 18: Closed loop system trajectory, \(p_{1}=2\), \(p_{2}=1\).