# Model Based Robust Predictive Control of Ship Roll/Yaw Motions with Input Constraints
## 3 Main Result
### A Predict Method Compensating Delay Dynamic of Fin Stabilizers  
In the practical operation of ship antiroll control system, there is always some delay in the response of the fin stabilizer drive system to the master signal. Therefore, it is not suitable to employ the present states to participate in the close-loop control. In cases where the dynamic response characteristics of the fin stabilizer drive system are not obtained, the prediction value of the roll angles should be used in advance, which participates in the closed-loop control system to compensate the dynamic delay of the fin stabilizers to achieve ideal control effect. It is noticed that the rudder has the different control effect on the both course and roll in delay characteristics, so only the delay characteristic of the fin stabilizer drive system is considered in this paper for simplicity of the controller design. The essence of the above method is to compensate the dynamic delay of fin stabilizers by a parameter estimation and prediction method based on a single-input single-output (SISO) stochastic model. The least square method can be used to estimate the corresponding parameter in batch processing. However, it brings additional computational burden and storage resources, thus it is not suitable for online identification. Based on the traditional recursive least square (RLS) algorithm, we add a fading factor to the previous data and propose the fading memory recursive least squares (FMRLS) algorithm, which can properly reduce the weight of old data while strengthening the weight to renew data. For SISO stochastic system  
\[\mathbf{Z}_{m}=\mathbf{H}_{m}\mathbf{\theta}+\mathbf{V}_{m}, \tag{24}\]  
where \(\mathbf{H}_{m}\) and \(\mathbf{Z}_{m}\) are the sample matrix, \(\mathbf{\theta}\) is the parameter to be estimated and \(\mathbf{V}_{m}\) is the noise. The objective is that we resolve the estimated value \(\hat{\mathbf{\theta}}\) such that  
\[\min\!/(\hat{\mathbf{\theta}})=(\mathbf{Z}_{m}-\mathbf{H}_{m}\hat{\mathbf{\theta}})^{T}(\mathbf{ Z}_{m}-\mathbf{H}_{m}\hat{\mathbf{\theta}}). \tag{25}\]  
Therefore, the FMRLS algorithm using forgetting factor is  
\[ \begin{split}\hat{\mathbf{\theta}}_{m}&=\hat{\mathbf{ \theta}}_{m-1}+\mathbf{K}_{m}\!\left[z(m)-\mathbf{h}(m)\hat{\mathbf{\theta}}_{m-1}\right] \\ \mathbf{K}_{m}&=\mathbf{P}_{m-1}\mathbf{h}^{T}(m)\!\left[\lambda \mathbf{l}+\mathbf{h}(m)\mathbf{P}_{m-1}\mathbf{h}^{T}(m)\right]^{-1}\\ \mathbf{P}_{m}&=\frac{1}{\lambda}[\mathbf{l}-\mathbf{K}_{m}\mathbf{h }(m)]^{-1}\mathbf{P}_{m-1}\end{split}  \tag{26}\]  
where \(\hat{\mathbf{\theta}}_{m}\) is the present parameter estimate vector, \(\hat{\mathbf{\theta}}_{m-1}\) is the past estimate, \(z(m)\) is the present measurement, \(z(m)-\mathbf{h}(m)\hat{\mathbf{\theta}}_{m-1}\) is the prediction error, also known as update information, \(\mathbf{K}_{m}\) is the correction error gain matrix, \(\mathbf{P}_{m}\) is the covariance matrix and \(\mathbf{h}(m)\) is the present sample matrix. The algorithm flow is based on the previous data and the new measurement data and can calculate the next recursion calculation required. Auto-Regression (AR) Model is common and prevalent. The general form of the p-order AR model is given by  
\[x(k)=a_{1}x(k-1)+a_{2}x(k-2)+a_{3}x(k-3)+\cdots\cdots+a_{p}x(k-p). \tag{27}\]  
Based on Equation (27), together with \(\hat{\mathbf{\theta}}_{m-1}=\left[ \begin{array}{cccccc}a_{1}&a_{2}&a_{3}&\cdots&a _{p}\end{array} \right]^{T}\), \(z(m)=x(k)\) and \(\mathbf{h}(m)=\left[ \begin{array}{cccccc}x(k-1)&x(k-2)&x(k-3)&\cdots&x(k-p)\end{array} \right]\), we obtain the \(l\)-step prediction as follows:  
\[ \begin{array}{ccccc}\hat{x}(k+1)=\sum\limits_{i=1}^{p}\hat{a}_{i}x(k+1-i)\\ \cdots\\ \hat{x}(k+l)=\sum\limits_{i=1}^{l-1}\hat{a}_{i}\hat{x}(k+l-i)+\sum\limits_{i= l}^{p}\hat{a}_{i}(k+l-i)\end{array}  \tag{28}\]  
where \(l=2\), \(3\),... ; \(i=1\), \(2\),... \(p\).