Collaboratively Optimizing Power Scheduling and Mitigating Congestion using Local Pricing in a Receding Horizon Market

A distributed, hierarchical, market based approach is introduced to solve the economic dispatch problem. The approach requires only a minimal amount of information to be shared between a central market operator and the end-users. Price signals from the market operator are sent down to end-user device agents, which in turn respond with power schedules. Intermediate congestion agents make sure that local power constraints are satisfied and any potential congestion is avoided by adding local pricing differences. Our results show that in 20% of the evaluated scenarios the solutions are identical to the global optimum when perfect knowledge is available. In the other 80% the results are not significantly worse, while providing a higher level of scalability and increasing the consumer's privacy.


I. INTRODUCTION
Three trends set a challenge for future power grids. Firstly, the transition towards sustainable energy sources leads to more renewable energy, but also to a larger fraction of unpredictable and intermittent production. Secondly, the electrification of various systems such as transport (electric vehicles), heating (heat pumps), and in general an increase of electricityconsuming devices leads to a huge growth of power consumption. And thirdly, the distribution of energy generation leads to a very different pattern in the load of the power transmission grid, than it was designed for.
The control of a vast number of small power units, both consuming and producing, is extremely difficult to do completely top-down, so a centralized control strategy cannot be used [1]. At the same time the power infrastructure is aging, and was not built for the emerging pattern of distributed prosumers [2]. This is why we need self-organizing control algorithms to schedule the use of electric devices while taking into account constraints of the power distribution infrastructure. This aids distribution system operators (DSO) and transport system operators (TSO) to maintain power balance and make sure there is no congestion, i.e. the grid capacity is not overloaded.

II. PROBLEM STATEMENT
The problem at hand is a variation of the economic power dispatch problem [3], [4], where the operation of a set of generators is optimized, such that power is provided to consumers in the most cost-effective manner. Traditionally this problem would include controllable generators (power generation plants), constraining transmission resources (transformers, stations, cables), and end-consumers having a static load. Currently, with distributed energy resources, and demand response-the possibility to control the load of consumers using flexibility of smart devices-the problem changes significantly.
A formal definition of the problem is as follows: With all parameters defined in Table I, the objective function as defined in (1) is the same as for the traditional economic dispatch, which can be summarized as: to find a set of electrical powers x i for every device i ∈ N in the grid, that minimizes the sum of all costs J i (x i ). In the original dispatch problem defined, N defines only the producers. However, in our problem formulation (1) N denotes the full set of devices in the grid, including producers and consumers. This means that contrarily to the traditional economic dispatch problem, not only the generators are controllable, but also the flexible loads of end consumers.
Note that the costs in (1a) do not necessarily refer to the financial cost of a dispatch. Rather, this generic model only optimizes some social welfare, which defines a desirable outcome for all participants involved. Depending on the situation at hand, one could minimize the amount of greenhouse gasses emitted, or maximize the amount of renewable energy used. However, for the rest of this paper the costs are defined as the energy losses of the devices. By minimizing the amount of energy losses we attempt to find a dispatch that is both economic and sustainable.
Note that powers are indicated from the grid perspective. That means positive powers indicate power going from the grid to the device, and negative powers are from the device back to the grid. * Z indicates a type of agent, which can either be MO for market operator, CO for congestion, LOAD for a static load agent, PV for an agent with photovoltaic solar panels, or ST for a storage agent.
Let us discuss the constraints of (1), i.e. (1b-1e). The constraint (1b) states that the sum of all powers in the system has to meet a specific target Θ. In a balanced (island) grid this target has to be zero for every time slot, but in a connected grid this target is the contracted load with the transmission operator. Put differently, Θ is the net power input of the grid to the rest of the world. Constraint (1c) defines the limitations of the physical power grid; a topology matrix A specifies which device is connected to which grid components, and b is the rating of those components-the maximum amount of power that it can safely transmit.
Constraints (1d) and (1e) represent the constraints of the devices in the grid. Specifically, constraint (1d) states that a device cannot produce or consume more power than it physically can, which is represented by lower and upper bound, x min i and x max i , respectively. However, (1e) also takes into account another private constraint C. We refer to this constraint as private, as it only concerns the state of a single device, and its state may concern information that we should not require to share with other parties. E.g. an end-user should not need to share its intent to run his or her washing machine with the rest of the neighborhood. This constraint differs per device, and specifies device limitations such as a battery that cannot hold more than a certain amount of energy, and cannot discharge when already empty. Flexible loads also may have constraints considering the time at which they can turn on or off based on the consumer's settings. We will elaborate on these constraints, as well as the cost functions of the device agents in Section III-B.

A. Related Work
In existing studies, different strategies are used for energy management. Four different main categories are defined in [1] based on whether there is a distributed aspect of decisionmaking and whether there is one-or two-way communication.
One of the strategies defined in [1] uses Transactive Control, where distributed systems decide locally on their device management, using two-way communication in a marketbased control scheme. The authors compare this approach with traditional top-down switching, price-reaction and centralized optimization strategies and show that transactive control is capable of using the full flexibility potential of the smart grid devices, while maintaining the end-user privacy. This claim is consistent with earlier studies [5], [6] that have shown that using a market-based control in a multi-agent system can provide equally optimal results as a centrally optimized system, under certain conditions.
Multi-agent based methods are already getting attention in the smart grid domain due to many desirable properties: robustness, user-friendliness, attack resistance and scalability [7], [8]. The economic dispatch problem is very well suited to be represented using multi-agent systems [9]. There are many studies that use a multi-agent based approach to model and solve the problem, such as the two-way message passing agents using consensus algorithms to find an allocation that is optimal [10]. Other methods use a completely decentralized method involving reinforcement [11], utility maximization [12] or model predictive control [13].
In [14], a strategy is proposed to schedule the power consumption and production of generators and loads based on a method called Negotiated Predictive Dispatch. In this approach wind and conventional generators, as well as static and flexible loads, are controlled on the transmission level. Agents propose power schedules, which are aggregated by a central market operator, which then updates a price program using gradient descent, meaning the price of congested timeslots increase, and that of underused time slots decrease. In doing so the authors show that they are able to balance power production and consumption, while satisfying power grid constraints. However, this approach focuses on the transmission level, whereas we consider the distribution level power grid to be at a much more imminent risk of congestion. At the transmission level, the scale is much larger than at the distribution level, both geographically and considering the power levels involved. Moreover, the power grid has a very different topology at the transmission level. A major drawback of this approach when applied at the distribution level, is that using a global power price for congestion mitigation is not only unfair for agents in non-congested areas, but it would also be converging to a solution much too slowly. A similar approach to the negotiated dispatch is provided by [15] in which a gradient descent on the pricing is used, followed by a local optimization of agents.
Another approach is given by [16], in which power programs are proposed by device agents that are able to satisfy cluster constraints to reach a target energy consumption, while also staying within the limits of the grid. In their approach, called Profile Steering, agents are only motivated to accomplish the cluster goal, which is to consume or produce energy at a specific target amount, and will propose alternative power programs whenever constraints are violated. Proposals that reduce the constraint violations the most, are then selected as the new candidate programs. In our view, the problem of this approach lies in the lack of motivation for the participant to sacrifice private rewards for running an alternative program. The only objective is the cluster goal, which means that the price of having limited resources is paid by a select set of individuals that offer the most flexibility, or conversely, the profit is reaped by those who are able to maximally make use of remaining capacity.
The authors of [17] propose an approach based on DCOPs (Distributed Constraint Optimization Problem) to solve the economic dispatch problem, as well as the real-time demandresponse balancing problem. Their algorithm is able to find optimal solutions for a system of controllable generators and (predicted) loads, taking into account transmission network constraints. They show that finding the optimal solution using Dynamic DCOPs is possible, but their solution does not scale very well. A relaxed version of the problem, in which soft constraints may be (temporarily) violated, scales better, but still for relatively small time horizons, even considering their implemented solution on a GPU.
We note that related work on the topic of this chapter listed here is not exhaustive. For further detailed background, a comprehensive overview of different mechanisms for solving optimization problems in smart grids, particularly where demand response is involved, we refer to [18], [19], [20].

III. SELF-ORGANIZING ECONOMIC DISPATCH
Our contribution is a self-organizing method for coordinating the power scheduling of smart grid devices on the distribution level energy grid. This is a multi-agent based heuristic approach for find a solution to the economic dispatch problem as defined in (1). This multi-agent based approach allows for great scalability, while ensuring privacy and final control of the end-user.
At the distribution grid level, devices are typically consumer devices, such as PV-panels, household batteries, heat pumps, ventilation or air-conditioning units. The controllability, or flexibility of such devices is often limited, and bound by the device limitations and the user preferences. With increasing numbers of such devices, using a strictly "top-down" approach is intractable, since the search space grows exponentially with each added device. For this reason we use a hierarchical approach, in which the market operator delegates its task to intermediate "congestion" agents which then independently solve subproblems-which is to make sure that the total power throughput at their allocated point does not exceed a certain threshold. Making such subdivisions is justified, since in the power grid, transformers are effectively branches of the topology, and two nodes under different transformers are independent of one another; hence, transformers are the logical point to place congestion agents in the control hierarchy.
Our approach, denoted as Local Pricing Receding Horizon (LP-RH) is based on the economic incentive that end-user devices should have, to provide its owner with a service, in the most affordable way. Put differently, the system will use price differences to stimulate agents to schedule their power consumption or production in a balanced way, such that any grid constraints are satisfied. The overall scheme is simply to gather expected power programs from the connected devices, and then iteratively adjust energy prices to steer the agents into a certain power program. The method is explained in more detail in the following section, and is similar to the Negotiated Price Dispatch proposed by [14].

A. Local Pricing Receding Horizon
In order to create a power planning taking into account forecasts and/or predicted power programs of clients, we use a Receding Horizon (RH) approach, depicted in Fig. 1 which means that at any point we only take a fixed horizon of T Fig. 1. The principle of a receding horizon market is that every time step the time horizon for optimization shifts by one. Planned power programs (white) are turned into fixed contracts for the current time step (green), which determines the outcome of the algorithm. This figure is redrawn from [14].
repeat 5: for all j ∈ M i do 6: end for 8: 11: until ǫ ≤ ǫ max 12: end if 13: return x i program time units (PTU) into account. A PTU is typically 15 minutes or one hour, throughout this paper we will use PTU length of one hour so T = 24. However, none of the mentioned approaches are limited to this convention. When the algorithm has converged and a power program is found for the next T PTUs that satisfies all constraints, the first PTU becomes the "current" situation, and the projected power program becomes a contract. The time horizon now shifts by one, and the entire system starts again.
The Local Pricing Receding Horizon algorithm is shown as pseudocode in Algorithm 1; an example graph on which the algorithm could run is shown in Fig. 2. The algorithm describes how any agent finds a new power program x i to satisfy its local constraint C i . Every device agent in the grid does this by solving a local optimization problem (line 2), taking into account local constraints as explained in Section III-B.
Prices ρ are updated by the market operator agent and Simple example topology of a graph which could be running the LP-RH algorithm. One market operator (M ) is connected to two congestion agents (C i ), which are connected to a total of five device agents (D i ). The device agents can represent PV panels, consumer loads, storage agents, or any other leaf nodes in the power grid. Topologies where congestion agents are connected to more congestion agents are also possible.
the congestion agents in order to get a power program x satisfying the grid constraints. When the market operator or any congestion agent runs the LP-RH algorithm, all j ∈ M i , where M i are the immediate children of agent i, are requested to propose a power program based on the price ρ (line 6). Here the function is called recursively until all agents have determined a new power program. Note, that if any of the children are congestion agents, they determine their power program by forwarding the prices to their children and returning the sum of all received programs. Many agents will not know exactly how they will function in the future, as contexts might change, a user might behave differently than anticipated, or weather conditions may act up; this is why receding horizon method updates the time iteratively. With the sum of all power programs, the market operator can determine the error ǫ, which is the sum of all local constraint violations C for every t ∈ T . In line 9 the constraint C i is used to compute the local constraint violation and stored as an error variable ǫ. The value of ǫ is taken into account to adjust the prices in line 10. In the "adjustPrices" function, a gradient descent approach is used, which linearly interpolates the last two errors as a function of the price. We then choose the price at which the error is projected to reach zero. Note that this means we assume the reaction of the devices linearly depends on the prices, which will only hold under very specific circumstances. To overcome this issue, we iteratively repeat the process until ǫ ≤ ǫ max and assume that a non-linear response can be described as a series of linear pieces. The parameter ǫ max then represents an upper bound on the error, which we can use as a convergence criterion.

B. Agent Behavior
Agents in the system are characterized by the device that they have to assign a power program for. In the distributed case, every agent locally optimizes a local cost function J i , which is part of the global optimization problem (1). Also, local constraints C i have to be taken into account which are represented by constraint (1e). The behavior of the agents can be defined by three functions for the costs, the local constraint and the power program; an overview of this is shown in Table II. In our model we consider the following types of agents: 1) Market Operator: This is the root node of the tree (M in Fig. 4), as far as the local distribution grid concerns. In the physical grid, it corresponds to the transformer that connects the local low voltage (LV) grid to the medium voltage (MV) grid. We assume that there is no energy loss at the market operator, so J MO = 0.
Its goal is to find a solution to (1), and its private cost would be the same as the target constraint in (1b). The market operator runs Algorithm 1, using a deviation of the target profile Θ as an error, which is minimized by the algorithm. Hence, its local constraint is defined as wherex denotes the power program of the market operator.
Since the market operator is not a device in the grid itself, its power is the sum of the powers of its children, which in case of the market operator are all nodes in the cluster: The value of (3) can either be negative or positive, which respectively means either the total power production or the total consumption is too high. The market operator sets an initial price of ρ = 0.5 for all timeslots, and then uses Algorithm 1 to minimize the constraint value until it reaches zero, in order to satisfy the global constraint (1b).
2) Congestion Agent: This is an intermediate node on the grid tree (C in Fig. 4) connected to a parent node who is either the market operator or another congestion agent. It corresponds to a component in the grid where congestion might potentially occur, such as a transformer. Equivalently to the market operator, we assume that no energy is lost here, so: This agent has a constraint that aims to limit the power usage of that part of the grid, this corresponds to the constraint (1c). The congestion agent also uses Algorithm 1 to minimize the error of its local constraint, which is defined as Here β i is the power limit of the agent i, which means it is the maximum power throughput of the grid at the point i represents. Againx i denotes the power profile of the congestion agent, but is now equal to the sum of all devices under the current node: Similar to the constraint of the market operator in (3) the constraint value can become negative or positive, and is used to compute the error ǫ in Algorithm 1.

3) Load Agent:
This is an agent responsible for an uncontrollable load in the grid (represented by any device agent D in Fig. 4). This could be a consumer household, an office, street lighting, or any other non-flexible load, and thus only participates in the problem as part of constraint (1b). In the distributed system however, it is responsible for making a forecast of the power usage, and this forecast will be updated with more accurate information as the time horizon shifts.
The load agent has no attached cost in the global problem, and no need to locally compute any optimal behavior. This is equivalent to stating that its cost and constraint correspond to Its corresponding load profile x i is fixed to some profile that constrains the global problem (1). In our experiments its values are taken from real households as described in Section IV-B.

4) PV Agent:
The PV agent (any D in Fig. 4) has some flexibility to offer to the optimization function by allowing curtailment in reference to the expected generation. We assume that curtailment is binary, in that either the PV generates power as normal, or it is switched off and produces no power at all. Curtailing means that there is potential energy lost, and hence the cost function of a PV agent is defined as where x ′ i indicates the expected power, when not curtailing. This expected power is taken from the scenario, which will be detailed in the Section IV.
When reacting to prices in the distributed system, a decision is made in order to decide whether to curtail based on the price profile. If the operational running costs γ i of the PV is more than the power that would be generated by it, there is no point in running the generator (from an economic point of view). Hence, the local constraint and its corresponding decision rule of a PV agent can be written as For the PV agent it also holds that the corresponding expected power profile x ′ i determines the global problem (1). Its values in our experiments are taken from real PV panels as described in Section IV-B. 5) Storage Agent: A storage agent (again a leaf node D in Fig. 4) provides flexibility by allowing to store some energy in a local storage like a battery or a heat buffer. There are limits to the amount of energy that can be stored, either because of the physical limitations of the storage device, or because of the end-user settings. Moreover, a storage agent has some efficiency, which defines energy loss when energy is put into it, or out from it. This means that we can define the cost function of the storage agent as the energy lost during charging or discharging where This difference makes sure that the loss is correlated to the internal power of the battery when charging or discharging. I.e. x i defines the power at the grid side of the storage, when charging a lower power effectively charges the battery, and conversely when discharging a higher power is required to provide some power level to the grid. In order to define the constraints of the storage agent we must define the update function for the amount of energy e i stored as the cumulative sum of the powers Here λ i represents the leakage or self-discharge rate of the storage agent i, and e i0 is the stored energy at the start of the experiment. Let us now define the following constraints on the storage agent The minimum and maximum energy values are defined by e min i and e max i , respectively. For a storage device, the power limits denote the maximum charge and discharge rates. They are defined by x max i and x min i , respectively, in (1d). A special case of a storage device is a heat pump, which (electrically powered) heats a house in order to keep the temperature within comfortable levels. The heat pump only allows charging and only discharges through leakage, hence for a heat pump x min i = 0 and λ i > 0. When a storage agent has to update its expected power profile in line 2 of Algorithm 1, some response function (f (ρ) in Table II) is required, which is "economically sane" and has the following characteristics: • return x max i for low prices and x min i for high prices, • be a monotonically decreasing for increasing prices, • have a "plateau" of zero power response for some intermediate price (ρ = 0.5), which is wider for less efficient devices. The final characteristic allows more efficient devices to respond to subtle price change, and have less efficient devices respond to more extreme prices. This way devices with a higher efficiency are used first when flexibility is needed, and (when parameterized correctly) less efficient devices will only be used when required. In our implementation we chose the simplest response, where the agent linearly decreases its power from x max i to zero at ρ = η i /2. It then stays at zero symmetrically around ρ = 0.5 until ρ = 0.5/η i , and then decreases its power response linearly to x min i . This power/price relation is depicted in Fig. 3. An alternative strategy for the storage agent would be to make use out of any differences in the price, charging and discharging as soon as the price differences are large enough to overcome its efficiency. From a strictly economic perspective, this is the optimal strategy to maximize its own benefit. However, this leads to very "binary" behavior with minimal and maximal charging rates [12] and thus, little room for optimizing from the market operator and congestion agent. Therefore, a linear strategy is implemented as depicted in Fig. 3, allowing to solve the overall optimization problem (1).

IV. EXPERIMENT SETUP
The LP-RH algorithm was empirically evaluated by running a simulation of an LV grid with a set of realistic household load profiles and PV production profiles for a series of 24 PTUs.

A. Distribution Network Topology
For the topology of the network we use the European Low Voltage Test Feeder [21] network. This dataset is used to benchmark power and energy algorithms on realistic European distribution networks. In this paper we superimposed six points on the topology, where we monitor and mitigate any potential congestion. These points are strategically chosen to separate the problem into independent subproblems. The resulting topology with the congestion points are shown in Fig. 4.

B. Household Load and PV Profiles
The household consumption and production profiles are taken from a pilot study [22], in which 92 residential consumers were monitored over the course of a year (from March through November 2018). The data was preprocessed such that we have separated information on the consumption of houses, and of the PV installations. Data is anonymized and randomized per month, so that we can select data from any specific month for a base load of a household, or a residential PV installation.
In the experiment the 54 households from Fig. 4 were assigned a random instance of the load and PV profiles from the same month (i.e. all households were equipped with PV panels). The daily load consumption varied between 4.98 kWh and 29.39 kWh, and the total PV production varied between 826 Wh and 18.8 kWh. Furthermore, 16 randomly selected Market operator Congestion agent Household Fig. 4. The topology of the IEEE LV feeder network used for the simulation. The figure depicts the connections between household consumers, the intermediate congestion agents, and the root market operator. The "filled" markers represent the agents from Section VI. households were assigned a household battery, and again 16 were chosen to have a heat pump installation.
Every household and PV installation in the simulation would select a random profile from the dataset, which was used as its power profile. The objective Θ was set to a total net consumption of the LV grid using the mean total power consumption of the houses including PV production. Choosing the target profile Θ in this way corresponds to a situation in which the energy provider of the simulated neighborhood would agree to a contract for the average behavior of the households, and subsequently attempts to use flexibility to account for any deviations from the normal.
The batteries were all dimensioned with storage capacities of e max = 10.8 kWh, and maximum charge and discharge rates of x max = 4000 W and x min = −4000 W, respectively. The batteries charging efficiencies were all set at η = 0.9. The heat pumps were estimated to have a working energy capacity of e max = 2 kWh, this means the difference between the thermal energy capacity of the house at the minimum and maximum comfortable user temperature is 2ψ kWh, where ψ = 4.0 is the coefficient of performance of the heat pump. Then, the heat pumps have a x max = 1600 W and x min = 0 W, an efficiency of η = 1 and a constant leakage rate of λ = 360 W. Finally, to ensure convergence, the maximal error value is set to ǫ max = 10 −3 in the experiments for this paper

C. Forecast Uncertainty
The predicted load and production power profilesx of the load and PV agents were generated by taking average profiles of the complete dataset. These average profiles are considered as taken from historic data and hence, provide a ground for predicting the power program of future PTUs. When agent i determines its power prediction x ′ i , it will compute a weighted average between its assigned power profile x i and the average profilex, such that: such that at t = 1 the prediction equals the selected profile x ′ it . At t = T , the prediction is simply the average powerx t .

V. CENTRALIZED SOLVER
In order to address the performance of the LP-RH algorithm, a centralized optimization approach is also introduced to provide lower bounds to its results. A mixed integer linear program (MILP) solver was used to find these bounds for the problem stated in (1). The centralized optimization approach considers the exact same scenario that was solved by the decentralized algorithm; the energy loss is minimized and the same set of constraints apply. A fundamental difference lies in the availability of information. Whereas detailed information is only shared locally in the LP-RH algorithm, the centralized optimization approach assumes complete knowledge of the current system state for the decision-maker; i.e., no limits are imposed on the spacial flow of information within the network. With these features in mind, two versions of the MILP were formulated: Receding Horizon Centralized Solver and Perfect Information Centralized Solver.

A. Receding Horizon Centralized Solver
The receding horizon centralized solver (RHCS) is the most similar to the LP-RH algorithm. It uses a receding horizon approach (as depicted in Fig. 1) to find an ideal dispatch solving the consecutive sub-problems. Uncertainty about future device states is again simulated by (17). Because this solver has perfect information at the current state for each iteration of the receding horizon, its solution represents a lower bound on the solution found by the LP-RH algorithm.

B. Perfect Information Centralized Solver
In the perfect information centralized solver (PICS), a single centralized optimization problem is solved for the complete dispatch. In addition to perfect spacial information, this version of the MILP also has perfect temporal information about the complete system state; this means that no uncertainty about future states is simulated. Referring back to (17), this is equivalent to setting α = 1, which results in perfect predictions for each profile. The solution of this MILP represents an absolute lower bound for problem (1).

VI. RESULTS
In this section the results of the described experiments are shown. Before comparing the performance of the different solvers, which is done in Section VI-A, the behavior of the LP-RH algorithm is shown in this section. The graphs in this section show examples of single simulation runs, demonstrating the behavior of the different agent types. Powers are shown as power consumption, this means a net consumption is shown as positive power, and conversely negative powers indicates a net power production. In Fig. 5 the final result of the market operator is shown, where the market operator has found a price profile such that the target profile is met exactly. Fig. 6 shows the power profile of one of the three congestion agents that is directly connected to the market operator. Its power congestion limits are set such that in the peak moments of the day there is some congestion expected. This results in a price difference shown in the power program, as around the peak PV production (t = 12, 13, 14) the local price is slightly lower than the market price, leading to a lower net power production. Similarly, at the end of the day (t = 19, 20, 21, 22) a positive power congestion was mitigated by increasing the price.
The power program of a heat pump agent is shown in Fig. 7. This heat pump is connected directly to the congestion agent from Fig. 6, hence its price profile should be identical. What is most obvious in this graph is that the high price at t = 12 leads to a zero power consumption, and quickly after that, the power consumption rises in order to maintain comfortable temperatures. Again, around t = 19, 20, 21 the relatively high prices lead to a power consumption of zero, which was apparently feasible because of the high power consumption leading up to it.
Finally, Fig. 8 shows the total power programs of all devices of the four classes in this experiment summed up. In this figure, the power profiles of the loads and the PVs are the direct result of the chosen profiles, and are the input for problem (1). We can see that for the majority of the experiment, all used flexibility is from the heat pumps with the high efficiency. Only at times of the congestion will the less efficient battery agents be used.

A. Comparison with Central Solvers
In a validation experiment 105 random problem instances (15 permutations for seven months) were created, and solved by the three different algorithms. In Fig. 9 the results are shown for the feasible instances. A solution is considered  feasible if all three solvers were able to find a solution that satisfies all constraints. The LP-RH algorithm did not find a correct solution for 26 problem instances, 11 of which were found to be overconstrained according to RHCS. For the feasible instances the LP-RH algorithm found solutions that were not significantly worse than the PICS, and in 21 instances found a solution with the exact same cost. In 27 instances LP-RH found a solution that was equally well as the RHCS or even slightly better-this seems to contradict the initial statement that RHCS acts as a lower bound for LP-RH; however, this is due to the way both solvers deal with uncertainty. The LP-RH algorithm allows the congestion agents to violate power constraints for future PTUs, as long as eventually they are not actually congested due to imperfect forecasts according to (17). The RHCS algorithm does not allow power constraints to be violated at any point in the future, Power loss (kW) Fig. 9. Compared with centralized optimization solvers, the LP-RH algorithm performs equally well. In this box plot the median is shown as a line, the boxes indicate the 25% and 75% percentiles, and the tails are capped at a maximum length of the box width; outliers are drawn separately. and hence might react too strict when a future congestion is mistakenly predicted. In the set of infeasible problems, i.e. problems that do not have a valid solution satisfying all constraints, LP-RH does find solutions that minimize the power loss. However, since these solutions either temporarily overload congestion agents (where x a gen > β i ), or does not match the target profile Θ exactly, they are not a fair comparison, since they do not strictly solve (1). In a separate run the problems were relaxed, by increasing the power rating of the congestion agents. This resulted in the LP-RH not being able to find a feasible solution in only 14 problem instances, but the results were otherwise very similar to the ones reported here in Fig. 9.

VII. CONCLUSIONS
We have introduced an algorithm for self-organizing smart grids, by solving the economic dispatch problem using a decentralized market based approach with local pricing. The LP-RH algorithm using a hierarchical approach was shown to be able to solve the problem using a fairly simple interaction scheme in which pricing information is sent down the hierarchy tree, and planned or forecasted power programs are sent back up. Using a gradient descent approach, the market operator is capable of tuning the pricing to find feasible solutions to minimize the power losses in the grid.
In our experiments we found that in 20% of the problems LP-RH did not perform any worse than a perfect-information centralized solver. In the other 80% our algorithm did not perform significantly worse. The benefit of LP-RH over a centralized solver are in the robustness and scalability of the solution, as well as in the preserved privacy of the endconsumers.
In the implementation of the response of the storage agent, we intentionally did not choose to respond with an optimal power program given the price signal. Particularly, when a high price is expected in the future, the agent will not "proactively" charge to avoid having to charge later, or vice versa. This behavior could be implemented at the agent quite easily using a dynamic programming approach, but it would lead to very extreme behavior, e.g. very binary behavior of charging or not-charging at full capacity even for small price differences. This binary behavior is hard to deal with in the rest of the hierarchical tree, and does not lead to any problems per se, but might be improved upon in a future continuation of this work.
Other variations of the problem may include other device types, for instance time-shiftable devices such as washing machines or dishwashers. Also, using electric vehicles (EV) as an additional type of agent, providing energy flexibility is a very interesting extension, which will undoubtedly lead to other complications because of their high power ratings. Finally, an integration with a real time balancing algorithm such as [23] would be very fruitful to complete the needs of the future smart grid.