# A Water Tank Level Control System with Time Lag Using CGSA and Nonlinear Switch Decoration
## 5 Simulation Experiments
### Comparative Experiments  
The set input signal for the level is a square wave that varies from 0.5 m to 1.5 m. We study the actual tank level control situation and find that there are limitations to both the tank inlet flow rate and the inlet acceleration. We introduce a servo system for the inlet water rate and acceleration to make the experiment fit the actual situation. We adopt the control variable method throughout the experiment. The conditions are as follows: (1) the objects are all hypothetical water tanks; (2) the simulation time is 500 s and the step size is set to 0.1 s; (3) the control parameter is \(T_{1}=1\); (4) the non-linear switching modification parameters are \(\alpha=1.03\), \(\beta=0.065\); (5) the interference range simulated with white noise is \(\left[-4\times 10^{-3},4\times 10^{-3}\right]\); (6) the maximum inlet flow rate is 0.1 m\({}^{3}\)/s and the maximum inlet acceleration is 0.01 m\({}^{3}\)/s\({}^{2}\). The control effects of small pump is shown in Figure 5.  
From the above results(see Table 2), we can obtain that for the same non-linear modification function, the third-order CGSA has a reduction of more than 65% in each metric compared to the second-order CGSA. Therefore, the third-order CGSA has a more obvious advantage. Furthermore, the non-linear switch modification technique further reduces the three main indicators by 62%, 81%, and 67% compared to the Gaussian function. Then, to investigate the advantages of the improved model, we varied the maximum inlet flow rate and maximum inlet acceleration to simulate different types of pumps while maintaining the other experimental conditions. The maximum inlet flow rate is set to 0.5 m\({}^{3}\)/s, and the maximum inlet acceleration is 0.05 m\({}^{3}\)/s\({}^{2}\) for next experiment. The control effects of large pump is shown in Figure 6.  
Figure 5: The control effects of small pump. From the above results(see Table 3), we can obtain that the MAE, MIA, and MTV of the third-order CGSA controller decreased by 84%, 91%, and 69%, compared to the controller with second-order CGSA in the case of the same non-linear modification function. In the case of the same order CGSA, the non-linear switching modification technique proposed in this paper results in a 70% and 74% decrease in the MIA and MTV, respectively, but a 20% increase in the MAE value compared to the Gaussian function. Notably, this is due to a decrease in response speed in comparison. However, the overshoot of the algorithm proposed in this paper decreases obviously, which is more significant for the actual control of the tank level. In summary, in the presence of time lag, a small amount of interference, pump speed limitations, etc., the third-order CGSA and non-linear switching modification techniques proposed in this paper have significant advantages in terms of control quality, energy savings, and algorithmic smoothness. The non-linear modified switching technique proposed in this paper performed well in both experiments. It shows that it works well for different types of water tanks. Therefore it has great application potential. We listed two reasons for the energy-saving effect and smoothness of the controller proposed in this paper. (1) The controller using second-order CGSA is equivalent to adding a first-order filtering component to PD control. The controller using third-order CGSA is equivalent to adding a second-order low-pass filter to the PD control. PD control will introduce high-frequency noise. High-frequency noise can be filtered by both first and second-order low-pass filters. However, the transition band of the second-order low-pass filter is narrower. Then unwanted interference signals will decay faster, and the noise is filtered out more cleanly. It can be verified by the better performance of the third-order CGSA controller for the same non-linear modifier function.