UTILIZING MATPOWER IN OPTIMAL POWER FLOW

This paper shows how MATPOWER, a MATLAB Power System Simulation Package can be used for optimal power flow (OPF) simulations. MATPOWER is a package of MATLAB files for solving power flow and optimal power flow problems. It is a simulation tool for researchers and educators which is easy to use and modify. An OPF simulation gives the active/reactive power generated and purchased at each bus and the nodal prices. The nodal prices are of special interest because they reflect the marginal generation and load at each bus (node). These prices are also called locational prices and are found to be the optimal prices, maximizing social welfare and taking transmission constraints into account. They can provide the right incentives to market players and to society. When transmission congestion is present this creates market inefficiency, since cheap distant generation may be replaced with more expensive local generation. We are especially interested in OPF as utilized by a centralized dispatcher, and we also describe the features relevant for the Norwegian and Nordic markets. We optimize three cases and analyze the economic consequences of different network topologies and transmission congestion.


1
INTRODUCTION Deregulation has required a stronger focus on the economical aspects of the Nordic power market and a need for economic analysis of power transmission services.
The optimal prices in a transmission network are the nodal prices resulting from an optimal power flow (OPF) performed by a centralized dispatcher (e.g. an independent system operator -ISO).The OPF model is implemented in parts of the United States (e.g.PJM), and in Australia and New Zealand.In the Nordic region area (zonal) pricing is used.This is a simplification and aggregation of nodal pricing.The Nordic power system does not include a central scheduling/dispatching entity, only a central power exchange (Nord Pool).Generators and loads schedule by self-dispatch.There is one power exchange and 5 transmission system operators (TSOs) in the Nordic region.
When congestion is predicted in Norway, two or more spot areas are defined.This procedure is called market splitting.In these cases the players must specify their bids in the different spot price areas.Clearing at Nord Pool determines that the prices in the different areas are such that the power flows do not exceed the specified constraints.A surplus area will then receive a lower price than a deficit area.The difference between the respective Area Prices and the System Price is called the Congestion Fee. 1 Statnett (the Norwegian system operator) defines the fixed price 2 areas in Norway according to its information on the likely pattern of flows on the system for a certain period of time.Congestion inside the price areas is managed by use of counter trade. 3e emphasize OPF in the context of nodal pricing and describe how it can be used for area pricing.This paper shows that even a simple system can give interesting results, when an economic analysis is conducted on the system.

2
OPTIMAL POWER FLOW AND NODAL PRICES OPF is a technique that has been used in the electricity industry for several decades.The objective in OPF is to minimize generator operating costs.

2.1
Formulation of OPF The objective function is the total cost of real and/or active generation.The costs may be defined as polynomials or as piecewise-linear functions of generator output.The problem can be formulated schematically as:

Min (costs of active and reactive generation) subject to active power balance equations reactive power balance equations apparent power flow limit of line, from and to side bus voltage limits active and reactive power generation limits
To guarantee that the OPF can be solved, one of the zones is assigned a zero phase angle by setting its phase angle upper and lower limits to zero (the swing bus).
The post-contingency interface flow limits are included in the OPF.If all n-1 contingencies were considered, there would be a constraint for each line contingency for each interface.This would make the problem size too large for efficient computation.To limit the number of constraints, the OPF is solved without contingency constraints, a contingency analysis is performed, and then the OPF is resolved with new constraints added only for those contingency outages that result in overloads, and only for the interfaces that are overloaded.
Generator cost functions are represented as quadratic functions: ( ) where G P is the produced power and a, b and c are constants.
The quadratic cost functions make this OPF formulation a problem that can be solved with a quadratic programming (QP) algorithm.The QP algorithm used can accept upper and lower bound limits on each variable.
The DC OPF power flow model assumes that only the angles of the complex bus voltages vary, and that the variation is small.Voltage magnitudes are assumed to be constant.Transmission lines are assumed to have no resistance, and therefore no losses.This is a reasonable first approximation for the real power system, which can be considered only slightly non-linear in normal steady state operation.In MATPOWER, a DC power flow is modeled by setting the resistance to zero for the transmission lines.An alternating current (AC) power flow is modeled by using values for both resistance and reactance.
In electricity markets the loads are usually relatively inelastic, meaning that they do not change as much as the price changes.When this is the case, the OPF objective is to minimize total generation cost subject to all relevant constraints.In MATPOWER it is possible to specify the inelastic power demand at a bus.The current version of MATPOWER cannot take elastic demand into account, but in principle this should be possible to do in the future.To model this, the coefficients in the cost function should be negative, because the load pays for the energy.A typical elastic demand is decreasing with increasing price (e.g. is a typical demand function, p is price).There should also be an additional constraint keeping the power factor4 constant.
In this paper a full AC OPF is used.For a detailed mathematical formulation of the OPF the reader is referred to [1] and [4].

2.2
The Interpretation of the Lagrange Multipliers Any optimization problem will have a Lagrange multiplier λ associated with each equality constraint in the problem.The Lagrange multiplier is the marginal value of the respective constraints; the instantaneous price of the next small increment of load.If no interfaces that are congested, then the zone price for all zones will be equal in the DC case (no losses) and almost equal in the AC case.The small difference is due to the effects of transmission losses.
In the decongested case an increase in a zone load may be met by an increase in output by a generator in that zone, or by an increase in generation in another zone or zones.The generators with the lowest cost and which are not at their maximum output are dispatched first.
When congestion occurs, zone prices across the system are different.Then the higher cost generators within the same zone have to run, because a contingency or transmission line makes the lowest cost generators in others zones unable to supply load.

2.3
OPF Used in a Deregulated Power System Generators send a cost function and loads send a bid function to the ISO.The ISO has a complete transmission system model and can then do an OPF calculation.The zone prices determined by the OPF are used in the following way: • Generators are paid the zone price for energy • Loads must pay the zone price for energy If there is no congestion and the ISO has run a DC OPF, there is one zone price throughout the whole system.Both generators and loads pay the same price for their energy.When there is congestion, zone prices differ, and each generator and load pays its zone's price for energy.
If there are no losses in the transmission system then some interesting relations can be shown to be true: where i λ is the price in zone i.This implies that the ISO has to pay all the money it collects from the loads to the generators.However, when there is congestion: In fact, there will always be a surplus.The money paid by the loads is greater than the money paid to the generators: The OPF performs the function of controlling the transmission flows and thereby system security.Congestion will give rise to different zone (nodal) prices and the ISO collects a surplus.In the AC case there will be some small modifications of the above results (e.g. the left and right terms in (3) will be almost equal).

THE THREE TEST CASES
We use an eleven-zone power system from [4] to illustrate the aspects of nodal pricing and congestion, shown in Figure 1.Each zone consists of a single bus.The zones are connected by interfaces.Each interface consists of multiple identical transmission lines.
Individual lines can be out of service, one at a time, and this event is called a contingency.When a contingency occurs, the power flow increases in the remaining lines in the interface and on lines in other interfaces.Flow limits immediately after a contingency are usually higher than in normal operation.Operators are expected to be able to reduce flows to normal limits before line damages occur.To reflect this common practice, postcontingency interface limits are 10% higher than normal interface flow limits.

3.1
Base Case Table 1 shows the generation and load cost data (i.e. the b and c constants).Note that the value of the a constant does not affect the optimal solution which is a well-known fact from optimization theory.It is set to zero in the calculations used in this paper.The loads are 1000 MW for all zones except zone 11 which has a load of 1500 MW.The willingness-to-pay (the negative b constant) is 200 Euro/MWh for all zones.The data for transmission lines can be found in the appendix.In the base case the transmission system is as shown in Figure 1.Contingencies are checked but no contingencies are binding at the optimal solution reached by the OPF.Tables 2 and 3 show the base case OPF generation and load results, the zone lambdas and total export or import.
Bus 11 has two generators, and in MATPOWER this is modeled by an introduction of a dummy bus for the most expensive generator.The transmission line connecting it to bus 11 has almost zero impedance.All load is being supplied and all the generators are supplying some power with the exception of the generator in zone 3 and the second generator in zone 11 which are so expensive they are not used.Note that any generator not at its minimum or maximum will have the same incremental cost in a DC OPF (almost the same incremental cost in the AC OPF).
In the base case all zones have almost the same zone price (λ).Note that zone 11 is importing 800 MW of power, its first generator is at its maximum output of 700 MW and its second generator is not producing.
In the decongested case, the transmission system can withstand any first contingency outage of a single line in any interface and still not be overloaded.Total generation is slightly higher than total consumption, due to grid losses.The difference between total generation and load equals total grid losses.

Congested Case
In this case we create congestion by changing the transmission system topology.All lines in the interfaces between zones 6 and 11 and zones 7 and 11 have been completely outaged.Table 4 shows the resulting congested system export/import data.
The active or binding constraint is a contingency of one line in the zone 10 to zone 11 interface which brings the remaining line in that interface to its postcontingency flow limit.This transmission limit is found by the calculation, 500 MW -250 MW + 250 MW * 10 % = 275 MW (data for the line from 10 to 11 is found in the appendix).
The congestion results in an import reduction into zone 11 from 800 MW in the base case to 273.4 MW.Therefore generation in zone 11 must increase from 700 MW to 1226.6 MW to supply zone 11 load, and this must all come from the very high priced second generator in zone 11.The reduction of 526.6 MW in generation exported from the remaining zones results in their zone lambdas dropping slightly to 29 EURO/MWh while zone 11 experiences an increase to 40.49EURO/MWh due to the expensive second generator.

Congestion in a Networked System
When congestion occurs on the radial interface in the previous case, there are two different zone prices at each side of the interface.Congestion in an interface that is part of a networked (meshed or looped) system will give unique zone prices at every bus.Congestion on any interface in a networked system affects zone prices in the entire networked system.This effect is illustrated by restoring the interface from zone 7 to zone 11 to service.Only the interface from zone 6 to zone 11 is out of service.Table 5 shows the AC OPF results.Because of the increased interface capacity to zone 11, more power is imported and the more expensive generator in zone 11 now operates at 188.7 MW.This is a reduction of 337.9 MW from the previous case and lowers the zone 11 price.
The interface from zone 10 to zone 11 is still the binding constraint, but this interface is now part of a networked system with unique zone prices.Every time the load or generation changes in a zone it affects the flow on the congested interface, even when the changed load or generation is in a zone far from that interface.Higher zone prices appear where decreases in generation or increases in load increase the flow on the congested interface.Lower zone prices appear where in-creases in load or decreases in generation decrease the flow on the congested interface.

ECONOMICS AND TRANSMISSION CONGESTION
In economics the ideal is a perfectly competitive environment, where goods wanted by consumers are produced at the least possible cost.In electricity markets this would imply that consumers could buy power at the same price without respect to location.
The degree of efficiency is measured by the social welfare, which should be maximized.The social welfare is the sum of the producer and consumer surplus, or alternatively the sum of the generator costs and the consumer benefits.The competitive benchmark is marginal cost pricing, resulting in maximum social welfare.In a competitive market more goods are produced at a lower price than in any other form of market.
However, a congested transmission system prohibits customers from buying power from lower cost generators.This implies that transmission congestion introduces inefficiency in electricity markets.
To study what the topology of a congested network involves, we analyzed our three test cases with respect to the social welfare and the income to the ISO.The results are shown in Table 6.The base case gives the highest social welfare, followed by the CNS case.As expected social welfare decreases as the number of line outages increases.When the lines 6-7 and 7-11 are out of service (case CC) there is less export/import, and some of the high cost generators have to be scheduled, which increases the cost.For the CNS case the most expensive generator at bus 11 is running and there is more export/import than in the CC case.
The income to the ISO is highest for the CNS case, which has different prices at every bus and is lowest in the decongested case.The income to the generators (producer surplus) is highest in the base case, closely followed by the CC case.The consumer surplus is highest in the CNS, followed by the base case.We also see that there is a 16.35 MW net export in the base case, due to grid losses.
Another interesting aspect is how large the capacity of the congested interface should be before the price would be equal at both sides (i.e. to decongest the interface).For the congested case we found that the interface between 10 and 11 had to be 760 MW for the prices to be equal.This is an increase of 485 MW in capacity or 176 per cent.For the meshed network the interface had to be 485 MW, which is an increase of 210 MW or 76 per cent.In the congested case the price differential is 11.65 Euro/MWh between buses 10 and 11.To make investments in transmission lines profitable for producers at bus 10 their benefits from the line must outweigh investment costs.Benefits must be greater than 11.65 Euro/MWh during the lifetime for the project in the CC case.
The greatest price difference over an interface appeared between buses 10 and 11, with bus 11 as the higher price bus.The producers at bus 11 experienced higher profits and consumers received lower surplus during congestion.We calculated the producer and consumer surplus in Table 7.The potential for creation of transmission congestion and thereby exploitation of market power is therefore considerable at bus 11.To model market splitting 5 we could compare the power flows from the unconstrained solution (i.e. the base case) with the interface limits defining the price areas, taking into account contingencies and security limits.When the unconstrained transfer exceeds the transmission limits, each price area becomes a separate market with the constraint that the power flow from one area to another does not violate the interface limit.In the case of two areas the power balance constraint for area A (the surplus area) states that the generation in area A is equal to load in area A plus maximum transfer from area A to area B (the constrained area).Similarly the area B constraint states that generation in area B is equal to load in area B minus the maximum transfer from area A to area B. New transmission capacity constraints expressing the maximum transfers are then replacing the unconstrained transmission limits.In practice price areas are defined pragmatically, based on operational and engineering experience.Analytical 5 Strictly speaking the relationship between the nodal prices and area prices in Norway is; nodal price = Area price * factor, where the factor is the marginal losses in the grid.determination of price area divisions in a meshed network is still an unresolved issue [5].
The Norwegian transmission provider (i.e.Statnett) can also use the OPF to analyze the impacts from new transmission lines or outages.

5
CONCLUSIONS This paper demonstrates how MATPOWER calculates the nodal prices as a result of an optimization of the minimum costs of active and reactive generation, taking into account the relevant constraints.We studied three cases: one base case, one congested case and one congested case in a meshed network.We found that when we had a congested case with two interfaces out of service it gave rise to a significantly higher price in one of the nodes.When one interface was out of service and the network was meshed it gave rise to different nodal prices at every node.Some of the prices were higher or some were lower than in the decongested case.We calculated the social welfare, producer and consumer surplus and income to the ISO for the different networks.Congestion in a network decreased social welfare and created inefficiency.
We also found how much we had to increase the capacity in the lines to decongest an interface.Bus 11 was found to be a market where market power could be exploited because the generators received higher profits under congestion.
Finally we explained how Nord Pool and Statnett could use OPF to analyze price areas and transmission congestion, including aspects of security and reliability.

Figure 1 :
Figure 3.1 Eleven zone model

Table 1 :
Generation and load cost data.

Table 2 :
Base case generation OPF results.

Table 3 :
Base case load, zone lambdas and export/import.

Table 5 :
Congestion in a networked system.

Table 6 :
Economic analysis of the networks (CC = congested case and CNS = congestion in a network system).

Table 7 :
Economic consequences for the players in the market at bus 11 for the three cases.