*2.1. Wind Generator Model*

Wind power generation has been modeled using a typical power curve described according to Equations (1)–(4) [33,34]:

$$P\_{W(t)} = \begin{cases} \text{0; } 0 \le S\_{W(t)} \le S\_W^o \\ P\_W^t + P\_W^b \left( S\_{W(t)} \right) + P\_W^c \left( S\_{W(t)} \right)^2; \ S\_W^o \le S\_{W(t)} \le S\_W^r \\\ P\_W^{\text{max}}; \ S\_W^r \le S\_{W(t)} \le S\_W^f \\\ 0; \ S\_{W(t)} > S\_W^f \end{cases} \\ \text{V} \\ \text{if } t = 1, \dots, T;$$

$$P\_W^o = \frac{1}{\left(S\_W^o - S\_W^r\right)^2} \left[ S\_W^o \left( S\_W^o + S\_W^r \right) - 4S\_W^o S\_W^r \left( \frac{S\_W^o + S\_W^r}{2S\_W^r} \right)^3 \right] \tag{2}$$

$$P\_W^\circ = \frac{1}{\left(S\_W^\circ - S\_W^r\right)^2} \left[ 4\left(S\_W^\circ + S\_W^r\right) \left(\frac{S\_W^\circ + S\_W^r}{2S\_W^r}\right)^3 - \left(3S\_W^\circ + S\_W^r\right) \right] \tag{3}$$

$$P\_W^c = \frac{1}{\left(S\_W^o - S\_W^r\right)^2} \left[2 - 4\left(\frac{S\_W^o + S\_W^r}{2S\_W^r}\right)^3\right] \tag{4}$$

In this way, the relationship between the wind speed (*SW*(*t*)) at a determined time step (*t*) and the corresponding wind power production (*PW*(*t*)) is clearly established.

### *2.2. BESS and Power Converter Models*

BESS is a crucial device for the appropriate operation of HES because it provides operational flexibility to the whole system. The technology chosen in this work is the vanadium redox flow battery (VRFB) due to its easy scalability, which makes it appropriate for large-scale integration. The mathematical model adopted is shown in Equations (5)–(15), and it has been experimentally tested and validated in [35–37].

Battery voltage (*UB*(*t*)) and efficiency (η*B*(*t*)) are defined according to charging and discharging processes using Equations (5) and (6), respectively.

$$\mathcal{U}\_{\mathcal{B}(t)} = \begin{cases} \mathcal{U}\_{\mathcal{B}(t)}^{\text{ch}}; P\_{\mathcal{B}(t)} > 0 \\ \mathcal{U}\_{\mathcal{B}(t)}^{\text{dis}}; P\_{\mathcal{B}(t)} \le 0 \end{cases} \quad \forall \, t = 1, \ldots, T; \tag{5}$$

$$\eta\_{B(t)} = \begin{cases} \eta\_{B(t)}^{ch}; \, P\_{B(t)} > 0 \\ \eta\_{B(t)}^{dis}; \, P\_{B(t)} < 0 \end{cases} \,\, \forall \, t = 1, \ldots, T. \tag{6}$$

During charging process, when battery power (*PB*(*t*)) is positive, battery voltage (*UchB*(*t*)) is related to the state of charge (SOC) (*SOCB*(*t*)) according to (7), while charging efficiency for voltage (η*chV*(*t*)) and energy (η*chE*(*t*)) are related to SOC and battery power as shown in (8) and (9), respectively. Then, global efficiency of charging phenomena (η*chB*(*t*)) can be estimated using (10).

$$\mathcal{U}\_{B(t)}^{\text{ch}} = \left(\mathcal{U}\_{\text{ch}}^{\text{H}} \text{SOC}\_{B(t)} + \mathcal{U}\_{\text{ch}}^{\text{b}}\right) \mathcal{P}\_{B(t)} + \mathcal{U}\_{\text{ch}}^{\text{c}} \text{SOC}\_{B(t)} + \mathcal{U}\_{\text{ch}}^{\text{d}} \,\forall \, t = 1, \ldots, T; \tag{7}$$

$$\eta\_{V(t)}^{ch} = \frac{\mathsf{U}\_{ch}^{\mathrm{c}} \mathrm{T}\_{\mathrm{ch}} \mathrm{\{SOC}\_{\mathrm{B}(t)} - \mathsf{U}\_{\mathrm{ch}}^{\mathrm{f}}\} + \mathsf{U}\_{\mathrm{ch}}^{\mathrm{g}}}{\left(\mathsf{U}\_{ch}^{\mathrm{h}} \mathrm{SOC}\_{\mathrm{B}(t)} + \mathsf{U}\_{\mathrm{ch}}^{\mathrm{i}}\right) \mathrm{P}\_{\mathrm{B}(t)} + \mathsf{U}\_{\mathrm{ch}}^{\mathrm{k}} \mathrm{SOC}\_{\mathrm{B}(t)} + \mathsf{U}\_{\mathrm{ch}}^{\mathrm{l}}} \,\forall \,\,t = 1, \ldots, T; \tag{8}$$

$$\eta\_{E(t)}^{ch} = \frac{\left(\mathcal{U}\_{ch}^{m}\text{SOC}\_{B(t)} + \mathcal{U}\_{ch}^{m}\right)P\_{B(t)} + \mathcal{U}\_{ch}^{p}\text{SOC}\_{B(t)} - \mathcal{U}\_{ch}^{q}}{P\_{B(t)}}\,\forall\,t = 1,\ldots,T;\tag{9}$$

$$
\eta\_{B(t)}^{ch} = \eta\_{V(t)}^{ch} \eta\_{E(t)}^{ch} \,\,\forall \, t = 1, \ldots, T. \tag{10}
$$

During discharging process (*PB*(*t*) < 0), battery voltage (*Udis B*(*t*)) and SOC are related according to the linear expression shown in (11). Voltage and energy efficiencies (η*dis V*(*t*) and η*dis E*(*t*)) depend on battery power and SOC following (12) and (13), respectively. Thus, discharging efficiency (η*dis B*(*t*)) is estimated through the product of these variables (η*dis V*(*t*)and η*dis E*(*t*)), as suggested in (14).

$$\mathcal{U}\_{B(t)}^{\text{dis}} = \mathcal{U}\_{\text{dis}}^{\text{u}} \left| P\_{B(t)} \right| + \mathcal{U}\_{\text{dis}}^{\text{b}} \text{SOC}\_{B(t)} + \mathcal{U}\_{\text{dis}}^{\text{c}} \; \forall \; t = 1, \dots, T; \tag{11}$$

$$\eta\_{V(t)}^{\text{dis}} = \frac{\mathsf{U}\_{\text{dis}}^{\text{d}} \left| P\_{\text{B}(t)} \right| + \mathsf{U}\_{\text{dis}}^{\text{e}} \mathrm{SOC}\_{\text{B}(t)} + \mathsf{U}\_{\text{dis}}^{\text{f}} \right. \tag{12}$$
 
$$\mathsf{U}\_{\text{dis}}^{\text{g}} \, T\_{\text{E}} \Big( \mathrm{SOC}\_{\text{B}(t)} - \mathsf{U}\_{\text{dis}}^{\text{h}} \Big) + \mathsf{U}\_{\text{dis}}^{\text{j}} \tag{12}$$

$$\eta\_{E(t)}^{\text{dis}} = \frac{\left|P\_{B(t)}\right|}{\mathcal{U}\_{\text{dis}}^k \left|P\_{B(t)}\right| + \mathcal{U}\_{\text{dis}}^l \text{SOC}\_{B(t)} \left(\text{SOC}\_{B(t)} - 1\right) + \mathcal{U}\_{\text{dis}}^{\text{nr}}} \; \forall \; t = 1, \ldots, T; \tag{13}$$

$$
\eta\_{B(t)}^{\text{dis}} = \eta\_{V(t)}^{\text{dis}} \eta\_{E(t)}^{\text{dis}} \,\forall \, t = 1, \ldots, T. \tag{14}
$$

SOC at a determined time interval (*t*) is defined using (15), which depends on the battery power and efficiency, calculated by following the equations previously described.

$$\text{SOC}\_{B(t)} = \text{SOC}\_{B(t-1)} + \int\_{t-1}^{t} \left( \frac{P\_{\text{B}(t)} \eta\_{\text{B}(t)}}{E\_{B}^{\text{max}}} \right) d\tau \; \forall \; t = 1, \ldots, T. \tag{15}$$

Additionally, some operational constrains of VRFB have to be fulfilled. This idea is expressed in (16) for the battery voltage, in (17) for the cell-stack power, and in (18) for SOC:

$$\|\mathcal{U}\_B^{\rm min} \le \mathcal{U}\_{B(t)} \le \mathcal{U}\_B^{\rm max} \,\,\forall \, t = 1, \dots, T;\tag{16}$$

$$1 - P\_B^{\max} \le P\_{B(t)} \le P\_B^{\max} \; \forall \; t = 1, \dots, T; \tag{17}$$

$$\text{SOC}\_{B}^{\text{min}} \le \text{SOC}\_{B(t)} \le \text{SOC}\_{B}^{\text{max}} \,\forall \, t = 1, \ldots, T. \tag{18}$$

Regarding the behavior of power converter, it has been represented through its variable efficiency shown (19), which allows us to estimate the power according to (20).

$$\eta\_{\mathcal{C}(t)} = \frac{P\_{B(t)}}{P\_{\mathcal{C}}^{a} \Big(P\_{\mathcal{C}}^{\max}\big) + \left(1 + P\_{\mathcal{C}}^{b}\big) P\_{B(t)}} \; \forall \; t = 1, \dots, T; \tag{19}$$

$$P\_{C(t)} = \pm \frac{\left|P\_{B(t)}\right| - P\_C^a P\_C^{\max}}{\left(1 + P\_C^b\right)} \; \forall \; t = 1, \ldots, T. \tag{20}$$

Regarding the parameters of the VRFB model previously described in (5–15), specifically the parameters *Uach* − *<sup>U</sup>hch*, *Ujch* − *Unch*, *Upch*, *Uqch* for charging and *Uadis* − *<sup>U</sup>hdis*, *Ujdis* − *Umdis* for discharging; they can be found in [35–37]. Similarly, the parameters *PaC* and *PbC* related to the power converter efficiency have been obtained from the experimental data published in [38].
