Joint energy and reserve market design with explicit consideration on frequency quality

Energy and reserve markets are two important market components in the deregulated power industry. Energy markets provide a platform for generating companies, retailers, and big energy consumers to centrally trade electricity. However, owing to the varying renewable power generation, load variation and unexpected contingencies, energy supply and consumption always embody high uncertainties. Furthermore, due to the lack of low-cost, large-capacity energy storage devices, an instant balance between the generation and load is required under these uncertainties. Therefore, the reserve market is set up to address the balance-disruptive uncertainties intrinsic to the power grid. Although this combined market design reduces the risk of the possible imbalance in energy supply and consumption, it does not guarantee that the frequency of the grid is satisfactory, even in the normal operation. This study analyzes the insufﬁciency of the energy and reserve market design in addressing frequency quality problems by exploring the root causes for the deteriorating frequency quality in the Australian National Electricity Market. A novel framework that incorporates the frequency quality, control capacity, and control cost to achieve the desired frequency quality is then presented. Case studies through a simple power system and the IEEE 30-bus system demonstrate the efﬁcacy of the presented methods.


INTRODUCTION
Electricity market reforms worldwide aim to create an open and fair platform to trade electrical energy among generating companies and consumers. Power pool and bilateral models have been set up based on the commodity in this market, that is, electrical energy [1][2][3][4]. However, to freely trade electrical energy and keep the lights on simultaneously, the built-in stochastic characteristics of the power grid operation must be addressed properly. One way to resolves this is to build the reserve markets parallel to the energy markets; thus, the stochastic load variation and generator contingencies can be compensated for by accruing sufficient spinning and non-spinning reserves. [5] proposed several alternatives to accrue the reserve services. [6] developed a linear-programming-based optimization model for pricing the reserves. [7] extends the energy and reserve management to the multi-zone power grids. [8] considers the opportunity cost of setting aside generation capacities as reserves.
This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited. The increased penetration of renewable energy raises renewed concerns on the reserves required under power market environments. The fluctuation of renewable outputs contributes to further uncertainties in the net load. Forecasting errors in both the load and renewable generator outputs also cause difficulty in balancing the generation and load. [9] analyzed the market effects caused by the differences between the reserves and uncertainty of the renewable energy generation. [10] developed weighted scenarios to consider the uncertainty of wind power outputs. [11] offers an international comparison on deciding the reserve amounts in power systems with high wind power penetration.
Although the energy and reserve market designs in both the old era with only fossil generators and new era with the increased penetration of renewables have attracted considerable research attention and the power industries have witnessed many implementations on these designs, the deterioration of the frequency quality, which has been observed in Australia and has its cause to exist in other places, has never been addressed systematically. The frequency quality deterioration experienced in Australia is elaborated in Section 2, followed by the root cause analysis. Herein, we do not aim to decide the reserve requirements in the market environment, but rather highlight the frequency problems that have not been well managed in the current market design and stress the importance of incorporating the frequency quality into the market. If the frequency problem is not addressed properly, the frequency deterioration will become more serious with the increase in renewable energy integration. The major contributions of this work are: 1) Analyzing the frequency deterioration problem neglected in the current market design and drawing insights on the problems inherent in the current market solutions in managing the power imbalance; 2) Developing a framework that includes the energy trade, reserve requirements, and primary frequency control capability in a market environment. Therefore, the market operator could accrue control capacity sufficient to address the increasingly frequent disturbances, while the generators that provide such control services could be rewarded by helping to maintain the quality of the electrical energy in the market; 3) the frequency quality of the commodity, namely the electrical energy, is explicitly considered, thus allowing to seek a balance between the frequency quality penalty cost and control cost to guarantee a certain level of frequency quality.
The rest of the paper is organized as follows: Section 2 discusses the frequency quality problem in Australian power markets and analyzes its root causes that have been neglected in the market design. To overcome the exposed problems, Section 3 proposes a novel model that is demonstrated through a simple power system. Section 4 develops the generic model of the proposed framework for the multi-zone power grids and presents its solution. Case studies using the IEEE 30-bus system are presented in Section 5. Section 6 concludes the paper.

PROBLEM STATEMENTS
The Australian National Electricity Market (NEM) regards frequency control as an ancillary service, which constitutes part of the reserve market. The special ancillary service markets, referred to as Regulation Ancillary Service Markets, which include the Regulation Raise and Regulation Lower Markets, are set up to control the frequency deviation caused by the power imbalance in the normal operation when the frequency is within the band from 49.85 to 50.15 Hz [12,13]. Generators and controllable loads bid into the regulation ancillary service markets in the form of MWs, which they could contribute if called into this market. Meanwhile, the generators also bid into the energy markets for electrical energy that they could provide to supply the load. Therefore, their bid curves take the general form of a trapezium because of the constraints of its total installed capacity, ramping up rate, and ramping down rate [12]. For each dispatch interval, the National Electricity Market Dispatch Engine (NEMDE) co-optimizes the energy transactions and frequency regulation ancillary services simultaneously to determine the minimum cost dispatch scheme to supply the load and satisfy the reserve requirements. Although the NEM design for trading energy and frequency regulation services follows the general economic principle, its implementation has witnessed a steady decline in the frequency quality over the years. Figure 1, based on the data in [14], shows the number of times when the frequency exceeded the bands from October 2013 to October 2016. The number of frequency band exceedances as well as the growth of the numbers is alarming. Figure 2 [15] shows the frequency distribution on 8 May 2001 and 8 May 2016 using the 4-s frequency monitoring data. The frequency distribution widens over a frequency deviation range and is less concentrated around the center of 50 Hz, compared to that 15 years ago. The deteriorating frequency quality is not a desired outcome from the good intention to introduce the electricity markets at its inception.
The great challenge well recognized on day one in trading of electrical energy is to maintain an instant balance between the energy generated and energy consumed. Current market designs are not sufficient to deal with this. The root reasons for this problem are fundamental, although often neglected, which are how to view the commodity, namely the electrical energy, in this market. First, because the commodity traded in the markets is electrical energy, all bids and offers in the energy markets or frequency ancillary service markets are valued by MWhs only. However, any commodities in any markets have both quality and quantity. Goods with the same quantity, but with different qualities, will be valued differently. Nevertheless, in the power market design, the quality of goods, which is the electrical energy, is separated from its quantity when traded in the markets. The quality of electricity is assumed, or more accurately, to be heeded out of market transactions. It is a big question whether the quantity based only on power markets is the best way to trade this commodity.
Second, guaranteeing the quality of the commodity incurs cost. In addition to separating the quality from the quantity in the current market runs, the quality quantification of the frequency under normal operation is separated from the commodity. The network reliability panel creates the minimum requirements on the frequency deviation, without explicitly considering the cost and viable approaches in the market, to meet that criterion. One likely consequence is that some generator owners have found that maintaining the primary frequency control, mandated at the start of the markets, has created costs and penalties and thus have decided to enlarge the deadbands of their primary governor controllers. This undoubtedly reduces their capacity to manage the frequency deviation.
Third, the current market design assumes that market participants maintain their successful market offers and bids during the time interval in the concerned markets. Generators make their offers in MW at a price $/MWh for both energy supply and frequency regulation services. The generation deviation from the scheduled amount is a key element in evaluating the generator's performance. However, generation production and control are all continuous processes in nature. There are natural transients for any events happening during normal operations. Particularly, when the frequency is disturbed, many generators respond to the frequency changes automatically which introduces a continuous dynamic process. The market design separates these continuous dynamics into discrete stages and completely neglects the transients/dynamics, which naturally view the market purely as static. Because generators lose incentives to respond to the frequency change while a physical power grid is always under transients owing to the randomness of the load and variable renewable generation, the power grid is more likely to experience deteriorated frequency quality.
The imbalances between the generation and load have become even more dynamic with the increased renewable energy penetration. The current frequency regulation market relies on automatic generation control (AGC), which is secondary frequency control and does not count the fast frequency responses to the power imbalance through primary frequency control. We debate that either the role of the primary frequency control should be retained as the pre-market era, that is, making it mandatory or a new market solution should be pursued. Leaving the primary frequency control unattended in the market environments may lead to further downgrades of the grid safety facing the increased integration of renewable energies. This study focuses on the frequency quality problem in the current market design and proposes to explicitly consider the frequency quality, cost, and control capacity of generators to achieve the desired quality. It is necessary to balance the cost of implementing primary frequency controls and that on the deteriorated frequency quality. Thus, generators that participate in primary frequency control can be rewarded, and the system frequency can be maintained to a level depending on the customers' acceptance level.

SIMPLE POWER SYSTEM CASE
Consider a power system with two fuel generators, G A and G B , with capacities 115 MW and 110 MW, respectively, and one wind generator, W C , with capacity 20MW. All generators bid into the energy market based on their marginal cost, that is, G A : $10/MWh; G B : $20/MWh; and W C : $0/MWh. The total load in this simple power system is 115 MW. The energy market dispatch can be solved through the following optimization problem: s.t., The optimal solution is P A = 95MW, P B = 0MW, and P C = 20MW. Since the wind generator has zero operational marginal cost, it is dispatched first. G A is the second cheapest in terms of the marginal cost; therefore, it is scheduled to supply the remaining load after the wind generator is fully loaded. Since G A is the marginal generator in this market, the wholesale electrical energy price is decided by the bid of G A , which is $10/MWh.
The limitation of the energy-only market design is that the market is not prepared for any unexpected change. Particularly, in a power grid with increased wind power penetration, the generator outputs also become uncertain. The reserves are recruited in a market environment to reduce the risks of power imbalance. As shown in Section 2, Australia has set up the frequency regulation service market to ensure that there are sufficient generation reserves to compensate for any sudden loss of generation. In this case, we assume that the required reserve amount of the system is the capacity of the wind generator, that is, 20 MW. Therefore, in the worst case, if the wind generator suddenly loses its full outputs due to a sudden change in wind speed, the remaining generator can fill in the gap, without interrupting the load supply. Assume that G A and G B enter the reserve market with bids $5/MWh and $30/MWh, respectively, and the maximum reserve capacity they could provide is 25 MW and 20 MW, respectively. Aligning with the cooptimization approach used in NEM, this energy + reserve market design can be formulated as the following optimization problem: s.t., The optimal solution gives P A = 95 MW, P B = 0 MW, and P C = 20 MW in the energy market, whereas in the reserve market, R A = 20 MW, and R B = 0 MW. The generator outputs in the energy market do not change in this combined energy and reserve markets dispatch. The cheapest two generators, G A and W C , are dispatched to meet the load, whereas the most expensive generator, G B , is left out of the energy market; in the reserve market, because G A provides the cheapest reserve and could satisfy the reserve requirement in the area, it reserves 20 MW capacity, whereas G B does not provide any reserves owing to its high bidding price. Although the generation scheduling in the energy market does not change compared to the energyonly market schedule, the clearing price in the energy market changes. Owing to the participation in both the energy and reserve markets, G A is stretched to its maximum capacity, causing a shadow price of $2.7272/MWh on its capacity. It tops up the energy generation cost of $10/MWh, leading to an energy market clearing price of $12.7272/MWh. Since G A also provides cheaper reserves, it determines the reserve market clearing price at $7.7272/MWh, which is the sum of its capacity shadow price of $2.7272/MWh and its reserve cost $5/MWh. Both the energy and reserve markets trade energy only, that is, only MWhs are traded in the market; however, the quality of service is not guaranteed. Thus, although the reserve market increases the system's capability to address the uncertainty in wind power generation, it has no control on the frequency deviation level before the reserves kick in. Since both markets do not motivate the generators to participate in the frequency control to ensure the frequency quality of the power system, there is no wonder that generators in NEM choose to quit from the primary frequency control and sell only their MWs in the energy and reserve markets, which causes the deterioration of the frequency quality, as presented in Section 2. As analyzed before, the root cause of this problem is that, while after the power market reform, the primary frequency control is no longer mandatory, there are no places in the current markets to consider it. The current market design takes the quality of electricity for granted. The frequency should be 50 Hz/60 Hz, and the market is not responsible for maintaining it. However, quantity and quality are inbuilt with any commodities including electricity. The expected frequency quality should be determined through the electrical energy in that utility. Meanwhile, maintaining the grid frequency at a certain level incurs cost. Generators should be motivated financially and convinced that doing so is necessary for the customers they serve. This problem has become more significant with the increased penetration of renewable energy sources. The intermittent nature of renewable energy will cause more frequent frequency disturbances to the system. The frequency quality and cost of frequency control should be considered to ensure that the frequency deviation meets customer requirements. Furthermore, it is affordable to do so, especially with the increased intermittent generating resources.
For the power system case, in addition to reserving the capacity to offset the likely wind power deficiency, the customers also require that the grid frequency deviation should be controlled to be less than Δ f max with the normal fluctuation of the wind speed. In real power systems, the uncertainty in wind power generation can be estimated from historical data. Without losing generality, we assume that the wind power variation will be within 75% of its full capacity. The frequency quality criteria depend on the specific situations of each power system, especially relying on consumers' requirements of the frequency quality. The system operator should balance the cost and expected quality. Herein, the allowed worst frequency deviation is used as the frequency quality requirement for the system operation. If the frequency can be controlled under the worst case to an acceptable level, the frequency quality is satisfactory for all the other possible situations. If the customers of the utility have no stringent requirements of the frequency quality, we use the maximum allowed frequency deviation for NEM in Australia for this utility, that is, Δ f max = 0.15Hz. This means that the frequency in this utility can drop up to this level but cannot be lower than that of the normal frequency regulation services, considering the fluctuation of the wind power outputs in the system. To ensure that the frequency quality does not drop below this level, in addition to bidding in the energy and reserve markets, G A and G B also bid their primary frequency control capability at $5/(MW/Hz) and $10/(MW/Hz) to provide the primary frequency control service. Here, (MW/Hz) is used as a unit to measure the primary frequency control capability of a generator, and 1 MW/Hz indicates that the generator can change its output by 1 MW under the governor control with a frequency change of 1 Hz. The maximum primary frequency control capabilities of G A and G B are 80 MW/Hz and 100 MW/Hz, respectively. This study focuses on reflecting the significance of primary frequency control through the governor, which is not considered in the current FCAS market design. The major function of the primary frequency control is to capture the frequency change quickly and improve the frequency nadir. Subsequently, the automatic generation control (AGC) will follow up regularly to return the frequency to the desired band. Therefore, the time duration within which the power system stays at a frequency lower than normal, but still within the frequency regulation service band, is not addressed by the primary frequency controllers, but by the second frequency controllers (AGC), and will not be considered in the frequency quality formulation in this work.
To find the lowest-cost dispatch in both the energy and ancillary service markets, with the expected frequency control quality under the fluctuation of wind power outputs, the following optimization problem needs to be solved: s.t., Both the primary and secondary frequency control directly impact the frequency quality. Nevertheless, they act on the frequency deviation at different times. The primary frequency control automatically changes the power outputs of the generator as soon as the frequency deviation is out of the pre-set deadband of the generator, whereas the reserves are dispatched with a time delay often after the primary frequency control is complete. Therefore, the constraints on the primary frequency control resources and the reserves are different and modeled separately in Equations (3c) and (3d). The least-cost dispatch is as follows: in the energy market P A = 83 MW, P B = 12 MW, and P C = 20 MW; in the reserve market R A = 20 MW and R B = 0 MW; for primary frequency control, K GA = 80 MW/Hz and K GB = 20 MW/Hz. Compared to the case not considering the frequency control quality and cost, the energy outputs of G A are reduced from 95 MW to 83 MW in this case to maintain the frequency deviation at the allowed level; thus, G B is called to compensate for the loss of G A outputs in the energy market. The redispatched share of G A in the energy market is committed to maintaining the frequency quality due to the change in the wind generator outputs. However, G A is insufficient to maintain an acceptable frequency level, and G B needs to contribute to the primary frequency control with a frequency control capability of 20 MW/Hz. The generators' commitments to maintaining the frequency quality change the clearing prices in both the energy and reserve markets. G B replaces G A as the marginal generator in the energy market, which sets the energy market clearing price to $20/MWh. G A is the marginal generator in the reserve market, which leads to a clearing price of $15/MWh, the sum of its reserve bid $5/MWh, and the shadow price of its total capacity $10/MWh. The marginal generator providing the primary frequency control service is G B , which sets the clearing price for providing this service to its bids, that is, $10∕(MW/Hz). Now, assume that a more stringent request is put on the frequency quality in this utility because the frequency deviation cannot be over 0.1 Hz with the same magnitude of the wind power fluctuation. Replacing Δ f max in Equation (3) with 0.1 Hz, the least-cost dispatch generates: in the energy market, P A = 87 MW, P B = 8 MW, and P C = 20 MW; in the reserve market R A = 20 MW and R B = 0 MW; for primary frequency control, K GA = 80 MW/Hz and K GB = 70 MW/Hz. The higher frequency control quality requires more controls with the fluctuation of the wind generator outputs. Thus, G B should provide a frequency control capability of 70 MW/Hz compared to the previous case of 20 MW/Hz. The more stringent frequency control request also impacts the energy market scheduling, which has the cheapest G A , generates more power and more expensive G B generate less energy to minimize the energy supply cost. Although the output schedules from the generators change, the marginal generator does not change in each market; thus, the respective market clearing prices do not change compared to the pervious case.
An alternative way to enforce the frequency control quality is to penalize the frequency deviation with a cost. For example, if the frequency deviation penalty is $500/Hz, that is, for a 1Hz frequency deviation, $500 should be paid to the impacted customers. Under this penalty mechanism, the utility might allow a maximum frequency deviation of 0.15 Hz with the presence of the wind power fluctuation, while only allowing the frequency deviation to be a maximum of 0.1 Hz if the frequency deviation penalty rises to $1000/Hz. Solving the model (3) shows that, in the former case, the frequency quality penalty cost is $75, and the total optimized market cost is $1770. In the latter case, the frequency quality penalty cost is $100, and the total optimized market cost is $2230. By attaching a cost to the frequency control quality, the frequency deviation becomes a decision variable. It is necessary to seek a trade-off between the frequency quality penalty and control cost to achieve that quality level. For example, if G A and G B provide cheap primary frequency control services, say, $2.5∕(MW/Hz) and $5∕(MW/Hz), respectively, the total optimized market cost is $1680 even if the frequency deviation is controlled within 0.1Hz. When it is added with a frequency quality penalty cost of $1000∕Hz × 0.1Hz = $100, which gives $1780, it is still less than the total cost to control the frequency deviation within 0.15 Hz, which is $1770 + $75 = $1845. Thus, the most economical way to satisfy the energy and reserve requirements, while simultaneously guaranteeing the frequency control quality can be solved through an optimization model. Its general form is presented in the next section.

OPTIMAL DISPATCH
For a generic multi-zone interconnected power grid, scheduling the energy and reserve markets by explicitly considering the frequency control quality, as well as its cost, can be formulated as the following optimization problem: Minimize s.t., Each power system has a normal frequency band owing to the fluctuations of the loads; therefore, if the frequency deviation is within this band, there is no penalty cost for the deviated frequency. Thus, the Δ f w in the cost function can be calculated by From the economic theory, the cost of the frequency deviation should be equal to the loss of the consumers' benefits caused by the frequency deviation. One way to measure the loss of consumers that is often used in similar studies in the power industry is through customer survey. An alternative is to use the standard generation cost that could remove the frequency deviation as a measure of the frequency deviation cost. For the first approach using a survey, the most widely used method in real industry practices to generate the function of the cost in terms of frequency deviation is the least squares regression method, which generates a linear approximation of the real cost. For the second approach, since the generation governor control gives a linear relationship between the change in generation and frequency deviation, the cost function in terms of the frequency deviation also takes a linear form. Therefore, the linear penalty function on the frequency deviation is used here. The value of p f should be determined according to the approach used and real system parameters. (4b) and (4c) are AC power flow constraints in the form of complex vectors; (4d) and (4e) are line loading constraints for each transmission line at both from and to ends; (4f) are the vector constraints on the bus voltage of each bus; (4g) shows the reserve requirements for each zone of a large power system; (4h) requires the primary frequency control capabilities in each zone when encountering the changes of power F R . The frequency deviation caused by the change of power F R should be no more than the maximum allowed frequency deviation Δ f max as shown in (4k); (4i) and (4j) are constraints enforced by the installed generator capacity as the total power output from each generator, which includes its offers in the energy market, the reserve market, and the power adjustments under the primary frequency control, constrained by its maximum generation capacity; (4l) constrains the primary frequency control capability of each generator; (4m) constrains the reserve outputs by either the maximum reserve capacity or the ramping rate, which models the AEMO FCAS trapezium [12]. Meanwhile, to put the market components into the control context, the resources accrued in the reserve markets correspond to the secondary frequency control, whereas the primary frequency control is reflected through the changes in generator outputs that automatically respond to the frequency deviation.
The augmented Lagrange function for the optimal model (4) can be built as follows: Δ f, , , , , , , , , , , , , , The KKT conditions required for the optimality of (4) are as follows: Equation (7a) shows that the energy price at the generator node is decided by its marginal generation cost and the shadow price of its capacity. (7b) shows the factors defining the final cost for the reserve services, which include the cost of providing the reserve, the total capacity of the generator, the limits on the reserves that can be provided, and the generators' participation in the reserve services in each zone. (7c) and (7d) indicate the interconnections between the frequency quality and primary frequency control cost. The primary frequency control cost for each generator shown in (7c) is related to the shadow price of its control limits and is affected by the frequency deviation Δ f . However, from (7d), the primary frequency control capability of generators that participate in the frequency regulation in each zone, represented by E NZ f K G , affects the cost of providing the primary frequency control. (7d) also shows that the penalty cost p f starts to become effective only when the frequency deviation is outside the deadband. However, if the system frequency is expected to be controlled within the deadband, a considerably high primary frequency control cost might be needed because of the required control capability, represented by K G , and the generators' capacity and control limits, which are reflected through the Kuhn-Tucker multipliers and when the respective constraints become bounded. The nonlinear optimization model (4)-(7) can be solved by the prime-dual interior point algorithm. The MATPOWER Interior Point Solver is used here [16].

CASE STUDIES
The IEEE 30-bus system is used in this section to show the proposed framework with the primary frequency control, explicitly considered for general power system models. The system consists of three areas. Generators connected to buses 1 and 2 are in Area 1 (denoted as Gen1 and Gen2 hereafter); generators connected to buses 13 and 23 are in Area 2 (denoted as Gen5 and Gen6 hereafter), and generators connected to buses 22 and 27 are in Area 3 (denoted as Gen3 and Gen4 hereafter). Areas

FIGURE 3
Nodal prices for scenarios with and without considering reserves and primary frequency control 1 and 3 belong to operational zone 1, and area 2 is in operational zone 2. The total installed generation capacity is 265 MW in Zone 1 and 70 MW in Zone 2. The total active load in the system is 189.2 MW, whereas the total reactive load is 107.2 MVar. We assume that the credible energy deficiency caused by the wind power fluctuation is 60 MW in Zone 1 and 20 MW in Zone 2. Therefore, in addition to the energy trades, extra reserves and the primary frequency control services should be recruited to ensure that A) in the worst case of the wind power fluctuation, the system frequency deviation is regulated at an acceptable level; and B) after the frequency deviation is captured, there are additional reserves to compensate for the wind power loss; thus, the frequency could return to the normal level. The normal frequency deviation deadband is defined as ±0.02Hz. The generators' marginal cost on the energy production is: The generators' bidding in the reserve markets are $1. p.u. with respect to each generator's MVA base. Because this is a multi-zone system, the generators that belong to multiple zones can choose the zone they would like to participate in the frequency regulation. For demonstration, we assume Gen1 to Gen4 are only willing to participate in frequency regulation in Zone 1, whereas Gen5 and Gen6 participate in frequency regulation in both zones. Figure 3 shows the nodal price for the energy in the energy only, energy + reserve, and energy + reserve + primary frequency control scenarios. Table 1 shows the energy dispatched for each generator in all the three scenarios, whereas Table 2 shows the reserve committed from each generator in all the three scenarios. Table 3 shows the primary frequency control capability required from each generator to meet the frequency quality requirements and primary frequency control cost. The requirement of the frequency quality is reflected by choosing the penalty cost on the frequency deviation when the grid encountering the disturbances. Here, three cases with the penalty cost $10 4 /Hz, $10 5 /Hz, and $10 6 /Hz are shown in the table. The respective frequency quality cost and corresponding control cost are shown in the table.
In all three scenarios, bus 8 has a relatively high energy price to serve the load at bus 8, which is 30MW + j 30MVar , the line connecting bus 6 and bus 8 is congested at its maximum capacity, which generates a shadow price $2.39/MVA, $4.63/MVA, and $3.65/MVA for each scenario. Since Zone 2 generators only participate in Zone 2 reserve management and Gen5 has a lower reserve cost, it is dispatched to provide most reserves for Zone 2, which leads to its reduced energy outputs, as shown in Table 1 in the energy + reserve scenario compared to the energy only scenario. However, when the primary frequency control is considered, and the frequency quality penalty cost is $10 4 /Hz, Gen5 has to further reserve its primary frequency control capability, which reduces its commitment to providing reserve services by 5 MW. Gen6 has reached the maximum limits on its primary frequency control capability; however, it still cannot meet the frequency quality requirement for Zone 2, and Gen5 must be called to provide the primary frequency control services. The deficiency in the reserve market caused by withdrawing the reserve commitment from Gen5 is compensated for by more reserve outputs from Gen6, as can be observed in Table 2. In Zone 1, Gen1 and Gen2 have the cheapest bids in providing the reserves; thus, they are dispatched first to meet the reserve requirements of Zone 1. When the primary frequency control is considered, because Gen4 in Zone 1 has the lowest cost in providing frequency control capability, it is dispatched to the maximum limit on its primary frequency control capability. However, because the primary frequency control cost of Gen1 is higher than those of Gen2 and Gen4, Gen1 is only called when Gen2 and Gen4 cannot meet the frequency quality requirement. Gen3 is the most expensive generator in terms of providing the primary frequency control service; thus, a balance needs to be established between calling it for controlling the frequency deviation and its control cost. When the frequency penalty cost is $10 4 /Hz, Gen3 is not called to provide the primary frequency control. However, it is used to compensate for the shifts in energy outputs from the other generators that have to commit to the primary frequency control, as presented in Table 3 and Table 1.  Table 3 also demonstrates the trade between controlling the frequency deviation and the incurred costs. When the penalty on the frequency deviation is relatively low, for example, $10 4 /Hz, the frequency deviation is controlled at 0.15 Hz because this is the maximum allowed frequency deviation under normal operation in the frequency regulation market. The cost on the frequency quality is $1300, whereas the corresponding control cost to maintain the frequency that will not drop below this level is $4300. When the penalty on the frequency deviation increases to $10 5 /Hz and $10 6 /Hz because of the high frequency quality cost, the frequency deviation under the normal operational disturbances is controlled to 0.11 Hz and 0.1 Hz, respectively, while the control cost is increased to $6659 and $7700 correspondingly. Table 3 shows that the best guaranteed frequency deviation is 0.1 Hz because all generators have been stretched to their maximum capability in providing the primary frequency control. If a better frequency quality is desired in this grid when encountering the normal operational disturbances, extra control facilities should be recruited; for instance, the controllable load or generators should increase their capability in providing the primary frequency control.

CONCLUSION
Frequency quality problems in market environments have not been given sufficient attention so far. However, the degraded frequency quality and exit of generators from participating in the primary frequency control have been observed in Australian NEM. The increased penetration of uncertain renewable energy generation increases the risks of power imbalance, consequently aggravating the frequency deviation. By contrast, using MWh energy blocks as a proxy for continuous control, as what is done in the current market practices, is insufficient. Power system security is the top priority in power system operation. However, the market design can compromise the power system security to some extent. This study proposed a novel market framework that could incorporate frequency quality concerns into the market design; therefore, generating companies have the motivation to participate in frequency control to ensure power system security under power imbalances. A novel model is presented to explicitly incorporate primary frequency control into the market design. The arguments in the study are that the energy, as a commodity, should be valued by both quantity and quality; thus, the generators that contribute to its quality control should be rewarded. However, because the quality becomes a part of the commodity, it should be differentiated by different costs. A compromise should be found in the markets among the frequency quality of the electrical energy and frequency control cost. Meanwhile, the system operators could ensure that they have accrued control capacity sufficient to achieve satisfactory frequency quality.

NOMENCLATURE
[A] Diagonal matrix with vector A on the diagonal Δ f max The maximum allowed frequency deviation Δ f w , Δ f Frequency deviation that incurs cost, Frequency deviation (Hz) A * Conjugate of vector A C g , C f , C t n b × n g generator connection matrix, n l × n b branch connection matrices from and to ends d Normal frequency variation band D F n z × 1 vector of power change in each zone with respect to the required frequency quality D R n z × 1 vector of zone reserve requirements E NZ f n z × n g matrix, if generator j in zone i participates in the primary frequency control E NZ f (i, j ) = 1, otherwise 0 E NZR n z × n g matrix, if generator j in zone i participates in the reserve market E NZR (i, j ) = 1, otherwise 0 I bus n b × 1 vector of complex current injection K Gi , K Gmax Generator i's primary frequency control contribution (MW/Hz), The vector form of all generators are K G ; n g × 1 vector of the maximum primary frequency control capability of generators n b , b Total number of buses, index set of buses n g , g Total number of generators, index set of generator n l , n z Total number of branches, total number of zones p f , p gi Frequency deviation cost ($/Hz),Generator i's energy bid ($/MWh) P Gi , P Ri Generator i's energy and reserve output(MW);The vector form of all generators are P G , P R P Gmin , P Gmax n g × 1 vector of the lower and upper limits of generators p ri , p c fi Generator i's reserve bid ($/MWh), Generator i's primary frequency control capability bid ($/(MW/Hz)) Q G n b × 1 vector of reactive power generation of all generators R max , R ramp n g × 1 vectors of maximum reserve capacity and ramping rates S f , S t n l × 1 vector of complex branch power flows from and to ends S bus , S d n b × 1 vector of complex power injections; n b × 1 vector of complex load S g n g × 1 vector of complex generation S max n l × 1 vector of maximum apparent power of branch V ∕ n b × 1 vector of bus voltage magnitudes/angles V min , V max n b × 1 vector of lower voltage limit and upper voltage limit