## 4 Microgrid Apparatus Modelling
### Energy Storage System Model  
In this paper, the battery is directly linked to the common DC bus via a bi-directional buck-boost converter for integrated charging or discharging; it is connected to the AC bus, as shown in Figure 1. The battery is required to improve the performance of the microgrid. This device responds to short-time disturbances and variations in solar irradiation. The number and capacity of batteries per string are adjusted to the PV generation's capacity and output voltage.  
Batteries in the applied microgrid system are utilized as storage devices. The battery system buffers the excessive energy through low power demand and releases its stored  
Figure 3: PV power output.  
energy through peak demand or while inadequate electricity is generated from the PV system. The battery energy that can be stored is calculated as seen below:  
\[\text{B}_{\text{bat}}=\text{B}_{\text{bat.0}}+\int_{0}^{t}\text{V}_{\text{bat}} \text{I}_{\text{bat}}\text{dt} \tag{9}\]  
where \(\text{B}_{\text{bat.0}}\) indicates the preliminary battery charge, \(\text{I}_{\text{bat}}\) and \(\text{V}_{\text{bat}}\) are the current and voltage of the battery, respectively [30]. The precise approximation of the state of charge (SoC) is a prerequisite to calculating the battery's energy applicable value. The SoC of the battery fluctuates relative to time, which can be illustrated by (10):  
\[\frac{SOC(t)}{SOC(T-1)}=\int_{T-1}^{T}\frac{P_{bat}(t)\eta_{bat}}{V_{bus}}dt \tag{10}\]  
where \(V_{bus}\) is the bus voltage of the simulated MG system, \(\eta_{bat}\) indicates the battery round-trip efficiency. The power generated by the battery is denoted by '\(P_{bat}(t)\)' [31]. Therefore, the battery round-trip efficiency is illustrated below:  
\[\eta_{bat}=\sqrt{\eta_{bat}^{c}\eta_{bat}^{d}} \tag{11}\]  
where \(\eta_{bat}^{d}\) and \(\eta_{bat}^{c}\) depict the discharging and charging efficiency of the battery system, respectively [31]. The maximum value of SoC is depicted by the '\(SOC_{max}\)', which is equal to the aggregate capacity of the battery bank (\(C_{n}\)(Ah)), and may be illustrated as:  
\[C_{n}(\text{Ah})=\frac{N_{bat}}{N_{bat}^{s}}C_{b}(Ah) \tag{12}\]  
where \(N_{bat}\) depicts the total number of batteries, C(Ah) illustrates the single battery capacity, \(N_{bat}^{s}\) is the number of batteries linked in series. The minimum constraint of the discharge of a battery bank is acknowledged as '\(SOC_{min}\)'. This constraint generally depends on the type of battery and its utilization in the battery bank [30]. The batteries are linked in series to achieve the necessary bus voltage. The number of batteries linked in series to achieve the necessary voltage is illustrated as follows:  
\[N_{bat}^{s}=\frac{V_{bus}}{V_{bat}} \tag{13}\]  
where \(V_{bat}\) depicts the voltage rating of a single battery. Additionally, the value of the maximum charge/discharge power of a battery at any time is illustrated as follows:  
\[P_{bat}^{max}=\frac{N_{bat}V_{bat}I_{bat}^{max}}{1000} \tag{14}\]  
where \(I_{bat}^{max}\) depicts the maximum charging current of the battery in amperes [31]. Table 2 details the distinct (Li-ion and LA) energy storages utilized.  
\begin{table}
\begin{tabular}{l l l} \hline \hline
**Criterion** & \multicolumn{2}{l}{**Battery Type/Model**} \\ \hline  & **LA Battery** & **Li-Ion Battery** \\ \hline Manufacturer & C\&D Tech & Kokam \\ \hline Model & KCR & 120216216 \\ \hline Total Capacity (AH) & 3816 & 3816 \\ \hline Nominal cell voltage (V) & 2.063 & 3.3 \\ \hline String Size & 12 & 12 \\ \hline \hline \end{tabular}
\end{table}
Table 2: Battery attributes.