# Adaptive Model Output Following Control for a Networked Thermostat +
## 5 Simulation and Experimental Results  
### Simulation Results  
As stated in Section 2, the system parameters are time-varying. In order to illustrate how the designed controller works when system parameters change, the model \(G(s)\) is assumed to change as follows:  
\[G(s)=\left\{\begin{array}{ll}\frac{0.13}{160s+1},&0\text{s}<t<2622\,\text{s} \\ \frac{0.15}{162s+1},&2622\,\text{s}\leq t<4370\,\text{s}\end{array}\right.. \tag{54}\]  
The above two functions are two possible models for \(G(S)\), which will be illustrated in the experimental parameter estimation. The parameters \(a_{0}\), \(a_{1}\), and \(b_{1}\) of model \(G(s)\) are identified by LSM, as described in Section 4.3. The time-varying delay becomes deterministic by setting a data buffer in the experimental platform, while \(T_{d}\) is set to 19 directly in the simulation for convenience. Let \(n=3\), the NCS model can be approximated by  
\[G_{p}^{*}(s)\approx\frac{e_{4}}{f_{0}\text{s}^{4}+f_{1}\text{s}^{3}+f_{2}\text {s}^{2}+f_{3}\text{s}^{1}+f_{4}}. \tag{55}\]  
where\[f_{0} =\frac{1}{27}a_{0}T_{d}^{3},\qquad f_{1}=\frac{1}{3}a_{0}T_{d}^{2}+ \frac{1}{27}a_{1}T_{d}^{3}\] \[f_{2} =a_{0}T_{d}+\frac{1}{3}a_{1}T_{d}^{2},\qquad f_{3}=a_{0}+a_{1}T_{d}\] \[f_{4} =a_{1},\qquad e_{4}=b_{1}.\]  
The compensator terms \(F_{2i}(s)\) can be constructed as follows:  
\[F_{21}(s) =\frac{\beta_{1}n_{1}(s)}{d_{1}(s)}\] \[F_{22}(s) =\frac{\beta_{2}n_{2}(s)}{d_{2}(s)}\] \[n_{1}(s) =n_{2}(s)=s^{2}\] \[d_{1}(s) =(s+2)^{4},\qquad d_{2}(s)=(s+2)^{3}\]  
where \(\beta_{2}=1\), \(\beta_{1}=0.6\), and \(\beta_{0}=0.09\). The compensator is given by  
\[F(s)=\frac{sG(s)}{s+\frac{3}{T_{d}}}\sum_{i=1}^{3}(\frac{T_{d}}{s+\frac{3}{T_ {d}}})^{i-1}+\frac{0.6s^{2}}{(s+2)^{4}}+\frac{s^{2}}{(s+2)^{3}} \tag{56}\]  
where \(G(s)\) are time-varying with identified parameters rather than Equation (54). The reference model is given by  
\[G_{m}(s)=\frac{1}{60s+1}. \tag{57}\]  
The forward control input \(u^{*}\) is computed by  
\[u^{*}(t)=\frac{f_{4}}{e_{4}}u_{m}(t)+(-\frac{f_{0}}{e_{4}T_{m}^{3}}+\frac{f_{ 1}}{e_{4}T_{m}^{2}}-\frac{f_{2}}{e_{4}T_{m}}+\frac{f_{3}}{e_{4}}-\frac{f_{4}T _{m}}{e_{4}})y_{m}(t). \tag{58}\]  
The reference input \(u_{m}(t)\) is set to 2.5 and \(K_{e}=1\).  
The simulation result of the CGT-based method [20] is shown in Figure 7. The settling time is about 1000 s. Before system parameters change, the system output follows the reference output, and the steady-state error is 0. After the system model changes, the control output also changes. However, the steady-state error does not decrease.  
Figure 7: Simulation result of the CGT-based method [20].  
The results of the proposed method are shown in Figures 8 and 9. The settling time is about 500 s, and the steady-state error is 0. The parameter estimation converges after several time intervals. After system parameters change, the maximum error is 0.3 \({}^{\circ}\)C, and the system parameters are estimated correctly by the LMS method in 400 s. Meanwhile, the steady-state error becomes 0.  
When parameters \(a_{0}\) and \(b_{1}\) change as follows  
\[a_{0} =162+5\cos(\frac{\pi t}{1520}), \tag{59}\] \[b_{1} =0.15+0.05\sin(\frac{\pi t}{1900}), \tag{60}\]  
the simulation results and parameter estimation are shown in Figures 10 and 11. At 500 s, the abstract temperature error is 0.08 \({}^{\circ}\)C, and the steady-state error is 0.15 \({}^{\circ}\)C. These results show that the proposed method ensures system stability for NCSs with time-varying parameters.  
Figure 8: Simulation result of the proposed method.  
Figure 9: Parameter estimation of the proposed method.