## 2 Modelling of PV System's Components
### Modelling of Battery System  
Energy storage is needed to supply load when a SAPV generates energy that is not sufficient to supply a load demand, and to store surplus power when there is excess energy generated by the system. For photovoltaic systems, there are three storage medium can be used, which is battery, fuel cell and supercapacitor. The storage medium is very important as an energy source, during low radiation in night or during autonomy days [28]. The most widely used storage technology in standalone PV systems is a lead acid battery, since it has high system reliability and long time services. However, lead acid battery may be damaged by poor charging control, which may cause overcharging or under-discharging [29]. One of the most earliest battery models in a PV system was presented in [30]. The researchers modelled the battery system based on its behaviour during charging and discharging. The behaviour is described as state of charge (SOC) as follows,  
\[\text{SOC}(t)=\text{SOC}(t-1)\sigma+I_{b}(t)\Delta t\eta_{b} \tag{12}\]  
where \(\sigma\) is self-discharge rate, \(I_{b}\) is battery current (charge during positive and discharge during negative), and \(\eta\) is battery efficiency. In recent years, most studies for system planning and sizing used different expression of SOC. In low solar radiation intensity, load demand can be met if the battery has not reached the maximum allowable depth of discharge. Simple mathematical model for battery's state of charge at time \(t\) is represented by following equation [31; 32],  
\[\text{SOC}(t)=\text{SOC}(t-1)+\left[\frac{N_{pv}\;P_{pv}(t)-P_{load}(t)}{V_{b} \ast C_{b}}\right] \tag{13}\]  
where \(N_{pv}\) is number of PV module, \(P_{load}\) is electric power demand (\(W\)), \(V_{b}\) is battery voltage (\(V\)), and \(C_{b}\) is capacity of battery bank (Ah). This model ignores charging, discharging and self-discharging efficiencies. In [33; 34; 35], a more detailed model was used. In each time step, charging and discharging efficiencies were applied in calculation. In addition to that, energy management for standalone PV-Battery-Diesel was done in [36], exclusively for a configuration where battery and diesel generators are centralized, and PV and loads are distributed. In the proposed strategy, there are three different mode operations, which are normal operation, PV power limitation, and diesel generator. During normal operation, diesel generator is not connected, and the PV array supplies the load demand and battery is either charged or discharged subject to demanded energy. While in the second mode where battery is fully charged, a new strategy to limit distributed PV generation is presented by a controller scheme to avoid being overcharged or over-currents. When power limitation is necessary, a battery inverter will increase the frequency, and then PV inverters detect frequency increment, it will reduce their generated power. The system will operates in third mode, in case when PV generated power is not enough to supply demand and battery SOC is lower than its' lowest limit. Hence, PV and diesel generator will supply demands and charge battery, until fully charged. In this research different expression for battery state of charge was used. The SOC was determined by,  
\[\text{SOC}(t)=\text{SOC}(t-1)+\left[\frac{\int l_{b}\eta_{b}dt}{C_{b}}\right] \tag{14}\]  
Meanwhile, in [37], for standalone PV system, the authors estimated battery's energy flow as in equation below,  
\[E_{B}(t)=\left\{ \begin{array}{c}E_{B}(t-1)\eta_{lim}\eta_{wire}\eta_{discharging }-E_{L}(t)\;E_{D}<0\;(discharge)\\ E_{B}(t-1)\eta_{charging}+E_{pv}(t)\;E_{D}>0\;(charge)\\ E_{B}(t-1)\;E_{D}=0\end{array} \right. \tag{15}\]  
where  
\[E_{D}(t)=E_{pv}(t)-E_{L}(t) \tag{16}\]  
\(\eta\) is derating factor, \(E_{B}\) is energy stored in battery, \(E_{PV}\) is energy generated from PV generation system, \(E_{L}\) is energy demand, and \(E_{D}\) is energy difference between \(E_{PV}\) and \(E_{L}\).