Simulation of smart grid technologies requires a fundamentally new approach to integrated modeling of power systems, energy markets, building technologies, and the plethora of other resources and assets that are becoming part of modern electricity production, delivery, and consumption systems. As a result, the US Department of Energy’s Office of Electricity commissioned the development of a new type of power system simulation tool called GridLAB-D that uses an agent-based approach to simulating smart grids. This paper presents the numerical methods and approach to time-series simulation used by GridLAB-D and reviews applications in power system studies, market design, building control system design, and integration of wind power in a smart grid.
Recent smart grid technological advances present a new class of complex interdisciplinary modeling and simulation problems that are increasingly difficult to solve using traditional computational methods. Emerging electric power system operating paradigms such as demand response, energy storage, retail markets, electric vehicles, and a new generation of distribution automation systems not only require very advanced power system modeling tools but also require that these tools be integrated with building thermal and control models, battery storage technology models, vehicle charging system models, market simulators, and detailed power system control models. Historically all of these simulation tools were developed independently and each treated the others as a quasi-static boundary condition, an approach that not only limits their effectiveness in evaluating technology impacts over multiple scale and multiple time horizons but which also neglects potentially important coupling effects.
In the case of electricity transmission simulation, PSLF [
Electricity distribution level tools such as SynerGEE [
The same can be said for building energy simulation, battery storage models, market simulations, and distribution automation controls in that they cannot represent the behaviors of the subject systems at the same time and size scales as power system simulations. Thus, the problem of integrating these tools into a single multiscale computational framework appears insurmountable using conventional simulations based on the numerical solution of systems of ordinary or partial differential equations (or their discretized counterparts) to represent changes in quantities of interest such as the voltage at a bus, the price of energy, the temperature in a building, or the charge in a battery.
Agent-based computational economics [ empirical research that seeks to understand why and how macroscopic regularity emerges from microscopic properties and behaviors; normative research that uses agent-based models as an theory generation that uses structured analysis to discover the conditions under which global regularity evolves; methodology development that seeks to improve the tools and methods that support computational economics.
Consistent with the postulate that markets should be designed using engineering tools [
The primary purpose of this paper is to place the development of GridLAB-D in the context of research on the application of agent-based simulations and provide details of how GridLAB-D solves interdisciplinary simulation problems as a time series using the agent-based paradigm. The first section discusses the general features of agent-based systems and briefly discusses examples and features of such systems in various domains. Next, the solution methods used by GridLAB-D are discussed and application examples are reviewed to demonstrate how the methods have been applied to various smart grid problems. Finally, planned future work is discussed and opportunities for other researchers to contribute further developments to the open source GridLAB-D tools are enumerated.
Agent-based modeling is not a new approach to modeling complex systems. Early development of this approach was pioneered by Von Neumann [
To illustrate the difference between conventional models and agent-based models, we review the Lotka-Volterra predator-prey model [
The simplicity of the Lotka-Volterra system lends itself to analysis in the sense that one can compute aggregate properties such as the fixed population equilibrium by solving (
State space trajectories of a predator-prey system.
Several significant problems become apparent when one attempts to find analytic solutions to many real-world systems. First, the parametric form of (
Integration error of a “naive” finite difference solution.
The second problem is any change to the structure of the system or coupling with other dynamic systems requires that the solution be rederived (often manually) from the original differential equations. This difficulty is encountered when using a mixed electromechanical, thermal, and economic system such as
The first equation describes the equilibrium condition for the electric power flow network, the second and third equations describe the equilibrium condition for the generator and consumer response to pricing, and the fourth equation describes the equilibrium condition for the power market. These systems tend to operate on different timescales using different variables to describe interfaces between them.
Finally, the third problem is that as the systems become more complex the differential equations become so numerous and unwieldy that the model becomes analytically intractable for any nontrivial condition. This is certainly the case when power systems, market systems, and building thermal models are combined as above with (
Fortunately, no matter how complex these systems become they can be numerically modeled using agent-based methods. To illustrate how this is done we review a model of the same predator-prey systems using Conway’s Game of Life, which uses cellular automata to represent a 2-dimensional landscape in which the populations interact. This landscape is represented by a matrix of cells that can take one of three values: 0 when a cell is vacant; 1 when it is occupied by a prey; and 2 when it is occupied by a predator. To simulate the advance of time the total population of each is counted as the matrix is iteratively updated using simple rules such as the following: the probability that a rabbit is born in a cell “adjacent” to a cell occupied by a rabbit is the probability that a fox replaces a rabbit in a cell “adjacent” to a fox is the probability that a fox dies is
Here, the meaning of “adjacent” uses a “north-east-south-west” cell adjacency condition that embodies the probability of the
The output of an agent-based simulation of the Lotka-Volterra model based on these rules using a simpler random 1-dimensional “encounter” map generated at each iteration can be seen in Figure
Fluctuation behavior of agent-based simulation.
The simulation shown in Figure
Convergent behavior of agent-based simulation.
The primary characteristics of verisimilar agent-based models are based on realistically defining the agents and their relationships in an interaction landscape so that their evolution over time accurately reproduces the dynamics of the system being modeled. This requires that the following considerations be addressed carefully: the internal states of the agents are represented by variables (discrete or continuous) that provide sufficient dynamic range and resolution to allow small fluctuations to affect agent behavior realistically; the agents’ behaviors are represented such that they evolve in a manner akin to a state machine (e.g., a Markov process, a cellular automaton, or a state space model) or equivalent model (e.g., differential equations); the agents interact with an environment that evolves over time such that the agents are both affecting the environment and affected by the environment; the agents interact with each other in a manner that is consistent with the expected interactions in the system being modeled; that is, not all the internal state variables of agent are revealed to other agents. More complex systems may also involve the following additional considerations: the environment may change over time; that is, an external simulation, underlying model, or prerecorded set of conditions changes it slowly with respect to the dynamics of the agents; agents of different types can be interacting concurrently, which is the most common situation in highly realistic simulations.
Unfortunately, while the descriptive power of agent-based models is readily apparent and has been amply demonstrated [
The second shortcoming is that agent-based model verification and validation are difficult to accomplish using formal methods. When considering conventional simulations such as the ODE solution to the Lotka-Volterra system, verification is the process of ensuring, for example, that the populations always satisfy (
In principle the same should be possible with agent-based simulations. However, as we have already seen agent-based model often exhibits fluctuations that resemble real systems so that instead of trying to verify an idealized model (nonfluctuating) against real (fluctuating) data, model developers are often trying to validate the model using a system that fluctuates in a different way. The verification question is no longer just about the uncertainty associated with the empirical data. Now the uncertainty associated with the agent-based model must be considered as well. Even for simple models like the Lotka-Voltera system the agent-based model does not strictly obey its conservation law: it only approximately follows the law in the sense that the simulation converges toward the fixed point when far from it but diverges when very close to it.
The problems with agent-based model validation came to the fore in the development of agent-based computational economics used in the design of electricity markets. In their discussion of this problem LeBaron and Tesfatsion identified three challenges [
One commonly used approach is verification against experimental and/or reduced simulations and validation against empirically collected data that demonstrate consistency with known initial conditions and outcomes. In this way, GridLAB-D models are often verified with simple “known good” simulations and validated using telemetry from large-scale real-world systems for which models are available. The latter is discussed further in the applications section below.
These problems are not unique to GridLAB-D. Widely used agent-based simulation environments such as SWARM [
Ultimately the decision whether to accept the mathematics of agent-based models hinges on an argument made by LeBaron and Tesfatsion in their assessment of the relevant differences between classical and constructive mathematics [
GridLAB-D was designed and implemented with the latter view in mind.
The success of GridLAB-D as a tool to study smart grids is primarily attributed to the use of the agent-based simulation paradigm. The approach has made GridLAB-D easy to use in spite of the extensive use of multidisciplinary elements in various modules. In addition the output of GridLAB-D is highly similar to data collected from smart grid demonstration project conducted in the field, which has facilitated verification and validation.
GridLAB-D allows modelers to choose which of the agent-based characteristics are implemented in a given module. Multiple modules may be operated concurrently in any given simulation and there is no requirement that every module uses the same modeling method in any given simulation. For example, the power flow module uses a state-space model with an underlying algebraic solver to compute the voltages and currents given the loading conditions presented to it by the other modules. The residential building module in turn uses the voltages to determine the energy input to home energy systems and an underlying ODE thermal model to solve the indoor air and mass temperatures. The market models use the building control systems to determine the price of electricity, which in turn is used to determine the price at which overall supply and demand for electricity are equal.
Agents are organized into ranks based on the relationships between them imposed on them by the modules’ solvers. The ranks are organized in trees of parent-child relationships, with each parent agent primarily depending on the values accumulated from one or more child agents. The ranks are given ordinal numbers with the greatest ordinal assigned to the agent that is the topmost rank and zero assigned to the bottom-most rank. In practice it is typical to find only one agent at the topmost rank and a plurality of agents of rank zero.
The determination of the ranks is made by the modules and based on the solution method implemented. For example, the
To illustrate how GridLAB-D’s solver gathers values from multiple agents consider how the average
set add each sivide Phase 1
Phase 2
Phase 3
This process can be conducted for
In GridLAB-D parlance this process is conducted in the following three parallelized phases. (1)
In addition, GridLAB-D includes modules that allow implementation of the so-called “precommit” and “commit” passes before and after the three main phases, respectively. This permits solvers that collect global data to prepare and commit the global data that are affected, if any. There is also a finalize pass that is complete only when the clock is advanced to allow any objects that need to compute time-dependent updates to do so before the clock is advanced.
A number of built-in properties with special characteristics are provided to represent physical or stochastic processes and maintain endogenous or exogenous relationships. These are always updated before the precommit stage to ensure that all the global, module, and object properties are correct at a given time indicated by the global clock. These built-in properties are updated in the following order: links to external simulations (both read and write); random variables (based on the supported distributions provided by GridLAB-D); scheduled values (updates on the ISO “cron” schedule standard); load shapes (primarily used to shape values in time using queues, pulse-width modulation, amplitude modulation, or simple analog shapes); transforms (functions that update a property based on the values of other properties); end uses (structures that describe how electric loads are composed); heartbeats (events that occur on a regular basis independent of synchronization events).
All these updates (with the exception of finalize updates) return a time for the next expected event for the object or property in question.
The current implementation of GridLAB-D does not guarantee convergence in the overall solution. Modelers can create situations in which two or more agents cannot find a combination of states that satisfy their respective convergence criteria. The design of GridLAB-D’s overall solver assumes that such situations are not intentional but are due to modeling error. In this case GridLAB-D detects the resulting large iteration count without the global clock changing and stops the simulation. Modelers must implement noniterative methods of resolving such state conflicts based on the assumption that they occur at a time scale less than the time resolution of the main solver.
If necessary modelers can process events with a time resolution less than 1 second using a discrete fixed time-step solution method. The discrete time step used is the shortest time step requested by the agent(s) seeking subsecond processing. During processing of subsecond simulations event-driven simulation is disabled until all agents indicate that they no longer require subsecond processing, which typically occurs when the transient behavior settles to steady state and event-based processing can resume.
Parallelization of many event and time-step update computations is accomplished using a “thread group” strategy. This multiprocessor approach improves simulation performance by preallocating computational threads to groups of objects that can always be executed independently. The determination of parallelizability is based on the rank of an object and the type of event being processed. Ranks are established on the basis of which way information flows during synchronization events, if any, with high-rank objects depending on multiple low-rank objects during the bottom-up synchronization event. This method of parallelization has been shown to exhibit approximately linear scaling for the smaller number of computing units typically found in desktop computing systems [
Synchronization avoidance strategies are also included in GridLAB-D’s main solver to reduce the number of unnecessary events and improve overall simulation performance. Among these is the “valid to” time, which agents may set when the time of the next event in an agent is independent of external inputs to the agent and the agent is not expecting to make any changes to its internal state until that time. Using this valid-to time the main solver can avoid processing certain agent event when the outcome of the call is a forgone conclusion and the agent is not expected to change state.
The AC power flow solution is implemented using a modified Newton-Raphson method for meshed electric networks [
Building thermal response is solved using the equivalent thermal parameters (ETP) method, which implements both the time and temperature solutions to the second-order ordinary differential equation that describes the response of the indoor air temperature of a building to outdoor temperature conditions, internal appliance and occupant heat gains, ventilation gains/losses, solar gains, and heating/cooling system state. The building modules include thermostatic controllers and appliance models, some of which incorporate demand response control strategies. A retail electricity market is included that implements a double-auction for feeder capacity and determines the real-time price (RTP) at which feeder supply is equal to the total load. The retail market supports both demand response resources, such as thermostats and electric vehicle chargers, as well as distributed generation resources such as diesel backup generators, microturbines, photovoltaics, and energy storage devices.
GridLAB-D has been used to study a wide variety of power system problem as summarized above. In this section we examine a few of the results obtained in more detail and discuss the role that GridLAB-D’s solution method played in enhancing the analysis beyond what is possible using conventional simulation tools. Specific applications or recent interests include Volt-VAR optimization (VVO), dynamic real-time pricing (RTP) experiments, and integration of renewable energy aided by demand response. In some cases, reliable solutions can be found from other methods, while in others, the agent-based methodology provides unique insight. As validation is often a key question in agent-based systems, studies that have been validated against experimental field data will be discussed.
VVO is a traditional utility technique for reducing energy consumption or peak demand on an electric circuit by lowering the system voltage to the lower portion of the operational voltage band [
Each of the loads within the system is modeled as a complex process driven by inputs such as outside air temperature, occupancy, and thermostat set points. Each load is modeled as an agent with its own specifications and inputs. As the voltage varies throughout the distribution system, this is also used an input into the load model to quantify how a change in system voltage affects the energy consumption of the individual devices, and thus the overall system. For example, an electric water heater is essentially a resistive element at any given moment in time. As voltage is reduced, the power demand decreases. However, because of the closed-loop thermostatic control on the device, the same amount of energy is required to heat the water. This affects the duty-cycle behavior of the water heater and is tracked through time by each agent. The effect is that peak load (i.e., the maximum number of devices in the
In a study with American Electric Power (AEP), new VVO technology was tested in GridLAB-D on eight distribution circuits. The technology was then deployed and tested on those same circuits. Simulation predicted a 2.9% average reduction while deployment produced a 3.3% average reduction in energy consumption. However, there were significant differences on individual feeders that could be attributed to changes in load composition between the modeling and testing phases.
As part of the American Recovery and Reinvestment Act, a real-time pricing experiment was devised to engage consumer loads with five-minute energy prices, in-home displays, and equipment utilizing automated response [
The power system is modeled along with individual appliance loads. In addition, each thermostat is modeled with additional market controls acting as bidding agents, and a centralized auction agent collects all of the information and dispatches a price signal. When required, the communication system is also modeled separately (i.e., message packets are dispatched through a communication layer rather than directly within the software), including message delays and dropped packets [
By working through the design of the control system (both the distributed bidding agents and the centralized auction) via the simulator prior to deployment, a number of effects and impacts could be evaluated and redesigned. Effects that caused undue strain on the system (such as synchronization of loads in response to the price signal, errors in load prediction, or loss of data) and potential impacts (such as changes in customer bills, equitable rebate and incentive mechanisms, or violation of local constraints) were evaluated and modified. For example, it was found through simulation that a slight error in the agent bidding caused by the thermostat deadband could cause system oscillations in power demand under certain circumstances. This was potentially a major flaw in the control system and was corrected prior to construction of the thermostats that were deployed. Reports comparing field demonstration results to GridLAB-D simulations will be available in late 2014. The combination of linear and nonlinear solutions, noncontinuous state variables, binary operations, and sorting algorithms is not solvable through direct solution methodologies.
Environmental concerns have spurred a significant growth of electricity generation from wind power and other renewable energy sources in the last decade. The temporal and spatial variability of these resources present a number of challenges to power system operators, particularly with respect to power system reliability and reserve requirements. These technoeconomic challenges have typically limited wind penetration to at most 30% of grid generation. Smart grid technology now makes it possible to address these challenges using novel strategies such as demand response, whereby loads can be controlled in response to power imbalance or market price signals, and adjust their power demand. This essentially shifts part of the burden of balancing power from the supply to the demand side and results in a reduction of costly contingency reserves.
Using GridLAB-D in conjunction with MATLAB, Williams presented a smart grid model to assess the potential of mitigating fluctuations associated with distributed wind power by using self-regulating, thermostatically controlled heat pumps. The modeling framework for the smart self-regulating system is shown in Figure
GRIDLab-MATLAB modelling framework for a smart self-regulating system (reproduced from [
Different bus-level control algorithms were investigated using the model, and Figure
Effect of control on (a) load and (b) real power ramp rate (reproduced from [
The viability of demand response will require effective market pricing and the integration of price signals and load controls. Broeer et al. [
This model was validated using a physical demonstration project conducted in the Olympic Peninsula, Washington, USA. RTP simulation results obtained using a system comprising 10,000 residential houses and a grid-integrated 35 MW wind park are shown in Figure
Controlled behaviour of an individual house over a 24-hour period in response to varying wind power. (a) Indoor house temperature following wind power. (b) Variation of market clearing price and resulting turning off of loads as a result of changes in wind power (reproduced from Broeer et al. [
These GridLAB-D-based renewable energy integration studies indicate that controlled customer power consumption can be modified to facilitate wind energy integration without compromising customers comfort. Such DR strategies can effectively modify load flow, improve energy efficiency, and reduce contingency reserve requirements. The versatile GridLAB-D agent-based modelling provides an integrated framework to assess the potential of various demand response strategies and to support the design of virtual power plants that can effectively provide the additional contingency reserve and regulation capacity required to increase the penetration of variable renewable energy generation in the electricity grid. Again, this cannot be accomplished through the use of traditional solution methods without making gross over-simplifications of the underlying behavior and response systems.
As an open-source tool for the smart-grid research community there are many prospective contributors to GridLAB-D development and thus many directions where it can go. The US Department of Energy’s Office of Electricity, which currently directs the development of GridLAB-D at Pacific Northwest National Laboratory (PNNL) is committed to ongoing improvements in the power system, building, markets, controls, and telecommunications modules themselves. In addition, PNNL is making investments in internal solution methods, with special consideration being given to parallelization for high-performance computing platforms, cosimulation environments to simplify integration with multiple simulation environments, and improvements to allow more formal model verification and validation methods.
In this paper we have presented previously unpublished details on the agent-based simulation methods implemented in GridLAB-D. Our objective is in part to introduce the applied mathematics community to the challenges faced by those who employ agent-based methods and encourage greater collaboration between applied mathematics and power engineering communities. We have presented the rationale for adopting an agent-based simulation approach to simulating the smart grid, discussed some of the challenges with using agent-based methods to design interdisciplinary smart-grid technology solutions, and reviewed at a high-level some applications and studies that best exemplify the versatility and impact of GridLAB-D.
The authors declare that there is no conflict of interests regarding the publication of this paper.
This work was funded in part by the US Department of Energy’s Office of Electricity.