An Energy Systems Modelling Tool for the Social Simulation Community

The growing importance of links between the social and technical dimensions of the electricity infrastructure mean that many research problems cannot be effectively addressed without joint consideration of social and technical dynamics. This paper motivates the need for and introduces a tool to facilitate the development of linked social and technical models of electric power systems. The tool, called MatpowerConnect, enables the runtime linkage of Netlogo - an oft-used modelling platform in the social simulation domain - with Matpower - a common power flow simulation package in the power systems domain. MatpowerConnect opens up new modelling possibilities for social simulation researchers active in the study of electricity systems. It offers ease of use coupled with a high degree of realism with which electricity infrastructure functionality is captured. We describe the development and use of two demonstration models using MatpowerConnect. These models illustrate two types of problems and system scales that can be addressed. In the first model we explore the consequences of actors' adaptive strategies on the performance of a small-scale power system. In the second model we simulate the effects of different regulatory regimes on network investment in a supra-national electricity transmission system to explore the long-term consequences for network development and social welfare. In both cases, the extension enables capturing a critical functionality of electric power systems, while allowing model development efforts to focus on social simulation aspects. Resources for using the extension are provided in conjunction with this paper.

Fuelled by concerns about climate change, the global electricity sector has embarked on a massive socio-technical transition -a shift to renewable energy sources and less carbon-intensive generation technologies (Chappin 2011;Perelman 1980;Verbong & Geels 2007). Efforts to realize this transition have sparked a number of pertinent questions spanning the social and technical domains: How can we encourage adoption of low-carbon technologies? How can we deal with strategic behaviour in liberalized electricity markets? How can we manage public concerns about new electricity generation and grid technologies?
1.2 To address questions such as these, considerable effort has been expended in the development of advanced simulation tools to facilitate electric power system modelling efforts spanning the social and technical domains. These platforms and models have been used to assess the effectiveness of policies for stimulating transitions in energy generation (Batten & Grozev 2006;Chappin 2011;Weidlich & Veit 2008), to explore the diffusion of low-carbon technologies (Kieckhaefer et al. 2009;Schwoon 2006;Stephan & Sullivan 2004), and to test different power market designs (Bhagwat & de Vries 2013;Sun & Tesfatsion 2007). Simulation tools such as these have enabled significant progress with respect to the questions noted above. However, further progress hinges partially on our ability to more tightly couple knowledge in the social and technical domains -to gain a deeper understanding of the relationships between social and technical dynamics and their consequences. This coupling can be facilitated by linking the tools and resources of these domains.

1.3
Efforts to couple detailed representations of the social and physical world are not uncommon in the social simulation field. One of the most active such areas has involved the development of hybrid socioeconomic/biophysical models, incorporating agent-based models linked with biophysical models such as hydrology models, nutrient dynamics models, soil fertility models and crop growth models (Bakam & Matthews 2009;Bithell & Brasington 2009;Giacomoni & Zechman 2010;Janssen & de Vries 1998;Matthews & Bakam 2007;Mauser & Ludwig 2003;Schreinemachers & Berger 2011). One specific example is the Artificial Anasazi model of Axtell et al. (2002), which incorporates interactions between households and a physical landscape with specific soil compositions and hydrological characteristics (Dean et al. 2000).

1.4
The coupling of social and physical models is essential to the future sustainability, reliability and resilience of electric power systems. The liberalization of electricity markets and the drive towards renewables-based generation are inciting a shift towards a more bottom up structure of electricity systems. This means that electricity supply is increasingly determined by the distributed decisions of numerous actors to invest in and deploy (distributed) generation technologies. The interactions of these actors with one another -in social networks, markets and organisations -will influence and be influenced by the physical infrastructure. Insofar as electricity networks act as essential mediators of and constraints on electricity supply and demand, their technical functionality is essential to understanding possibilities for realizing more sustainable, reliable and resilient electric power systems.
1.5 In this paper we introduce a tool for developing coupled social and technical representations of electric power systems. The tool, called MatpowerConnect, enables the runtime linkage of Netlogo -an oftused modelling platform in the social simulation domain [1] -with Matpower -a common simulation package in the power systems domain [2] . Both Netlogo and Matpower are actively used and welldocumented, and are freely and readily available to researchers. In enabling runtime linkage of these pieces of software, we endeavour to enhance the ability of social scientists working on electricity sector topics to more easily and effectively incorporate pertinent technical considerations of power systems.

1.6
In the remainder of this paper, we introduce the MatpowerConnect tool in more detail and describe two models employing this tool. Our aim is two-fold. First, we seek to provide social simulation researchers with sufficient knowledge to effectively employ MatpowerConnect in their own research. Second, we seek to illustrate the potential of this tool to contribute in meaningful ways to the study of socio-technical electricity systems. We continue in the following section with a brief introduction to key power systems concepts underlying the developed tool.
Overview of relevant power systems concepts 2.1 Electric power systems are the infrastructures responsible for allocating, producing, transporting, and using electric power. In this section, we provide a brief introduction to key electric power systems concepts necessary for understanding and using the developed tool. These concepts also form the basis for the demonstration models described later in this paper. Electric power systems may be conceptualized as socio-technical systems, consisting of interacting technical and social subsystems (Bijker et al. 1987;Geels 2005;Sovacool 2009). Figure 1 illustrates the types of social and technical components of a typical electric power system and the links between them. In the paragraphs that follow, we describe the composition of the power system's social and technical subsystems.
flow patterns that may be produced by different production and consumption regimes, also under extreme conditions.
The social subsystem 2.7 The technical subsystem of the power system is designed, operated, maintained and used by a variety of actors, each of whom interacts with certain components of the technical subsystem and with other actors within the social subsystem. Prior to electricity market liberalization processes, which began in Europe roughly in the 1980s (Glachant & Ruester 2013), many of the responsibilities involved in supplying electricity to consumers were bundled within a single actor, the electric utility. As a consequence of liberalization, these responsibilities have become increasingly fragmented amongst a range of (interacting) actors. Important social components (actors) in a liberalized power system include: Consumers, including household, commercial and industrial consumers Power producers, who are the owners and operators of power plants and generators A transmission system operator (TSO), who is the owner and operator of the transmission system Distribution system operators (DSOs), who are the owners and operators of distribution systems Electricity retailers, who sell electricity to consumers Governments, who define the rules of the game Regulatory agencies, who oversee the implementation of power system regulations 2.8 Each of these actors interacts with different portions of the technical subsystem -consumers deal primarily with loads, producers with generators/power plants, and DSOs and TSOs with the components of the distribution and transmission systems, respectively. These actors interact with one another largely in the context of electricity markets, including: (1) spot markets, in which producers offer their output to retailers on different timeframes; (2) retail markets, in which consumers sign supply contracts with retailers; and (3) balancing and ancillary services markets, in which TSOs buy and sell electricity in order to maintain real-time balance between supply and demand.

2.9
The dominant structures of the social subsystem are currently being challenged by the growing role of "prosumers" -consumers with distributed generation capabilities. While prosumers (currently) normally do not directly participate in traditional electricity markets, the electricity they produce can significantly influence the physical system. The institutions and processes governing the participation of prosumers in future energy systems and markets are still in flux, but have the potential to disrupt the dominant structures. This is an active area of current research and debate (Bompard et al. 2015;Rickerson et al. 2014).
2.10 Importantly, the actions of prosumers and other actors within the social subsystem are not independent of one another, but may be heavily influenced by social factors. The interactions of consumers within the context of their social networks may, for instance, facilitate or hinder the diffusion of electricity consuming or producing technologies (e.g. electronic devices, electric vehicles, solar panels) (Jager et al. 2014;Noll et al. 2014). And they may determine when, where and how certain electricity loads (e.g. electric vehicles) are deployed. Next to this, the institutional forms in which prosumers choose to organize themselves -e.g. community energy systems, virtual power plants, cooperatives -may significantly influence their interactions with other actors and with the technical subsystem.
The need for linked social and technical models of electric power systems 3.1 Links between the social and technical dimensions of the electricity infrastructure mean that many research problems cannot be effectively addressed without joint consideration of social and technical dynamics. The overall structure of the socio-technical infrastructure is an emergent outcome of underlying social processes and technical design parameters, interacting through a coupled fitness landscape (Kauffman & Johnsen 1991). Changes in the social realm -e.g. institutional changes, new forms of organization -may affect the relative fitness of different technical (network) configurations. Likewise, changes in the technical configuration of the network may affect the fitness of the properties and dynamics of the social system -e.g. the partnerships, strategies and financial performance of actors.
3.2 Electricity transmission and distribution systems are key elements of the electric power system. As mediators between electricity supply and demand, the properties of these systems influence and may be influenced by developments within the social subsystem. An example of this is the recent grid congestion issues created by rapid increases in rooftop solar installations in Hawaii. In recent years, federal and state market subsidies made rooftop solar installations very attractive for consumers, leading to high penetration rates in a relatively short period of time (Mulkern & ClimateWire 2013). However, the technical properties of the distribution system in Hawaii meant that, at some point, this system struggled to accommodate the growing influxes of solar power. This constraint provoked the sudden implementation in 2013 of institutional changes limiting the grid connection of new solar installations in Hawaii. The controversy around this decision, in turn, has driven the drafting of legislative action to deal with the issue from a longer-term perspective, and will likely lead to future institutional and technical changes influencing the further development of the Hawaiian power system, and perhaps elsewhere (Mulkern & ClimateWire 2013).

3.3
Another example is the recent growth of (onshore and offshore) wind power combined with a nuclear phase-out in Germany. Large amounts of wind capacity have been installed in, predominantly, northern Germany, while a large portion of the country's nuclear generation capacity, which is located predominantly in the south as is a large part of the load, has been decommissioned or will be by 2022 (Ederer 2015;Lechtenböhmer & Samadi 2013). These events increase the need for electricity transports from the north to the south, but expanding the transmission grid to accommodate this need has proven difficult due to public opposition against new transmission infrastructure.

3.4
Sequences of events such as these cannot be understood without adequate comprehension of both the social and technical dynamics underlying the development of electric power systems. Effective modelling of technology diffusion coupled with accurate modeling of the technical functionality of the grid could have foreseen the situation in Hawaii and prevented the necessity for emergency measures. Both of these are active areas of modelling and research in the social simulation and power systems domains, respectively (Fang et al. 2015;Jager et al. 2014). It is a lack of coupling of research in these domains that hinders progress in this direction.

3.5
The events currently playing out in Hawaii and Germany are just two of many possible scenarios in which coupled representations of social and technical power system dynamics could be advantageous. Bottom up developments in the electricity sector mean that the technical operation of the power system will, more than ever, be determined by the aggregate actions of numerous actors (e.g. prosumers) influenced by various forms of social interaction. In order to understand likely influences on the technical system, it is essential to understand how various patterns of social interaction may lead to certain patterns in the installation and deployment of power system technologies. How may learning effects influence the societal diffusion of renewable generation technologies, and what problems may this pose for the functionality of the infrastructure? What are the likely temporal and spatial patterns of electric vehicle charging, given likely social correlations between the movements and activities of drivers, and how can these patterns be efficiently managed and effectively influenced by grid operators? Likewise, constraints on the technical operation of the power system will inevitably influence the nature of social interaction and the emergent social phenomena observed. Under what conditions might restrictions on the grid connection of residential solar arrays encourage large-scale "grid defection" on the part of consumers? Progress on these topics is fundamental to the development of sustainable energy systems, and cannot be addressed without the coupling of detailed social and electric power system models.
MatpowerConnect -description of the tool 4.1 Power flow analysis is a tool commonly employed by power system engineers in planning expansions and optimizing the use of existing infrastructure. It is a numerical technique which takes the properties and configuration of a power system as input and uses Kirchhoff's laws to calculate power flows and voltages in the technical components of the specified system. Numerous software tools are available for performing power flow analyses and variations of them. One such tool is Matpower -a MATLAB-based simulation tool (a package of MATLAB M-files) for solving power flow and optimal power flow problems, originally developed at Cornell University in the context of the PowerWeb project (Zimmerman et al. 2011). This section introduces a simple demonstration model that makes use of MatpowerConnect. The model is implemented in Netlogo 5.0 and can be downloaded from GitHub at https://github.com/ABollinger/MatpowerConnectDemonstrationModel. As described in Appendix B, this model may serve as a template for social simulation researchers seeking to make use of MatpowerConnect. The purpose of this model is to explore the consequences of actors' adaptive strategies on the performance of a simple power system.

5.2
The elements of the model are divided into a social subsystem and a technical subsystem. The social subsystem is composed of three types of actors (represented as agents) -electricity consumers, electricity producers and a grid operator. The technical subsystem is composed of four different types of technical infrastructure components -loads (electricity consuming devices/installations), generators, power lines and buses (nodes in the power grid). The configuration of these components and their initial properties are set using the IEEE 14 bus test case, which represents a portion of the Midwestern US electricity transmission grid [5] . Only the capacities of power lines are not set in accordance with the test case, as they are not specified in the test case data. By way of IEEE test cases, MatpowerConnect offers a linkage to (standard) datasets that detail electricity transmission networks (see Appendix A for an explanation of IEEE Power System Test Cases).

5.3
Each time step during the course of a simulation, electricity consumers demand electricity and electricity producers use their generators to supply this electricity. The amount of electricity demanded by each consumer increases by a user-determined percentage each time step, and has a small random component. The electricity is transported from producers to consumers by way of a network of power lines and buses -an abstracted power grid. The flows through the lines in this network are calculated each time step using the MatpowerConnect extension.

5.4
Producers' ability to provide for the demand of consumers is limited by the generation capacity available to them -they are only able to increase their power output to the maximum output capacity of their generators. Similarly, the ability of the grid operator to transport power from producers to consumers -from generators to loads -is limited by the capacity of his power lines. The lines of the power grid are not able to transport more power than their capacities allow. If the power flowing through a line exceeds its capacity, the line fails and is considered to be out of service for a given number of timesteps.

5.5
These restrictions within the technical subsystem limit the performance of the system as consumer demand increases. Performance of the system is expressed in terms of mean consumer satisfactionthe ratio of the power received by a consumer within a given time step to the power he demanded that time step. Consumer satisfaction thus drops when generator and grid constraints limit the capacity of the technical infrastructure to provide for demand.

5.6
The agents of the social subsystem have been endowed with several adaptive responses that allow them to improve the system's performance. Producers can increase the output capacity of their generators if aggregate demand begins to exceed aggregate supply; consumers can decrease their demand in response to impending electricity shortfalls; and the grid operator can increase the capacity of specific power lines as their power flow approaches their maximum capacity [6] . When performance of the system begins to deteriorate, these adaptive responses allow the agents of the social subsystem to use their individual points of leverage over the technical subsystem to bring performance back to acceptable levels.
Model results 5.7 Figures 3, 4, 5 and 6 illustrate the results of several runs of the model under different conditions. In each case, the simulation has been run for 100 time steps, consumer demand increases by 3% each year, and four metrics are tracked -total consumer demand, aggregate generation capacity, power flows and consumer satisfaction. Figure 3 illustrates the results of the model under conditions in which the adaptive responses of all agents of the social subsystem have been de-activated. In this case, consumer demand increases exponentially, and power flows follow suit as an increasing amount of electricity is transported from generators to loads. At the point at which total consumer demand exceeds generation capacity, the amount of power received by consumers begins to fall short of their demand and consumer satisfaction begins to drop. The technical subsystem has reached saturation, and no additional power can be produced.

6.3
This will mean that not just one, but multiple transmission system operators (TSOs) will be responsible for the network that connects generators and consumers. However, these TSOs may have different objectives or reasons for network expansion (to increase the power transfer capacity between areas), which are often influenced or driven by national interests as formulated by (national) regulators and governments. The model described below enables one to simulate the development of transmission capacity in North West Europe as the result of investment decisions by individual TSOs. Its purpose is to explore how different regulatory regimes affect the long-term development of the transmission network under a variety of scenarios, and what this means for the social welfare of different countries and different types of stakeholders (producers, consumers). The paragraphs below provide an abridged description of the developed model. For a complete description, please see van Blijswijk and de Vries (2013).
Model design 6.4 The model considers a high-level representation of the electricity systems of Germany, Netherlands, Belgium, France, and Austria. It represents the system as 13 areas, each of which has a generation portfolio (represented at the level of fuel types) and a level of (perfectly inelastic) demand, which develop over time as specified by the model user through exogenous input scenarios. These areas are connected by a total of 20 transmission links, each of which represents one or more power lines that exist in reality. It is assumed that network constraints do not play a role within the areas (nodes) [7] , but only on the links between nodes. There are 8 agents that perform the function of TSOs, which consists of expanding the network capacities between nodes according to their own criteria for investment (social welfare optimization within their region). Five regulatory agencies (one per country) are responsible for approving or rejecting the expansion plans made by these TSOs on the basis of criteria specified for each simulation run (see below). 6.6 At the end of each simulated year, the TSO agents make (individual) investment decisions to determine which links to add capacity to and how much capacity to add. Links between nodes that are operated by different TSOs require an investment approval from both agents, with costs shared on a 50/50 basis. These investment decisions are based on a cost-benefit assessment in which the costs of a link expansion are compared to the (monetary) benefit it delivers. If an net present value (NPV) assessment of the effects of an expansion over time yield net benefits, a TSO proposes its construction. There is a delay of several time steps before the capacity added by the investment actually becomes available to the network.

6.7
While the costs of a link expansion only depend on its length and capacity, the assessment of benefits can yield different outcomes depending on the scope of the agent that performs the assessment. (For instance, an agent could only consider the benefits of a link expansion for producers and consumers within its own country, but ignore the welfare effects for producers and consumers in other countries which are also affected by the expansion.) The scope of effects that are considered by the agents can be varied between model runs, in order to find out to which extent this affects network investment in the system. In the demonstration model we present in this paper, we compare a case where the agents only consider the economic effects of link expansions for producers and consumers within their own country, versus a case where they take into account the economic effects for the system as a whole.
Model results

6.8
For the case presented in this paper, we used the model to determine whether the North West European transmission network would develop differently when the investment decisions of individual TSOs (the agents) were taken on the basis of a system wide cost-benefit analysis, compared to and load, the model used the PTDF table to determine the link loads in the system. The main advantage of this approach is that it eliminates the need to run separate load flow calculation models for every set of dispatch and load configurations (e.g., when doing year-round market simulation).

7.5
However, in order to obtain the PTDF table for the given network topology, the user is still required to perform a separate load flow simulation, and the PTDF table must be re-calculated if the network is reconfigured (e.g., line capacities are expanded). In the second demonstration model we were concerned with network expansion over time, which not only implies that the network topology changes throughout the model runs, but also involves assessment of the effects of a large number of potential network expansions (i.e. topology changes) by the agents in each time step. Each of these reconfigurations requires the re-calculation of the PTDF table based on the new network topology. Even with the high level of abstraction used in the second demonstration model (a handful of nodes and links to represent the entire North West European electricity system), the number of different network configurations that could exist requires a prohibitively large number of different PTDF tables to reflect the network flows that would arise in network topologies that could exist. A shift to the MatpowerConnect extension in this case enabled much greater scalability and extended the capabilities of the model by allowing on-the-fly load flow calculations for networks on any level of detail. Moreover, it allowed for work on the model to focus on the core elements for which it was designed -investment in a (technically) common network by (institutionally) individual agents -while a basic, yet vital and complex functionality is provided by the extension to virtually any initial network configuration specified by the user.

7.6
Key advantages of the MatpowerConnect extension relative to alternative techniques include: 1. Scalability and flexibility, including the possibility to simultaneously analyse multiple, distinct networks 2. Realistic representation of power systems functionality 3. Ease of use, also by those lacking a power systems background 4. Speed: A single run of the first demonstration model of 100 time steps takes about 23 seconds [9] 7.7 In using the extension for real cases, accurate data describing the relevant portion(s) of the real-world electric power grid is essential. In some cases, coarse datasets aggregating regional grids into single nodes may be sufficient -this is the approach adopted in the second demonstration model. However, the suitability of coarse approximations is highly dependent on the problem being addressed. In many cases, detailed grid data may be necessary or preferable. For transmission level studies, accurate national level datasets are increasingly available [10] . For distribution level studies, accurate data is more difficult to come by, and in the experience of the authors is often proprietary. However, it is known that common sets of rules often guide the development of transmission and distribution systems in different geographical areas, resulting in the emergence of network structures with similar properties (Rosas-Casals 2009). These patterns can be leveraged to generate realistic synthetic networks in cases where insufficient data is available. While it has been shown that simple networks based on random, preferential attachment and small-world structures "do not provide substantial utility for modeling power grids" (Hines et al. 2010), alternative methods have been shown to generate sufficiently realistic synthetic electric power networks (Soltan & Zussman 2015).

7.8
Though the MatpowerConnect extension may be a useful tool for social simulation researchers, it has certain limitations which should be kept in mind. First, the extension currently only handles DC power flow analyses. As previously stated, the accuracy of DC analyses lag relative to AC analyses, but in many cases it is a sufficiently accurate approximation. Second, the extension requires an extensive description of the technical characteristics of the power system being modelled, which may be challenging for some researchers in the social simulation domain. By referencing the code of the demonstration models described in this paper, however, we expect that researchers should be able to overcome this challenge with little difficulty. By making the MatpowerConnect extension available and providing extensive documentation in the form of this paper and the referenced model code, we hope to inspire and enable new strands of research in underexplored areas spanning the social and technical domains.
Conclusion 8.1 This paper has introduced and motivated the need for MatpowerConnect, a tool for social simulation researchers active in the energy domain. The tool enables study of electric power systems as evolving socio-technical systems at a variety of system scales, to explore a plethora of problems. As researchers spanning social and the technical domains ourselves, we have put this tool to use in multiple models and to address multiple research questions, several of which have been noted above. The rapidly changing structure of global energy systems demands research efforts jointly considering the technical and social dimensions of electric power systems. Via this paper, and the documentation and model code made available, we aim to make MatpowerConnect available and accessible to the social simulation community. In doing so, we seek to expand the scope of topics that can be addressed by this community, and to enable and inspire new research paths.

8.2
Many of today's key societal challenges demand research efforts spanning multiple domains. In fostering a large-scale shift to renewable and low-carbon energy sources, this is particularly imperative. The daily operation and long-term development of energy systems are emergent products of the behaviour and interactions of numerous actors. In turn, the performance and physical development of energy systems may influence and constrain the behaviour of these and other actors. Understanding and exploring these relationships and their consequences is essential to the realization of sustainable and resilient energy systems. Via this paper, we seek to contribute in a small and practical way to this ongoing process. 5 For purposes of simplicity, the model does not include representation of a distribution grid. 6 An important assumption of the model is the immediate effect of these adaptive responses. In real power systems, the infrastructure investments involved in increasing the capacity of generators or power lines may take several years, leading to a delay between the identification of a potential issue and the completion of improvements to alleviate it. 7 In the field of power systems research this is referred to as the copper plate assumption. 8 We assume solar PV to play a major role in the North West European electricity supply and furthermore assume that demand increases two-fold (in 2050) as a result of a shift from (direct) fossil fuel consumption to electricity.

Appendix A -IEEE Power System Test Cases
The technical components of power systems are organized into networks whose structures have evolved over time to accommodate emerging societal demands and changing technological capabilities. While the precise configuration of power systems varies significantly around the globe, the structural characteristics of these systems exhibit remarkable similarity from a network perspective (Rosas-Casals 2009). Given these similarities together with the need for standardized configurations for testing power systems algorithms, power systems researchers often make use of IEEE power system test cases -standardized abstractions of certain real world power systems. These test cases have been used, amongst others, to test methods and algorithms for calculating optimal generator dispatch (Xie & Ilic 2008), planning reactive power compensation (Fernandes et al. 1983) and identifying critical nodes in a power system (Nasiruzzaman et al. 2012 Understanding the demonstration model: The MatpowerConnect demonstration model can be launched by double-clicking the runMatpowerConnect-DemoModel1.bat (Windows) or runMatpowerConnect-DemoModel1.sh (Linux) file. This is a small script that starts the extension and opens Demonstration model 1 in Netlogo. The code of the demonstration model uses sensible variable names and is heavily commented in order to facilitate understanding on the part of the user. The interactions of the demonstration model with the MatpowerConnect extension are primarily defined in two places in the code of the demonstration model. The first is via the extensions[matpowerconnect] tag at the top of the model code. The second is via the matpowerconnect:octaverun command, which is the key point of interaction between the Netlogo Model and Matpower. This command is preceded by an input variable and followed by an output variables, as can be seen in the run-matpower procedure of the demonstration model, specifically the line set matpower-output-list matpowerconnect:octaverun matpower-input-list. This line of code passes the technical configuration of the power system (represented here by the variable matpower-input-list) to the extension and accepts back the calculated power flow values (represented by the variable matpower-output-list).
The input variable to the extension takes the form of a Netlogo list containing three sublists. These lists utilize the standard PTI Load Flow Data Format, described at http://www.ee.washington.edu/research/pstca/formats/pti.txt, for representing the technical composition of an electric power system. The first of these sublists defines the properties of the buses in the electricity network, the second describes the properties of generators in the network, and the third describes the properties of power lines and transformers in the network.
The output variable to the extension also takes the form of a Netlogo list containing two sublists. The first sublist contains information about the calculated power flows across each of the lines in the defined network. The second sublist contains information about the output of generators in the system. The ordering of power flow and generator output data in the sublists of the output variable is identical to the ordering of these elements in the input variable.
Creating your own model: The MatpowerConnect extension is most easily used by copying the power flow procedures portion of the code -containing the set-generator-outputs, set-power-demand-ofbuses, create-matpower-lists, create-final-matpower-list and run-matpower procedures -together with the appropriate variable declarations (e.g. buses-own, generators-own) to a new Netlogo model file. This portion of the code manages the creation of the lists to pass to the extension and the extraction of results data.
In developing an initial model, users may find it easiest to start by instantiating and testing a network based on the IEEE Power System Test Cases (described above), the definitions for several of which can be found in the case data folder of the downloaded directory containing the demonstration model. This data gives social simulation researchers a way to incorporate realistic power system structures into their models with limited prior knowledge of the technical aspects of power systems. Code for loading the power system test cases into a model can be copied and pasted from the setup-network procedure of the demonstration model. A description of these and other IEEE Power System Test Cases can be found at https://www.ee.washington.edu/research/pstca/.
The source files for the MatpowerConnect extension may be downloaded from https://github.com/ABollinger/MatpowerConnect.

Appendix C -Comparison of results from Matpower and the MatpowerConnect extension
Using a modified version of the IEEE 14-bus test case as a basis [11] , Table 1 compares the power flow results of the MatpowerConnect extension with those of Matpower itself, on the basis of power flows through the lines of the network. The results from the extension were obtained from Netlogo after having been passed from the extension. The results from Matpower were obtained from an separate simulation in Matlab using Matpower. As demonstrated below, the results from the MatpowerConnect extension and Matpower are identical, supporting the validity of the extension. References AXTELL, R. L., Epstein, J. M., Dean, J. S., Gumerman, G. J., Swedlund, A. C., Harburger, J.,