## 2 Materials and Methods
### Stand-Alone Photovoltaic Energy System  
PV renewable generation has been installed in many residential homes to meet their own energy needs. Batteries are used in conjunction with this generation to store energy during times of surplus and to provide energy during periods of insufficient PV output. A typical installation of photovoltaic panels and batteries to power an off-grid residential load is shown in Figure 1. The battery is equipped with a regulator or battery controller (BC) to adjust SOC and maximum current during charging and discharging. Power flows between the battery and the PV panel array are decided by the BC. A conventional auxiliary generator is additionally considered to provide energy in the hours in which the main system (PV + batteries) does not meet the supply--in this case, a fuel generator set. In this study, time series data with a temporal resolution of one hour were registered to model a typical household's energy demand. Figure 2 displays typical seasonal values for a residential customer's daily demand. An approximate instantaneous generation power is estimated from solar irradiance and temperature data collected in the PVGIS tool [41]. In this database, data from different years are registered, in addition to having data from typical meteorological years (TMY). In a TMY, the annual data are formed from the data set of previous years, taking the values that are considered average or typical for a location. The effects of the irradiance variation in the nominal generation of the module and the effects of the temperature in the installation are considered according to Equations (1) and (2). \[\mathrm{T_{cell}}=\mathrm{T_{amb,j}}+\mathrm{G_{i}}*\frac{\mathrm{NOCT}-20}{800} \tag{1}\]  
Figure 1: Stand-alone photovoltaic (SAPV) system scheme. \[\mathrm{Pg_{i}}=\frac{\mathrm{G_{i}}}{\mathrm{G_{STC}}}*\mathrm{P_{N}}*(1+\gamma*( \mathrm{T_{cell}}-25)) \tag{2}\]  
where:  
\(\mathrm{T_{cell}}\): Temperature of the photovoltaic cell. \(\mathrm{T_{amb}}\): Ambient temperature at the location. \(\mathrm{G_{i}}\): Instantaneous global irradiance value on the module. NOCT: Nominal operating cell temperature (45 \(\pm\) 2 \({}^{\circ}\)C). \(\mathrm{G_{STC}}\): Irradiance under standard test conditions (1000 W/m\({}^{2}\)). \(\gamma\): Coefficient of percentage variation in power with temperature. If the term \(\mathrm{P_{N}}\) is eliminated from this equation, it is normalized, so that it can be used in an iterative method for designing the installation, multiplying by the installed power in each case. On the other hand, in order to have an adequate demand model, consumption data for a household over a year have been obtained, which will be used as a profile to generate the system load time series. The energy balance of the system is evaluated as the balance at the terminals of the battery, i.e., the energy that contributes to charging or discharging it (Equations (3) and (4)). \[\mathrm{E_{b,i}}=\left(\mathrm{E_{g,i}}-\mathrm{E_{d,i}}\right)*\mathrm{\eta_{ c}},\qquad\mathrm{E_{g,i}}>\mathrm{E_{d,i}} \tag{3}\]  
\[\mathrm{E_{b,i}}=\frac{\left(\mathrm{E_{g,i}}-\mathrm{E_{d,i}}\right)}{\mathrm{ \eta_{d}}},\qquad\mathrm{E_{g,i}}<\mathrm{E_{d,i}} \tag{4}\]  
where:  
\(\mathrm{E_{b,i}}\): energy that the battery can return in a daily discharge cycle in period i. \(\mathrm{E_{g,i}}\): average daily energy generation in period i. \(\mathrm{E_{d,i}}\): average daily energy demand in period i. \(\mathrm{\eta_{c}}\): battery charging efficiency. \(\mathrm{\eta_{d}}\): battery discharge efficiency. Once the energy that charges/discharges the battery at each instant has been obtained, the equation that determines the state of charge can be evaluated (Equations (5) and (6)). \[\mathrm{Q_{b,i}}=\mathrm{Q_{b,i-1}}+\mathrm{E_{b,i}}\quad\mathrm{if}\quad \mathrm{Q_{b,i-1}}>\mathrm{SOC_{min}} \tag{5}\]  
Figure 2: Seasonal residential customer daily load profile and hourly generation curve.