#### 2.1. Frequency Response Measurement Methods

Amongst the electro-analytical techniques used for measuring the transport properties of ions in solutions, cyclic voltammetry (CV) and galvano-static charge–discharge (GCD) methods are commonly used for modelling the impedance of electrochemical cells, which in turn can be correlated to various properties of the cell array and bulk solution. CV requires controlling the excitation voltage while measuring the resulting current. GCD requires applying a controlled current and measuring the resulting potential. Recently, new EIS data acquisition systems were proposed to improve automated data acquisition. For instance, Grossi et al. developed a low-cost portable measurement system based on a microcontroller to obtain an EIS spectrum of four saline solutions (NaCl, Na

_{2}CO

_{3}, K

_{2}HPO

_{4} and CuSO

_{4}) in a frequency range from 10 Hz up to 10 kHz. [

10]; the excitation signal (i.e., a sinewave) is generated by an AD5932 function generator so that the frequency response measurement can be approximated to the test solution. Therefore, the choice of the measurement method is a compromise, with the following four considerations.

- (1)
The frequency measurement range should be suitable for capturing the frequency response of the process accurately over a high-frequency range (

Figure 1).

- (2)
The measurement method should provide an accurate impedance measurement over the entire frequency measurement range.

- (3)
The method should require minimal calibration procedure.

- (4)
The measurement method must be suitable for measuring the properties of the test bulk material.

Therefore, the choice of the measurement method is essential to ensure the quality of measured data, as well as the reproducibility of results.

Table 1 lists available measurement methods. Ultimately, efforts are made towards developing measurement solutions to obtaining a fingerprint frequency response of the test sample [

10].

#### 2.2. Sensing Electrode Array

Characterization of the physicochemical properties of bulk materials has spearheaded the application of EIS in many areas to study the effect of electrode shape, size and material on electrode–solution interaction. Since Newman studied the influence of electrode geometry on current distribution continuity to understand frequency dispersion processes [

12,

13,

14,

15], significant advances are continually reported in developing sensing electrodes to understand the correlation of different compounds in bulk solutions with frequency response to identify and quantify the presence of particular substances. Levent et al. demonstrated that a boron-doped diamond electrode can detect ambroxol in concentrations of 0.05–0.7 μm [

16]. Yari and Shams presented a silver-filled multi-walled carbon nanotube for determination of sulfamethoxazole, in the range 0.05–70 μm, in pharmaceutical formulations and urine [

17]. Sgobbi et al. developed a screen-printed electrochemical sensor for the detection of sulfamethoxazole and trimethoprim without pre-treating the sample [

18]. Recently, Chen et al. presented a graphene-based electrode for the determination of sulfamethoxazole in aqueous environments [

19].

Despite the fact that improved measurement technologies, including electrode sensing technologies, are continuously introduced, and the experimental setup may be relatively simple (i.e., bulk solution in the presence of a set of electrodes), the process of modelling electrical properties of bulk solutions is by no means complex because there are many physicochemical processes involved.

#### 2.3. Basic Electrochemical Electrical Equivalent Circuit (EEC) Models

Physicochemical reactions involve charge transport through the interface and the chemical phases. The kinetics are controlled by charge, mass transfer, or both and depend on the rate at which coupled chemical reactions take place at the electrode-solution interface. In general, a frequency-dependent model can be obtained to fit the impedance data and thus can be correlated with localized physicochemical processes. One of the most common cell models used to correlate basic electrochemical processes to Electrical Impedance Spectroscopy data is the simplified Randles model (also referred to as modified Kelvin–Voigt model) (

Figure 2A) which comprises three processes: the solution bulk resistance (i.e., a single resistor, R

_{B}), a polarization resistance, R

_{P}, and a capacitor (C

_{D}) that represents the double layer effect [

20].

However, modelling electrochemical dynamic processes often require several additional parameters to be accounted for. For instance, modelling microbial fuel cells involve several processes such as “electrolyte resistance, adsorption of electroactive species, charge transfer at the electrode surface and mass transfer from the bulk solution to the electrode surface” [

21].

Thus, a common approach is to combine series and/or parallel arrays of passive components (resistor and capacitors), constant phase elements (CPE) and/or Warburg elements to correlate the measured data with the electrochemical processes involved, including the charge transfer resistance, R

_{CT} (

Figure 2B) as the interfacial charge transport, mass transfer or both behaviours can explain the interfacial charge transport process and the role of contacts quantitatively by using the electrical equivalent circuit (EEC) [

22]. Although the suitability of a measurement model for extracting parameters from EIS experimental data depends on the nature of the electrochemical process, Liao et al. [

23] argue that a CPE may not represent distributed-time constant behaviours and therefore the use of a measurement model offers advantages for obtaining low- and high-frequency ohmic resistances. Argawal et al. [

24] propose that it is possible to obtain a reasonable approximation fit by selecting the appropriate number of Voigt-type elements; using synthetic data, the authors evaluated the modelling of different processes (CPE, coated materials, diffusion and inductive systems) using the sum of squared errors as a parameter to determine the appropriate number of Voigt-type elements. Thus, it is common to find that CPE and Warburg elements are modelled as combinations on Kelvin–Voigt arrays. For instance, in [

20], the authors discuss a simplified model, which considers R

_{B}, R

_{P}, R

_{CT}, C

_{D} and the coating capacitance, C

_{C} (

Figure 2C).

Tests are also conducted on the bulk solution to determine an appropriate frequency range, where the measured impedance values are best represented. However, different compounds may exhibit great differences over the measurement frequency spectra, and thus, it is necessary to start the modelling process. Software solutions are proposed to facilitate the modelling process [

25]. In addition, the measurement range is often constrained up to a few hundred kHz. Nevertheless, it is important to extend the frequency measurement range to capture the frequency response of all processes involved. For instance, in electrochemical systems that exhibit Warburg impedance for a diffusion flux with non-vanishing relaxation, Ramos-Barrado et al. argued that it is necessary to modify the phenomenon-logical description of the electrochemical system in a non-equilibrium state, based on Fickean Diffusion [

26]. They further proposed a hyperbolic equation for diffusion flux to explain the prevalence of smaller imaginary values at high frequencies. Huang recently proposed a new impedance expression, which includes three diffusion coefficients (diffusion coefficient of cations, the diffusion coefficient of anions, and the ambipolar diffusion coefficient) to describe the mass transport in electrolytic solutions [

27].

Another approach to elucidating system properties is frequency-domain system identification, where a model is estimated from frequency data [

28]. Here, we use frequency-domain system identification methods to estimate electrochemical models to differentiate drug compounds.

Modelling electrochemical cells often involve the use of arrays of passive components, resistors and capacitors, where the frequency response data are used to determine the corresponding resistance and capacitance values to fit the frequency response. Similarly, frequency-domain system identification techniques are suited to model RC networks.

#### 2.4. Representation of Basic Kelvin–Voigt Electrochemical Cell Models

In the electrochemical analysis, impedance models are regularly represented in terms of complex variables as a function of the complex term jω, explicitly, where ω is the frequency in radians per second. In contrast, in control theory and electrical circuit analysis, another approach is to obtain the frequency-domain impedance model of ideal, linear time-invariant passive components in terms of s = σ + jω, through Laplace-Transform. Thus, impedance models of Kelvin–Voigt (parallel) or Maxwell (series) elements can be represented as a function of s. For instance, the equivalent impedance of the Kelvin–Voigt RC parallel network (

Figure 3),

Z_{K-V}(

s), can be represented as a first-order, strictly proper transfer function of

s:

The equivalent impedance,

Z_{K-V}(

s), contains a product RC ≡ τ, which is the time constant, and R ≡ H, is the system gain when

s→0 and the root of the denominator (pole) is

$\left(-\frac{1}{\tau}\right)$:

Introducing a single resistor in series with the R-C parallel array (

Figure 4) yields the Modified Kelvin–Voigt element.

The impedance of the modified Kelvin–Voigt model,

Z_{MK-V}(

s), results in a proper polynomial transfer function:

which can be written in terms of gains and time constants:

#### 2.5. State-Space Modelling in the Frequency Domain

Consider the state-space minimal realization of a single-input, single-output (SISO) linear time-invariant system in the frequency domain:

The state-space frequency-domain system identification problem consists of obtaining a set of parameters [$\widehat{A}$, $\widehat{B}$, $\widehat{C}$, $\widehat{D}$], so that the estimated frequency response function represents closely the frequency response of the continuous state-space model determined by [A, B, C, D].

In the electro-analytical method, measurement of the electrochemical cell’s response results in a set of magnitude (Z(ω

_{i})) and phase (θ(ω

_{i})) measurements (i.e., G(ω

_{i})), corresponding to the

ith excitation signal applied frequency (ω

_{i}). To ensure that a measured data set is sampled at a frequency above the Nyquist frequency to reproduce correctly the system dynamics, the sampling rate is adjusted to 10 times the applied frequency. A common approach to minimizing the L

_{2}-norm error is to minimize the least-squares cost function [

29]:

where

W(ω

_{i}) is the weight array,

F(ω

_{i}) is the measured data,

$\widehat{G}\left({\omega}_{i}\right)$ is the estimated transfer function and

l is the number of measurement data frequencies.

#### 2.6. Estimation of Equivalent R-C Network Model

Once the state-space representation has been obtained, it is possible to estimate resistive-capacitive network arrays (

Figure 5) or ladder networks. For instance, Saatci et al. used a similar approach to obtain lung RC networks from state-space representation of lung models [

28]. To illustrate the process, consider the model of the electrochemical cell constructed using a set of Kelvin–Voigt elements [

23,

24].

Assuming that the system’s poles are different from the system’s zeros and that

G(

s):

which represents the model, is a proper rational function (m ≤ n) corresponding to a linear, time-invariant, underdamped, stable system, the R-C network parameters can be deduced from the partial fraction expansion of

G(

s).

Considering that the transfer function,

G(

s), is the result of a combination of different first-order elements (i.e., Kelvin–Voigt-type element models as shown in

Figure 4) and there are no repeated poles,

G(

s), can be simplified to:

where the coefficients

k_{α} are calculated using the Heaviside cover-up method, as:

The partial fraction expansion representation results in a summation of first-order functions, which for a proper function can be rewritten as:

Recalling Equation (4), the individual RC network parameters can be calculated as

Thus, the linear approximation of the electrochemical cell [

20] can be represented as the network model as shown in

Figure 5, using a combination of passive components.

#### 2.7. Measurement Setup

Four commercial drugs were used in this experimental study. The EIS method was used to obtain a description of the impedance variations caused by the conductive properties of different compounds over the liquid test fixture operational frequency range (20 Hz to 30 MHz). The experimental setup is shown in

Figure 6, which consists of three main components: (1) an impedance analyser with an operational frequency range from 20 Hz to 50 MHz (Keysight E4990A), (2) a liquid test fixture with an operational frequency range of 20 Hz to 30 MHz (Keysight 16452A) and (3) a 4-wire connection (Keysight 16048A).

The specifications of the liquid test fixture (

Figure 7) are:

- (a)
Electrode size: 38 ± 0.5 (mm) (circular geometry).

- (b)
Casing dimensions: 85 height × 85 width × 37 depth (mm).

- (c)
Materials (electrodes, spacers, liquid inlet and outlet): nickel-plated cobal (Fe 54%, Co 17%, Ni 29%).

- (d)
Insulator: ceramic insulator (alumina Al_{2}O_{3}).

- (e)
O-ring: Viton (Fluoro rubber).

- (f)
Insulator soldering: silver-copper and gold copper.

The measurement equipment selected is an auto-balancing bridge, which offers the advantage of high accuracy over a wide impedance measurement range (20 Hz to 30 MHz), limited by the liquid test fixture operational frequency range [

30]. This is well within the frequency range required to analyse the dielectric properties of the electrochemical cell filled with test samples. For every test, 200 impedance and phase data points, logarithmically separated over the measurement range, were obtained. The excitation voltage/current values were adjusted to 10 mV

_{RMS}/200μA

_{RMS}.

Commercial drugs are often highly lipophilic and insoluble in aqueous media, materials frequently require the use of a solvent or carrier system to ensure adequate bioavailability. Thus, liquid crystals are a mixture of compounds in a state between liquid and solid forms [

31]. Here, we used liquid-based drug suspensions, syrup and injectable solution (C

_{14}H

_{18}N

_{4}O

_{3}-C

_{10}H

_{11}N

_{3}O

_{3} Liomont Lab), (C

_{13}H

_{18}Br

_{2}N

_{2}O.HCl Bruluart Lab), (C

_{13}H

_{16}N

_{3}NaO

_{4}S SON’S Lab), and (C

_{13}H

_{22}N

_{4}O

_{3}S.HCl PiSA Lab) of commercial-grade, respectively as listed in

Table 2.

The drugs were introduced in the test device using a syringe of 5 mL for each as shown in

Figure 8.

The measurement setup was 40 points per decade in a frequency range of 20 Hz to 30 MHz controlled signal. All tests were repeated twice to decrease the margin of measurement error for each test trial. The impedance measurement was made at 27 °C.

#### 2.8. Determination of the Order Model

Appropriate determination of the model order is critical to obtain an accurate representation (fit) of measured data. It is often the case that trial-and-error is used to fit the model parameters, either by choosing a different combination of components or adding or subtracting components. Guascito et al. pointed out that blind fitting could lead to unsatisfactory results [

32]. In frequency-domain identification, it is necessary to determine that the state-space model corresponds to the minimal realization. Saatci et al. considered the rank of observability and controllability matrices of lung models in correlation with the number of model states to assess the accuracy of linear respiratory models [

28]. Another approach in frequency-domain modelling is to look at the Hankel singular values of the model including disturbances. Finally, the Akaike Information Criterion [

33] derived from statistical model identification, is a measure of the fit of the model. We depart from the basic model configuration as shown in

Figure 5 and then assess the validity of resulting models based on % fit, the rank of controllability and observability matrices, Hankel singular value and Akaike Information Criterion (AIC).