## 2 Power Circuit Modeling  
The proposed solution considers the parallel connection of a bidirectional Zeta converter with the battery to be supported; the electrical scheme of this solution is depicted in Figure 2. This circuit describes the electrical structure of the bidirectional Zeta converter, which is formed by two capacitors (\(C_{1}\) and \(C_{2}\)), two inductors (\(L_{1}\) and \(L_{2}\)), and two MOSFETs. In addition, the proposed solution requires a fast controller with a wide operation range because the Zeta converter must be stable for capacitor voltages lower, equal to, or higher than the battery voltage; also, it must support positive, negative, and null current conditions. Therefore, the proposed solution includes the design of an adaptive sliding-mode controller (adaptive SMC) to ensure the correct operation of the system. The adaptive SMC requires two voltage sensors, one for the capacitor \(C_{2}\) voltage (\(v_{C_{2}}\)) and another for the battery voltage (\(v_{b}\)). It also requires three current sensors, one for the \(L_{1}\) current (\(i_{L_{1}}\)), another for the \(L_{2}\) current (\(i_{L_{2}}\)), and a final one for the load/ microgrid current (\(i_{o}\)) that is served by the battery. Figure 1: Structure of the hybrid energy storage system. Figure 2: Zeta power system designed to support battery transients. The design of the adaptive SMC requires a control-oriented model of the power system. Such a model is obtained by writing the differential equations of the inductor currents and capacitor voltages for each possible state of the control signal, i.e., \(u=1\) and \(u=0\), following the classical method based on charge and volt-second balances reported in [32]. For the first condition (\(u=1\)), the differential equations are given in Equations (1)-(4). \[\frac{di_{L1}}{dt}=\frac{v_{\text{C2}}}{L_{1}} \tag{1}\] \[\frac{di_{L2}}{dt}=\frac{v_{\text{C1}}+v_{\text{C2}}-v_{b}}{L_{2}}\] (2) \[\frac{dv_{\text{C1}}}{dt}=-\frac{i_{L2}}{\text{C}_{1}}\] (3) \[\frac{dv_{\text{C2}}}{dt}=-\frac{i_{L1}+i_{L2}}{\text{C}_{2}} \tag{4}\]  
Similarly, for the second condition (\(u=0\)), the differential equations are given in Equations (5)-(8). \[\frac{di_{L1}}{dt}=-\frac{v_{\text{C1}}}{L_{1}} \tag{5}\] \[\frac{di_{L2}}{dt}=-\frac{v_{b}}{L_{2}}\] (6) \[\frac{dv_{\text{C1}}}{dt}=\frac{i_{L1}}{\text{C}_{1}}\] (7) Figure 1:0  
The previous two sets of equations must be mixed into a single set of non-linear differential equations, thus forming the switched model of the power system given in Equations (9)-(12). In such a model, \(u\) is the control signal of the MOSFETs, and \(\overline{u}=1-u\) is the complementary control signal. Figure 1:1 Figure 1:2 (10) Figure 1:3 (11) Figure 1:4  
The switched model can be averaged within the switching period to generate the averaged model, which is useful for analyzing the main dynamic behavior of the power system; this modeling strategy is documented in [32]. Taking into account that the duty cycle \(d\) corresponds to the average value of the control signal \(u\), as given in Equation (13), the averaged model of the power system is obtained as reported in Equations (14)-(17), where \(d^{\prime}=1-d\) is the complementary duty cycle and \(T_{sw}\) is the switching period. Figure 1:5 Figure 1:6 (14) Figure 1:7 (15) Figure 1:8 (16) Figure 1:9  
Finally, the steady-state conditions of the power system are obtained from the averaged model by considering the derivatives equal to zero, as described in [32]:  
Figure 2:0 Figure 2:1 (19) Figure 2:2  
Another important analysis concerns the current and voltage ripples in the power system. Then, the magnitude of the ripples on the inductor currents \(i_{L1}\) and \(i_{L2}\) is calculated from Equations (5) and (6) following the method reported in [32]:  
Figure 2:3 Figure 2:4  
The magnitude of the voltage ripple in the \(C_{2}\) capacitor must be calculated from the charge stored and extracted from the capacitor during a switching period.