## 1 Introduction  
The increase in energy demand and dependence on fossil fuels [1] has boosted the integration of renewable energies [2]. This has favoured the development of distributed energy resources (DERs) [3], especially in rural or isolated areas [4]. Small size DERs in Spain are usually implemented through the so-called stand-alone photovoltaic (SAPV) energy systems [5; 6; 7], which generally include batteries to store energy and supply night demand. These types of systems are currently very attractive in rural areas thanks to the new regulations that have regulated self-consumption since 2019 [8]. In a general case, the energy storage system (ESS) could also be based on renewable energies, as in the case of micro hydroelectric plants or green hydrogen generators [9; 10]. The great disadvantage of this type of system is the reliability of supply, since a profitable design usually implies a large number of hours per year of energy not supplied (ENS), increasing indices such as the loss of load probability (LOLP) to inappropriate levels [11]. Due to the high price of ESSs, especially those based on renewable energies, an optimized design of the generation system is of vital importance. In this sense, there are studies that focus on improving the performance of these systems [12; 13; 14]. On the other hand, other works are focused on improving the management of generation, demand and storage resources to obtain maximum reliability with the lowest possible cost [15; 16]. The reliability of these systems can be improved with support systems such as a diesel generator, but it is necessary to manage the use of each resource with the best possible strategy to minimize diesel consumption, due to its price and environmental impact [17; 18]. Thus, many studies have focused on the technical feasibility of these systems and their reliability [19]. A group of the developed studies have focused on the assessment of residential SAPV generation plants connected to the electricity distribution network. These allow the users to sell their energy surpluses or demand extra energy as needed. Another type of study has focused in isolated systems [20; 21], which is the only available option in most rural areas. As stated before, the optimal design of these systems is very important [22]. To achieve a good design of these systems there have been a large number of methods developed, as can be seen in some review works [23; 24]. One of the greatest measurable benefits of using systems based on renewable energy is the increase in the sustainability of the energy supply [25] and its positive impact against climate change [26]. Furthermore, various studies point to a clear correlation between the integration of these energy systems and economic growth [27; 28; 29]. Among the key elements of this type of system, the importance of the ESSs stands out [30]. On the other hand, one of the challenges that is arousing growing interest is the problem of optimizing these systems considering various realistic scenarios. There are multiple objectives that can be set to study this problem, such as energy supply in rural or isolated areas [31; 32], losses minimization [33] or reliability improvement [34]. Among these objectives, reliability is one of the least studied and most important aspects in systems based on renewable energies, especially in rural areas, since in many cases the resources are intermittent [30] and difficult to predict [35]. One of the strategies that should be studied to improve the reliability of supply in systems based on renewable energies is the use of configurations following the architecture of a microgrid (MG) with cooperative behaviour [36], also called CoMG. This configuration can benefit the entire system in the different objectives discussed [37]. In summary, there are numerous papers that address the optimization of energy management based on renewable sources.