# Dynamic Analysis of Fuzzy Systems
## 5 Application
### Model of the Tank  
The GUNT RT450.01 consists of a transparent plastic level tank as the main element and uses water as the working medium. It provides the following features: section tank \(A=0.0147\) m\({}^{2}\) with a liquid of height \(h(t)\), volume \(v(t)\) and outlet flow \(q_{o}(t)\) due to an input flow \(q_{i}(t)\). It presents a delay time of \(t_{d}=10\) s and a percentage of valve opening \(\alpha(t)=0.5\), with a maximum output section \(C=2.83\times 10^{-5}\) m\({}^{2}\) and gravitational acceleration \(g=9.81\) m/s\({}^{2}\), as shown in Figure 18.  
An empirical model of this multivariate system is given by  
\[ \begin{split}\dot{v}(t)&=q_{i}(t-t_{d})-q_{o}(t)\\ v(t)&=Ah(t)\\ q_{o}(t)&=\mathcal{C}\alpha(t)\sqrt{2 gh(t)}\\ \dot{v}(t)&=q_{i}(t-t_{d})-q_{o}(t)\end{split}  \tag{28}\]  
Figure 16: The result for concentration graphs shows the per cent overshoot and normalised peak time as a function of damping ratio \(\zeta\); (**a**) step-up, (**b**) step-down. Figure 17: The result for dilation graphs shows the per cent overshoot and normalised peak time as a function of damping ratio \(\zeta\); (**a**) step-up, (**b**) step-down. This equation represents a multivariate relationship between \(q_{i}(t),\alpha(t)\) and \(h(t)\):  
\[Ah(t)=q_{i}(t-t_{d})-C\alpha(t)\sqrt{2 gh(t)} \tag{30}\]  
Rewriting in the standard form,  
\[\frac{A\;h(t)}{C\alpha(t)\sqrt{2g}}+\sqrt{h(t)}=\frac{q_{i}(t-t_{d})}{C\alpha(t )\sqrt{2g}} \tag{31}\]  
The static gain of this non-linear system is when the derivative is zero, it is as follows:  
\[\sqrt{h(t)}=\frac{q_{i}(t-t_{d})}{C\alpha(t)\sqrt{2g}} \tag{32}\]  
Therefore, for \(t>T_{d}\) the static gain K would be,  
\[h=K=\left(\frac{q_{i}}{C\alpha(t)\sqrt{2g}}\right)^{2} \tag{33}\]  
and the model for this condition is,  
\[\frac{A\;\dot{h}(t)}{C\alpha\sqrt{2g}}+\sqrt{h(t)}=\frac{q_{i}(t)}{C\alpha \sqrt{2g}} \tag{34}\]  
The initial conditions to fill the tank are \(q_{i}^{(0)}=1.09\times 10^{-5}\) m\({}^{3}\)/s. Replaced in (33) gives \(h^{(0)}=0.03\) m. To analyse the dynamic behaviour of this empirical model, initially, the tank is in equilibrium at \(h^{(0)}=0.03\) m; at a time of 35 s, the inflow increases to \(q_{i}=3.1\times 10^{-5}\) m\({}^{3}\)/s and then after 628 s, it drops to \(q_{i}=0\) m\({}^{3}\)/s. It can be seen that the system is in a steady state and has a final value of around \(K=0.244\) m. Figure 19 shows the dynamic evolution of the system, with a sampling time of 0.5 s.  
The Mamdani model of the tank model in the standard form (Equation (34)) can be approximated; the normalised fuzzy sets between [0, 1] are shown in Figure 20.  
Figure 18: GUNT RT450.01 level tank module. Using the input and output scaling factors, the delay time was added in Figure 21.  
The resultant Mamdani model becomes:  
Figure 17:0 Dynamical evolution of the tank. Figure 17:1 Fuzzy sets tank; **(a)** input set \(q_{i}\), **(b)** input set \(h\), **(c)** output set \(\dot{h}\) centre of gravity and **(d)** output surface between \(\dot{h}\), \(h\) and \(q_{i}\). Figure 17:2 Input and output scaling factors. \[ \begin{split} R^{(11)}&:\text{IF }q_{i}\text{ is }Small\text{ AND }h\text{ is }MLow\text{ THEN }h=0\\ R^{(12)}&:\text{IF }q_{i}\text{ is }Small\text{ AND }h\text{ is }MHigh\text{ THEN }h=-\frac{C\alpha\sqrt{2g}}{A}\\ R^{(21)}&:\text{IF }q_{i}\text{ is }Large\text{ AND }h\text{ is }MLow\text{ THEN }\dot{h}=\frac{C\alpha\sqrt{2g}}{A}\\ R^{(22)}&:\text{IF }q_{i}\text{ is }Large\text{ AND }h\text{ is }MHigh\text{ THEN }\dot{h}=0\end{split}  \tag{35}\]  
The membership functions for \(q_{i}\) and \(h\) applying the dilation are:  
\[ \begin{split}\mu_{Small}(q_{i})&=1-\frac{q_{i}}{C \alpha\sqrt{2g}},\ \ \ \forall\ q_{i}\ \in\ [0,C\alpha\sqrt{2g}]\\ \mu_{Large}(q_{i})&=\frac{q_{i}}{C\alpha\sqrt{2g}}, \ \ \forall\ q_{i}\ \in\ [0,C\alpha\sqrt{2g}]\\ \mu_{MLow}(h)&=1-\sqrt{h},\ \ \forall\ h\ \in\ [0,1]\\ \mu_{MHigh}(h)&=\sqrt{h},\ \ \forall\ h\ \in\ [0,1]\end{split}