A Rising Role for Decentralized Solar Minigrids in Integrated Rural Electrification Planning? Large-Scale, Least-Cost and Customer-Wise Design of Grid and Off-Grid Supply Systems in Uganda

: Increasing Uganda’s low electrification rate is one of the country’s major challenges. Power service is essential to achieve socioeconomic development and poverty reduction, especially in rural areas. This paper shows the advantages of using an integrated (grid and off-grid) electrification model with high geospatial, temporal, and customer-class granularity as the Reference Electrification Model (REM). In universal electrification strategies, REM will help better ascertain the role of minigrids, jointly with grid extension, solar kits, and stand-alone systems. REM has been applied to the Southern Service Territory (SST) to determine the least-cost mix of electrification modes—grid extension, off-grid minigrids, and standalone systems—that satisfies the hourly demand requirements of each customer—residential, commercial, or industrial—considering its individual location. REM incorporates the existing grid layout, the hourly solar local profile, and the catalogs of actual components for network and generation designs. The paper shows that minigrids can provide grid-like service at a significantly lower cost in many circumstances and to a considerable extent. Therefore, minigrid strategies should play a more important role in electrification planning, both transitorily and on a permanent basis, particularly when the central grid suffers from frequent and prolonged blackouts.


Introduction and State of the Art
Uganda's National Electrification Strategy (NES) objective is to achieve universal access by 2030 [1]. Currently, around 24% of the households are connected to the national grid, 23% own a Solar Kit (SK) or lantern, and 3% own a Solar Home System (SHS). According to NES: "Achieving universal access in Uganda will involve the massive expansion of both on-grid access, through densification, intensification and grid expansions, as well as off-grid access through the development of minigrids and the expansion of standalone solar energy systems".
There are operational minigrids in Uganda [2], primarily solar/battery hybrid grids, but their numbers are presently negligible compared to other electrification modes (19 existing minigrids, mostly solar and hydro-powered, and 61 more under construction). However, the NES has estimated that in 2030, by using GEOSIM village-level analysis [3], that minigrids could provide grid-like service at a significantly lower cost in many circumstances. They should play a more significant role in universal electrification planning. Some minigrids could be the best supply mode for many years or even permanently in very isolated locations. Others may play an efficient transitory role while demand grows or while the existing central grid suffers from low reliability and yields frequent and prolonged blackouts. This transitory solution will pose a low-cost supply alternative for critical services, productive, community, or other priority clusters of customers. At the same time, decision-makers should make provisions for an eventual later connection to the grid as the situation evolves.
In Section 2, we summarize the bases of the REM modeling and detail briefly the input data gathering, inferencing, and assumption processes. We describe how we determine building locations, network data, energy costs and resources, and the main assumptions and inferences required to model the Southern Service Territory with REM.
In Section 3, we summarize the REM results for the whole territory, considering the input data and assumptions specified for the pivotal (reference) scenario analyzed.
In Section 4, we focus specifically on the minigrid results, analyzing why they are preferred to grid extension in some cases, determining the cost ratio of both alternatives, and analyzing the size of minigrid customer clusters as opposed to village-size oversimplifications.
In Section 5, we see how different assumptions impact and affect the importance of minigrids in the least-cost REM solutions, such as different central grid reliability levels or different demand levels.

Methodology
The outputs provided by REM rely on a combination of ground data, calculated assumptions, and strategic decision-making. The tool should be used in close interaction with the lead agency and departments for planning. In this case, all the analysis has been developed in close collaboration with the GIZ team in Uganda, with detailed insights from the MEMD and the collaboration and input of the US National Rural Electric Cooperative Association (NRECA), as a consultant responsible for the elaboration of master electrification plans for the country.

Minigrids, Standalone Systems, and Network Extension Design: Compared Cost of Supply
The novelty of our approach is the comparison of the cost of electricity supply for three alternatives for the whole territory and down to each customer connection, and according to the demand level and profile for each customer type:


Network extension from the national distribution grid, including the Medium Voltage (MV) and Low Voltage (LV) technical and economic network catalog of components, the applicable grid code, and the cost of energy taken from the grid and its reliability of supply;  Off-grid minigrids including generation and network design;  Standalone systems, either fully-fledged Alternating Current (AC) solar systems or Direct Current (DC) solar kits.
This detailed comparison results in selecting, for each customer or group of customers (cluster), the best (least-cost) supply mode among those three for every scenario modeled.

Description of the Data Gathering Process
Detailed electrification planning requires a comprehensive set of input parameters and data. The data gathering and pre-processing steps for a case require a significant effort to ensure accurate designs and results. The input data needed by REM is summarized below (please refer to Appendix A. REM Input Data Catalog for a detailed list of the various data required by the model): 1. The study has used existing field data from canvasses developed by GIZ and our tools for satellite imagery processing to overcome the lack of information about the precise location of electrified vs. non-electrified customers. 2. Existing distribution feeders (MV): The MEMD provided a shapefile of the layout of the MV network within the Southern Service Territory of Uganda. The network file was closely analyzed to differentiate between existing and planned lines. On top of this layout, we added the respective voltage level and the energy cost at the distribution feeders. To characterize the frequent blackouts and weak supply in rural areas in Uganda, we included the reliability of each section of the network. 3. Energy resources: The model considers the typical hourly solar irradiance in the SST through a year, using the National Renewable Energy Laboratory's PVWatts ® tool [58] to inform better the possible generation capacity of solar resources, taking into account seasonality, weather and temperature conditions. Additionally, we used an average cost of diesel fuel within the SST for the various minigrids designed. We assumed that the solar resource and the cost of diesel fuel were uniform throughout the SST. 4. Network and minigrid generation catalog: Electrification technologies, including network equipment, such as distribution lines and transformers, PV panels, diesel generators, storage, and power conversion equipment, all have costs and quality specifications that may vary by region. For this study, we have considered mainstream available and affordable components in the region, averaging the expected evolution of their costs until 2030, especially in rapidly evolving technologies such as batteries or solar (We have not considered the emergence of future disruptive technologies, especially anticipated in batteries [59] and solar PV [60,61] for this study. Being a lowmargin market, before entering the off-grid sector in developing countries, these technologies will need to mature and become widely available at a low cost).

Building Identification and Electrification Status Estimation
The original buildings' location information used for the GIZ study, established by identifying rooftops from open-access satellite imagery using our computer vision system (as described in [5]), has been updated for this article. This dataset combines building files from the OpenStreetMap (OSM) data [62] with those from the Open Buildings (OB) set from Google Research [63]. Where building shapes overlapped between the two datasets, we prioritize those from OpenStreetMap because they are manually annotated. We perceive them to be of higher quality than the computer vision-based detection used in Google Research's buildings. The total number of buildings identified in the Southern Service Territory of 1,014,421 users, including not only residential users (74.5%) but also community users (5.8%) or productive users (19.7%).
The MIT/IIT team performed an electrification status estimation using an inference system based on Gaussian Processes with GIZ's October 2016 electrification survey for the SST [4,18,64]. GIZ surveyed clusters of 3-10 buildings in geographically distributed areas around the SST, totaling 472 edifices. GIZ also augmented this data with expert knowledge of the local landscape. The MIT/IIT team's Gaussian Process method exclusively used survey data and inferred electrification probabilities based on spatial correlation. Electrification probabilities were given for every geospatial location in the SST, as shown in Figures 1 and 2.  For modeling purposes, electrification probabilities from the Gaussian Process model were converted to specific building classifications using a probability threshold and Bernoulli trials. Any inferred probability less than 19% was classified as non-electrified. Any inferred probability greater than 19% was subject to a Bernoulli trial with a parameter equal to the electrification probability assigned by the Gaussian Process, scaled to meet National Housing and Population Census 2014 district-level specifications. This scaling process enforced the assignment of 37% electrification in the Masaka district, 15% electrification in Rakai, 11% in Isingiro, and 12% in Ntungamo. These figures are consistent with this most recent census [65].
The original electrified buildings information has been further extrapolated to the OSM and OB datasets used for the present study and updated using nighttime lights [66] processed by Gridfinder to filter fires and reflections and identify electrification targets [67]. This process identified a total of 515,941 electrified buildings in the updated dataset (50.9% electrification rate), which are consistent with previous canvases [68]. All buildings under the nighttime lighting measurement were considered electrified for the purpose of this study. In this region of Uganda, some of those buildings within an illuminated area will still probably miss a connection. However, they are so close to the power supply infrastructure (usually the LV and MV network) that connecting them will simply require a drop line or a very short LV extension, protections, and a meter. Therefore, they are excluded from this paper's analysis. Figure 3 shows electrified buildings overlaid onto nonelectrified buildings for the whole SST. One of the caveats of nighttime lighting satellite imagery is that it shows evidence only of those areas electrified where nightlights can be visible from outer space. Therefore, nighttime lights' imagery will not detect electrified areas with no streetlights, dimmed illumination, or frequent curtailment of power supply at night (as it is not uncommon in grid-connected rural areas in developing Africa and Asia). The combined approach used in this article, including merging ground field data and nighttime imagery, provides a more precise determination of the location of already electrified customers.

Existing Distribution Network (MV and LV) Infrastructure
For each one of the Southern Service Territory Scenarios, REM computes thousands of on-grid/off-grid system alternatives to find the optimal least-cost mix of grid extension systems, minigrids, and standalone systems. The REM benchmarks them by designing in detail each alternative and determining, for each household, the solution that minimizes the social cost (including the cost of non-served energy) for the entire system.
Regarding grid connection, REM designs each network extension system (LV lines, LV/MV transformers, and MV lines), connecting individual customers to the existing (or already planned) MV network layout.
The cost of upstream energy supplied by the central grid at the bulk MV distribution level has been set to USD 0.072/kWh for the Universal Access Least-Cost Scenario (Reference Scenario) as indicated by the MEMD. A higher-energy cost gives rise to many more minigrids and SHS connections. In an ideal cost-of-service framework, this cost of upstream energy will also fund any subsequent upstream reinforcements for generation, transmission, and distribution. The scope of the present paper does not include the specific design of these reinforcements. However, it could be the subject of a more detailed analysis if the topology and load status of the existing grid components (lines and transformers) were known.
The MEMD, NRECA, and GIZ provided technical and economic information for the MV and LV catalog of lines and transformers. Therefore, this study has developed all the additional grid extensions and minigrids according to the same national standards (please refer to Appendix A. REM input data catalog for further details on MV and LV components and characteristics). Components selected for the Reference Scenario were specified, bestowing the best practices and experience of the MEMD, considering that large catalogs with more different choices for LV and MV lines would also represent a logistic challenge for implementation, operation, and management. Therefore, for this paper, low-cost distribution technologies (e.g., SWER lines or two-phase wires that could lower the cost of long-distance distribution lines) have not been considered.
Given the alternative of cost-efficient minigrids, new grid extensions might not need to cover considerable distances to serve all the customers. This paper includes a Full-Grid Extension Scenario designed with REM to benchmark both approaches in the sensitivity analysis.
Where the grid is no longer efficient, REM will choose the least-cost option between grid-compliant minigrids (enabling them to be connected to the grid in the future) and standalone systems. Standalone systems will consist of DC solar kits or grid-like AC systems, depending on the level of expected demand.

Off-Grid Generation Catalog and Hybrid PV-Battery-Diesel Design Optimization
The Reference Scenario, detailed later, shows a large share of off-grid electrification in the Southern Service Territory of Uganda (both minigrids and solar home systems). The implementation of more than 900 minigrids will increase the market size for PV panels, batteries, and other off-grid equipment and attract large contractors. Therefore, we expect that the prices will become similar to those of other mid-size international markets with higher volumes of purchases. Per-system costs, such as infrastructure investment (e.g., small control buildings or fuel tanks), are also considered, as well as installation and maintenance labor costs.
REM assumes that each off-grid system has a single centralized generation system. The architecture is flexible, as not all the components are always required. There are alternative architectures, but this one was selected because it can be supported with available off-the-shelf components. It provides AC service, allowing a more straightforward comparison with grid extension designs.
The sizing of each minigrid is optimized considering the hourly solar performance profile, the aggregated customer profiles, and the existing solar, storage, and diesel hybrid generation alternatives. REM performs a simulation using the load following the dispatch strategy for each point in the search space. This strategy meets the demand by using solar energy first, batteries in the second place, and diesel as the last resource. The battery is only charged with solar energy.
The optimization of each generation design includes the evaluation of the different diesel/solar/storage choices to minimize the annuity cost of generation [36]. This design considers the aggregated demand profile for the combination of residential, community, and productive customers in each generation design optimized. It also ponders the lack of reliability (Cost of Non-Served Energy, CNSE), taking into account that some designs will not be able to meet all the expected demand at certain hours of the year.

Topographical Restrictions
There are a number of geographical features considered in our methodology at different moments. First, for the location of households (outside any forbidden areas) and then to determine the cost of generation (solar map of Uganda).
Regarding network design, REM takes into account the slope of the terrain and the location of areas of particular difficulty (rivers, other water bodies, high-risk areas, natural reserves,) which are costlier or even impossible to cross [4,35,69]. Therefore, to decide whether a village should be connected to the central network (including the design of the corresponding connection) or if a minigrid is a better approach, REM will ponder these topographic obstacles. Accurate network design optimizes the layout of the lines, either going over or around hills or mountains (comparing the additional length and cost of these alternative pathways) and avoiding lakes surrounding them when needed, pondering the higher cost of crossing trenches of water bodies. Figure 4 shows the relief and water bodies map of the SST.

Customers Demand Characterization and Quality of Service Targets
For this study, we considered three customer types, each one of them with three different hourly profiles across the year. The average consumption data of the three profiles were estimated according to field data provided by GIZ and are shown in Table 1. The amount of critical energy needs (e.g., domestic morning and evening lights, health centers 24 × 7, or school shifts) and non-critical needs (e.g., after midnight or daytime domestic supply, or non-working hours for productive uses) has been estimated according to the hourly profiles extrapolated from fieldwork at the village of Mutete (Rwanda) [70,71] as can be seen in Figure 5. It is essential to consider both the reliability of the central network (for the grid-connected customers) and the performance of minigrids and isolated systems (for the off-grid customers). REM can compute different scenarios according to different reliability hypotheses. For the central network, we have analyzed scenarios ranging from the present state of around 85% [72], up to a 97% reliable network, considering that the country will improve from the present status through the necessary investments in central generation, transmission, and distribution reinforcements.
The value of the critical cost of non-served energy (0.75 USD/kWh) was estimated first by considering the current expenditure of residences without electricity on candles, kerosene, and batteries for their needs [73]. This value is also a fair estimation of firms' expenditure on diesel backup systems, which need to supply around 15% of their energy consumption as a backup for blackouts. This cost per kWh is high because the customers must size their diesel generators according to their peak demand power, even if the genset only works a limited amount of time every year. As per not essential (non-critical) demand, our study assumes that leaving demand unserved for domestic uses from midnight until sunrise has a small economic value (USD 0.30/kWh). According to the project's stakeholders, the population does not have a strong need for power service during nighttime at present.
For small isolated residential customers (consumption expected under 150 Wp), REM will consider a small USD 290 DC Solar Kit, with a 90 Wp solar panel and 40 Ah 12 V (which can supply nearly 64% of the expected demand of these isolated households). The loss of utility of these systems is high compared to grid and minigrid connections,. The kW hours hours kW kW hours value of the cost of non-served energy for DC systems has been set to USD 0.75/kWh (equal to the CNSE for critical demand).
Other input parameters, such as equipment failure rates and technical constraints (e.g., the maximum voltage drop at MV and LV according to the distribution grid code) are included in the techno-economic catalog so the results will comply with the specifications established by the MEMD.
For the Reference Scenario, to determine which customers should probably be offgrid, we assume that the rural network will have improved its reliability from today to 2030, reaching at least 90% of the expected supply.

Least-Cost Integrated Electrification Plan for the Southern Service Territory: Reference Scenario
The Reference Scenario detailed in this section has been computed for the non-electrified buildings (498,480 loads) in the Southern Service Territory, considering the most probable situation in terms of demand, costs, and grid reliability described before. Figure  6 illustrates REM results for this Reference Scenario, showing the areas (green) where minigrids would be the least-cost option until 2030, as compared to grid extension (blue) and standalone systems (orange, red and pink).

Description of the Reference Scenario
The least-cost balance for this Reference Scenario ponders the cost of service of grid extension vs. the alternative cost of minigrids and, where appropriate, solar kits or standalone systems. REM calculates the cost of service for any given alternative (evaluated as an annuity in USD/year) considering the following summary data and assumptions (validated by the MEMD): Algorithm: Grid extension decision taken at customer (building) level, exhaustive configuration, meaning all alternative electrification modes considered for every cluster or buildings inside a cluster.

Reference Scenario Results
The Southern Service Territory is a region with a high population density. The prevalent solution can be expected to be connected either to the central grid (grid extension) or to an isolated minigrid, as can be seen in Figure 7 (The computing time required by REM to model the Reference Scenario was 171 min, using Windows-MATLAB 2020 with 10 parallel processing in a Dell Blade M640 server with Intel Xeon Silver 4116 with 12 cores and 128 Gb RAM. Future work to improve computing time for large-scale scenarios includes optimization of the code to enhance parallel processing and data transfer, and the possibility of cloud computing [74]). Minigrids represent 59.6% of the customers, exposing that when the central grid is not very reliable (90%), the solution will favor an alternative (minigrid) with a higher quality of service (98.7% in minigrids), with an investment per customer of 1174 USD, and a total overnight investment of USD 349 million. Grid extension is the second preferred electrification mode, with 23.7% of the customer base, an average investment of 505.3 USD per customer, and a total of almost USD 60 million. Finally, customers located too far from each other and village centers represent 16.7% of the population, with an average cost of 685 USD per customer and a total investment of USD 57 million. It is important to note that only residential customers with peak demand below 150 W are supplied in this scenario with a low-cost solar kit (when isolated) which supplies only 67% of their forecasted demand. REM designs a fully-fledged 24 × 7 solar home system for any isolated community or productive customer, with an average cost of USD 1642 and 1030/customer for community and productive loads, respectively. Table 2 summarizes other central figures associated with each electrification mode, such as the cost of service per unit of energy (USD 0.47/kWh in minigrids, USD 0.41/kWh for grid extension and USD 0.51/kWh for standalone systems). It is clear that, though they are different, they fall around the same magnitude. Another significant result is the added cost of non-served energy. It is negligible for minigrids in this scenario but very relevant both in grid extension (USD 23.46/year per customer, 17.5% of the cost-of-service annuity expressed in the TOTEX) and especially for standalone systems (USD 45  It is important to stress that REM computes the final least cost per customer, including fixed, variable, and social costs. Variable cost includes operation and maintenance (OPEX) of all the electrification modes and, for grid extension, the variable cost of purchasing upstream energy for new grid-connected customers. CNSE value shows the social cost of non-served energy according to the critical and non-critical demand filed to supply by grid extension, minigrids, and standalone systems. Figure 8 shows the aggregate per electrification mode of capital expenditures (CAPEX), operational expenditures (OPEX), upstream energy per customer, and CNSE of the different systems designed for the Reference Scenario. The figure shows how minigrid customers' annual cost of supply (TO-TEX) is, on average, close to the cost of grid-connected customers, 168 vs. 134 USD/customer, only 25% higher. If we include the social cost of non-served energy, these figures become even closer (USD 180.94 vs. 157.58/customer). Please note that even this higher cost is lower than extending the grid to those off-grid customers, as will be further detailed in the following sections. If we focus on the overnight investment instead of analyzing the annuity of each electrification mode, the balance can be misleading. Figure 9b shows how, although their annuities are similar, as seen in Figure 8, minigrids require more than double the initial investment than grid extension. Minigrids require investing both in generation and network and have little OPEX. In contrast, grid connection has high variable costs (including the upstream purchases of the energy consumed). Figure 9a shows the share of investment effort per electrification mode for the Reference Scenario.

Determining the Minigrid/Grid-Extension Frontier
The cost of service (CAPEX + OPEX per customer and per energy unit) is not homogeneous for all the systems designed in the Reference Scenario. REM compares the different supply choices and finally decides which is the least-cost option for each customer or cluster of customers.
The total cost of service needs to consider both CAPEX and OPEX, the cost of upstream energy, and the cost of non-served energy. For grid extension, this average annuity of the cost of service is USD 157.58/year per customer. As shown in Figure 10, for all the clusters of customers considered by REM, this cost (blue line) ranges from USD 131.21 up to 535.44/year per customer, four times more, depending on their distance to the grid and the density of customers. As the grid extension cost grows higher, the cost of service of minigrids (green line) becomes more competitive. The average cost of service for minigrids is USD 170.94/year per customer, roughly 8% more than the equivalent cost of grid extensions for the area of study. It ranges from USD 136.49 to 220.99/year per customer. For the Reference Scenario, electrification with minigrids of all these customers (instead of extending the grid) results in a net decrease of the cost of service by 17%, USD 8.7 million/year. The ratio between grid extension (GE) and minigrid (MG) annuity is also shown (black), clarifying the frontier where minigrids become a least-cost option (where the ratio is lower than 1). Figure 10. Individual cost of service USD/year) for grid extension (blue) and minigrids (green), and ratio for each cluster of minigrid and grid extension cost (black).
As explained above, REM calculates for each minigrid the alternative grid extension design. When the cost difference between options is too significant (when grid extension is more than five times costlier than the equivalent minigrid), REM stops computing the grid extension design. This feature is configurable and has the sole purpose of saving computer power. Figure 11 shows the location of all the resulting minigrids. The color code follows the MG/GE ratio: Red dots are those minigrids where the cost of service is from twice (50% cheaper) to more than five times (80%) cheaper than the one of the corresponding grid extensions. Orange minigrids range between 1.25 (20% cheaper) and 2 (50% cheaper). Yellows are for MG, where the savings are between 10 and 20%. Green minigrid savings would be from 5 to 10%, while Blue is for those minigrids where the cost of service is between 95% and 99.97% of the cost of the corresponding extension. The size of the circle depicts the number of customers in the minigrid. The map shows many minigrids where the savings are relevant (red and orange dots). Most are located far from the network, but some of them, smaller in size, can be only a couple of km away from the central grid. If we look at Figure 12, we can see that most of the market (65%) is for those minigrids where the savings in comparison with grid extension are less than 10%. Orange areas lower costs by between 15% and 25% and represent 29% of the market (nearly 85,000 customers). Those minigrids with savings over 25%, up to 90% or higher, are 6% of the customer base (19,000 customers).  It is important to note here that the Southern Service Territory is a densely populated area, where minigrids sizes are not small, and they are not too far from the grid in any case. Figure 13 shows the frequency of minigrid sizes, rounded in multiples of 50 customers. Out of the 902 individual least-cost minigrids designed for the Reference Scenario, with an average size of 329.36 customers/minigrid, the model appears in minigrids around 200 customers, where 126 systems connect over 25,000 customers. The peak of customers for a specific minigrid size appears for systems around 400 customers, which connect over 33,000 customers. In the Southern Service Territory, with almost 300,000 minigrid customers, 78.29% of that market (233,000) are systems between 200 and 600 customers. The location and quality of the sites selected for minigrids deployment are critical to attract investors and facilitate the good economic viability of the business models applied [30]. As seen above, the distribution of the minigrids over the Southern Service Territory is not homogeneous. Moreover, Figure 14 shows the heat map of minigrid geographical locations. It can help determine areas where the economies of scale of building and operating several minigrids together will help bring down the cost of service. Reducing this cost will help lower the viability gap of the minigrids. It will also decrease the subsidies required to cover the difference between applicable tariffs (or fees), which the customers can afford, and the actual cost of supply. It is important to remember that, even in least-cost planning, the cost of supply in isolated rural areas (with any electrification mode) is always much higher than in densely populated urban neighborhoods. Any average tariff which includes urban and rural customers will always imply a cross-subsidy between those areas where the actual cost of service is fundamentally different.

MiniGrid Portfolio: Break down of the Cost of Service, Investment, and Implementation Pipeline
The average supply cost annuities of 168 USD/year per customer (CAPEX + OPEXs) and 0.46 USD/kWh per unit do not reflect the diversity of systems shown in Figure 15. Starting with those dense villages where the cost of service is as low as 0.34 USD/kWh (where the cost of the network only adds 5 cents per kWh to the generation cost of supply of 0.29 USD/kWh), up to the most disperse minigrid where supply cost per unit is 0.52 USD/kWh.
The main cost component is always the generation cost, ranging from USD 87 to 114/year per customer. The network cost is more volatile and varies from USD 14 to 76/year per customer. The connection cost is USD 7.6/year per customer, and the administrative cost falls between USD 12 and 36/year per customer. Finally, the cost of nonserved energy is between USD 2.31 and 3/year per customer. This system by system cost breakdown, as provided by REM, helps establish the reference financial effort devoted to build, operate, own, or transfer (BOOT) [30] for each minigrid. It provides detailed cost breakdown to calculate the appropriate cost-of-service remuneration for applicable business models, and to determine both the income expected (pondering all the customers connected to each minigrid, their types, and applicable regulated tariff or market fee for service according to their affordability). This allows estimating the need for subsidies and grants for each scenario and the development of detailed financial plans.
To prepare any financial plan, it is necessary to know when the investments are required and when each minigrid (or any other system) becomes operational each year during the electrification period. Figure 16 shows how these different minigrid projects can be sorted according to their efficiency. The investment amounts have been evenly distributed from 2022 to 2030 for their implementation. In this example, two criteria have been used for prioritization. First is the amount of productive and community loads in the minigrid. Second is the efficiency of the investment in terms of the cost of service per customer of the investment. SST7_ug_21 Breakdown cost components MG Reference Scenario

Assessment of the Impact of the Reliability of the Existing Grid
For this section, to fully acknowledge the trade-off between the different approaches and electrification technologies, we have not considered the topography for this sensitivity scenarios. Figure 17a-c show results for different scenarios. Each one represents both the least-cost systems map and the share of customers per electrification mode. The map shows grid extensions with the existing grid in black, the new MV lines in red, and LV lines in blue. It shows the new LV minigrid lines in green (there are no MV minigrid lines in the REM solutions for these scenarios) and the new standalone systems in orange. The plots use blue for grid extension, green for minigrids and orange for standalone systems. The scenarios are defined as follows: (a) Reference Scenario, described in the previous section, assumes that some upstream investments in generation expansion, transmission, and distribution grid reinforcements happen, so reliability reaches 90% in this rural territory; (b) 85% Grid Reliability Scenario. According to [72] and [75], this is an estimation of the present average reliability of the grid supply in Uganda and the need for diesel backup by companies that require 24 × 7 services. In this scenario, we assume that no significant improvements will happen before 2030; (c) 97% Grid Reliability Scenario analyzes what would be the least-cost solution in case upstream investments in the Southern Service Territory manage to get close to total reliability in 2030; (d) The average reliability of the minigrids supply in these scenarios remains constant at 98.7% since all the scenarios have the same demand profiles, critical and non-critical periods and uses, and the same catalog of generation components. Figure 18i shows the energy dispatch of a specific minigrid (26 kWp load, 83 MWh of energy served per year) for 4 sample days of the year. Some areas with non-served energy are visible in red. They correspond to non-critical nighttime periods for daytime productive customers. Consequently, the dispatch shows how some non-served energy appears in the early morning before dawn and partially close to midnight on rainy days. Figure 18ii shows the impact of these periods on the average hourly reliability of this system. Reliability is perfect, 100%, from 8:00 to 23:00, and declines slowly, so at 7:00, it serves 89% of that non-critical demand throughout the year. This figure stresses the importance of the definition of critical and non-critical uses and periods and the determination of the cost of not attending these loads sometimes across the year. The share of minigrids grows from 59% in (Figure 17a) Reference Scenario to 83% in (Figure 17b), 85% Grid Reliability Scenario. Highly reliable minigrid supply (98.7%) becomes the preferred option for nearly all connected customers, as the grid in this scenario only reaches 0.1% of the customers in (Figure 17b). The share of standalone systems in both scenarios remains almost the same, 16.72% in (Figure 17a) vs. 16.76% in (Figure 17b). This result would point out that while grid extension and minigrids are complementary, the balance between both can be explained by the trade-off between non-served energy cost vs. capital expenses, operation and maintenance, and upstream energy costs of both alternatives.
Inversely, for the 97% Grid Reliability Scenario, the share of minigrids decreases from 59% in (Figure 17a) to 14% in (Figure 17c). As expected, the grid grows from 23.68% to 70.9%, respectively. In this case, the number of standalone systems decreases from 16.72% to 15.49%, showing that a highly reliable grid might still attract some isolated customers around it. Still, in this optimistic scenario, the number of least-cost minigrids is relevant, connecting almost 68,000 customers with grid-like service.
In terms of cost, the average annuity (including CAPEX, OPEX, Upstream Energy, and CNSE) of these three scenarios is very similar (172.89 for the 85% Grid Reliability Scenario, 172.18 for the Reference Scenario, and 166.26 USD/year per customer for 97% Grid Reliability Scenario) as can be seen in Figure 19. CAPEX is less relevant in (Figure  19c) while OPEX and upstream energy costs grow significantly compared to the other two scenarios.
(a) (b) (c) Figure 19. (a) Reference Scenario with 90% Grid Reliability; (b) 85% Grid Reliability Scenario; and (c) 97% Grid Reliability Scenario costs of service breakdown including CAPEX, OPEX, Upstream Energy, and CNSE. Figure 17d vs. Figure 17a shows how doubling the demand expected in 2030 affects the electrification maps and the supply modes mix. Grid extension grows from 23.68% in (Figure 17a) to 68.99% in (Figure 17d), mainly at the expense of minigrids, which fall from 59.6% to 17.32%. Despite this reduction, minigrids continue to represent the preferred least-cost choice for more than 86,000 customers. The impact of doubling the demand in the standalone systems is not so relevant, resulting in a moderate decrease from 16.72% to 13.69%. This result is also consistent with the notion that minigrids and grid extensions cover similar territory. In this case, the trade-off between both can be explained because of larger economies of scale in network investments as demand grows, compared to those, also existing but lesser, in minigrids generation, resulting in a higher weight of grid connections in the Double Demand Scenario.

Assessment of the Impact of a Higher Demand Forecast
The cost of service for the Double Demand Scenario grows from USD 172.18/year per customer in Figure 20a to USD 281.54/year per customer in Figure 20d, 63.5%. The cost per unit falls from USD 0.461/kWh to USD 0.368/kWh, as economies of scale increase the efficiency of the grid and minigrid supply by almost 20%. The more significant weight of the grid extension solution also results in a decrease in the relative weight of CAPEX in this solution, while OPEX and upstream energy cost increases, as can be seen in Figure 20.

Least-Cost Reference Scenario vs. 100% Grid Extension Scenario
As detailed in Section 4, the Reference Scenario finds the least-cost choice of supply mode (extension, minigrid or solar home system) for each customer in the area of study. In the 100% Grid Extension Scenario, Figure 17e, we design the optimal grid extension that reaches every customer in the study area.

Discussion and Conclusions
Minigrids have a role to play in rural electrification, which might have been traditionally underestimated. Minigrids can provide grid-like service, and in some areas and under certain conditions, their cost of service is lower than the cost of supply extending the main grid or electrification with standalone systems.
The Reference Electrification Model evaluates and designs customer-wise according to their individual location and specific demand curves, the least-cost mix of standalone, minigrid, or grid extension systems to provide electric service with user-defined quality of service. The most critical statement of this paper is that full customer granularitygeographical location, kind of customer, and hourly modeling of supply and demand-is necessary to correctly decide the electrification mode for each individual customer.
Even in high-density rural or peri-urban areas, like the Southern Service Territory of Uganda, and not too far from the existing grid, the cost of decentralized off-grid minigrids can be lower than the cost of grid extension.
One way to visualize the comparison between the costs of electrification with minigrids and grid extension is to compute the ratio between the cost of service (including CAPEX, OPEX, and CNSE) of minigrid supply vs. the equivalent cost (CAPEX, OPEX, upstream energy purchases, and CNSE) of grid extension supply. We conclude that:


Minigrids can be several times cheaper than grid extensions, even when they are not too far from the grid. The main drivers for minigrid cost competitiveness are grid reliability, distance to the grid, distance between customers, and low aggregated demand;  Large numbers of close-by customers and the existence of anchor loads, as large industrial customers, may justify the extension of the main network over large distances;  Even if the cost difference is not significant, minigrids can play a transitory role as demand grows enough to make the grid connection cost-efficient;  Grid-compatible minigrids will facilitate the transition between grid and off-grid supply, guaranteeing the permanence of the assets when the grid arrives. Regulatory provisions must be considered to enable this process.
The share of minigrids as the least-cost option changes with each different scenario studied in this paper. Even in a densely populated area like the Southern Service Territory, where the grid is not very far, in the Reference Scenario, we find that minigrids are the best solution for almost 59.6% of the customer base, as compared to 16.7% of standalone systems and 23.7% grid extension.
The cost of service of the least-cost solution for the Reference Scenario is 28% cheaper than extending the grid to every customer and 17% cheaper than extending the grid only to the minigrid customers in relatively dense settlements, setting aside dispersed standalone customers.
Even when the current grid quality of service is very high, minigrids still can represent a significant portion (14%) of the customer base.
Demand is an essential factor in determining the frontier between grid extension and minigrids. As demand grows, more customer clusters must become connected. In our study, even as demand doubles, with 90% grid reliability, minigrids remain the least-cost option for 17% of the customers.
Sensitivity analysis shows that the share of least-cost minigrids is higher when the central grid reliability is low, as in Uganda and many other countries in Sub-Saharan Africa.
Minigrids in the Southern Service Territory are not small. With an average size of nearly 330 customers, 80% of them are between 200 and 600 customers.
From the investors' point of view, it is preferable that the minigrids are larger and close to one another, since this facilitates the operation and maintenance, reducing the associated costs, thus reducing the need for subsidies or grants to cover the gap between affordable tariffs or negotiated fees and the actual cost.
It is crucial to be able to estimate the cost of service of each one of the minigrids precisely, which varies from 0.34 USD/kWh up to 0.52 USD/kWh in the Reference Scenario. A precise computation of the fixed and variable costs would enable cost-of-service regulation of minigrid supply.
Determination of the cost of service allows the application of the same sound regulatory principles already established for grid extension. Establishing a cost-reflective remuneration of minigrids makes possible to attract private investments at scale; tariff crosssubsidization between urban and rural customers can be used to reduce the gap between affordable regulated tariffs in low-income rural areas and the cost-reflective revenue requirement of minigrids.
REM provides the cost of supply of every on-and off-grid supply system, therefore helping to establish the reference financial effort devoted to building, operating, owning, or transferring each minigrid. Therefore, it also determines the viability gap, and the resulting need for subsidies or grants, allowing the development of detailed financial plans.
The static electrification plan that REM provides (e.g., the least-cost mix of electrification modes in 2030) can be the basis of a year-by-year trajectory of implementation of the solutions over the considered time horizon. This trajectory, with its associated annual costs of investment and operation, is necessary to prepare the financial plan that can make it possible to raise the funds that will pay for the electrification effort. Funding: The origin of this study comes from the project, Promotion of Minigrids for Rural Electrification [5], funded partially by GIZ contract 81206123.
Data Availability Statement: The data used in this study is detailed in the Working Paper [5] for the initial field data.
Acknowledgments: The authors wish to acknowledge the critical contribution of the GIZ team in the development of this analysis. Thanks are given primarily to Ashley Wearne for his leadership, and Moses Kakooza and Diego Pérez López for their tireless dedication. We also want to thank the global team of the Universal Energy Access laboratory at MIT and IIT-Comillas, especially Rob Stoner, Doug Ellman, Clara Pérez-Andújar, Vivian Li, Turner Cotterman, Claudio Vergara, and Carlos Mateo, for their support and inspiration throughout the project.

Conflicts of Interest:
The authors declare no conflict of interest. The GIZ funded the initial development of this study and helped provide links with the Government of Uganda and other electrification stakeholders in the country to collect the data required for the analyses. They had no influence in the interpretation and analyses of data, in the writing of the manuscript, or in the decision to publish the results.

Appendix A. REM Input Data Catalog
Appendix A.1. Network Catalog