An interdisciplinary exploration of responsible algorithm design in the era of distributed energy resources

While the governance of algorithms is of growing societal concern, the energy sector has been slow to engage with this issue. We argue that there are at least three systemic concerns to the design and operation of algorithms in the new, digital energy era. Namely, reliance on algorithms can bias considerations towards the easily quantiable, that they can inhibit explainability, transparency and trust, and that they could undermine energy users’ autonomy and control. We examine these tensions through an interdisciplinary study that reveals the diversity and materiality of algorithms. Our study focuses on neighbourhood-scale batteries (NSBs) in Australia as a case study of new energy algorithms. We conducted qualitative research with energy sector professionals and citizens to understand the range of perceived benets and risks of NSBs and the algorithms that drive their behaviour. Issues raised by stakeholders were integrated into our development of multiple NSB optimisation algorithms, whose impacts on NSB owners and customers we quantied through techno-economic modelling. Our results show the allocation of benets and risks vary considerably between different algorithm designs. This insight a need to improve energy algorithm governance, enabling accountability and responsiveness across the design and use of algorithms so that the digitisation of energy technology does not lead to adverse public outcomes. Taken together, our study underscores the importance for researchers and developers of new algorithms to take a holistic view of stakeholders and public benet, and demonstrates one method to practice responsible algorithm design. these three potential concerns associated with algorithm design in the energy system through the case study of neighbourhood-scale batteries (NSBs). These are 0.1-5 megawatt (MW) batteries, located close to customers in the distribution network. They provide an ideal case study of the multitude of issues associated with energy algorithms because their actions are primarily determined by algorithmic control systems (as opposed to the kinetic laws governing traditional generators), their physical presence in neighbourhood streetscapes raises citizens’ attention and engagement through familiar planning processes, and the energy they store can be viewed as a collective resource – particularly when it comes from local rooftop solar generation – which raises questions of resource sharing.

technology, particularly in the case for solar PV and batteries, represents a reshaping of citizens' relationships with the energy system, representing new risks and potential accountability gaps 13,14 .
This paper examines these three potential concerns associated with algorithm design in the energy system through the case study of neighbourhood-scale batteries (NSBs). These are 0.1-5 megawatt (MW) batteries, located close to customers in the distribution network. They provide an ideal case study of the multitude of issues associated with energy algorithms because their actions are primarily determined by algorithmic control systems (as opposed to the kinetic laws governing traditional generators), their physical presence in neighbourhood streetscapes raises citizens' attention and engagement through familiar planning processes, and the energy they store can be viewed as a collective resourceparticularly when it comes from local rooftop solar generation -which raises questions of resource sharing.
Existing studies of NSBs have focused on the development of algorithms that optimise NSB operations for techno-economic objectives, such as maximising owner pro ts 15 , minimising customers collective costs 16,17 , managing voltage 18 , and maximising decarbonisation 19,20 . These studies typically disregard potential limitations on access to consumer data and presuppose clear -and in our view narrowly de ned -customer desires. Social science studies of NSBs meanwhile have primarily focussed on key stakeholders' views on NSB's integration with 21 , or disruption of 22 , existing energy systems. Others have examined the speci c regulatory barriers to business models 23 and the need for new institutional arrangements 24 , but citizens' perceptions of NSBs themselves have largely been missing 25 26 . The few existing studies on citizens' perception consider views on risks and bene ts, but not how these would become institutionalised via algorithmic design and governance 25 26 .
This paper addresses an existing research gap in how to re ect public concerns and values in the algorithm dictating NSB operation 'upstream' in the development process (i.e., before the technology is rolled out at any signi cant scale) 27 7 . Even while interdisciplinary research is often championed in energy research, to our knowledge, no work has been published that attempts to integrate social valuesthrough deliberation with citizens -in energy algorithm design. In line with an established framework for responsible research, our aim is to demonstrate how researchers can anticipate future harms (and bene ts) of new energy algorithms by including citizens perspectives in the development of algorithms.
As we demonstrate, algorithms could be developed in responses to issues raised by citizens 28 . While this will not be an exhaustive account of how to make NSB algorithms design 'responsible', we aim to provide a novel demonstration of algorithm design that uncovers a range of important and usually neglected ethical and normative considerations.
Our research design was an iterative collaboration between a social researcher and developers of optimisation algorithms. Our social research involved interviews and focus group discussions (FGD) with energy sector professionals and citizens from diverse backgrounds that explored participants' views about the potential bene ts, risks, and governance considerations of NSBs. This is the rst study to consider the general public and energy sector professionals' views of NSBs side by side. From the qualitative research we identi ed a range of objectives that NSBs may be operated in pursuit of and encoded these objectives into optimisation algorithms. The algorithms were then applied to real world customer electricity data to quantify their techno-economic impacts on stakeholders and the grid. This approach allowed us to uncover the systemic issues in algorithm design that are typically overlooked by algorithm researchers.
This process revealed that both energy sector participants and citizens shared several hopes and fears, but that there were also important divergences. It demonstrated how chosen values could be encoded into algorithms and thereby prioritised over other values that would either require con icting battery actions or are simply challenging to quantify. Our ndings emphasise the need for digital energy technologies to be developed through an "algorithmic accountability in action" 29 approach that aligns the behaviour of these technologies with public values. We argue that energy researchers need to work collaboratively across disciplines to develop algorithms in line with evolving public understandings of a sustainable energy system.

Stakeholder identi ed bene ts and risks
The Australian electricity system was largely disaggregated and privatised in the 1990s and since 2008, electricity prices have increased at more than four times the Consumer Price Index 30 . These high electricity prices, together with concerns about climate change, have driven record installations of rooftop solar, with one in ve households now having solar 31 , as well as generally making electricity a topic of signi cant public and political engagement, including the emergence of advocacy groups like "solar citizens" 32 . It is increasingly unfeasible for technocrats -accustomed to managing centralised generation -to develop policies without public scrutiny in what has now become a decentralised energy system.
Our study took place in Australia with research activity in ve states. We began with interviews and FGDs with energy sector professionals and (separately) citizens, whose voices then informed our algorithm designs. As shown in Fig. 1, these stakeholders identi ed a wide range of bene ts and risks from NSBs. Some of these in uence the design of NSB optimisation algorithms in direct and straightforward ways (indicated in bold in Fig. 1). These principally economic and technical bene ts tended to be prioritised by energy professionals from networks and retailers. Consumer advocates and government representatives complemented these issues with less easily quanti ed values, such as the potential for NSB to build trust in the energy sector. Citizens identi ed many of the same bene ts as energy professionals (see overlap in Fig. 1) but with a clear difference in emphasis. Citizens particularly valued the capacity for NSBs to increase the volume of renewables in the energy system. Several participants also raised the potential for neighbourhood batteries to be a community asset that would increase energy [1] [2] stated that: ...what would be really interesting for me is a community owned shared battery so that it's not by some company but it's actually the community that feels an ownership of it and is therefore more connected to it.
Both energy sector professionals and citizens raised the potential for a range of risks or harms. Interestingly, energy sector professionals raised fewer risks, and no unique risks that had not been raised by citizens. These differences would be important to consider in NSB governance and social acceptance for proposed developments. The range and potential con icts between these values highlights the di culty of distilling diverse issues into rigid algorithms. And because only a subset of the bene ts and risks can be directly addressed through algorithm design, measuring the 'success' of NSBs by these metrics alone could miss important aspects of public value.
Having heard stakeholders' concerns -about less quanti able values being neglected, and being excluded from the decision-making of algorithm priorities -and their desires for active involvement and understanding of NSB actions, we developed three algorithms that embody these values and allow us to explore the material impacts of design choices.

Encoding values in NSB algorithms
The rst two algorithms we developed utilised purely nancial metrics. Such metrics are easily quanti ed and are therefore the most commonly used. They are however often blind to broader social goals. The third algorithm operates on physical power ow metrics, which lends itself to targeting local energy selfsu ciency.
Each algorithm was applied to a scenario consisting of a neighbourhood of 100 households and a 500kW:1000kWh NSB connected to a large upstream power grid ( Fig. 2(a)). Each household has a solar system (on average 6kW in capacity) and has a unique power demand and solar generation pro le, which are taken from the NextGen Battery Trial in Canberra, Australia's capital city 34 . We present results for the summer month of January, with further months shown in the Supplementary Materials. The net load for the 100 households over a representative two-day period is shown in Fig. 2(b), where negative values indicate power exported from the local grid to the upstream grid.

Financial objectives
Exploring nancial ows allowed us to understand whether citizens' concerns that the NSB could be operated in a way that did not spread bene ts to local communities could become a real possibility. We rst considered two scenarios in which NSB algorithms are designed to pursue one of two nancial objectives raised by FGD participants, either: 1. to maximise the pro t for the NSB owner (labelled max-pro t), or 2. to minimise the net electricity costs for all households and the NSB (labelled min-cost).
In all scenarios we use the electricity spot price from the South Australian region of the Australian National Electricity Market (shown in Fig. 3(a)). This price signal is only modestly correlated to the net demand of the 100 customers due to their residential usage patterns and 100% penetration of solar.
Additionally, we apply a network charge of $0.15/kWh for energy that ows between the local neighbourhood and the upstream grid and a discount network charge of $0.075/kWh for energy that ows between households or between households and the NSB (see Fig. 3(b) and Fig. 2(a)). Such pricing structures are under active consideration in Australia 35 and are crucial for the NSB algorithm to prioritise servicing the neighbourhood over the upstream grid. While these conditions represent a speci c context that gives rise to its own set of issues, they serve as an illustration of the types of issues that may arise from new energy algorithms, which will likely include trade-offs not covered here.
The charge/discharge actions of the NSB under the max-pro t and min-cost algorithms are shown in The differences between these behaviours are striking. The max-pro t algorithm produces far fewer charge/discharge actions, with only the extreme price peaks on the second day being su ciently lucrative to warrant discharging (in the process creating a massive export of power that is cut off on the scale of Fig. 3 but is shown in Fig. 5). The min-cost algorithm meanwhile charges substantially from the local solar generation on the rst day (bene ting from the reduced network charges) and discharges throughout the moderately high prices during the second evening. It also charges a little from solar on the second day and discharges a little on the rst evening but substantially less so.
The differences in algorithm actions are especially signi cant given that the two adjacent days have similar demand and solar generation and only modestly different price pro les. While the behaviour can be explained -the algorithm is co-optimising NSB revenue from price arbitrage with reducing households bills by providing increased amounts of local energy that incur reduced network charges -it is di cult to do so to a lay audience. Such behaviour could thus reinforce knowledge barriers and undermine transparency and trust in the energy system -issues that were identi ed as major concerns by FGD stakeholders.
The nancial impacts of the two algorithms are as-expected: the max-pro t algorithm creates the greatest bene t for the NSB (blue striped bars in Fig. 4), while the min-cost algorithm saves households the most (green square hatches in Fig. 4). This highlights how decisions of techno-economic algorithm design are strongly linked to issues such as ownership, inequality and pro t extraction. Citizens' in FGD were highly attuned to this, and substantive parts of the discussion explored these issues in detail. Furthermore, these questions are connected to the issue of trust and explainability, as both nancial approaches may claim to produce public bene t through improved market e ciencies and lower market prices, these claims are unlikely to be accepted in the absence of trust and simple and transparent evidence. As one participant said: … we need to understand the concept of what is abuse of their powers and what isn't abuse. And of course, us on the street, we don't know how these people could abuse [their power] if we gave them control.
In this sense the min-cost algorithm is advantageous in presenting savings directly to customers.

Non-nancial objectives
The next type of algorithm we developed is not concerned with nances but rather on the power ows between the neighbourhood and the upstream grid. The algorithm's objective is to minimise these ows to atten the demand curve and maximise neighbourhood self-su ciency. The actions of this algorithm, shown in Fig. 3(e), are more regular -and intuitive -than the other algorithms: the NSB charges when there is excess local solar and discharges this energy evenly throughout the evening. The algorithm addresses the FGD desires for self-su ciency and autonomy and is relatively explainable -matching citizens'' expectations of batteries smoothing demand. It also minimises households' electricity costs (yellow diagonal hatches in Fig. 4), however does so at a signi cant nancial cost to the NSB owner (Fig.  4).
The effect of all three algorithms on the net load of the neighbourhood is shown in Fig. 5. The selfsu ciency algorithm is seen to minimise and smooth the load pro le signi cantly, whereas the nancial algorithms have variable impact on the excess solar generation and demand peaks and create a new, very large export peak -discharging at the NSB's full power capacity of 500kW -during the price peak on the second day. This exempli es how narrowly designed algorithms, such as those preoccupied with nancial markets, can pose signi cant risks to the secure operation of the energy system 36 by ignoring physical objectives (as well social ones). Such risks occur whenever markets fail to fully describe systems or spilt system control variables across multiple markets with separate price signals that algorithms must prioritise between.
Lastly, we quantify the impacts of the different algorithms on the grid across the whole month by plotting the power ow between the neighbourhood and the upstream grid at each time interval in Fig. 6. As expected, the self-su ciency algorithm provides the greatest reduction in power ows into and out of the neighbourhood -best delivering citizens' stated expectations for NSB behaviour and desires for autonomy. The gure also showcases the aforementioned susceptibility of nancially oriented algorithms to drive increased imports and exports (including extreme peaks) in pursuit of arbitrage.
The self-su ciency algorithm is but one of any number of potential non-nancial algorithms. Some technical objectives, such as voltage or frequency management, are well studied in the literature 37,38 , while there are many more, such as prioritising transparency, that are deserving of future research. We note that while algorithms may allow multiple objectives to be combined and co-optimised (we have not done so in the interest of clarity), such co-optimisation still requires design choices on how each objective is prioritised and traded-off relative to others. This point emerged in a conversation between an energy professional representing low-income people and a network professional: These tensions, uncovered in the FGD and demonstrated in the modelled scenarios, therefore remain as inherent questions to be mediated through socio-political processes of algorithmic governance -they cannot be solved through techno-economic advancements.
[1] This pro-renewable energy stance is consistent with the ndings of successive surveys in Australia 33 .

Discussion And Conclusion
Our interdisciplinary study demonstrated the many values and preferences involved in NSB algorithms and the impacts these choices have on different stakeholders. Responsible development of NSB algorithms requires all of these to be carefully considered, and to be especially mindful of those that are di cult to quantify. While previous research on NSB optimisation algorithms explored techno-economic values, our contribution has been to highlight broader range of public values at play and how algorithm design choices have the potential to materially affect how these values are realised and prioritised.
Because NSB operations inevitably involve trade-offs, the design of their control algorithms should involve a wide range of stakeholders so that these trade-offs can be made explicit, understood, deliberated and then determined in a participatory fashion. Secondly, our paper demonstrates the challenges associated with understanding battery behaviour in even simple single-goal optimisation, a rming the need to consider issues of transparency and explainability in NSB governance. Finally, FGDs revealed that concern over battery control were signi cant, made especially acute because the battery would be located nearby to citizens and be drawing on local residential solar resources. These considerations of algorithm design must be infused throughout the research, development, planning, and other regulatory processes.
For researchers, our ndings emphasise the need to take a holistic view of the values embodied in their algorithms, for individual users as well as social and political bodies. We believe this requires truly interdisciplinary work, as we demonstrate in this article, as "good modelling cannot be done by modellers alone. It is a social activity." 39 For new energy technologies, there are numerous methods for exploring potential effects of technologies, but importantly, it is key for these to be explored within speci c cultural contexts (since concepts such as 'accountability' differ) 40 . Within discipline communities, it is also possible to integrate ethical and societal considerations into publication and recognition practises, as is being enacted by the arti cial intelligence community 41,42 in response to increased public scrutiny and backlash 43 . The need to anticipate and re ect public concerns in algorithm design are likely especially acute in privatised energy systems where key incumbents must prioritise shareholder values, over overarching public bene ts or concerns.
In addition to the actions of researcher, the responsible development of algorithms demands a critical and thorough examination of the biases potentially embodied in the data sets that are so fundamental to algorithms. In our study, for example, we note that the ne grained solar and demand data used in this study come exclusively from early adopters of batteries in the ACT. These individuals represent a distinct demographic (wealthy owners of premium houses), whose energy use is likely signi cantly different to other groups (such as renters or apartment dwellers). This biases in our data will have predictable as well as unknowable consequences that must to be acknowledged and ought to caution against generalisation 44 .
For developers and regulators of new energy technologies, our ndings reveal that NSB could ful l a wide range of legitimate functions, but also that these values can con ict with one another. This suggests that NSB could not only face conventional planning issues around placement and battery disposal, but also contestation over its functions. In places like Australia where trust in incumbents is low, our FGD data suggests issues such as transparency and explainability will be particularly important to address.
Dedicated research on how accountability and responsibility of digital infrastructures can be institutionalised in energy is required to explore these issues in more detail.
This paper represents an initial sketch of the theory and practice of integrating the public's concerns into NSB algorithm design and governance. Our work explored general concerns about NSB governance with citizens. But future work could explore in a more detailed fashion, deliberation and decision-making on speci c models of NSB. Our research approach could be extended, for instance, to consider other species 45 , and future generations 46 . Another issue to explore is the ways in which these processes may be institutionalised within energy governance more broadly, in different energy regimes. Could local community involvement in NSB design have the potential to undermine energy equity at broader scales? Other possible research directions include exploring new parameters and methodologies to ensure that NSB re ect values of the community located within the electricity area of in uence, without engendering new forms of energy injustice.

Social science research activity
The study was grounded in a conceptualisation of social acceptance of new energy technologies as a dynamic process of interactions -promoting and resisting new elements -across multiple scales and arenas of social activity, including governance and regulation, socio-political acceptances, and markets and innovation 47 . It thus was important to understand how different groups in the energy system viewed NSB and its potential bene ts and risks, existing regulatory barriers, and emerging potential business models. As appropriate for an unfamiliar research question, the qualitative design enabled depth and diversity, rather than statistical representativeness 48 . Our purposive sampling was designed to gather views from a diverse set of householders and energy professionals. We conducted a series of qualitative research activities involving 1) 9 interviews with energy professionals (who were also our project partners); 2) FGD with key decision makers across government and industry; and 3) FGD across a diverse section of the community.
In total, we spoke with 21 energy professionals representing: Municipal, State and Federal governments (4 participants)

Electricity distribution networks (8 participants)
Retail companies and consultants (4 participants) Non-government organisations, mostly in the consumer advocacy area (5 participants) Five participants had worked directly on implementing energy projects with local communities. The gender breakdown of energy professional participants was 6 women and 15 men.
In total we spoke with 57 householders in eight locations. We aimed for breadth of experience and diversity across the Australian community selecting: rural (4) and urban (4) locations; a range of socioeconomic characteristics and voting patterns, pro led using Australian Bureau of Statistics and Australian Electoral Commission data; and households with and without solar and batteries, encouraging broad participation by providing vouchers for participation. We aimed to reach citizens across different political orientations with varying levels of education and income but could only control this to the extent that we targeted particular suburbs and used various recruitment channels, including online (community Facebook groups and local council emails), poster-iers located in community spaces, and word of mouth. Five participants in Broome (Western Australia) were Indigenous Australians from different parts of the Kimberley in Western Australia and were recruited by Nulungu Institute of Notre Dame University.
The FGD questions were designed to remain at a general level in order to gather detailed impressions of the range of issues associated with this scale of batteries. We did not use any speci c term to describe NSB, referring to it as a 'mid-range sized battery' that would be in suburbs or small towns. The FGD were semi-structured to enable participants to explore the issue in their own manner. The detailed script and questions for both group types can be found in the Supplementary Materials as well as further detail about the demographic characteristics of citizens. All FGD were recorded and transcribed and subsequently coded in NVivo, using a thematic coding method. The draft report of ndings was shared with all participants for review.

Optimisation algorithm development
Our techno-economic modelling utilised data for household electricity use and solar generation from the publicly available ACT Nextgen Battery Trial 49 , which was cleaned as in 34 . Electricity price data was taken from the South Australian spot market 50 , whose volatile prices elicit frequent actions from the NSB. The presented scenarios cover January 2018, with further months presented in the Supplementary Materials to show the generality of our ndings.
We use a pricing structure that differentiates between power ows in the neighbourhood and those owing to/from the remote grid. Without this distinction, the neighbourhood customers would be indistinguishable and the max-pro t and min-cost algorithms would be identical. In our implementation, the cost of electricity is comprised of a time varying spot price (discussed above) and a at per kWh rate applied for transportion on the electricity network. This latter component is charged at either a standard rate (15c/kWh), which applies to power ows that involve the network outside of the local area, or a discounted rate (7.5c/kWh), which applies to power ows that remain within the local network. This pricing scheme re ects the reduced cost of shorter power ows and is applied consistently in all scenarios. The network charges are levied equally onto customers importing power and generators exporting power. The spot price is also applied equally to both groups (with generators receiving the price as revenue).
The operation of the NSB was optimised using a linear program in the python based c3x open-source simulation package 51 . For clarity, we did not consider degradation in battery capacity but did apply a battery degradation cost of $0.032 per kWh per cycle and provided each optimisation algorithm with perfect foresight in power ows (demand and solar generation) and prices. All simulation scripts are available online 52 together with the c3x package.
Integrating the social science and algorithm design research activities The project team had an integrated view of the separate research activities from the initial design of the project. Importantly, we conceived the different elements of the research activity -qualitative research and the optimisation work -as complementary. All members of the optimisation development team attended at least one FGD as observers in order to understand how the data was generated. The social researcher provided summaries of FGD to the wider team immediately after completion so that dialogue between the team was continuous throughout data collection and analysis. Issues around the different values of stakeholders subsequently informed the parameters used to explore the optimisation algorithms. The social scientist also played a critical role in reviewing the optimisation work and in this process raised new questions around consideration of energy justice for cost reduction to customers immediately within the NSB consideration, versus those outside of it. The project team met regularly to discuss the wider implications of our research ndings for regulatory changes and public values.