## 4 Results and Discussion
### Results for EIS
#### 4.1.3 Creating Transfer Function Models from EIS Data and Comparative Analysis  
The data points collected from the impedance spectroscope were imported into the MATLAB workspace for further processing. The phase angle was changed from degrees to radians using the function deg2 rad. The impedance magnitude and phase in radians was converted into a rectangular complex number format. This complex variable was created using Magnitude-Angle to complex block using the Simulink@software. Figure 7 shows the Simulink program to autogenerate the complex variables for the recorded impedance spectra. This complex variable was further used to create a frequency response data (frd) model object in MATLAB. In the Control System Toolbox(tm) of MATLAB, the frd models can be used to store, manipulate, and analyse frequency response data. The frd model stores a vector of frequency points with the corresponding complex frequency response data obtained either through simulations or experimentally. The MATLAB function used to create the frequency response data model object was: sysfrd = frd(sys,frequency,units). Figure 6: Impedance magnitude and phase response of the solutions at ethanol to water ratio; 0.33 (**a**,**b**), 0.66 (**c**,**d**), and 0.99 (**e**,**f**) for the frequency range from 50 kHz to 300 kHz. Table 1 lists all the solutions. Transfer function models describe the relationship between the inputs and outputs of a linear system using a ratio of polynomials. The model order is equal to the order of the denominator polynomial. The roots of the denominator polynomial are referred to as the model poles. The roots of the numerator polynomial are referred to as the model zeros. It describes the dynamic characteristics of the linear system. The transfer function of any linear invariant system \(G(s)\) can be expressed in general terms in the ratios of polynomials in terms of s as  
\[G(s)=\frac{Y(s)}{X(s)}=\frac{b_{m}s^{m}+b_{m-1}s^{m-1}+\ldots+b_{0}}{a_{n}s^{ n}+a_{n-1}s^{n-1}+\ldots+a_{0}}\,\ m\leq n \tag{12}\]  
where \(X(s)\) is a system input signal in the Laplace domain, and \(Y(s)\) is the system output evoked by \(X(s)\). \(a_{0}\) to \(a_{n}\) gives the coefficients of the numerator polynomial and \(b_{0}\) to \(b_{m}\) gives the coefficients of the denominator polynomial. \(m\) is the number of zeroes, and \(n\) is the number of poles in the system. The equivalent factorized form of the transfer function is given as  
\[\frac{Y(s)}{X(s)}=\frac{(s+z_{1})(s+z_{2})\ldots(s+z_{m})}{(s+p_{1})(s+p_{2}) \ldots(s+p_{n})} \tag{13}\]  
Here _the_\(z_{1}\), \(z_{2}\ldots\), \(z_{m}\)_are_ zeroes of the system and \(p_{1}\), \(p_{2}\ldots\), \(p_{n}\) are poles of the system. The transfer function (tf) model object in the MATLAB Control System Toolbox represents the transfer function in a polynomial form. The data used for estimation was in the frequency range of 50 kHz and 300 kHz. First and second-order transfer functions were estimated for the experimental data from the generated system frd model object using the MATLAB function tfest: sys = tfest(data,np,nz). This function estimates a continuous-time transfer function, sys, using frequency-domain data (data) and contains (np) number of poles and (nz) number of zeroes. Table 2 shows the three models tested. The number of poles (np) was set to 1 and 2 to obtain a first-order and a second-order transfer function, respectively. The number of zeros in the sys by default was max(np-1,0). The standard transfer function of the first-order inertial system is given by Equation (14). \(\tau\) is the system time constant, and \(K\) is steady-state gain. This was the first model (Model 1) tested. \[\frac{Y(s)}{X(s)}=\frac{K}{\tau s+1} \tag{14}\] \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **Number of Poles** & **Number of Zeroes** & **Order of the Model** \\ \hline
**Model 1** & 1 & 0 & First-order \\
**Model 2** & 2 & 0 & Second-order \\
**Model 3** & 2 & 1 & Second-order with a zero \\ \hline \hline \end{tabular}
\end{table}