# Robust Control Examples Applied to a Wind Turbine Simulated Model
## 3 Data-Driven and Model-Based Control Designs
The on-line control development requires a recursive estimate of the model parameters represented by the vector \(\theta_{k}\) of Equation (15), while the input and output data \(u_{k}\) and \(y_{k}\) acquired on-line by the dynamic process of the wind turbine system. In fact, the adaptive control law computedat time step \(k\) is based on the recursive estimate of a model of the process, which is derived exploiting the dynamic data up to the sample \(k\). In this way, the algorithm of the Frisch scheme defined by the expressions of Equations (20), (22) and (24) is expressed by means of an on-line scheme. Note that the expressions of Equations (22) and (24) are required in their recursive form. Therefore, whilst the derivation of the on-line form of the covariance matrix update is easily obtained as in the form of Equation (25):  
\[\Sigma_{\tilde{\psi}_{k}}=\frac{k-1}{k}\,\Sigma_{\tilde{\psi}_{k}}+\frac{1}{k} \,\psi_{k}\,\psi_{k}^{T} \tag{25}\]  
the formulation of the auto-covariance expression \(r_{eh,k}\) can be obtained recursively for \(1\leq l\leq k\) only if the approximated expression of Equation (26) is considered:  
\[\epsilon_{l}\left(\tilde{\theta}_{k}\right)\approx\epsilon_{l}\left(\tilde{ \theta}_{l}\right) \tag{26}\]  
for \(l<k\). In this way, only the residual \(\epsilon_{k}\left(\tilde{\theta}_{k}\right)\) has to be computed at time step \(k\) using the lagged data in the vector \(\psi_{k}\) and the updated estimate \(\tilde{\theta}_{k}\) of the model parameters. The on-line computation of the expression of the auto-covariance matrix of Equation (27):  
\[r_{eh,k}=\frac{k-1}{k}\,r_{ek,k-1}+\frac{1}{k}\,\epsilon_{k}\left(\tilde{ \theta}_{k}\right)\,\epsilon_{k+h}\left(\tilde{\theta}_{k}\right) \tag{27}\]  
can be achieved using only the vector \(\epsilon_{k+h}\left(\tilde{\theta}_{k}\right)\) at each time step. The initial values \(\theta_{0}\), \(\Sigma_{\tilde{\psi}_{0}}\) and \(r_{e0,h}\) for the recursive algorithm are equal to the variables of the classic Frisch scheme batch procedure. Since variations of system properties have to be tracked on-line, in order to cope with time-varying systems, this paper considers a further modification of the recursive estimation scheme. This point can be achieved by placing more emphasis on the more recent data, while forgetting the older ones. Therefore, the methodology represented by the expressions of Equations (25) and (27) with the approximation of Equation (26) is implemented by including the so-called exponential forgetting factor. This is achieved in practice by defining the new expressions of the sample covariance and auto-covariance matrices in the form of Equation (28):  
\[\left\{ \begin{array}{rcl}H_{\Sigma_{\tilde{\psi}_{k}}}&=&\omega(\delta)\, \Sigma_{\tilde{\psi}_{k}}\\ h_{eh,k}&=&\omega(\delta)\,r_{eh,k}\end{array} \right. \tag{28}\]  
where \(\omega(\delta)\) is a scaling factor that coincides with \(k\) when no adaptation is introduced. In this way, the updated expressions have the form:  
\[\left\{ \begin{array}{rcl}H_{\Sigma_{\tilde{\psi}_{k}}}&=&(1-\delta)\,H_{ \Sigma_{\tilde{\psi}_{k}-1}}+\delta\,\psi_{k}\,\psi_{k}^{T}\\ h_{eh,k}&=&(1-\delta)\,h_{eh,k-1}+\delta\,\epsilon_{k}\left(\tilde{\theta}_{ k}\right)\,\epsilon_{k+h}\left(\tilde{\theta}_{k}\right)\end{array} \right. \tag{29}\]  
with \(0<\delta<1\) representing the forgetting factor. Thus, the adaptive Frisch scheme algorithm is implemented via Equation (29) in three steps. First, \(\theta_{0}\), \(\Sigma_{\tilde{\psi}_{0}}\) and \(r_{e0,h}\) with \(h\leq n_{a}\) are initialized. Moreover, at each recursion step, by means of \(r_{eh,k}\), the noise variances \(\sigma_{u}\) and \(\sigma_{y}\) are computed. Finally, at each recursion step, \(\tilde{\theta}_{k}\) is determined by solving Equation (20) via the expression of Equation (29). In this way, the vector \(\theta_{k}\) contains the estimates of the model parameter derived at the step \(k\).