## 2 Materials and Methods
### Reliability Evaluation Method  
Two questions must be answered in order to assess the SAPV system's reliability. If the combined instantaneous power from the PV arrays and the energy stored in the batteries is insufficient to meet demand, there will be a supply interruption. The occurrence of unanticipated system faults is the second reason for a supply interruption. A PV plant's reliability model is a complicated subject [42; 43; 44]. An aggregated PV plant reliability model (including PV panels and BC) with a failure rate \(\lambda_{\text{c}}\) is employed to achieve the goals of this study. It is assumed that the PV plant's reliability model has two states, with total power output in the up state and zero power output in the down state. Batteries' faults are not taken into account because it is assumed that they will be maintained and replaced before reaching the end of their useful life (so it is assumed that \(\lambda_{\text{b}}=0\)). The PV plant's time to failure (TTF) and mean time to repair (TTR) are both modeled using exponential and Rayleigh distributions, respectively [45]. Utilizing the inverse transform method, TTF and TTR are generated at random [46]. When a PV panel array or BC fails, the PV generation curve becomes zero when the sequence of failures is combined with it. The generating capacity sequence (GCS) is acquired in this manner. Then, the GCS and the demand sequence are combined to determine the battery's SOC. SOC(t) is obtained from Equation (7) by taking into account the instantaneous power demand \(\text{P}_{\text{d}}\)(t) and GCS(t):  
\[\text{SOC(t)}=\text{SOC(t-1)}+\alpha(\text{GCS(t)}-\text{P}_{\text{d}}(\text {t}))\cdot\Delta\text{t}, \tag{7}\]  
where \(\alpha=\eta_{\text{c}}\) if GCS(t) \(-\) P\({}_{\text{d}}\)(t) > 0 and \(\alpha=1/\eta_{\text{d}}\) if GCS(t) \(-\) P\({}_{\text{d}}\)(t) < 0. An interruption of supply due to generation inadequacy occurs when:  
\[\text{SOC(t)}\leq\text{SOC}_{\text{min}}\text{ and GCS(t)}<\text{P}_{\text{d}}(\text {t}). \tag{8}\]  
The energy supplied by the battery is assessed using Equations (7) and (8) during PV failure periods to reduce the failure time completely or partially until the battery is discharged to \(\text{SOC}_{\text{min}}\). The frequency of interruptions (FOI in number of interruptions/yr) and the loss of energy expectation (LOEE in Wh/yr) are evaluated according to the reliability analysis method. There is a capacity for producing energy that cannot be used (ENU) if SOC(t) = SOC\({}_{\text{max}}\) and GCS(t) > P\({}_{\text{d}}\)(t). The variables \(\text{P}_{\text{s}}\)(t) and \(\text{P}_{\text{d}}\)(t) must be discretized in order to use the analysis method numerically. The energy generated by the PV array is calculated for each hour h of the year,and its value is assigned to the discrete variable \(\mathrm{P_{s}(h)}\). Its value can be expressed in both kW and kWh, which are equivalent units of measurement, because it relates to average hourly power. If the discrete values of \(\mathrm{P_{s}(h)}\) are used to calculate the GCS(t), then GCS(t) is automatically discretized as GCS(h). An analogous discrete variable, \(\mathrm{P_{d}(h)}\), is used to represent the energy required for each hour. The system's hourly behavior for a sequence of n years is simulated using a sequential Monte Carlo simulation (MCS). To create chronological generation and demand random sequences, the randomized irradiance level for each hour of the day for each month of the year is taken into account along with the hourly demand. The reliability evaluation method is carried out as explained in [47]:  
* BEGIN: Set up the counter with n = 1. Obtain the initial system settings. * FOR n = 1 to n DO:
* Initialize the following counters: h = 1 (number of simulated hours of the year); i = 0 (counter of interruptions); H = 0 (hours of interruption); LOEE = 0; ENU = 0, SOC = 80% (battery state of charge). * To create the annual failure sequence, simulate TTF and TTR in turn.