*2.2. Battery Storage System (BSS)*

In this study, the battery storage system (BSS) is comprised of strings of lithium-ion battery, a bidirectional DC-AC VSI, and a bidirectional DC-DC buck-boost converter. A control technique proposed in [5] was employed in this study to control the battery VSI. The size of the battery was chosen based on the critical load demand, so that in the case of any contingency the battery was able to provide back up. In charging mode, battery charged either by PV (power generation of PV is more than demand) or via the grid in grid-tied mode. In contrast, the battery operated in discharge mode when the MG was islanded, or the generation of PV was less than its capacity in grid-tied mode.

The crucial parameters of the battery are terminal voltage and SOC, which can be calculated based on (3) and (4) [40]:

$$V\_{bat} = i\_{bat}R\_{bat} + V\_{oc} + V\_{c}e^{B\int i\_{bat}dt} - k\frac{Ah}{Ah + \int i\_{bat}dt} \tag{3}$$

$$\text{SOC} = \left(1 + \frac{\int i\_{bat}dt}{Ah}\right) \ast 100\tag{4}$$

where open circuit voltage is *Voc*, terminal voltage of the battery is *Vbat*, battery internal resistance is *Rbat*, battery current is *ibat*, exponential voltage is *V<sup>e</sup>* , polarization voltage is *k* and *B* is the exponential capacity.
