## 2 Methods
\begin{bmatrix}-z(0)&\cdots&-z(1-n_{a})&u(0)&\cdots&-u(1- n_{b})\\ -z(1)&\cdots&-z(2-n_{a})&u(1)&\cdots&-u(2-n_{b})\\ \vdots&\vdots&\vdots&\vdots&\vdots&\vdots\\ -z(L-1)&\cdots&-z(L-n_{a})&u(L-1)&\cdots&-u(L-n_{b})\end{bmatrix}  \tag{18}\]  
\[z_{L}= \begin{bmatrix}z(1),z(2),\ldots z(L)\end{bmatrix} ^{T}\]  
\[\theta= \begin{bmatrix}a_{1},a_{2},\ldots a_{n_{a}},b_{1},b_{2},\ldots b_{n_{b} }\end{bmatrix} ^{T}\]  
\[v_{L}= \begin{bmatrix}v(1),v(2),\ldots v(L)\end{bmatrix} ^{T}\]  
The credibility of each \(u(k)\) and \(z(k)\) is supposed as \(W(k)^{0.5}\). Then, the weighted matrix  
\[z_{L}=H_{L}\theta+v_{L} \tag{19}\]  
is defined as  
\[W^{0.5}= \begin{bmatrix}\sqrt{w(1)}&0&0&0\\ 0&\sqrt{w(2)}&0&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&0&\sqrt{w(L)}\end{bmatrix}  \tag{20}\]  
Then, Equation (19) can be rewritten:  
\[W^{0.5}\cdot z_{L}=W^{0.5}\cdot H_{L}\theta+W^{0.5}\cdot v_{L} \tag{21}\]  
Redefine the minimum error criterion function:  
\[J(\theta)= \begin{bmatrix}W^{0.5}(z_{L}-H_{L}\theta)\end{bmatrix} ^{T}\!\!\! \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!Use the derivative Formula (23), where \(A\) = diagonal matrix. Then, the first-order partial derivative of the minimizing error criterion function at the parameter estimate \(\theta_{0}\):  
\[\frac{\partial f(\vartheta)}{\partial\vartheta}\bigg{|}_{\theta=\theta_{0}}=-2( z_{L}-H_{L}\theta_{0})^{T}WH_{L}=0 \tag{24}\]  
\[\theta_{0}=\left(H_{L}^{T}WH_{L}\right)^{-1}H_{L}^{T}Wz_{L} \tag{25}\]  
Moreover, the second-order partial derivative of the error criterion function satisfies the following conditions on the parameter estimation \(\theta_{0}\):  
\[\frac{\partial^{2}J(\vartheta)}{\partial\vartheta^{2}}\bigg{|}_{\theta= \theta_{0}}=2H_{L}^{T}WH_{L}>0 \tag{26}\]  
So, the parameter estimate \(\theta_{0}\) must make the criterion function minimal. \(\theta_{0}\) is called the weighted least squares estimate of the parameter. Set the weighting coefficient as \(W\) = 1, then \(\theta_{0}\) can be reduced as  
\[\theta_{0}=\left(H_{L}^{T}H_{L}\right)^{-1}H_{L}^{T}z_{L} \tag{27}\]  
The sine sweep signal is given at the input of the system:  
\[u=\sin(2\pi ft) \tag{28}\]  
According to actual engineering experience, \(f\) takes 100 frequencies with a 2-200 Hz interval of 2 Hz and 10 cycles per frequency. The output signal of the open-loop system is shown in Figure 4.  
The identification system model is set as a single-input and single-output linear constant system, and the difference equation is shown in Equation (29). Determine the system order by using the Akaike information criterion (_AIC_) according to Equation (29), and the _AIC_ is defined as shown in Equation (30):  
\[\left\{ \begin{array}{l}A\left(z^{-1}\right)\cdot y(k)=B\left(z^{-1}\right) \cdot u(k)+e(k)\\ A\left(z^{-1}\right)=1+a_{1}z^{-1}+\ldots+a_{n_{x}}z^{-n_{x}}\\ B\left(z^{-1}\right)=b_{0}+b_{1}z^{-1}+\ldots+b_{n_{y}}z^{-n_{b}}\end{array} \right. \tag{29}\]  
\[AIC=-2\mathbf{ln}L+2p \tag{30}\]  
where \(L\) = likelihood function of the model and \(p\) = number of parameters in the model. Figure 4: Input of open-loop system. After derivation, \(AIC\) is obtained as shown in Equation (31):  
\[\left\{ \begin{array}{l}AIC=N\ln\partial_{e}^{2}+2(n_{a}+n_{b})\\ \partial_{e}^{2}=\frac{1}{N}\big{(}\mathrm{Y}-\Phi\dot{\theta}\big{)}^{T}\big{(} \mathrm{Y}-\Phi\dot{\theta}\big{)}=\frac{1}{N}\dot{e}^{T}\dot{\theta}\\ n_{a},n_{b}\in[1,10]\end{array} \right. \tag{31}\]  
Figure 5 shows the new identified system has the best fit when \(n_{a}=4\) and \(n_{b}=1\). The linear least squares method is used to identify the system of speed open-loop discrete model, as shown in Equation (32). The continuous system transfer function is shown in Equation (33). The observable canonical form corresponding to the discrete model is shown in Equation (34). Figure 6 shows an open-loop bode diagram of the identified system.