## 1 Introduction  
On-site renewable electricity generation is widely used in rural areas, where the electrical grid is weak, or it does not exist. Standalone energy systems usually include a PV (photovoltaic) generator and battery storage. Wind turbines are used in places with high wind speed during the whole year. In many cases, a hybrid system including PV, a fossil fuel genset (diesel or gasoline) and battery storage can be the optimal solution. Auxiliary components as the battery charge controller and inverter are required. The charge controller avoids the overcharge of the battery, preventing from premature failure. It also controls the battery discharge, preventing the over-discharge. Generally, the load is AC (alternating current) type while the battery is DC (direct current), so an inverter (DC/AC converter) is needed. Inverters used in standalone systems include battery over-discharge protection. If the system includes a fossil fuel genset, then a battery charger (rectifier, AC/DC converter) is used to charge the batteries. In many cases, the inverter and the battery charger are a single device called inverter-charger or bi-directional inverter [1]. Regarding storage in standalone systems, lead-acid batteries have been widely used [2], although Li-ion batteries can be competitive in some cases [3] as their cost have been reduced recently. Standalone systems can be DC or AC coupled. DC coupled are usual in low power systems, while AC coupled are used in middle and large power systems. The sizing of a standalone renewable energy system is a critical process for the stability of the supply. It includes the choice of the suitable components from both technical and economic points of view. Choosing the economically optimal battery is one of the results that can be obtained from a simulation and optimization process. However, the simulation and optimization of hybrid standalone energy systems is a complex task, due to the high number of variables, the time-dependence and the non-linearity of the components [4]. Heuristic optimization techniques, such as genetic algorithms, particle swarm optimization, etc. have been used by different researchers [5]. Multiple optimization objectives have been used [4,6], but the most common are the minimization of the cost and the minimization of emissions [7]. Usually, a mono-objective optimization is performed, where the unique objective is the minimization of the net present cost (NPC) or the Levelized Cost of Energy (LCOE). Specific software tools are used for the simulation and optimization of hybrid standalone systems [4,8]. The mono-objective economical optimization is usually done by simulating the performance of different combinations of components and control strategies, looking for the combination of lowest NPC or LCOE. After the simulation of each combination, if it meets all the constraints, NPC is calculated [5], including the acquisition cost of all the components, the replacement cost at the end of the components lifetime and the O&M (operation and maintenance) cost. The battery total cost (including its replacement during the system lifetime) is frequently the highest cost in the NPC of the hybrid system. Therefore, in optimization processes for hybrid standalone systems, the accurate estimation of the battery lifetime is one of the most important issues. Great errors in the prediction of battery lifetime would lead to great errors in the estimation of the NPC, making the optimization process unreliable. The aging factors of lead-acid batteries are charge and discharge rates, charge (Ah) throughput, time between full charges, time at low state of charge (SOC), and partial cycling. Several researchers have analyzed them [9,10]. Classical models widely used by researchers to estimate the battery lifetime are the \"equivalent full cycles model\" and the \"rainflow model\" [11].