{'fraction_non_alphanumeric': 0.02159319166930965, 'fraction_numerical': 0.010598371920921874, 'mean_word_length': 5.0792095115681235, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Synergistic optimization of renewable energy installations through evolution strategy

With large parts of the world moving toward renewable energies, there is an urgent need to organize this large-scale transition effectively. This paper presents a new methodology to guide the planning and siting of renewable electricity generation for countries or larger geographical regions. Its flexible approach accounts for the specific boundary conditions, constraints and available resources of the region of interest and enables solutions that optimize the interplay between the various types of generation. Evolution strategy permits a simultaneous optimization of the placement and the share of renewable electricity generation technologies that are to be added to a system, while most efficiently combining the new with the existing electricity generation and respecting the constraints of the electrical grid. Using Switzerland as case study, we demonstrate the method’s ability to devise national installation scenarios that are efficient, realistic with respect to land use and grid infrastructure and reduce significantly the need for seasonal storage. We show how the spatio-temporal variability of weather-driven electricity generation can be exploited to benefit the electrical system as a whole.


Introduction
Many countries are currently on their path to more renewable energy and scientists are trying to aid this endeavor to their best ability [1][2][3][4]. But every place has its own unique environmental potential and is constrained by specific boundary conditions. Instead of following an organic growth, renewable installations could be planned under the consideration of the system as a whole. A major challenge in replacing conventional by renewable electricity generation is to manage a typically much more volatile generation profile. Depending on the country, this might pose a problem on short time scales only, but particularly in the mid-latitudes, seasonal energy deficits and overproduction emerge, which cannot be alleviated with existing storage technologies. The spatiotemporal variability of wind, solar and hydro is an asset that can be used to better align electricity generation and consumption and reduce the need for storage. We propose a new optimization scheme that can devise realistic installation scenarios at high spatial resolution for renewable electricity generation. Our method is particularly suited for geographical regions that exhibit high spatial heterogeneity in the weather that drives the renewable generators. As in our test case: Switzerland, such regions can be rather small but can nevertheless show high variability across short distances. This variability is also found in much larger geographical regions like Europe or North America, which are affected simultaneously by various synoptic weather systems. The high resolution (number of grid cells in the considered territory) admitted by our method allows to truly capture and optimize the electricity generation profiles from solar, wind and hydro sources.
Energy modeling is an active research field that tackles many facets of the energy or electricity sectors. The optimization of the generation mix can be addressed in multiple manners, each one targeting certain features of the system and neglecting others. In Europe, Heide et al [5] optimized the photovoltaic (PV) and wind turbine capacities in each country to reduce the need for storage given the load curve. The effect of excess generation was then investigated in [6]. Rasmussen et al [7] adopted a similar approach but aggregated at the European level. Dujardin et al [8] present a comparable work for Switzerland, with a detailed representation of the hydropower system. Those studies used predetermined locations for PV panels and wind turbines and considered unrestricted power transmission (copper-plate assumption). In those non-economic approaches, the optimization was performed by computing the effect of all possible generation mixes. Becker et al [9] did a similar work for the USA but included a simplified electrical grid and used a combination of least-cost optimization and simulated annealing for the optimization of the Levelized Cost of Electricity. Jacobson et al [10] and Clack et al [11] present a cost-optimized model of a fully-renewable USA without explicit power flow but considering transmission. Kayal and Chanda [12] use particle swarm optimization, a heuristic method, to find the best integration of PV panels and wind turbines on a distribution grid and offers a detailed review of similar work based on heuristics. Another line of research focuses more on the effect of renewable electricity generation on the transmission grid and the electricity market. Leuthold et al [13] introduce a European model of the grid, generation and economics that maximizes social welfare through non-linear optimization. In Switzerland, Schlecht and Weigt [14] simulate the dispatch and load flow via a linear cost minimization and a detailed representation of the hydropower system. Bartlett et al [15] show with the same level of detail the impact of large shares of PV panels in Switzerland, but without economic considerations. Another detailed electricity model for Switzerland is presented in [16]. It integrates a dispatch model on the transmission grid, a market model and a long-term investment model. The system, formulated as a quadratic problem, is optimized to minimize dispatch and investments costs. A detailed review of modeling tools for energy and electricity systems can be found in [17].
The complementarity between diverse renewable generators installed at various locations is a key component of a reliable electricity system with large shares of renewables. This is shown in [18], where optimized wind power capacities across Europe, under the local weather regimes, can deliver a more balanced generation. To our knowledge, there has been no work optimizing simultaneously the generation mix and location of renewable power plants while considering a detailed grid and the spatio-temporal variability of renewable electricity generation, instead of predetermined locations.
We present a novel approach which optimizes simultaneously the generation mix and location of renewable generators at high spatial and temporal resolution and the management of storage hydropower plants (SHPs) and pumped-storage hydropower plants (PSHPs) while considering the electrical grid. The optimization considers the spatiotemporal demand, the existing generators, the electrical grid, the weather variability in space and time and the land availability. We adopted a hybrid approach that combines evolution strategy, a heuristic optimization that mimics the biological evolution of a population as its individuals get fitter with respect to a certain objective function, and a reduction of the problem complexity by regionally ranking the best locations. Because of its heuristic nature, there is no restriction in the problem formulation and the objective function can be freely defined to target any of the important aspects of the system.
Intermittent renewable electricity generation is never a perfect substitute for dispatchable generation. Within a geographical region, overproduction needs to be stored, exported or curtailed, underproduction needs to be compensated by dispatchable generation or import. In our Swiss test case, we want to show how a smart planning of renewable installlations can better align generation and consumption by efficiently combining the various generators given the spatio-temporal variability of the weather that drives them. We applied our method in a new model called OREES: Optimized Renewable Energy by Evolution Strategy. This model finds the optimal configuration of PV panels and wind turbines in Switzerland in order to replace the currently operational but soon decommissioned nuclear reactors, while minimizing the mismatch between electricity generation and consumption. This Swiss-specific combination of PV panels and wind turbines is not necessarily the economic optimum, especially when considering the Pan-european electricity market. Instead, we show how weather variability can realistically be exploited to reduce some drawbacks of solar and wind energy, namely the need for large storage and the grid congestion.

Test scenario
As case study we selected Switzerland because of its ambitious plan to phase out nuclear energy by 2035, replacing it by the largest possible share of renewables. However, because of its high flexibility, our methodology can be applied to other countries or bigger geographical regions with different boundary conditions or objective functions. The initial setup is based on the year 2016, given its spatially distributed time series of modeled wind speeds, measured solar irradiance, estimated water inflows into the reservoirs (equivalent to 17.1 TWh), actual electricity production from run-of-river (16.6 TWh) and real electricity consumption (62.5 TWh). We use the transmission network as projected by Swissgrid for 2025 [19] (figure 1). If nuclear and conventional thermal plants would be removed from the generation mix in 2016, a net domestic production deficit of 29 TWh would result. It is this gap, mostly occurring from November to April (referred to as winter in the following) that we aim to fill with new PV and wind energy. We focused on those two technologies as hydropower is already almost fully developed. While the deployment of such a large capacity will take several years or decades, we consider a completed installation, i.e. the total installed capacity does not change throughout the year. The analysis is repeated for 2017 and 2018 and yields very similar results which are presented in the supplementary information (SI) (available online at stacks.iop.org/ERL/16/064016/mmedia).
This modeling effort is rooted in detailed simulations of the Swiss hydropower system and its interplay with PV and wind [8] through the electrical grid [15] by means of a least-cost dispatch model. A summary of those models is provided in section 2.4 and from now on, as in those studies and in section 2.2, we will use the term 'import' as a placeholder defining any supplementary electricity storage or dispatch needed to balance the system after SHP and PSHP have been invoked. We compute hourly, spatially explicit electricity generation from PV panels and wind turbines using the SUNWELL model [20] on a 1.6 × 2.3 km grid and the wind fields from the Numerical Weather Prediction model COSMO-1 [21] on a 1.1 km grid (see section 2.5). The location-specific tilt and azimuth of each PV panel is chosen to maximize its winter production.

Constraints and objective function
In Switzerland, the capacity factor (i.e. the fraction of the nominal power that is reached on average) and the cost per installed capacity, are roughly equivalent for PV panels and wind turbines, respectively. If we consider similar lifespans and maintenance costs, and similar sales values (EUR/MWh) for both technologies, their equivalent annual costs and revenues are also similar. Under those assumptions, we can exchange one unit of installed capacity of one type of generator with the other, without changing the associated costs and revenues. To equitably compare every scenario of installation our optimization explores, their combined installed capacity remains constant between each optimization step. Given an expected capacity factor of 18.5% in the optimized locations (as achieved in figure 6), 17.85 GW of installed capacity is needed to reach the aforementioned 29 TWh of generation in 2016. A constant capacity implies that the total generation from PV and wind varies at each optimization step, which is compatible with the objective of reducing the total required import.
Dujardin et al [8] used a quantity termed 'required import' as an overall metric for the synergy between the various renewable energies and their interplay with SHP and PSHP. This quantity corresponds to the amount of supplementary electricity needed to balance the grid after all domestic generation and storage has been used. As described in section 2.4, our dispatch model is set to minimize the exchanges with neighboring countries. If the PSHP would be large enough (installed capacity and energy storage), the dispatch model would not need to activate those exchanges and hydropower would compensate for the fluctuations of solar and wind. However, given its limited size, the current hydropower infrastructure cannot compensate for all those fluctuations. This results in e.g. export of excess solar energy in summer and import of electricity in winter. In this context, the total amount of (required) import is the quantity we aim to reduce, by aligning production and demand as much as possible and by concurrently optimizing the operation of the hydropower system.

Genetically encoded generation mix and installation locations
As detailed in SI, our optimization is split into two sub-problems: (i) How many PV panels and wind turbines should be connected to each node of the electricity network; (ii) where within the territory surrounding the node should those installations be located. The first is treated by the evolution strategy algorithm and the second is treated by a deterministic ranking of the locations given their winter production potential.
Following the previously used, biological metaphor, a candidate solution to our problem is represented by one individual which can propagate its genetic information to its descendants. We start with a pool of 12 random individuals, each one being close to a uniform distribution of placement and having a random generation mix from PV and wind. Progressively, as the best individuals are selected, their breeding and mutations lead to an evolution toward better solutions until the optimum is reached. Except for very small values, the size of the population pool did not influence the optimal solution. Larger pools converge after fewer optimization steps because more diversity exists simultaneously but require more computation per step. The total number of individuals evaluated before convergence, and thus the total computational time, was minimal for a pool of 12 individuals.

Power and energy balance models and objective function
At the heart of our optimization scheme lays the nationally aggregated power and energy balance model described in [8] and the spatially distributed optimal power flow model described in [15]. They use hourly time series of electricity consumption, nondispatchable generation from run-of-river plants and water inflows into the hydropower reservoirs. The total effective storage capacity of the reservoirs amounts to 6.3 TWh and the pumping capacity amounts to 3.5 GW. As depicted in figure 1, we discretize the country into 129 clusters surrounding 169 indigenous grid nodes (several nodes are collocated) and aggregate generation and consumption inside each cluster to then distribute it across its nodes. Those two models share the same goal: to balance electricity supply and demand at any time while minimizing the amount of import and export with the neighboring countries. Their behavior can be described in three steps: (i) The nondispatchable generation (run-of-river, PV, wind) is subtracted from the demand at each node; (ii) the dispatchable SHP and PSHP are invoked to decrease the overproduction or underproduction within its capabilities while adhering to a long-term water management strategy; (iii) import and export are used to guarantee that total generation equals total consumption at any time.
The aggregated model computes the theoretical lower limit of required import, and determines how SHP and PSHP should be used in coordination with the other generators. The spatially explicit model combines a simulation and water management strategy of the largest 67 Swiss hydroelectric reservoirs and 69 associated SHP and PSHP with a dispatch model on 169 Swiss electric nodes and 37 foreign ones. Given the (non-monetary) generation costs of each domestic and foreign generator, the DC optimal load flow from the MATPOWER library [22] ensures that generation and demand match at any given time for the least total generation cost. This dispatch respects the grid constraints (node voltages and current rating of lines and transformers). In our setup, electricity import occurs only when necessary. This is realized by using a constant cost for foreign electricity generation, which is higher than the average costs of domestic generation. The domestic costs fluctuate given the water availability and long-term water management strategy. The results from this setup (when aggregated spatially) are similar to the results from the aggregated model. In OREES, we use the aggregated model as a first filter to exclude candidate solutions that do not achieve a decrease in import, because of its low computational cost. We apply the spatially distributed model to each of the remaining solutions in order to eliminate those that are not compatible with the grid.

Electricity generation from PV panels and wind turbines
PV generation is computed with the SUNWELL model, which uses Meteosat Second Generation (MSG) data. The model is described in [20]. Based on hourly satellite-derived radiation and albedo maps [23] on a 1.6 km × 2.3 km grid, SUNWELL computes the potential production as function of the panel's tilt and orientation. Based on a nominal power of 150 W m −2 at 20 • C, the panel efficiency is adjusted for environmental conditions (air temperature and wind speed). The model is conceived to capture the complex irradiance conditions in alpine areas; it accounts for topographic shading, cloud cover and the highly variable reflectance from the ground as the snow cover varies throughout the year.
Hourly time series of wind power are computed using the curve of the coefficient of performance from the Enercon E-82 E4 wind turbine (common model in Switzerland), which has a nominal power of 3.02 MW, a hub height of 84 m and a diameter of 82 m [24,25]. The calculation involves the wind speed at 90 m above ground level from COSMO-1 analysis dataset and a correction for the local air density which varies strongly given the wide range of elevations investigated in this study. Details for this calculation are given in SI. Figure 2 shows the capacity factor of PV panels (upper panel) and wind turbines (lower panel) calculated in their respective grid cells.

Geographical information system (GIS) analysis for installation potential
Since the geographic placement strongly influences the electricity generation from PV panels and wind turbines, we used a GIS analysis to determine their feasible installation areas on a 50 m grid, accounting for accessibility and social acceptance. Based on high-resolution datasets [26,27], we exclude for both installations grid cells which are: (i) on slopes steeper than 30 degrees, or within 150 m from them; (ii) at elevations greater than 2700 m; (iii) farther than 500 m from a motorable road; (iv) within the National Park. The Corine Land Cover inventory [28] is used to exclude glaciers and areas of persistent To enhance the contrast, we saturated the representation to the maximum values encountered at elevations smaller than 2700 m. Elevation larger than this limit (red hatch) are not considered as potential location. snow cover. It is further used only for PV installations to exclude all surface cover types except for: urban fabric, industrial or commercial units, non-irrigated arable land, permanently irrigated land, pasture, heterogeneous agriculture areas, natural grasslands, bare rocks and sparsely vegetated areas. For wind turbines only, we exclude areas within a radius of 500 m from houses. Additionally, we exclude northern orientations (slope × cos(0.5 × aspect) > 10 • ) for PV. This procedure generates binary maps at 50 m resolution indicating the possibility of installation. For PV, we allow a maximum of 5% coverage for the selected areas. In the 2552 km 2 of constructed areas, 5% approximates the 150 km 2 of roof area suitable for PV installation [29]. For non-urban territories, 5% corresponds to one PV farm with a footprint of 1 km 2 (500 000 m 2 of panels) in an area of 10 km 2 . We enforce a minimum distance of 500 m between wind turbines, which limits the density of installations in each contiguous potential area. Aggregating those maps on the grids of the respective time series (figure 3), yields 9148 MSG pixels for potential PV and 22 269 COSMO-1 pixels for potential wind installations.
This rather conservative analysis reveals that Switzerland could accommodate 605.77 km 2 of PV panels and 50 398 wind turbines. This potential is large in comparison to the aforementioned installed capacity required to reach our production target. Our optimization will thus have the freedom to place these installations in various configurations.

Evolution strategy
As represented schematically in figure 4, the optimization algorithm surrounds our power and energy models to supply them with changing times series of PV and wind power production that progressively lead to lower values of required import. Each individual in the pool of candidate solutions is a vector representation of how much installed capacity of PV panels and wind turbines is connected to each grid node.
This vector thus has 338 (2 × 169) entries. For each vector entry we compute the corresponding time series of power generation using the previously mentioned ranking algorithm within each cluster. A pre-filtering step checks if newly-created individuals lead to import values lower than the highest value obtained in the previous optimization step. In other words, children should be better than the worst parent. Individuals not fulfilling this condition are discarded and new individuals are created until six viable children are generated from the six parents. This reproduction is based on a random selection of two out of six parents, on their breeding (linear combination of their vectors with random weights) and on four mutations within the child (exchange of a random value between two randomly chosen vector entries). The aforementioned random values are generated within controlled boundaries such that the vector entries of the child are always within a range of values which are coherent with the installation potential on each grid node. SI describes how we define the solution space in such a way and how we generate those random but controlled values. The six children are then filtered by the power flow model to guarantee that the grid can handle the corresponding configurations of PV panels and wind turbines. Individuals who fail are discarded. Finally, we select the six individuals with the lowest amount of import among the six parents and the remaining children. They become the parents of the next pool. The first iteration is atypical as we generate random individuals until we can form a pool of 12 solutions that pass the power flow test. This guarantees that our initial solutions are all compatible with the grid and will not propagate wrong configurations of PV and wind to their children. The next pool is based on the six solutions that have the lowest import and is created through the described procedure. A sensitivity analysis showed that population size, survival rate and mutation rate only affect the speed of convergence, but not the final solution of the optimization. SI provides a description of the reasons that guided the architecture of our optimization scheme and the required computation to reach the optimal solution.

Results
In our test case, the optimal solution of PV panel and wind turbine installations has the following characteristics: a high share of wind turbine capacity, and placements in mountainous areas with high wind speeds and high solar radiation in winter. Moreover, this solution is compatible with the electrical grid and the SHP and PSHP are optimized to work concurrently. For Switzerland, installing 29.63 km 2 (4.44 GW) of PV panels and 4438 wind turbines (13.40 GW) in the specific locations identified by our model reduces the mismatch between generation and demand, via the optimized support from hydroprower, to the lowest possible amount. This better alignment with demand and complementarity between PV, wind and hydropower reduce the requirements for supplementary seasonal storage and the reliance on foreign exchanges at times when many neighboring countries will face similar challenges of overproduction and deficits.

Wind dominated evolution
Starting with 12 random individuals, the pool of candidate solutions evolved toward an optimal configuration where 75.1% of the capacity is from wind turbines and 24.9% is from PV panels. Figure 5 shows how import changes during this evolution. This change is computed with respect to the averaged import value (7.09 TWh) associated to the initial 12 candidate solutions. The green curve, reflecting our objective function, indicates the change of import associated to the best solution in the pool at each optimization step.
We must first identify the origin of this reduction of import. Our evolution strategy has the control over two variables: the generation mix of PV panels and wind turbines and their location. We can further decompose the effect coming from the latter into two parts: the change in yield (total annual production, red band) because of higher radiation or wind speed in certain locations, and the change in the temporal pattern of the production because of the local weather characteristics (blue band). At each optimization step, we generated three fictitious solutions that demonstrate the effect of generation mix, yield and timeliness of production. This decomposition, described in SI, is quite accurate as the summation of the change of import from the three factors almost equals the change of import from the real solution.
The thumbnail in figure 5, a normalized version of this figure, helps to identify the relative importance of each contribution. Initially the optimization could achieve the highest improvements through changes in the generation mix. Subsequently, changes in installation location, more specifically the associated increase in yield and better synchronization with the demand, contributed more to the reduction in import.
Our optimization scheme reduces the required import from an initial 7.09 TWh to a final 3.47 TWh: a reduction by 51%. We can put this achievement into perspective: in a conventional base load scenario, a constant production leading to our 29 TWh target would require 5.9 TWh of import. Furthermore, compared to the business as usual (BAU) scenario described below, which requires 17.48 TWh of import despite its higher capacity of 21.7 GW, the reduction amounts to 80%. It is thus possible to achieve a lower dependence on import with renewable than with a conventional base load. But this is only possible if these renewable generators are smartly selected and located.

A solution for the benefit of all
One might wonder where this high level of performance comes from. Figure 6 shows how PV panels and wind turbines perform as our algorithm optimizes them. It depicts the evolution of the generation mix and the capacity factors of PV panels and wind turbines calculated for the entire year and for the winter period only. As comparison, we also show values for a BAU scenario with a more standard setup where only 4 TWh (as targeted by the Swiss Energy Strategy 2050) come from 679 wind turbines located in productive areas and the remaining 25 TWh are produced by 131 km 2 of rooftop PV panels in urban areas, as described in SI. The first important element that we can observe is the continuous increase of the capacity factors as the system gets optimized. The optimization does not just reduce the import, which is beneficial for the system as a whole, but also boosts the yields which is Figure 5. Change of import throughout the optimization. The green curve represents the best candidate solution in the pool at each optimization step. The three colored bands represent the contribution of three main factors responsible for this change of import. The thumbnail is a normalized copy of this figure that shows the relative contribution of each factor. beneficial for the owner of such installations. Unsurprisingly for Switzerland, winter electricity generation from wind turbines is always higher than from PV panels. Their relative improvement however is similar. Even if the BAU scenario has a yearly PV capacity factor close to the initial one of our optimization, it performs poorly in winter with values as low as 5%. In comparison, the optimization covers winter values ranging from 13.1% for homogeneously distributed locations to 17.6% as they are displaced toward the mountains: A value that is 3.5 times higher than in the BAU scenario.
We can summarize these findings with two short statements: (i) Many locations offer a high winter production from wind turbines which favors a high share of wind in the system; (ii) Winter PV production is mediocre in many areas but mountains offer some exceptionally favorable locations.
The efficiency of those two renewable generation technologies in the system does not stand on its own: SHP and PSHP play a major role. In Switzerland, most of the solar and wind fluctuations can be compensated by the flexibility of the hydropower system. Underproduction can be covered by turbining water from the reservoirs and overproduction can be absorbed by pumping water to fill them. This interplay is described in [8] and is fully represented in our model. The optimization exploits this capability to its limits. Interestingly, as the optimization progresses, so does the use of the PSHP. Its initial utilization rate of 13.8% increases to 17.8% at the end of the optimization. Thus, by improving the system as a whole, the optimization turns the PSHP into a more profitable generator. This however implies a change in its operation, with more occurrences of ramp-ups and ramp-downs to accommodate the fluctuations in the new power generation profile. This has impacts on the equipment and on the water discharges, which are the objects of multiple studies [30,31].

Grid constraints
As described in sections 2.4 and 2.7, each candidate solution undergoes a power flow test ensuring that the entire grid can satisfy the overall balance between generation and consumption. Figure 1 depicts the characteristics of the Swiss transmission network: Multiple high capacity lines connect the mountains in the south and the urban centers in the north. Those lines currently transport electricity from dispatchable alpine SHP. They could also transport electricity from alpine PV panels or wind turbines when they are active and hydro-electricity otherwise. Moreover, when there is too much solar or wind energy for the system to consume or even to transport, the pumps which are located nearby, can absorb and store the overproduction.
To visualize the constraints imposed by the grid, we perform a parallel optimization run which leaves out the power flow model, but keeps the upper limits of installed capacities on each node. As described in SI, the solution space, hence the theoretical potential for installation on each node, is bounded by the installation potentials from the GIS analysis and by the capacities of the lines connected to the node. In this alternative scenario, we keep the line-imposed limits in order to prevent unrealistic concentration of installations is certain locations. The results from our two scenarios show the impact of grid congestions on the optimal solution and on its performance. Figure 7 shows the differences in location of PV installations (upper panel) and wind turbines (lower panel) between the optimal solutions of the two scenarios described above. Areas depicted in blue did not show any change while the red areas lost some installations (relocated in the green areas) because of the limitations imposed by the grid. In gray, we show the location of PV panels used in the BAU scenario. The change of installed capacity can also be observed in the lower panels of figure 8, in a clusterwise aggregated way. The upper panels depict the installed capacities in each cluster for our initial scenario (with power flow).
Concerning PV installations, one large cluster located in the northwestern part on the Alps shows the strongest reduction (90 MW) of its installed capacity, which is almost half of what was installed in the no-powerflow scenario. From the 3.9 GW of total PV capacity in this scenario, 1.06 GW have to be removed from which 0.56 GW have been relocated due to grid congestions. The remaining 0.5 GW are replaced by turbine capacity because of the change in generation mix between the scenarios (see below). This relocation mostly happens in: (i) The northern part of the Alps which is directly connected to the northern urban centers; (ii) around two nodes with strong grid infrastructure in the southwestern Alps; (iii) in Ticino in the South, which is well connected to Italy.
For wind turbine installations, the Jura mountain range in the West holds almost 40% of the total installed capacity because of its strong winter winds and numerous potential installation sites. However, due to the congestion of the lines, large relocations were needed, which populated the pre-Alps and the Alps. In total, 3.15 GW of the initial 13.9 GW of turbine capacity in the no-powerflow scenario were displaced.
Remarkably, the performance of the two scenarios is quite similar, with required import values of 3.47 TWh with power flow and 3.14 TWh without it. Even if the grid forces the relocation of certain installations, they are placed in locations that are almost as good. The optimal generation mix is also not strongly affected by the grid, with shares of PV equal to 24.9% and 22.1% respectively. Figure 1 in SI depicts how the winter electricity generation from PV and wind varies from place to place and how it correlates with the electricity consumption. Our optimization takes advantage of this spatial variability while respecting the grid constraints.

Conclusion and discussion
Our methodology matches weather-driven electricity generation with electricity consumption given the available storage and grid infrastructure. It devises placement scenarios for renewable installations, determines how hydropower should be used and displays the associated system dynamics. For our test case, we showed that Switzerland has a wind energy resource that should be exploited in coordination with the existing hydropower system. PV installations should also play a significant role, especially if located in alpine terrain which offers high winter insolation. If the optimal configuration of electricity generation is employed, winter production from PV panels can be increased threefold and dependence on import or supplementary electricity storage can be reduced by 80%, while reducing by 18% the capacity needed to reach the desired total generation. Such methodology can be applied to different geographical regions, with different scales and boundary conditions, in order to discover the optimal interplay between the various renewable electricity generators.
Given the complexity of the socio-politicoeconomic conditions determining where renewable installations will be built, our conservative assumptions aimed at reaching a midway between extreme restriction and improbable freedom while ensuring opportunities for harvesting energy in favorable places. This work did not aim to provide a turnkey solution to the future Swiss electricity supply but aimed to reveal the weather-driven optimality in electricity generation that can be used to secure the supply of electricity. Being free from economic considerations, our model can show how combining the various sources smartly can positively impact the system as a whole. It reveals the highest level of complementarity between those sources that can be achieved given the spatio-temporal heterogeneity of the weather. In this work, we did not consider curtailment of renewable electricity generation nor demand side response. Those features would certainly alter the optimal solution. However, as for the relatively small change observed between our two scenarios involving the grid or not, it is expected that curtailment or demandside response, if they have a relatively small magnitude, would not influence strongly the observed dynamics.
We hope this work will inspire scientists, energy planners and policy makers to orient their investigations and decisions toward more encompassing approaches based on the environmental conditions and on the behavior of the system as a whole. Optimization models as the one presented in this article have the ability to associate the various renewable energies together in a synergistic manner while considering physical, social and economic constraints. The current work should also motivate the modeling of similarly detailed but larger systems like the European, North American, Chinese or Indian electrical grids where neighboring states or countries will have to rely on each other to guarantee their interoperability. Smartly complementing and coordinating renewable energies over large regions can smoothen intermittencies by reducing correlations among generators and among consumers [18,32]. Seasonal deficits can be alleviated through the wider range of weather patterns that drive the generation in distant places.

Data availability statement
The data that support the findings of this study are available upon reasonable request from the authors.