Integrating PowerWorld and MatLab for Optimal Dispatch and Unit Commitment Study of Competitive Electric Power Markets

: The transition to competitive wholesale and retail markets for electric utilities around the world has been a difficult and controversial process. One of the difficulties that hindered the development and growth of the competitive wholesale power market is the absence of efficient computational tools to assist the design, analysis and operation of a competitive power market. PowerWorld simulator is an industry standard software package that has strong analytical and visualization functions suitable for extensive power flow study of a large power system. However, PowerWorld is not designed in such a way that can be used for the analysis and evaluation of a competitive wholesale power market. This paper investigates mathematical models associated with a competitive wholesale power market and how these models can be converted and transformed in such a way that makes it possible to use PowerWorld for optimal power dispatch study of a competitive power market. The paper also develops a co-simulation mechanism to integrate PowerWorld and MatLab for a combined optimal power dispatch and unit commitment study. Finally, the paper demonstrates a case study for a large competitive electric power system.


Introduction
The Standard Market Design was proposed by the US Federal Energy Regulatory Commission (FERC) in 2002 (Joskow, 2006;ISO, 2005) by using Locational Marginal Pricing (LMP), Load Serving Entities (LSEs) and an Independent System Operator (ISO). Under this structure, the purpose of the ISO is to formulate the optimal power flow study and calculate the price by concerning both the location and time scheme of the injection and withdrawal of electric power in the grid.
Conceptually, LMP is the least cost to serve the next MW of load at a specific location under the limitations of transmission lines . It has been widely implemented in the Mid-Atlantic States, Electric Reliability Council of Texas, New York, New England, California and New Zealand (Hogan, 2011). Due to the severe congestion, LMPs of some constrained areas may be much higher than other areas with no or less congestion. LMPs can separate the entire power network into different pricing zones or locations. With this mechanism, more energy efficiency and economic profit can be achieved, since it encourages the generator with a cheap marginal price provide more energy to the grid.
Because the divergence of LMPs exists in the wholesale power market, buyer's payment can be significantly different from the revenue of sellers (Li and Tesfatsion, 2011). In a wholesale power market, there are three net surpluses: ISO, LSE and Generation Companies (GenCos) net surpluses. Li and Tesfation (2009), all the three surpluses are determined based on the auction basics in a competitive market (Tesfatsion, 2009), in which both seller and buyer offer the biding respectively until they settle at a certain price. Seller surplus indicates the price difference between seller's receiving and reservation values. Similarly, the buyer surplus can be considered as the price divergence between buyer's payment and reservation values. Intuitively, in the biding scheme, both seller and buyer are willing to maximize their surplus and market efficiency. The Total Net Surplus (TNS) is defined as the summation of ISO, LSE and GenCos net surpluses.
However, most conventional studies for a competitive wholesale power market are based on individually developed software packages without using existing power flow simulation tools, making a lot of powerful analytical and visualization functions available in the commercial software unable to be integrated with a competitive power market study. Li and Tesfation (2009), an AMES Wholesale Power Market Testbed is developed based on Java and is used to investigate how ISO net surplus varies in response to changes in the price-sensitivity of demand in ISO-operated wholesale power markets with congestion managed by LMP. In (Li, 2007a), a continuous LMP is proposed and is applied to a small five bus system. Hamoud (2004), although a computer program PROCOSE is used for assessment of transmission congestion and LMP, the price sensitive loads and generations are not properly reflected in the program. Therefore, developing an efficient computing system becomes an important issue that was specially emphasized and discussed in the Session of ISS Panel and TF on Agent-Based Modeling of Smart-Grid Market Operations during 2012 IEEE Power and Energy Society General Meeting hold in San Diego, USA (Tesfatsion, 2012).
The main goals and contributions of this paper include: (1) Studying what are characteristics and models associated with a competitive wholesale power market, (2) investigating how these models can be converted and transformed in such a way that PowerWorld simulator can be used for optimal power dispatch study of a competitive power market so as to take many advantages provided by the commercial software and (3) exploring how PowerWorld and MatLab can be integrated together for combined unit commitment and optimal power dispatch study for a competitive power market.
In the sections that follow, the paper first presents the economic dispatch models for a competitive wholesale power market in section 2. Section 3 shows how to convert the economic dispatch models into PowerWorld compatible models. Section 4 presents a mechanism to integrate PowerWorld and MatLab for combined unit commitment and optimal power dispatch evaluation. Section 5 validates the effectiveness of using PowerWorld for economic dispatch computation of a competitive power market. Section 6 presents a detailed optimal power dispatch and unit commitment study for a practical competitive power system. Finally, the paper concludes with the summary of the main points.

Competitive Wholesale Electricity Market
A wholesale electricity market exists when competing generators offer their electricity output to retailers. The retailers then re-price the electricity and take it to market. While wholesale pricing used to be the exclusive domain of large retail suppliers, increasingly markets like New England are beginning to open up to end-users.
For an economically efficient electricity wholesale market to flourish, it is essential that a number of criteria are met. In North America, this is typically achieved through a bid-based, security-constrained, economic dispatch with nodal pricing or Locational Marginal Pricing (LMP) (Li, 2007b). The objective of LMP is to adjust energy prices in a pool to reflect the locational value in a node, which must account for congestion and transmission losses. The method relies on the actions of the pool ISO which (i) receives demand bids and supply offers, (ii) selects the most efficient sources to satisfy prevailing constraints and (iii) makes financial transactions that involve payments from consumers and payments to suppliers (Li and Tesfatsion, 2011). The prices that govern these payments are based on the supply offers submitted by dispatched generators, the demand bids submitted by load-serving entities and an adjustment made by the ISO to reflect the locational value of suppliers in terms of their contribution to the system losses and transmission constraints. In general, the LMPs are higher at consumer locations than at source locations. The price differentials between sending and receiving nodes result in a net income or surplus to the ISO.

Demand Bids and Supply Offers
For each day (d), the demand bid reported by LSE j for each hour (h) in day d+1 of the day-ahead market consists of a fixed demand bid and a price-sensitive demand bid. The fixed demand bid has a constant increment bidding rate γ j F (h) for a fixed power demand P Lj F (h). The price-sensitive demand bid has a variable increment bidding rate γ j V (h,p) for an adjustable demand P Lj S (h) that drops as power demand increases (Li and Tesfatsion, 2011): The price-sensitive demand is defined over an interval of: For each day (d), the supply offer of GenCo i for each hour (h) in day d+1 of the day-ahead market consists of a reported increment cost function and a true increment cost function. The true increment cost function C i T (h) represents the actual power production cost of GenCo i per MWh as: where, P Gi (h) is defined over a maximum and minimum operating capacity interval: In a competitive power market, the reported increment cost function C i R (h) represents the minimum dollar amount that GenCo i is willing to accept per MWh and is at least as large as the true increment cost function C i T (h). Thus, the coefficients of the reported increment cost function is different from (3) and is represented by:

Profits and Net Earnings
The profit of a wholesale power market consists of three parts: LSE profit, GenCo profit and ISO profit.
The profit of LSE j as shown by (8) on day (d) and hour (h) is the difference of the revenue Rev Lj (h), corresponding to payments received from its customers as shown by (6) and payments Pay Lj (h), paid to ISO according to the LMP structure as shown by (7): The profit of GenCo j as shown by (11) on day (d) and hour (h) is the difference of the revenue Rev Gi (h), paid by ISO according to the LMP structure as shown by (9) and GenCo expense Exp Gi (h), obtained based on the true cost function as shown by (10): The profit of the ISO on day (d) and hour (h) is the difference of payments received from all the LSEs and GenCos as shown by:

Optimal Dispatch with Nodal Prices
For each day (d) and hour (h), the optimal dispatch for a competitive power market is to find power supply by individual GenCos, power demand by each LSE and system LMP levels so as to maximize the total net surplus involving all the three parties. At the same time, the power balance constraint at each bus, GenCo power generation capacity, price-sensitive demand capacity and power capacity of transmission lines should not be exceeded. In terms of DC power flow, this results in a quadratic programming as shown below (Liu et al., 2009): Maximize: where, P k is the active power of the generator injected into the network at bus k and x km is the branch reactance between buses k and m and δ k (h) is the voltage angle at bus k. Note that GenNet i (h) in (13) is computed by using the reported increment cost function rather than the true increment cost function. This is a little bit different from Equation 10 and 11. For a large power system, it is very complex and time consuming to develop a program to solve the optimal dispatch problem. Hence, most conventional studies use DC power flow approximation as shown by Equation 13-17. This would cause errors compared to AC power flow computation. In addition, to accurately capture changes and solve the optimization problem throughout a day, calculations must be repeated hour by hour using practical system data.

Optimal Power Dispatch for Competitive Power Market Using PowerWorld
PowerWorld Simulator is an interactive power systems simulation tool designed to simulate power system operation on a time frame ranging from several minutes to several days. The software contains a highly effective power flow analysis package capable of efficiently solving systems with up to 100,000 buses (PowerWorld, 2015). Theoretically, PowerWorld can be used for simulation study of any practical time frame, such as few hours to one week ahead.
The first step for the optimal power flow evaluation using PowerWorld is to develop a singleline diagram. The program can read in impedance data of each line and the length of the line and then automatically transfers the impedance of each line into per unit. For each line, the MVA limit, representing the constraint of a line, is specified too.
The next step is to define generation units. This includes maximum and minimum power generation and increment cost function of each unit. The generator capacity, i.e., Max_MW, Min_MW, Max_Mvars and Min_Mvars values of a generator, are specified except for the slack bus generator. These parameters represent maximum and minimum active and reactive power constraints of a generator, respectively. Note: The actual generation of a generator is obtained through optimal power flow computation. The coefficients of the cost models associated with the generators are specified using one of the following two options defined in PowerWorld: Cubic model option and piecewise linear model option. Actually a cubic cost model is converted into a default piecewise linear model automatically for the optimal power flow computation in PowerWorld. The piecewise linear model option makes it more convenient to define a user specified piecewise linear model (Sontag, 1981). The reported increment cost function is used for each generation unit.
The final step is to create a special technique so that the fixed and price-sensitive loads can be properly implemented in the PowerWorld simulator. For fixed loads, only the fixed power demands need to be specified because these loads do not participate the open market bidding process. These loads can be represented by the conventional load model defined in PowerWorld. But, the price-sensitive loads will participate in the wholesale power market auction so that both power demands and variable increment bidding rates must be specified. Hence, the conventional load model in PowerWorld is not suitable to a price-sensitive load. To overcome the challenge, we use a specially developed strategy to model a price-sensitive load based on the conventional generator model defined in PowerWorld. The strategy requires: (1) The power generated by the generator is negative instead of positive and (2) an increment bidding rate function γ PW_j where, instead of a negative sign, a positive sign is applied to β j (h) coefficient because a negative pricesensitive generation is used to model a price-sensitive load. The conversion from (1) to (18) for the increment bidding rate function of a price-sensitive load is based on a special mechanism that makes it possible to solve the optimal power dispatch problem (13) in PowerWorld as explained below. PowerWorld uses linear programming (Thie and Keough, 2008) in its Optimal Power Flow Analysis Tool (OPF), an optional add-on to the base Simulator package. The OPF provides the ability to optimally dispatch the generation with the minimum overall cost in an area or group of areas while simultaneously enforcing the transmission line and interface constraints. PowerWorld OPF also calculates the marginal price (LMP) to supply electricity to a bus, while taking into account of transmission system congestion.
However, the objective of the PowerWorld OPF is to find a solution that minimizes the overall generation cost. This requirement is different from (13). Thus, to use PowerWorld OPF, (13) must be converted into the PowerWorld compatible format. By applying (8), (11), (12) to (13), it is obtained: Note: The fixed demand component in (21) is constant. Thus, removing the constant loads from the objective function (21) does not affect the optimal solution. Then, the optimal power dispatch problem can be represented by (22), in which Cst PW_Lj S (h) stands for the equivalent generator cost associated with the pricesensitive load P Lj S (h) and the corresponding increment bidding rate function is (18). According to (22), the optimal power dispatch problem becomes to minimize the overall generation cost of all the positive and negative generators: By this way, we can use PowerWorld OPF to solve the optimal power dispatch problem for a competitive power market, in which a generator model is used to represent a price-sensitive load. However, the active power of the "generator" must be negative (absorbing) while the reactive power can be both negative and positive. This means that when using the PowerWorld generator model, the Min_MW value of the "generator" is negative while the Max_MW value of the "generator" is zero. Max_Mvars and Min_Mvars values of the "generator" can be selected to represent the generating and absorbing reactive power constraints of the price-sensitive load. For price-sensitive load j, coefficients of α j and β j associated with the variable bidding rate (Equation 1) of the load need to be specified. However, different from (1), both α j and β j must be positive according to (18).

Integrating PowerWorld and MatLab for OPF and Unit Commitment Study
A competitive power market is usually represented as a Security-Constrained Unit Commitment (SCUC) problem (Pinto et al., 2006). The Unit Commitment (UC) problem involves finding the least-cost dispatch of available generation resources to meet the electrical load. It determines the optimal operational schedule of a set of generators by considering the operating fuel cost and transition cost to switch on and off a generator. However, the normal UC function is not available in PowerWorld. Wwe propose a mechanism to integrate PowerWorld and MatLab together for combined optimal power dispatch and SCUC study.
The basic idea of the integrated co-simulation system is to use PowerWorld for optimal power dispatch computation and to use MatLab for UC evaluation. The two software programs are connected together through Simulator Automation Server (SimAuto). SimAuto provides a COM interface so that a user can extend the functionality of PowerWorld Simulator to any external program. By using SimAuto, we can launch and control PowerWorld from our MatLab-based program. Basically, we use MatLab to solve a UC problem based on a dynamic programming approach (Prateek Kumar and Naresh, 2011;Snyder et al., 1987) and use PowerWorld to do the optimal power flow computation. By this way, we are able to use the special power of both software tools for very fast formulation and computation of a large-scale competitive power market.
The integrated UC and OPF computation consists of a backward and a forward sweep procedures as shown by Alg. 1. For a day of 24 h, for example, we first generate all possible generator combinations for 24 h in MatLab. Note: Although we used 24 h here as an example, the mechanism can be applied for simulation study of a competitive power market with any practical time frame, such as few hours to one week ahead. In each hour, any unit can be considered either on (denoted by 1) or off (denoted by 0). For a power system with n generators, there are N = 2 n -1 candidate combinations available. But, some combinations may not be feasible due to various constraints. For instance, if the total capacity of the generating units is less than the total loads at an hour, that generator combination cannot be included.
In the backward sweep, the dynamic programming and optimal power flow computation (limes 4 to 11) starts at the termination time (h = 24) to get an initial cumulative costs for all the feasible combinations. We assume that there is no transition cost at the termination time. Therefore, the initial cumulative cost for a combination equals to the generator operational cost obtained from PowerWorld (lines 8 and 9). For a feasible combination i at hour h at a non-termination time, the minimum operational cost c i (h) is calculated in PowerWorld (lines 18 and 19 of Alg. 1) and then transferred back to MatLab, where the transition cost t ij (h) from the combination i at hour h to a combination j at hour h+1 is added to the minimum operational cost c i (h) at hour h plus the minimum cumulative cost of the combination j at hour h+1 to form the cumulative cost of the combination i at hour h (line 24 of Alg. 1). After the computation of the cumulative costs of the combination i at hour h to all the combinations j at hour h+1, only the minimum one of the cumulative costs is saved (line 27) for the cumulative cost computation at hour h-1 and the combination j * at hour h+1 associated with this minimum cumulative cost is saved for the forward sweep computation. In the forward sweep, the computation starts at the beginning time (h = 1) by finding the minimum cumulative cost and the associated combination (line 31 in Alg. 1). Then, through a forward recursive process, the program recalls the combination j * at hour h+1 and adds the cumulative cost of the combination j * at hour h+1 until the termination time (lines 32 to 34 of Alg. 1). At the end of the forward sweep procedure, the most efficient generator combinations as well as the optimal power dispatch solution at all the time segments is available.

Using PowerWorld and MatLab Co-Simulation for Optimal Power Dispatch and Unit Commitment Investigation
Validation Before OPF and UC study for large systems, we first used MatLab optimization toolbox (Mathwork, 2012) for the validation of the proposed approach. The dynamic programming mechanism associated with Alg. 1 is easy to program for a small system in MatLab. The MatLab optimization toolbox provides widely used algorithms for standard and large-scale optimization. The toolbox includes functions for linear programming, quadratic programming, binary integer programming, nonlinear optimization, nonlinear least squares, multi objective optimization and systems of nonlinear equations (Mathwork, 2012). Hence, it provides a fast and accurate approach for validation of PowerWorld based models developed in Section 3 for a competitive power market.
The comparison and validation is conducted for several small power systems. The comparison focused on the following three aspects: (1) Whether an optimal solution obtained by using PowerWorld is consistent with the results obtained by using MatLab, (2) how the piecewise linear simplification in PowerWorld affects the accuracy and (3) how much difference is between the results generated by using DC and AC OPFs (Bo and Li, 2008). In general, the comparison shows that the results generated by using MatLab and PowerWorld are very close, demonstrating the effectiveness of using PowerWorld to solve the optimal power dispatch problem for a competitive electric power market. For small power systems, results generated by using AC and DC OPFs are close.

A 37-Bus System
With the successful validation shown in section 5.1, this section presents an extensive optimal power dispatch and UC study for a more practical 37-bus system by using the proposed PowerWorld and MatLab cosimulation technique (Glover et al., 2011). The system has nine generators, among which four generators are always online while the other five generators participate SCUC scheduling. Bus 31 is the slack bus. The system has twenty-five fixed loads and two price-sensitive loads. The maximum capacities of the two pricesensitive loads are 40 and 70 MW, respectively.
The cost coefficients and capacities of generators are given in Table 1, where F represents the fixed price of a generator. The transmission line parameters and capacities are specified in PowerWorld for each line.
Three different types of variable loads are considered as shown by Fig. 2. The power factor is 0.85 lagging for Type 1 load and 0.9 for Type 2 and 3 ones. The load profiles are first created by using other software (such as Excel) and then loaded from MatLab into PowerWorld simulator at each simulation interval. The study focuses mainly on (1) UC scheduling, (2) how much difference between AC and DC OPFs is, (3) what impact can be caused by the price-sensitive loads and capacities of transmission lines and generators and (4) how variable loads affect optimal power dispatch and unit commitment of a competitive power market.

Optimal Power Dispatch Based on AC and DC OPFs
For a large power network, such as the 37-bus system, the difference between AC and DC OPFs is evident. In general, the LMP on each bus is normally higher for AC OPF than DC OPF. Table 2 and 3 show the comparison of UC scheduling generated by using AC and DC OPFs as well as the total daily operational cost. As it can be seen from the tables, the UC scheduling is clearly different between AC and DC OPFs. Compared to DC OPF, AC OPF requires more generator units to be online at a certain hour and the total operational cost obtained from AC OPF is higher than that of DC OPF, demonstrating the importance of using AC OPF for accurate UC scheduling and optimal power dispatch evaluation in a competitive power market.

Impact of Price-sensitive Loads and Capacities of Transmission Lines and Generators
The impact of price-sensitive loads and capacities of transmission lines and generators to the optimal power dispatch and UC scheduling is very convenient to study by using PowerWorld and MatLab co-simulation technique. For the 37-bus system shown by Fig. 1, it is possible to assign a price-sensitive load to each load bus. By connecting/disconnecting a price-sensitive load or changing capacities of transmission lines or generators, the optimal power dispatch and UC scheduling can be easily evaluated and visualized. For any change of system conditions, the difference between the two adjacent condition changes of the power system can be demonstrated by using the Difference Flows function in PowerWorld. The following observations are obtained: • The line capacity and location and size of loads are primary factors to affect the congestion. When the congestion appears on a line, the LMP of a bus associated with that line could be much higher than the LMPs of other buses • To reduce the congestion of a line, either the capacity of generators close to a large load area or the capacities of the lines supplying the same load area need to be strengthened. However, the offered costs of generators are also an important factor to affect congestion • The inclusion of the price-sensitive loads causes the LMPs to drop and a reduction of the overall surpluses of GenCos, ISO and LSEs. The larger percentage of the price-sensitive loads over fixed loads, the smaller the net surpluses of all the involved three entities are

Optimal Power Dispatch and UC Scheduling Over Time
Under the conditions of variable loads over time, the LMP on each bus and average LMP vary as the loads change. The LMP curves could be quite different depending on the congestion of the lines connecting a bus (Fig. 3a). For example, LMP at Bus 15 is much higher than other buses due to the congestion of the line between Buses 15 and 54. One exception is the low load condition. During a low load condition, there is no congestion in the system so that LMPs on all the buses are the same.
The surplus of each generator is calculated by using the generator true cost (Equation 11) but also is affected by the reported cost, capacity and unit transition cost of the generator. For example, the cheap and high capacity generator on Bus 17 supplies most of the power, making its net surplus higher than other generators, especially at a peak load condition. The surplus of a generator could be negative under a light load or on/off transition (Fig. 3b). The primary cause of the negative surplus at a light load condition is the low LMP as well as the minimum amount of generation that a generator must supply. Thus, for the expensive generator 7 at Bus 33, the surplus of the generator could be trivial or negative when the generator supplies the minimum amount of generation with a low LMP.
The ISO net surplus is determined by the payments received from LSEs and payments given to generators by ISO, both of which are calculated based on LMPs. Therefore, if the LMPs at all the buses are close or the same, the net surplus of ISO could be very low or even negative due to the line losses that are not reflected in the LMP payment structure (Fig. 3d).

Conclusion
With the transition to competitive wholesale and retail markets for electric utilities around the world, it is urgently needed to have efficient computing tools for design, analysis, evaluation and visualization of a competitive wholesale power market. This paper investigates mathematical models associated with a competitive power market and how these models can be converted in such a way that makes it possible to use commercial software for the optimal power dispatch computation. The paper also proposes a mechanism to integrate PowerWorld and MatLab for combined optimal power dispatch and unit commitment study.
In PowerWorld, it is very convenient to build a very large power system for optimal power dispatch study and to select either DC or AC OPF. For a large power system, the difference between AC and DC OPFs is evident. Due to the line losses, the LMP on each bus is normally higher for AC OPF than DC OPF. Compared to DC OPF, AC OPF requires more generator units to be online at a certain hour and the total operational cost obtained from AC OPF is higher than that of DC OPF.
The inclusion of the price-sensitive loads into a competitive power market causes the LMPs to drop and a reduction of the overall surpluses of GenCos, ISO and LSEs. The larger percentage of the price-sensitive loads over fixed loads, the smaller the net surpluses of all the involved three entities are.
For variable loads over time, the load profiles can be first created by using other software (such as Excel) and then loaded into the PowerWorld simulator from MatLab at each simulation interval. Under variable load conditions, the LMP curves could be quite different depending on the congestion condition of the lines connecting a bus. If the LMPs at all the buses are close or the same, the net surplus of ISO could be very low or even negative due to the line losses. The surplus of each generator is affected by the cost and capacity of the generator. The LSE gain depends strongly on the price structure of the LSE.