## 5 Conclusions and Future Work  
The study shows that the novel open-source MES optimization tool that we developed, building on the existing MicroGridsPy, effectively allows for the generation and comparison of multiple integrated thermal and electric energy system configurations for off-grid contexts. In particular, the application of the tool to the Chilean village of Toconao confirms how the integration of multiple energy vectors and storage options allows to identify the lowest-cost optimal solutions that remain unreachable within a single-sector perspective. Indeed, both \"micro-grid\" configurations proposed (conventional and multi-good) face some limitations as compared to the integrated multi-energy system, either in terms of economic viability or technical feasibility. In fact the conventional micro-grid (b) configuration, in which thermal loads are not involved in the optimization of the new supply technology, and left to be satisfied with the same technology adopted in the traditional energy system (a), lowers the NPC of the project by 15%, mainly by cutting the use of diesel through the 20 years of operation, overcompensating the higher installation cost of the PV technology, but leaves untapped the potential of the integration of the two energy systems. Figure 7: Example of thermal energy dispatch for representative single users for each of the four modeled user classes. The represented day is 23 rd September 2017. Representative days for all the modeled seasons are reported in the Supplementary Information of this work. The multi-good micro-grid (c) represents a first step towards this integration. In this configuration the totality of the thermal load is satisfied by the electric microgrid, by means of electric water heaters. This configuration shows slight improvements in terms of NPC, and hence, of LCOE, showing a further reduction of 8% in the Net Present Cost, meaning 23% less than the traditional energy system (a). While from the point of view of penetration of renewable energy in the system, this configuration with a penetration of 83% results in 60% more solar energy bring used in the system compared with configuration (b). Reaching the higher level of integration in this work is represented by the multi-energy system (d), configuration in which thermal loads and electrical loads can be satisfied by a completely integrated system, made up of PV panels; battery electric storage system; a back-up diesel generator; thermal solar collectors; a hot-water storage tank, with electric resistances able to heat up the contained water; and back-up LPG boilers. In this configuration is possible to reach a minimum NPC that is 65% lower than the traditional energy system (a), 59% lower than the conventional micro-grid (b), and 54% lower than the multi-good micro-grid (c). What is more, a LCOE of 0.090 USD/kWh and a renewable penetration of 93.7% are reached. A \"Multi-Energy\" or \"Smart Energy System\" perspective is thus critical to achieve overall optimal energy systems configurations, especially in relationship with the inclusion of multiple storage options. Potentially, larger benefits might be achieved in cases where different renewable energy sources can be coupled and where even more energy vectors and storage options can be integrated. Furthermore, the link between the electric and thermal sector is in this case limited to the supply of energy to counterbalance heat losses from thermal storage, but it might be improved by considering the use of heat pumps or combined heat and power (CHP) plants. It is also worth noting how the focus of the present analysis is the comparison of different energy system scenarios from an overall point of view. As such, it does not aim at accurately reproducing the physical behavior of all the modeled technologies, which may be indeed obtained, if needed, by implementing a MILP logic. We are aware of this limitation and future work is planned to explore the effects of implementing it.