Distributed energy resources can enhance community resilience to power outages in the aftermath of natural disasters. We develop a method to quantify the resilience value that rooftop solar can provide to residential neighborhoods. We group homes into geographical clusters and simulate the e ect of a disaster that disables the electric grid and damages some of the homes. We then use historical energy consumption and solar irradiance data to estimate the likelihood that each cluster could meet its own energy needs given a de ned level and pattern of rooftop solar adoption. As a case study, we apply the method to single family homes in San Carlos, California, subjected to an earthquake based on the 1906 San Francisco event. We characterize the impact on resilience of increasing adoption of rooftop solar and of grouping homes into resilience clusters for energy sharing. Policy intervention can ensure more geographically uniform adoption of solar and therefore more even resilience. We evaluate the e ect and cost of such an intervention, nding that a modest subsidy can make a notable di erence in evening out resilience across a community. Community resilience is receiving increased attention as climate change threatens more frequent and severe catastrophic weather events and as improved technology enhances the ability of commu- nities to respond [1 {4]. Hurricanes Irma and Maria severely damaged the electric grids in Florida and Puerto Rico, respectively, leading to widespread power outages that a ected millions [5, 6]. Earthquakes also cause signi cant damage to power systems [7 {9]. For example, the medium-size Mw 6.0 Napa, California, earthquake left 70,000 residents completely without power in 2014 [10]. Distributed energy resources (DERs), such as rooftop solar and storage, are gaining commercial traction and have the potential to mitigate the impact of catastrophic events by generating and managing energy locally while the centralized grid is out of service [11{15]. Public entities are studying the combined sustainability and resilience bene ts of microgrids, which are a group of interconnected loads and DERs that can connect to and disconnect from the main grid [16 {19]. Evidence has shown that microgrids can increase the disaster resilience of power systems. For example, the Roppongi Hills and the Sendai microgrids functioned as secure power islands following the 2011 Tohoku earthquake and tsunami in Japan [20]. However, there are key design and policy questions that need to be addressed to guide microgrid development to maximize the resilience bene t. Modeling and quantifying how DERs can improve resilience is a prerequisite to answering these questions. In its roadmap for the commercialization of microgrids, the California Energy Commission identi es the development and validation of metrics of resilience bene t as a 1 key next step. In light of this need, our study provides a probabilistic formulation of resilience that couples disaster analytics with DER modeling to develop a framework well suited to residential communities. Existing studies have proposed methodologies to evaluate nancial losses caused by outage scenarios [21]. Outages can trigger prolonged interruptions of business operations leading to losses of millions of dollars per building [22]. These studies have also proposed methodologies to quantify the nancial bene ts of adopting more resilient power technologies such as microgrids and DERs [23]. The technologies can decrease future economic losses by reducing the severity and frequency of blackouts and can also decrease immediate costs such as insurance premiums [22]. The focus of these studies is commercial buildings and business interruptions. Our study expands this body of literature by addressing the residential sector, which features smaller, more variable, and more exible loads, neighborhood-level di erences in incentives to adopt DERs, and a social setting conducive to resource sharing, particularly after a disaster. Our close integration of detailed disaster modeling with high resolution energy consumption and generation data enables engagement with these characteristics of the residential sector. Numerous public entities are supporting increased adoption of distributed solar photovoltaic systems as part of an overall push for increasing the share of renewable generation [24]. For that reason, we focus on rooftop solar systems as backup power sources for disaster resilience. Currently, the most common backup electric power systems are small generators that consume fossil fuels. Their power output is steady, provided they have enough fuel, but they do not align with the aforementioned renewable generation goals. Rooftop solar, however, is an intermittent power source, which motivates our e ort to develop a probabilistic formulation of its resilience value. We characterize how the adoption of rooftop solar can improve residential community resilience in terms of electrical energy in the aftermath of a Mw 8.0 earthquake scenario reproducing the 1906 San Francisco event. Speci cally, we study how likely it is that rooftop solar systems can supply enough energy in a day to meet the needs of a group of homes, assuming they reduce their energy consumption in the aftermath of the earthquake. We use energy consumption and building construction data for single family homes in the city of San Carlos, California. We provide a rst-cut analysis of whether the daily energy balance will work out. We also characterize the size of storage systems required to avoid wasting energy generated by rooftop PV during an outage of the main grid, which partially addresses the problem of the mismatch in timing between solar generation and energy consumption. Our study does not address how to physically share electrical energy within a group of homes. The IEEE 1547 standard requires that in the event of an outage of the main grid, grid-connected rooftop solar systems must cease providing power to the grid and enter a tripped state that prevents an immediate return to service [25]. Furthermore, the distribution network itself may be damaged by the disaster. For these and other technical reasons, simply reusing the existing distribution grid to share energy is not a solution. In the near future, the likely scenario for energy sharing during an outage is keeping the rooftop solar panels disconnected from the grid and directly accessing their power output from outlets on inverters, like the Secure Power Supply devices produced by SMA. Then, energy can be shared among homes using xed storage devices or electric vehicles as mobile storage units. Further development of smart grid technology may enable the implementation of recon gurable microgrids within the distribution grid network that could be put into island mode for energy sharing during an outage. We quantify the e ect of increasing adoption of rooftop solar on power resilience. We also 2 quantify the improvement in resilience gained by grouping homes into resilience clusters that share energy. Next, we identify a threshold for cluster size that achieves most of the resilience bene t. Finally, we compare the resilience provided by two di erent adoption patterns: one in which households choose to adopt rooftop solar based on their own economic bene t, and another in which a policy intervention ensures more di use adoption of solar. We estimate the cost of such an intervention. 1 Modeling and estimating risk We consider a community of single family homes. The homes consume electrical energy, and some of them have adopted rooftop solar systems that are sized to make the home net-zero electrical energy. That is, over the course of a year, an adopter home's solar system generates the same amount of electrical energy as the home consumes. We choose this system sizing because it aligns with explicit policy goals in California [26,27]. The homes are grouped based on proximity into resilience clusters in which they cooperate to share energy during main grid outages. Suppose a natural disaster occurs, causing damage to some of the homes. In the aftermath of the catastrophe, all homes reduce their electricity consumption to some fraction fof what it otherwise would have been. Also, the solar systems of damaged homes are no longer able to generate energy. We assume the disaster causes an outage of the main grid for one day. For a given period of analysis, say a season or a year, we de ne the risk faced by a cluster of homes as the probability that if the disaster occurs anytime during that period, the reduced consumption of the homes in the cluster will exceed their solar energy generation for that day. In other words, the risk is the chance that the cluster will not produce enough energy to meet its own reduced needs if the catastrophe occurs sometime during this period of analysis. The lower the risk faced by a cluster or community, the greater its resilience in terms of energy needs after a disaster. Refer to the Methods section for a detailed explanation of our analysis and data sources. We apply our method to a case study of single family homes in the city of San Carlos, California, subjected to an earthquake modeled on the 1906 San Francisco event. We use anonymized actual daily electricity consumption for a subset of homes, and we map the consumption data to construction information for all homes in San Carlos by strati ed sampling based on square footage. We model how much energy the homes would generate from their solar panels using solar irradiance data that is contemporaneous with the electricity consumption data. We empirically estimate the risk for a cluster by averaging across all of the days in the period of analysis and across 500 Monte Carlo realizations of the earthquake. We compute the risk for di erent values of the rate of adoption of rooftop solar as well as for two di erent adoption rules. Under the overall adoption rule, the households that adopt are those with the highest bill savings across the entire community. This rule may result in some clusters having many more adopters than others. Thus, we consider as an alternative the even adoption rule, under which the households that adopt are those with the highest bill savings within their resilience cluster. Even adoption ensures more uniform adoption among the clusters, which leads to more uniform risk. The adoption pattern generated by the overall adoption rule is more in line with what households might do if left to their own devices because those who stand to bene t more have a greater incentive to adopt rooftop solar. In contrast, achieving the adoption pattern generated by the even adoption rule would require a policy intervention for two reasons. First, even adoption requires some degree of coordinated decision making. Second, the bill savings of the adopters is 3 lower than in the case of overall adoption, so a subsidy could be required to make up the di erence if the adopters are relying on their bill savings to fund their purchases of their rooftop solar systems. We vary the size of the resilience clusters in order to study the e ect of grouping more homes together. As demonstrated in the following simple, stylized model, increasing cluster size does not necessarily reduce risk. 1.1 Cluster size and risk Consider a single time period with homogeneous households. Each household has an independent and identically distributed load liN (L;2 L), withL>0. All households in the cluster are near each other, so they experience the same solar irradiance IN(S;2 S), withS>0, which is independent of the household loads. The solar panel sizing for a household scales linearly with its mean consumption, so the energy generated by a household that has adopted rooftop solar is ei= LI, where >0 is the scaling factor between mean load and panel size required to make the home net-zero electrical energy. Let the cluster size be Q, let the fraction of households who have adopted rooftop solar ber2[0;1], and let the fraction of adopter homes that are inhabitable after the catastro- phe be 2[0;1]. Then the reduced load of the cluster in the aftermath of the catastrophe isL=PQ i=1fli, soLN(fQL;f2Q2 L). The energy generated by the cluster is E=P rQ i=1ei, soEN ( r LQS; 2r2 22 LQ22 S). De neYLE. We know that YN Q(fL r LS);Q(f22 L+ 2r2 22 L2 SQ) . Denote the mean of YasYand the standard deviation as Y. The risk faced by the cluster is R=P(Y > 0) =P(YY Y>Y Y) = 1(Y Y), where () is the cumulative distribution function for the standard normal distribution. The risk Ris increasing inY Y: Y Y=QL(f r S)q Q(f22 L+ 2r2 22 L2 SQ)=L(f r S)q f22 L Q+ 2r2 22 L2 S: (1) The e ect on risk of increasing the cluster size Qdepends on the sign of f r S, which captures the balance between load and generation in the aftermath of the catastrophe. If the generation is likely to be enough, i.e., if f r S<0, thenRis decreasing in Q, so risk decreases with increasing cluster size. On the other hand, if the generation is unlikely to be enough, i.e., if f r S>0, then risk is increasing in cluster size. The magnitude of the impact on Rof changes inQis governed by the ratio of f22 Lto 2r2 22 L2 S. Also, increasing cluster size leads to a limiting behavior in R: lim Q!1R= 1 L(f r S) r LS : (2) Thus, beyond a certain point, increasing the cluster size does not have much impact on risk. The actual distributions of the load and generation of homes in our study do not satisfy the model assumptions about identicality, independence, and normality. Nevertheless, the general insights from this stylized model are a useful framework for understanding the resilience cluster concept and for exploring the simulation results. 4 0.000.250.500.751.00 yearspringsummer fallwinter Time periodCluster riskFigure 1: The cluster risk is strongly seasonal because the resilience clusters rely on solar energy to meet their needs. Note in particular the dramatic di erence between summer, where the median cluster risk is around 0.1, and winter, where the median risk is at its maximum possible level of 1. For this gure, the cluster size is 20, the adoption level is 15%, the adoption rule is even adoption, and the reduction fraction f=1 3. In this and all subsequent boxplots, the center line indicates the median; the upper hinge is at the 75th percentile, and the lower hinge is at the 25th percentile; the upper whisker extends to the largest value within 1.5 times the inter-quartile range (IQR) from the upper hinge; the lower whisker to the smallest value within 1.5 times the IQR from the lower hinge; values beyond the whiskers are plotted individually. 2 Results The energy resilience in this study is provided entirely by rooftop solar, so the risk metrics are strongly seasonal. We estimate the risk for the whole year for which we have consumption data, as well as for each season within that year. As shown in Figure 1, the median cluster risk can vary from close to zero in summer all the way to one in winter. Even with an adoption rate of 100% and a reduction fraction of f=1 3, the median risk in winter remains at 0.4 for all cluster sizes. Thus, either a di erent generation technology or a di erent approach to system sizing would be required to provide high levels of resilience to outages during winter. From here on, we will focus on metrics for either the entire year or for seasons other than winter. 2.1 Increasing adoption Figure 2 illustrates the e ect of increasing adoption of rooftop solar on reducing risk. Increasing adoption steadily shifts the distribution of whole-year cluster risk downward. For the summer season, however, the risk is almost entirely eliminated at about 20-25% adoption. Thus, one home with a solar system sized to make the home net-zero electrical energy can very likely support the energy needs of three or four neighbors during an outage in summer if they can all manage to cut their consumption to one third of their usual usage. As seen in Figure 2c, a small decrease in adoption from 15% to 10% can lead to a large and widespread increase in risk. The same results are depicted geographically in 4a, which depicts 15% adoption, as compared with 4c, which depicts 10% adoption. This sensitivity point is a function 5 0.000.250.500.751.00 51015202550100 Adoption rate (%)Cluster risk for year(a) 0.000.250.500.751.00 51015202550100 Adoption rate (%)Cluster risk for year (b) 0.000.250.500.751.00 51015202550100 Adoption rate (%)Cluster risk for summer (c) 0.000.250.500.751.00 51015202550100 Adoption rate (%)Cluster risk for summer (d) Figure 2: The cluster risk for cluster size 20 and f=1 3is shown as a function of the adoption rate. The left two panels are for the even adoption rule, the right two for the overall adoption rule. Note that the increase in adoption from 5-25% is in linear steps, whereas the last two steps to 50% and 100% represent a geometric increase. of how much energy a home with solar system can generate in excess of its own needs. In this particular case, the median risk is very low, around 0.1, at 15% adoption; thus, one home with a solar system can reliably support the reduced energy needs of about seven homes but no more. However, the median risk increases to about 0.7 at 10% adoption. This means that the decrease from three adopters in a cluster of 20 to just two makes a big di erence. 2.2 Comparison with other resilience metrics The literature on power systems has developed several metrics to characterize resilience. We include for comparison two that are most directly relevant to the impact on residential end users: hours of outage and load not served [28]. Both metrics are computed in the same context as the risk metric developed in this paper, an outage of the main grid after a disaster. Hours of outage is the average number of hours during the day that a cluster's rooftop PV systems cannot fully serve its reduced 6 load, and load not served is the amount of load that goes unserved during those hours. We report daily load not served as a percentage of average daily load. These metrics are sensitive to the timing mismatch between generation and consumption, so even at 100% adoption of rooftop PV, the resilience clusters have a substantial number of hours of insucient generation and a substantial portion of their daily load goes unserved. In contrast, the risk that daily total load exceeds daily total generation is very low for most clusters even at just 20% adoption as seen in Figure 2c. This discrepancy gives a sense of the extent to which some combination of temporal load exibility and storage is necessary to realize the full resilience value of rooftop solar. 2.3 Di erent adoption rules By design, the even adoption rule leads to much more even risk across clusters. As shown by the contrast between Figure 2c and 2d, the median cluster risk is similar for both adoption rules, but the dispersion is much wider under overall adoption. This same e ect is evident when comparing Figures 4a and 4b, showing many more homes belonging to clusters with high risk in the overall adoption case. The total system size adopted, and the total bill savings of the adopters, will vary under the overall and even adoption rules. For the cases in the gures just mentioned, the cluster size is 20 and the adoption rate is 15%. Under the overall adoption rule, the total system size adopted is 11.1 MW, and the total annual bill savings is $2.92 million. Under the even adoption rule, the total system size adopted is 10.7 MW, and the total annual bill savings is $2.79 million. 2.4 Increasing cluster size Figure 5 illustrates the e ect of increasing cluster size for a xed adoption rate and reduction fraction f. The e ect of cluster size varies depending on the adoption rule. The even adoption rule satis es some of the conditions of the theoretical model presented in Section 1.1. For the case depicted in Figure 5a, the fundamental balance between generation and load in the aftermath of the earthquake tilts in favor of generation, so increasing cluster size reduces risk as in the theoretical model. The model's asymptotic behavior of risk with respect to increasing cluster size is also apparent in the gure, with most of the bene t achieved at a cluster size of 20-25. The homes in our study, however, have heterogeneous loads, which is a departure from the theoretical model. As a consequence, with even adoption, the adopting households will be di erent for di erent cluster sizes. At larger cluster sizes, it becomes more and more the case that the households who save the most overall | and therefore have the largest rooftop solar system size | are the adopters.1This increases the total adopted system size, which has a direct impact on reducing the risk. For example, in Figure 5a, the total adopted system size is 12.7 MW for cluster size 5, 13.6 MW for cluster size 30, and 13.7 MW for cluster size 50. Under the overall adoption rule, the total adopted system size does not vary with cluster size. Thus, the improvement in risk seen in Figure 5b, in particular the shift downward at the upper end of the distribution, is due to improved sharing with larger groups. Speci cally, as the cluster size increases, it becomes less and less likely that any given cluster will have no adopters in it. Thus, the worst case cluster risk decreases. There is no clear trend for the median risk. 1In the limit, with a single cluster containing all households, the even adoption rule results in the same adopters as the overall adoption rule. 7 0510152025 51015202550100 Adoption rate (%)Cluster daily hours of outage for year(a) 0255075100 51015202550100 Adoption rate (%)Cluster daily load unserved for year (%) (b) 0510152025 51015202550100 Adoption rate (%)Cluster daily hours of outage for summer (c) 0255075100 51015202550100 Adoption rate (%)Cluster daily load unserved for summer (%) (d) Figure 3: Two additional resilience metrics are plotted as a function of adoption rate for cluster size 20, f=1 3, and the even adoption rule. The left two panels are for average daily hours of outage, and the right two are for percent load not served. The top two panels are for the whole year, and the bottom two are for summer only. The increase in adoption from 5-25% is in linear steps, whereas the last two steps are larger, to 50% and 100%. 8 0 1 2 .5 Miles(a) 0 1 2 .5 Miles (b) 0 1 2 .5 Miles (c) 0 1 2 .5 Miles (d) Legend Building Footprint Summer Risk 0.00 - 0.20 0.20 - 0.40 0.40 - 0.60 0.60 - 0.80 0.80 - 1.00 Figure 4: These images geographically depict the risk faced by the households during summer under varying conditions. Each home is colored based on the risk value for the cluster to which it belongs. (a) The homes face relatively low risk when they are grouped into resilience clusters of size 20, with rooftop solar adoption rate of 15% with the even adoption rule, and with reduction fraction f=1 3. (b) The conditions are the same as in (a) but with the adoption rule changed to overall adoption. Now the risk is much more uneven across the homes, as would be expected. The overall adoption rule can lead to very uneven adoption among clusters, with some clusters having no homes with rooftop solar. (c) The conditions are the same as in (a) but with the adoption rate reduced to 10%. This decreases the number of adopters in a typical cluster from three to two, dramatically driving up the risk for many homes. (d) The conditions are the same as in (a) but with f=1 2. Consistently meeting this higher fraction of the original load is much harder with solar system sizes used in this study, leading to higher risk across the city. 9 0.250.500.75 5101520253050 Cluster sizeCluster risk for spring(a) 0.250.500.751.00 5101520253050 Cluster sizeCluster risk for spring (b) Figure 5: The cluster risk for spring with f=1 3and an adoption rate of 20% is shown as a function of cluster size for the (a) even adoption rule and (b) overall adoption rule. Note that the last step from size 30 to 50 is much larger than prior steps. 2.5 Storage to complement PV Here we provide a simple analysis of the storage capacity required for a cluster to avoid wasting its solar generation during outages of the main grid. The "bounding battery" for a cluster is the storage capacity that the cluster would need available during an outage of the main grid in order to capture all of the solar energy it generates for use at later times. Storage of this size does not guarantee that the cluster would meet its energy needs at each point in time - just that it wouldn't waste any of its solar generation. In Figure 6, the distribution of the bounding battery is given per home, per kW of adopted PV, and per kWh of mean hourly load for the case depicted in Figure 4a. The capacity required per home ranges from 4 to 16 kWh. Plug-in hybrid electric vehicles have battery capacities ranging from about 5 to 20 kWh, whereas most fully electric vehicles have battery capacities well over 20 kWh. This suggests that the widespread adoption of electric vehicles would provide enough storage capacity to complement the resilience bene ts of rooftop PV. From another angle, the storage capacity required per kW of adopted solar ranges from about 4 to 6 kWh - in other words, the battery needs to be able to store 4 to 6 hours of peak production from the PV system. Finally, when normalizing by the mean hourly load of the cluster, the battery capacity ranges from a factor of 5 to 12. 3 Discussion We present a methodology for conducting a rst order assessment of the contribution of distributed energy resources to energy resilience in the aftermath of a catastrophe. Resilience ocers can apply our methods to estimate how increasing rooftop solar adoption will a ect risk related to outages in their neighborhoods. This type of assessment lays the groundwork for developing metrics that account for the resilience value of rooftop solar in addition to its value in terms of bill savings and sustainability. In addition, quantifying the bene ts of clustering and sharing can help inform resilience planning e orts in residential communities. We nd that increasing the size of a resilience 10 01020304050 4 8 12 16 Cluster bounding battery per home (kWh)count(a) 01020304050 4 5 6 Cluster bounding battery per kW of solar (kWh/kW)count (b) 010203040 6 9 12 Cluster bounding battery per kWh of mean loadcount (c) Figure 6: The bounding battery size for each cluster was computed for summer, with f=1 3, a cluster size of 20, an adoption rate of 15%, and the even adoption rule. The distribution of the cluster bounding battery capacity per home is given in (a), per kW of adopted solar in (b), and per kWh of mean hourly load in (c). cluster can be bene cial or detrimental depending on the fundamental statistics of energy balance within a cluster in the aftermath of the disaster. Turning to the adoption rule comparison, if households that stand to save the most from rooftop solar adopt rst, the resulting adoption pattern will be close to that of the overall adoption rule. In our study, we nd that overall adoption can lead to large and widespread disparities in risk, with some clusters at much lower risk than others. Bill savings are higher for homes with larger system systems, which are homes that consume more energy. These also tend to be larger homes. We nd a negative correlation between home square footage and risk for the case depicted in Figure 4b, despite the fact that larger homes are more often red-tagged after the earthquake. In other words, neighborhoods with larger homes sustain more loss of rooftop PV generation but are nonetheless more likely to be able to meet their collective energy needs. These neighborhoods tend to be inhabited by people with more wealth and income, so with overall adoption, disparities in risk overlap with economic disparities. Policymakers interested in evening out risk could seek to encourage adoption patterns closer to those generated by the even adoption rule. For the case shown in Figure 4a, which is the same as Figure 4b but with even adoption, there is a small but positive correlation between home square footage and risk. The neighborhoods with larger homes are now lesslikely to meet their energy needs due to the greater loss of PV that they su er. We can compare the overall and even adoption rules economically based on the total adopted system size and the total bill savings for the two cases as reported in Section 2.3. Suppose that, under either rule, the adopters as a group attempt to fund their purchase of the rooftop solar systems out of their bill savings. Their per unit bill savings is the key gure that they would compare to the per unit costs of rooftop solar systems. Because the total number of adopters is the same in both cases, we assume that the xed costs are the same. In the overall adoption case, the annual bill savings divided by the system size comes to $262.4/year/kW; in the even adoption case, that gure is just slightly lower at $261.3/year/kW. If a policymaker augmented the total bill savings of the adopters under even adoption by $12,100/year, then their per unit bill savings would match those of the adopters under overall adoption. This seems like a modest cost for achieving the notable improvement in resilience under even adoption, but the policymaker would need to compare the annual augmentation with costs of other methods to reduce 11 risk. Our study poses even adoption and overall adoption as exclusive alternatives to cleanly compare them. In order to perfectly implement the even adoption rule, however, the policymaker would have to prohibit additional adoption in clusters that already have the right number of adopters. Thus, some clusters would face higher risk under even adoption than they would under overall adoption. This is not feasible or desirable from the standpoint of promoting the adoption of distributed energy resources. Any real policy intervention aimed at more evenly dispersed adoption is likely to result in an adoption scenario somewhere between even and overall adoption. Some clusters, those with larger homes and greater potential bill savings, will end up with a greater fraction of adopters, and other clusters will require targeted help to achieve some minimum level of adoption for resilience. We identify three key steps to advance this study. The rst is to translate our risk metrics into dollar terms. There are direct costs from disaster-related outages, like spoiled food and medicine, productivity loss, and damage to home equipment. Some of these can be mitigated by reducing outage risk as proposed in our study. More importantly, making neighborhoods more resilient makes it more likely that people will stay in their communities in the aftermath of a disaster, avoiding indirect costs and economic dislocation due to evacuation, resettlement, and return. These indirect costs and dislocations may be more important than the direct costs of outages in residential communities. Assigning a dollar value to the resilience bene t of rooftop solar will facilitate its inclusion in systematic cost and bene t analyses that inform policy decisions. The second extension is to methodically address the distribution of energy | how to physically share energy between homes, and how to deal with the mismatch in timing between generation and consumption through storage, temporal exibility, and other means. Finally, we note that electrical energy resilience is only one part of what makes a residential community livable in the aftermath of a disaster. Water and communication infrastructure are also essential. A holistic framework that accounts for the interactions of these and other systems would be an important contribution to modeling and quantifying resilience. Author contributions S.P. developed and conducted the empirical cluster risk analysis and wrote the bulk of the manuscript. L.C. and C.L. prepared the building construction data and conducted the earthquake and red-tagging simulations. L.C. contributed to the manuscript. C.L. prepared all of the maps included in the gures. S.P. and C.L. developed the theoretical model for the e ect of cluster size on cluster risk. A.K. and R.R. jointly supervised the project, with A.K. serving as the primary adviser. Acknowledgements We thank Paci c Gas and Electric Company for providing the smart meter data used in this study. We thank Irene Alisjahbana for reviewing studies of earthquake damage to power systems and recent developments in microgrids. We thank Emily Alcazar for laying the groundwork for the geographic risk visualizations. 12 4 Methods 4.1 De ning risk Consider a community of Nsingle family homes H=fH1;:::;HNg. The electrical energy used by homeHiisli, withli;d;hbeing the usage during hour hof dayd, andli;d=P24 h=1li;d;h. LetAbe an adoption scenario that de nes which homes have a rooftop solar panel and which do not. For the homes that have adopted, the indicator variable qi(A) = 1; otherwise, qi(A) = 0. If home Hihas a solar panel, the panel generates energy ei;d;hduring hour hof dayd, andei;d=P24 h=1ei;d;h. LetV=fV1;:::;VMgbe a partition of H; each home belongs to exactly one element of V. We call the elements of Vresilience clusters. A resilience cluster is a group of homes that cooperate to share energy in case of an outage of the main grid. Now suppose a catastrophe Coccurs, which causes a power outage with a span of s(C) days. The catastrophe also destroys some of the homes. Let xi(C) = 1 if home Hiis uninhabitable after eventC, and 0 otherwise. We assumed that, in the immediate aftermath of the earthquake, all homes will reduce their electricity consumption to a fraction fof the pre-earthquake consumption. Consider a sequence of days Tas the time span of analysis, which could be a season or an entire year. LetS(C;T) be the set of all spans of length s(C) inT. For example, if Tis a 90 day season, and ifs(C) is 3, then S(C;T) is the set of all 88 spans of 3 consecutive days in T. Let ~sbe chosen uniformly at random from S(C;T). We de ne the risk for cluster Vjover period Tfor eventCas the probability that if event Chappens, the homes in the cluster will be unable to generate enough energy to meet their reduced load for at least one day in the randomly chosen span ~ s. Formally: R(Vj;T;C;A ) =P[ d2~sX Hi2Vjfli;d>X Hi2Vj 1xi(C) qi(A)ei;d (3) We include the loads of homes rendered uninhabitable by the event under the following framework. The electrical energy usage of a home can be conceptually divided into baseline usage by always-on devices (e.g., a refrigerator) versus active usage initiated by occupants (e.g., a toaster). If a home is uninhabitable, its occupants will move in with a neighbor in their resilience cluster, bringing their active usage with them. Furthermore, even though the uninhabitable home may be structurally unsound, its electrical wiring may still be in place and some of its baseline usage may continue. By contrast, we assume that uninhabitable homes with solar panels cannot generate energy, under the assumption that the panels are destroyed or that they enter a fault state that cannot be cleared without human intervention.2 4.2 Empirical estimation The daily load and solar energy generation for a household are random variables. There is also uncertainty in which homes would be uninhabitable as a result of earthquake damage. We use a realization of daily load and daily solar generation for each household, as well as multiple Monte Carlo realizations of building damage due to the earthquake shaking, in order to generate an empirical estimate of the risk. 2There is some evidence that rooftop solar panels can survive natural disasters [29], but returning them to an operational state is a separate matter. For example, residents may be unable or unwilling to enter a partially destroyed home in order to reset inverters or otherwise get their rooftop panels into an operational state. 13 Let~li;dand ~ei;dbe the realized load and solar generation. Let ~Cbe a set of equally likely realizations of a given earthquake scenario C. Each element ~cof~Cis a particular realization, associated with a span of s(~c) as well as a set of homes rendered uninhabitable for which xi(~c) = 1. The empirically estimated risk is an average taken across all earthquake realizations and spans: ^R(Vj;T;C;A ) =P ~c2~CP ~s2S(~c;T) 1S d2~sP Hi2Vjf~li;d>P Hi2Vj 1xi(~c) qi(A)~ei;d P ~c2~CjS(~c;T)j;(4) where 1fgis the indicator function, which evaluates to 1 if its argument is true and 0 if it is false. Note thatjS(~c;T)j=jTj(s(~c)1). 4.3 Related resilience metrics De ne average hours of outage as follows: O(Vj;T;C;A ) =P ~c2~CP ~s2S(~c;T)P d2~sP24 h=1 1P Hi2Vjf~li;d;h>P Hi2Vj 1xi(~c) qi(A)~ei;d;h P ~c2~CjS(~c;T)j; (5) wherehindexes the hour of the day. This metric gives the average number of hours during which a cluster's reduced load exceeds its generation over all earthquake realizations and spans. De ne load not served as: U(Vj;T;C;A ) =P ~c2~CP ~s2S(~c;T)P d2~sP24 h=1P Hi2Vjf~li;d;h>P Hi2Vj 1xi(~c) qi(A)~ei;d;h +P ~c2~CjS(~c;T)j; (6) where []+represents max(;0). This metric gives the amount of the cluster's reduced load that goes unserved during hours in which that reduced load exceeds the cluster's generation, averaged over all earthquake realizations and spans. We will normalize this metric by the load that goes unserved in the absence of any solar adoption - i.e., when Ais such that qi(A) = 08i. 4.4 Bounding battery analysis To get a sense of the storage required to complement and enable the resilience value of rooftop solar PV, we de ne a metric called the bounding battery for a cluster Vj. For a given earthquake realization ~c, and for each day din a given period of study T, we compute the reduced net load of the clusterP Hi2Vjf~li;d 1xi(~c) qi(A)~ei;d. If the sum of the reduced net load across all 24 hours is non-positive - i.e., if in that day the cluster generated more energy than it consumed - then we include this day in the analysis for the cluster. Otherwise, we exclude the day, because batteries can only move energy around in time; they cannot make up for a net de cit in energy, so there is no sense including days with a net de cit. For each day included for the cluster, we nd the most negative cumulative sum of the net load across any span of hours within that day. The absolute value of this cumulative sum is the capacity required for a battery to store all excess solar energy generated during that day for use later in the day. We take the maximum of this required capacity 14 across all days in T, and the mean of these maximum capacities across all earthquake realizations ~c2~C, and call this the bounding battery for cluster Vj. Note that having a battery of the size computed for a given day does not guarantee that the cluster would have been able to satisfy its energy needs at every hour of a given day. In particular, it is likely that the cluster would have positive net load in the early morning hours before the rooftop PV would begin generating energy. The only way for the battery to meet the cluster's energy needs at those hours is to be pre-charged with energy from the prior day. This is not unreasonable as electric vehicles are often charged overnight, so they may have energy available prior to sunrise. However, that energy is not directly related to the energy resilience provided by the cluster's rooftop PV, which is the focus of this study. 4.5 Creating resilience clusters Homes are grouped together into resilience clusters, each containing about the same number of homes.3The clustering is accomplished using a same-sized k-means algorithm using Euclidean distance based on location coordinates available for each home [30,31]. The k-means method has de ciencies - some clusters are intermingled, some include homes that are far from each other, and the outcome varies based on the random initialization. Simple Euclidean distance does not take into account access through usable pathways. Furthermore, in a real world setting, the resilience communities that households and city planners form will be of varying sizes, will change over time, and will not be isolated from each other, particularly in the aftermath of a disaster. For the speci c purpose of quantifying the e ect of cluster size, however, we consider static clusters of the same size. This clustering method yields mostly reasonable clusters that are adequate for our analysis. 4.6 Variations studied We compute the empirically estimated risk metric for the resilience clusters under di erent scenarios for adoption and cluster size. An adoption scenario Ais a combination of adoption rate and adoption rule. The adoption rate ris simply the fraction of homes that have adopted rooftop solar. With N homes, the total number of adopters will be rN. The adoption rule determines whichrNhomes out of theNhomes will be the adopters. We consider two di erent rules: overall adoption and even adoption. First, for each home, de ne bias how much it would save on its annual electricity bill if it had a rooftop solar system sized to make the home net-zero electrical energy. Under the overall adoption rule, the adopters are the rNhomes with the highest values of biacross the entire community of homes. Under the even adoption rule, the adopters are chosen from within each cluster by ordering homes in the cluster by biand then taking the top rwithin the cluster as the adopters. Figure 7 illustrates the di erence between the two adoption rules. We compute the risk under di erent cluster sizes in order to study the advantage of larger resilience clusters. For each cluster size, we compute one set of cluster assignments. Note that the clusters thus generated are not necessarily hierarchically nested. In other words, the clusters of size 10 are not formed by merging two clusters from the size 5 clustering results. We also note that practically speaking, the size of a resilience cluster may be limited by the logistics involved in planning and coordination among households. 3Speci cally, the largest cluster has at most one more home in it than the smallest cluster. 15 8 12 10 7 11 6 2 3 9 1 4 5 (a) 8 12 10 7 11 6 2 3 9 1 4 5 (b) Figure 7: This gure provides an example illustrating the di erence between the adoption rules. There are 12 total homes grouped into two resilience clusters of 6 homes each, with the dotted lines demarcating the clusters. The number on each house is its economic bene t bi. The adoption rate r=1 3, and the adopters are the houses lled with green. The overall adoption rule results in the situation shown in (a), and the even adoption rule results in that shown in (b). We consider two values of the energy reduction fraction f:1 2and1 3. An analysis of data from the Pecan Street Project found that for many homes, refrigeration and air conditioning made up less than 50% of total usage [32]. Communication loads (e.g. charging cell phones) are very small, as are nighttime lighting loads if LEDs are used. On this basis, we regard a reduction to1 2as readily attainable in the aftermath of a disaster, and a reduction to1 3as achievable with some thought. 5 Data 5.1 Building construction The San Mateo County Tax Assessor's data provides the latitude and longitude coordinates for over 8460 single family homes in San Carlos. The data also includes the height of the home and the square footage. Figure 8 geographically depicts the homes. This data is almost complete in its coverage of single family homes in San Carlos. While the building height is available for all buildings, the number of stories is available for only 65% of the buildings. We performed a Bayesian inference based on the building height to estimate the most likely number of stories for the buildings without this information, using a cuto height of 14 feet to separate single story homes from two story homes. 5.2 Electrical energy consumption The household electrical energy consumption data comes from smart meters for over 1800 single family homes in San Carlos and 46 single family homes in nearby Redwood City, California. The smart meters recorded hourly electrical energy consumption, ~li;d;h, for each home from November 1, 2011, to October 31, 2012. We exclude any meters with less than 0 :1 kW annual mean consumption or with more than half of the readings being zero. We sum the hourly data each day to produce the daily electrical energy consumption for each home, ~li;d. Figure 9 characterizes the energy 16 0 1 2 .5 MilesFigure 8: The building construction data comes from the tax assessor's le. Single family homes with a height less than or equal to 14 feet are light orange, and those with a height greater than 14 feet are blue. That cuto is related to an assumption about one story versus two story homes that is used in the earthquake damage modeling. The green shaded area marks the extent of the city of San Carlos. 17 050100150200 0255075100 Mean daily consumption (kWh)count(a) 050100150200 050100150200 97th percentile daily consumption (kWh)count (b) 0100200300 010203040 Standard deviation of daily consumption (kWh)count (c) Figure 9: These gures provide distributions of statistics of the daily load for each household. The statistics are computed over a year's worth of data for each household. consumption data by giving the distributions of various load statistics for each household. We have survey data that includes the year built and a square footage range for each home. Figure 10 shows the relationship between average daily consumption and these home characteristics. The Redwood City smart meters are included to augment the small number of San Carlos meters available in the 501-750, 4001-5000, and 5001-10000 square foot ranges. There is a de nite relationship between the area of a home and its energy consumption, while there is no evidence of a relationship between consumption and year built. 5.3 Combining energy and construction data The energy consumption data does not contain precise location information for the meters. In addition, we only have energy consumption data for 1900 homes, while there are 8460 homes in the construction data. Therefore we cannot perform a precise one-to-one matching between the consumption data and the construction data. The homes from the consumption data set are on average smaller and newer than the homes in the construction data as seen in Figure 11. Figure 10b makes clear that square footage is correlated with electrical energy consumption. This relationship motivates the use of strati ed sampling based on square footage in order to assign meter data to buildings, as described in Algorithm 1. 5.4 Solar energy generation and economic bene t We follow [33] for de ning the solar irradiance and system sizes for each home.4Together, these produce ~ei, the energy that each household would generate if it adopted a rooftop solar system sized to make the home net-zero electrical energy. The sizing is such that for each household i,P d;h~ei;d;h=P d;h~li;d;h, where the summation over his taken over the 24 hours of each day, and the summation over dis taken over the 366 days in the year of smart meter data that we have for each home. In words, the PV system for each household is sized so that its realized generation over the course of the year in the data exactly equals its realized consumption. We use the annual bill 4The homes in San Carlos are in one zip code, so they all experience the same irradiance. 18 0255075100 1925195019752000 Year builtMean daily load (kWh)(a) 0255075100 unknown 501 − 750 751 − 1000 1001 − 1250 1251 − 1500 1501 − 1750 1751 − 2000 2001 − 2500 2501 − 3000 3001 − 4000 4001 − 5000 5001 − 10000 10000+ Area (sq. ft.)Mean daily load (kWh) (b) Figure 10: These gures capture the relationship between mean daily load and characteristics of the home in the energy consumption data. (a) There is not a strong relationship between mean daily load and year built. (b) Mean daily load generally increases with the square footage of the home. Note that there are only ten meters from homes in the 5001 10000 square feet range, and only one in the 10000+ range, so that information is less reliable. Algorithm 1 Strati ed sampling procedure for assigning smart meter data to homes in construction data. The inputs to this algorithm are as follows: a partition of possible home areas A= fA1;:::;APgcorresponding to the ranges used in the consumption data survey information (e.g. the numerical ranges on the x-axis of Figure 10b); the set of meter readings U=fU1;:::;URg; for each meter reading Uj,~ajis the element of the area partition reported in the survey information; the set of homes H=fH1;:::;HNgfrom the construction data; the area aiof each home Hi. 1:fork =1,Pdo 2:Uk fUjj~aj=Akg . Ukis all meters whose survey data shows area range Ak 3:Bk Uk 4:fori=1,N do 5: Findksuch thatai2Ak .Find the area range for home Hi 6: ifBkis empty then 7:Bk Uk 8: Choosebuniformly at random from Bk 9:li b . H i's loadlicomes from a home with same area range 10:Bk Bknb . Sample without replacement and re ll when needed 19 0 100 200 300 unknown 501 − 750 751 − 1000 1001 − 1250 1251 − 1500 1501 − 1750 1751 − 2000 2001 − 2500 2501 − 3000 3001 − 4000 4001 − 5000 5001 − 10000 10000+ Area (sq. ft.)count(a) 0 100 200 300 190019502000 Year builtcount (b) 05001000150020002500 unknown 501 − 750 751 − 1000 1001 − 1250 1251 − 1500 1501 − 1750 1751 − 2000 2001 − 2500 2501 − 3000 3001 − 4000 4001 − 5000 5001 − 10000 10000+ Area (sq. ft.)count (c) 050010001500 190019502000 Year builtcount (d) Figure 11: The area and year built of homes in the energy consumption data are shown in (a) and (b), while (c) and (d) show the same for the homes in the building construction data. As a population, the homes in the energy consumption data are smaller and somewhat newer than the homes in the construction data, which is more representative of the stock of single family homes in San Carlos. One possible explanation for this bias is that the survey responses for the energy consumption data are self-reported, and people are more likely to decline to state large home sizes, whereas the building construction data is gathered directly by a public ocial. 20 savings computed per that study as the economic bene t bi, assuming that households purchase electricity at the retail time of use rate and sell any surplus back at the wholesale rate.5The annual bill savings for a household are strongly positively correlated with its system size. 5.5 Earthquake simulations The catastrophe Cin our study is modeled after the 1906 San Francisco earthquake in terms of the magnitude and the fault. The geometry of the 1906 rupture was extracted from the Uniform California Earthquake Rupture Forecast (UCERF) version 2 through the OpenSHA engine [34,35]. Average spectral accelerations, Saav, were computed in San Carlos to represent the shaking intensity measure.Saavis de ned as the geometric mean of the spectral accelerations, Sa, between 0.2 and 3 times a fundamental period of vibration. We choose a period of 0.16 seconds because [36] demonstrates that it best correlates with seismic damage in 1- and 2-story wooden buildings, which together represent more that 99.5% of the building typologies in our case study. We computed 500 realizations of spatially distributed Saavusing the ground motion model in [37], incorporating a spatial correlation structure from [38]. The set ~Ccontains the 500 realizations as its elements. We assume that every realization causes a power outage span of one day, so s(~c) = 1 for all ~ c.6 In a post-earthquake setting, buildings are red-tagged by trained engineers if the buildings are unsafe to be occupied. We simulate the post-earthquake building tagging by using fragility functions developed for 1- and 2-story wooden single-family residential buildings [36]. These functions evaluate the likelihood that a building is red-tagged after an earthquake as a function of Saav. Using these data and models, the probability of being red-tagged pi(~c) is calculated for each home i and for each earthquake realization ~c. Then, this probability is used to sample from a Bernoulli distribution to determine whether the home will be red-tagged or not. We deem that red-tagged homes are uninhabitable, and thus if home iis red-tagged, we set xi(~c) = 1.7In other words, xi(~c)Bernoulli (pi(~c)). Figure 12 shows the proportion of times that a given home is deemed uninhabitable across all 500 realizations of the earthquake. 5.6 Data availability statement The building construction data are publicly available and can be obtained from the San Mateo County Tax Assessor's Oce. The solar irradiance data are publicly available from the National Renewable Energy Laboratory's National Solar Radiation Database and are available from the authors on reasonable request. The electricity consumption data are the property of Paci c Gas and Electric Company (PG&E) and were obtained under a non-disclosure agreement restricting their use for research purposes, so they are not publicly available. These data may be available upon request to the authors and with the permission of PG&E. The bill savings data are subject to the same restrictions as the electricity consumption data. 5In [33], homes adopt a rooftop solar system sized to make the home net-zero electrical energy as well as a storage device linearly scaled to the size of the PV system. The storage device itself is responsible for a small fraction of a household's total bill savings. 6More detailed analysis could give better estimates of the earthquake power outage timespan. Our assumption was based on previous medium- and large-magnitude earthquake observations that left thousands of households without power for several days (e.g., 1989 Loma Prieta, 1994 Northridge, and the 2014 Napa earthquakes). Longer outage spans will lead to higher values of risk, all else being equal. 7After an actual earthquake, it may take some time for an engineer to show up and ocially red-tag a building. We assume, however, that the occupants would abandon such a home out of caution right after the earthquake. 21 0 1 2 .5 Miles redtag 0 - .03 .03 - .06 .06 - .09 .09 - .12Figure 12: This gure depicts the proportion of times that a home is deemed uninhabitable across the 500 simulations of the 1906 San Francisco earthquake. The distribution is bimodal, with two story homes more likely to be red-tagged than one story homes, as can be seen by comparing this gure to Figure 8. 22 Figures 1, 2, 4, and 5 are derived from a combination of the building construction, solar irradiance, electricity consumption, and bill savings data. Figures 8 and 12 are derived from the building construction data alone. Figures 9 and 10 are derived from the electricity consumption data alone. Figure 11 is derived from both the building construction data and the electricity consumption data. 5.7 Code availability statement The code for simulating the earthquake ground motions, red-tagging buildings, generating resilience clusters, and computing cluster risk is all available from the authors on reasonable request.