optimal demand-side bidding strategies in electricity spot markets

10
1204 IEEE TRANSACTIONS ON POWER SYSTEMS, VOL. 27, NO. 3, AUGUST 2012 Optimal Demand-Side Bidding Strategies in Electricity Spot Markets Rocío Herranz, Antonio Muñoz San Roque, José Villar, and Fco. Alberto Campos Abstract—This paper proposes a methodology for determining the optimal bidding strategy of a retailer who supplies electricity to end-users in the short-term electricity market. The aim is to min- imize the cost of purchasing energy in the sequence of trading op- portunities that provide the day-ahead and intraday markets. A ge- netic algorithm has been designed to optimize the parameters that dene the best purchasing strategy. The proposed methodology has been tested using real data from the Spanish day-ahead and in- traday markets over a period of two years with a signicant cost reduction with respect to trading solely in the day-ahead market. Index Terms—Electricity markets, genetic algorithms, strategic bidding. NOMENCLATURE A. Indexes and Sets 1 Trading markets (0 for the day-ahead market and 1 to 7 for intraday markets). Hours belonging to a set where each market is cleared. Set of hours with the same number of trading opportunities. Points of the residual offer curve of the retailer under study. B. Parameters Load forecast at each hour [MWh]. Maximum purchase capacity of the retailer [MWh]. Quantities of the total residual offer curve in [MWh]. Price of in the residual offer curve [ /MWh]. Manuscript received December 21, 2010; revised May 24, 2011, October 19, 2011, and December 07, 2011; accepted January 15, 2012. Date of publica- tion March 02, 2012; date of current version July 18, 2012. Paper no. TPWRS- 01034-2010. The authors are with the Instituto de Investigación Tecnológica (IIT), which belongs to the Universidad Ponticia Comillas, Madrid 28015, Spain (e-mail: [email protected]; [email protected]; Jose.Villar@iit. upcomillas.es; [email protected]). Digital Object Identier 10.1109/TPWRS.2012.2185960 1 Some indexes have been suppressed in the text for the sake of simplicity. C. Variables Market clearing price in each market and hour [ /MWh]. Optimal energy purchase [MWh]. Imbalance cost respect to the load forecast [ ]. Imbalance energy with cost [MWh]. Proportion of energy bought after market with respect to the total load forecast. Binary variable to indicate the activated step of the residual offer curve for the optimal cleared energy . Purchase energy in each step of the residual offer curve (null if ) [MWh]. D. Functions Aggregated demand of the rest of retailers in each market and hour in . Demand curve of a general retailer. Aggregated supply function of the competitors. Supply function of a retailer. Residual offer curve of a retailer. I. INTRODUCTION D UE to the great variety of spot markets and market rules designs, many approaches have been presented in the lit- erature to deal with the design of optimal bidding strategies. In [1] four main aspects are used to classify the variety of pro- posed methodologies: different spot market mechanisms, price taker or price maker agents, uncertainty modeling and resolution methodologies. Other features, such as the amount of informa- tion that is released, how agents are willing to hedge against risk, and the representation of power systems, such as transmis- sion networks constraints, are also considered. This introduction briey reviews these four topics prior to describing the method- ology proposed in this paper to compute the optimal bidding of a buying agent. On the whole, electricity markets are organized in a sequen- tial way, where trading takes place through a set of different mechanisms, which range from long-term bilateral contracts to very short-term transactions. Generally, most energy is traded in a day-ahead market (DM), and most related literature optimizes the bidding strategies for this type of markets (see Table I). De- pending on the country, there may or not exist additional trading 0885-8950/$31.00 © 2012 IEEE

Upload: comillas

Post on 14-May-2023

0 views

Category:

Documents


0 download

TRANSCRIPT

1204 IEEE TRANSACTIONS ON POWER SYSTEMS, VOL. 27, NO. 3, AUGUST 2012

Optimal Demand-Side BiddingStrategies in Electricity Spot MarketsRocío Herranz, Antonio Muñoz San Roque, José Villar, and Fco. Alberto Campos

Abstract—This paper proposes a methodology for determiningthe optimal bidding strategy of a retailer who supplies electricityto end-users in the short-term electricitymarket. The aim is tomin-imize the cost of purchasing energy in the sequence of trading op-portunities that provide the day-ahead and intradaymarkets. A ge-netic algorithm has been designed to optimize the parameters thatdefine the best purchasing strategy. The proposedmethodology hasbeen tested using real data from the Spanish day-ahead and in-traday markets over a period of two years with a significant costreduction with respect to trading solely in the day-ahead market.

Index Terms—Electricity markets, genetic algorithms, strategicbidding.

NOMENCLATURE

A. Indexes and Sets1

Trading markets (0 for the day-ahead market and1 to 7 for intraday markets).

Hours belonging to a set where each marketis cleared.

Set of hours with the same number of tradingopportunities.

Points of the residual offer curve of the retailerunder study.

B. Parameters

Load forecast at each hour [MWh].

Maximum purchase capacity of the retailer[MWh].

Quantities of the total residual offer curve in[MWh].

Price of in the residual offer curve [ /MWh].

Manuscript received December 21, 2010; revised May 24, 2011, October 19,2011, and December 07, 2011; accepted January 15, 2012. Date of publica-tion March 02, 2012; date of current version July 18, 2012. Paper no. TPWRS-01034-2010.The authors are with the Instituto de Investigación Tecnológica (IIT), which

belongs to the Universidad Pontificia Comillas, Madrid 28015, Spain (e-mail:[email protected]; [email protected]; [email protected]; [email protected]).Digital Object Identifier 10.1109/TPWRS.2012.2185960

1Some indexes have been suppressed in the text for the sake of simplicity.

C. Variables

Market clearing price in each market and hour[ /MWh].

Optimal energy purchase [MWh].

Imbalance cost respect to the load forecast [ ].

Imbalance energy with cost [MWh].

Proportion of energy bought after market withrespect to the total load forecast.

Binary variable to indicate the activated step ofthe residual offer curve for the optimal clearedenergy .

Purchase energy in each step of the residual offercurve (null if ) [MWh].

D. Functions

Aggregated demand of the rest of retailers ineach market and hour in .

Demand curve of a general retailer.

Aggregated supply function of the competitors.

Supply function of a retailer.

Residual offer curve of a retailer.

I. INTRODUCTION

D UE to the great variety of spot markets and market rulesdesigns, many approaches have been presented in the lit-

erature to deal with the design of optimal bidding strategies. In[1] four main aspects are used to classify the variety of pro-posed methodologies: different spot market mechanisms, pricetaker or pricemaker agents, uncertaintymodeling and resolutionmethodologies. Other features, such as the amount of informa-tion that is released, how agents are willing to hedge againstrisk, and the representation of power systems, such as transmis-sion networks constraints, are also considered. This introductionbriefly reviews these four topics prior to describing the method-ology proposed in this paper to compute the optimal bidding ofa buying agent.On the whole, electricity markets are organized in a sequen-

tial way, where trading takes place through a set of differentmechanisms, which range from long-term bilateral contracts tovery short-term transactions. Generally, most energy is traded ina day-ahead market (DM), and most related literature optimizesthe bidding strategies for this type of markets (see Table I). De-pending on the country, there may or not exist additional trading

0885-8950/$31.00 © 2012 IEEE

HERRANZ et al.: OPTIMAL DEMAND-SIDE BIDDING STRATEGIES IN ELECTRICITY SPOT MARKETS 1205

TABLE IDIFFERENT MARKETS CONSIDERED BY SOME REFERENCES

opportunities. In the Spanish case, intraday markets (IM) allowagents to adjust their schedules to their latest forecasts or toreal time operating conditions. In addition, ancillary servicesmarkets (RM) are typically managed by the system operator toensure electricity supply under suitable conditions of security,quality and reliability [2]. Table I lists the markets consideredby different authors to optimize short-term bidding.A market agent can be considered as a price taker when his

cleared energy does not significantly affect the resulting marketprice [3], [4], [11], [16]. In this case, to guarantee a positivemargin, generators offer their energy at marginal costs while re-tailers try to buy at a price that satisfies their expected income.In both cases the strategy comes down to a decision about whichmarkets to buy or sell energy in. For example in [3], [4], [11],and [16], the strategy of a price taker is optimized given marketprices forecasts, thus ignoring market price changes due to itsown cleared energy. However, even if a price taker does notset the market price, his bids shift the total aggregated biddingcurves and affect the final price. This effect could be especiallysignificant in adjustment markets where a much smaller amountof energy is traded. In these cases using residual curves fore-casts is the most common approach to properly model the effectof the agent on the market prices [6], [13], [14]. The decisionvariables of the optimization problem can either be quantities(the agent sells at marginal cost and buys at maximum price),or both quantities and prices [5]–[8], [12]–[14] when the opti-mization result is the whole offer curve.Price takers and price makers are exposed to different sources

of uncertainty. Indeed, works focusing on price taker agentsusually maximize their profit, considering uncertainty only inmarket prices and typically using different price scenarios as in[3], [4], and [11].A model for price uncertainty based on the probability den-

sity functions of forecasted prices is developed in [3]. In [4]the definition of price scenarios is based on the forecasted priceand on the historical error observed in the forecasting process,which uses a combination of neural networks and fuzzy logic.In addition, [4] improves the method proposed in [3] by consid-ering both risk averse and risk seeker agents, in the sense thatthe scenarios used to build the bids are selected according tothese risk attitudes. In [11], price scenarios are sampled fromprices forecasted with time series and artificial neural networkstechniques. A small price taker agent’s strategy is optimized in[16], in which the authors propose a stochastic linear program-ming model with scenarios for the day-ahead and balancingmarket prices and load prediction errors. The scenarios are gen-erated by an algorithm that produces a discrete joint distribu-tion consistent with the values of the first four marginal mo-ments and the correlations of each variable. In [17], the authorsoptimize the strategy of a retailer in the U.S. California power

market, introducing uncertainty in the demand as a martingaleand considering that the prices are random variables. They solvea stochastic dynamic problem with three sequential markets. In[18], the performance of an energy buyer through a long anda short-term market is analyzed. The purchase allocation ap-proach minimizes the total purchase cost, taking into accountthe price volatility and the risk that is reflected by the variance ofthe cost. A risk weighting factor is defined to avoid purchasingenergy in the market with the cheapest price but larger volatility,concluding that the energy should be bought in more than onemarket.When the influence on price is taken into account, since

uncertainty (such as the demand forecast, fuel costs and thestrategic behaviors of other agents) is implicit in their supplyand demand functions, it is a common practice to generatescenarios of these supply and demand functions from pastdata. Reference [6] represents competitors’ behavior witha probabilistic residual demand linear function obtained byclustering past data, and takes into account the risk assumedby the market participant. In [13], residual demand curves aresampled from past realizations, with demand similar to theexpected demand for the day of study. [14] obtains residualdemand curve patterns by clustering past data, and determinestheir probabilities with decision trees. The patterns and theirprobabilities are supplied to a stochastic optimization model.The resolution of the optimal bidding problem is dealt with

using different methodologies. Mathematical programmingtechniques are the most frequently implemented as in [3],[4], [7], [8], [11], and [13]–[18]. Game theory is also appliedby some authors. For instance, [9] proposes a model basedon a Cournot iterative equilibrium. However, Nash equilib-rium approaches [19] seem more suitable for the long andmedium-term rather than for optimizing short-term strategies.Indeed they represent ideal and stable situations where noagent can increase its profit from a unilateral change in itsstrategy, while real time real markets are very dynamic andcannot be considered at the equilibrium, but rather fluctuatingover time around a theoretical equilibrium, that in practiceis never reached. In addition, although detailed informationof competitors cost functions is generally not available, mostof the information of the competitors aggregated behavior isinternalized in the aggregated offer or supply curve, which inthe case of the Spanish market is available just after marketclearing. Equilibrium models are developed in [20], where theconditions under which a purchaser should bid his expecteddemand are analyzed. In [6], the optimal offer curves arecomputed with a genetic algorithm (GA). In [12], the strategicbidding problem is formulated as a stochastic optimizationproblem, and a refined GA with binary encoding is imple-mented to solve it. The difference between the refined and aconventional GA is that the crossover probability decreases andthe mutation probability increases, with the iteration number.A GA together with price forecasting techniques is applied in[21] to select appropriate bidding strategies, although the priceuncertainty is not considered. In [10] a nodal pricing model isassumed and a GA is used to find the strategy that optimizesa two level problem: at the first level, a market participantmaximizes his expected profit while at the second one the

1206 IEEE TRANSACTIONS ON POWER SYSTEMS, VOL. 27, NO. 3, AUGUST 2012

system operator solves an optimal power flow for dispatching.The competitor’s behavior is modeled probabilistically. A GAcomputes the optimal strategy, the fitness being the expectedprofit, calculated using a separate Monte Carlo simulation.There is a clear methodological parallelism between the

strategy optimization of energy buyers and sellers, and whilemost of the previous references [3]–[15], [21] deal with theoptimization of the generator’s bidding strategies, some ofthem [16], [18], [20] do focus on the optimal bidding problemof a retailer who supplies electricity to end-users.This paper proposes a methodology to compute the optimal

bidding of a demand side agent operating in the day-aheadmarket and intraday markets and subject to the imbalancepenalty mechanism. Given an amount of energy to be purchasedat each hour, purchasing costs are minimized by deciding theamount of energy to sell or to buy over the whole sequence ofavailable trading opportunities. The basic assumption of thisapproach is the feasibility of learning from the recent past inorder to take advantage from the differences in the residualsupply functions of the different markets that persist over time.These differences are a consequence of the strategic behaviorof the market agents, which typically evolve as a sequence ofstable regimes.In the proposed methodology the agent is assumed to sell at

a minimum price or to buy at a maximum price. His influenceon market prices is considered by computing the new clearingprices, using his residual offer curves (analogous to the residualdemand curve but from the point of view of an energy buyer) ineach market, which in the Spanish case are published immedi-ately after the clearing of eachmarket. Uncertainty is consideredusing amovingwindowof residual offer curves corresponding tothe recent past. AMonte Carlo-like simulation is performed con-sidering that the residual supply curves of the moving windoware all equiprobable simulation scenarios. These curves are usedto optimize, using a GA, the bidding strategy for the followingday. Each day is broken into sets of hours with identical tradingopportunities, and a different optimization problem is solved foreach set. This tends to group hours with similar demand levels,and thus similar trading strategies.There are several contributions in this paper with respect to

previous works. Firstly, the paper formulates a practical, robustand adaptive procedure to optimize the bidding strategy of a re-tailer. It has been designed taking into account the rules thatregulate the participation of a real agent in the Spanish market,and only uses the information that is available at the moment ofpreparing the offer. Robustness is achieved avoiding over-fit-ting, by minimizing the number of decision variables, since thesame strategy is applied for all the hours sharing a same numberof trading opportunities, but also by using out-of-sample vali-dation techniques during the fitting process. In addition, uncer-tainty is considered by facing each bidding strategy against amoving window of recent past scenarios that are supposed torepresent the distribution of the expected residual supply. Thesize of this moving window has been empirically optimizedusing the whole training period for a better representation of theexpected residual supply. Finally, adaptation is guaranteed bythe moving window, since the strategy is re-estimated for eachday.

Secondly, the influence of the agent strategy in the marketprice is taken into account by reproducing the clearing processwith the residual supply curves (however computed ignoringbids constraints among different hours). Indeed, assuming aconstant market price could lead to significant errors when thecorresponding residual supply presents a large slope around theclearing point.Finally, the formulation of a classic optimization problem (as

the Appendix shows) leads to a nonlinear and rather complexprogramming model, hard to solve with commercial solvers.The use of GA provides an alternative and effective solving ap-proach that has proved to perform adequately for the whole setof training and testing data, as large as a two-year period.The paper is organized as follows. Section II contains a

description of the problem and a full explanation of the marketframework and of the residual offer curves. Section III providesa detailed formulation of the problem that is solved by theproposed GA, which is described in Section IV. Section Vdeals with the adjustment process of the GA parameters, andSection VI presents the results of testing the found biddingstrategies. Finally, conclusions are drawn in Section VII.

II. PROBLEM DESCRIPTION

A. Market Framework

This paper focuses on the optimal demand-side bidding inan electricity spot market that includes several independent andsuccessive short-term trading auctions: the DM, the IM (up tosix sessions that are equivalent to seven trading opportunities)and an imbalance penalties mechanism. The objective is to min-imize the final costs of the purchased energy in the above-men-tioned markets.The structure and data of the selected framework correspond

to the Spanish electricity market [22], [23]. Spot markets in-volve economic and technical issues that can be managed byone or several operators. In the Spanish case the spot market isconstituted as a sequence of short-term auctions economicallymanaged by the market operator (MO) and technically managedby the system operator (SO). It consists of a DM, several IM,ancillary services markets, balancing markets and an imbalancepenalties mechanism. In the Spanish case there are no nodalprices since the transmission constrains are solved by a specifictwo-phases-constraints market. For the sake of simplicity thispaper will only focus on the DM and IM. The largest volumeof energy is currently traded in the DM that covers the 24 hoursof the day ahead. For each hour, the agents submit their offersto sell or to buy. Market clearing produces a schedule of pro-duced and consumed energy over the 24 hours of the next day,as well as the energy prices. After the DM, seven IM take place,with the purpose of allowing participants to correct their energyschedule in the event of deviations from the previous one.The MO determines the marginal price and the accepted bids

by intercepting the aggregated offers to buy with the aggregatedoffers to sell for each hour. Offers to sell settled are those underthe market price and offers to buy settled those over the inter-section. Although beyond the scope of this paper, the Spanishbids mechanism also makes it possible to constrain the energycleared among different hours [22].

HERRANZ et al.: OPTIMAL DEMAND-SIDE BIDDING STRATEGIES IN ELECTRICITY SPOT MARKETS 1207

Fig. 1. Equivalent timetable for DM and IM sessions for Spanish market.

After every intraday market session, the SO manages realtime deviations, using ancillary services and, if needed, sum-moning balancing markets. Each market participant is respon-sible for balancing between the real generation or consumptionand the cleared quantities. If imbalances finally occur, how-ever, the agents are penalized for their contribution to the globalsystem imbalance.For the sake of simplicity, the sequence of the Spanish

markets has been reorganized into an equivalent session’stimetable, shown in Fig. 1, where crossed grey cells repre-sent when the MO receives the bids and clears each market,and the black and grey cells the time scope of the bids sent.Seven IM have been represented since the 21–24 hours of IM1are in fact like a new IM for the current day, often called IM7.As can be seen, day can be partitioned into 6 sets ofhours, each one with the same number of trading opportunities:1–4 hours (S1), 5–7 hours (S2), 8–11 hours (S3), 12–15 hours(S4), 16–20 hours (S5), and 21–24 hours (S6). For example,for all the hours belonging to set S1, energy can be traded inDM, IM1 and IM2, while for set S2, it can be traded in DM,IM1, IM2, and IM3. A different optimization problem is setout for each set. In addition, this partition helps in groupingtogether hours with similar demand levels, and thus likely sim-ilar strategic behaviors.

B. Market Clearing and Price Computation

Many approaches have been proposed in the literature tomodel market clearing and price computation [1]. In this papera residual offer curve [24] (analogous to the residual demandcurve but from the point of view of an energy buyer) is used tocompute the market price for each cleared energy.At each hour and for eachmarket, the aggregated supply

indicates the amount of energy to sell at price , and is computedas the sum of all the supply functions of all the generating units.The supply of the rest of participants, , is obtained bycombination of the total aggregated supply and the agent’sown supply as follows:

(1)

Similarly, the demand of the rest of the participants,, can be computed from the total aggregated market

demand by subtracting the agent’s own demand :

(2)

Given and , for each hour and for eachmarket, the agent’s residual offer is given by

(3)

In case the agent is a potential new incoming, as it is in thecase example of this paper, its own historical supplyand demand would logically be null.The residual offer curve provides the quantity that

a retailer can buy at each clearing price , or equivalently, theprice that results from a cleared quantity (negative quantitiescorresponding to energy selling):

(4)

Spanish residual offers are stepwise functions. For simplicity,the range of market prices has been discretized withsamples, yielding to simplified stepwise functions representedwith vector with prices and the corre-sponding vector quantities . The number ofsamples has been selected large enough to guarantee that theoriginal curve is well enough approximated.

III. BIDDING STRATEGY FORMULATION

This paper addresses the bidding problem faced by an energybuyer that has to buy a specific amount of energy for each hourat the available power auctions DM and IM. Its principal ob-jective is the minimization of the total purchase cost. For thesake of simplicity, the buying and selling prices have been set,respectively, at the maximum and minimum Spanish regulatedmarket prices (180 /MWh and 0 /MWh) in order to guaranteethat the bids are always cleared, provided that there is enoughenergy traded in the corresponding market. The strategic deci-sion variables are thus the hourly energy (MWh) that theagent is willing to buy in every market (0 standsfor DM and 1-7 for IM) and hour .To consider uncertainty, the cost function has been defined

over a moving window of residual offer curves correspondingto the recent past behavior of the market competitors. For eachwindow a fixed set of strategic parameters is optimized and ap-plied to the day ahead. The cost of buying energy in a settle-ment period is then computed as

(5)

where is the size of the moving window (see Section V-B);is the cleared energy at hour in each market ;

is the market clearing price and is the imbal-ance cost that has been set at

(6)

where is the imbalance energy incurred by the retailer givenby

(7)

1208 IEEE TRANSACTIONS ON POWER SYSTEMS, VOL. 27, NO. 3, AUGUST 2012

being the perfect forecast of the load that should theoreticallybe bought at each hour .As can be seen, imbalances have been heavily penalized. If

the retailer is short (his final cleared energy is lower than thatwhich was scheduled), the deficit of energy is penalized at themaximum market price 180 /MWh. On the other hand, if theretailer is long (his final cleared energy is higher than sched-uled), the surplus of energy is paid at null price.In the proposed approach, the retailer makes his decisions as

follows. He always uses his best load forecast at the time of sub-mitting his offer. His first offer are the pairs sub-mitted to the DM for each hour , where the purchased energy

is a proportion of its initial load forecast:

(8)

Coefficient is one of his decision variables, and has beenassumed to be constant for all the hours of a same set of hours,being the proportion of energy bought after DM with respect tothe total energy to be bought.The cleared energy and the new market price are

computed from (4). To avoid unrealistic clearing, the offer islimited by the maximum energy that is being sold or bought ateach hour and market session:

(9)

Note that provides the energy that can be bought atprice in market and hour . In this approach, offer priceshas been set to 180 /MWh for the buying and 0 /MWh forthe selling.In addition the bought energy is always constrained to the

maximum purchase capacity of the agent (declared to theMOand SO) since otherwise its offers would be rejected:

(10)

After DM clearing, the retailer’s schedule can be correctedin the subsequent adjustment markets (IM). Depending on theset of hours considered, the number of trading opportunities,including DM, range from 2 to 7 (see Fig. 1). The quantities tobe sold or bought are given by

(11)

where are the decision variables for IM market for theset of hours. Note that means that a positiveamount of energy is bought in market . The cleared energy

at market price for each IM market is computed asfor the DM, generalizing (9) and (10):

(12)

(13)

To avoid imbalances the quantity submitted to the last ad-justment market available is computed with , so im-balances take place only if not enough energy is traded in the

last adjustment market. In this case the imbalance energy is cal-culated using (7). The final energy schedule results from thecleared energies over this sequence of market mechanisms.Accordingly, a different optimization problem to minimize

the total purchasing cost can be solved independently for eachset of hours. For example, the optimization problem for set S6,which has DM and seven IM different trading opportunities, isformulated as follows:

(14)

(15)

(16)

(17)

(18)

(19)

(20)

IV. PROPOSED OPTIMIZATION ALGORITHM

A. Genetic Algorithm

The optimization problem formulated in the previous sectionhas been solved using a genetic algorithm (GA) [25]. GA doesnot require specialized optimization software such as CPLEX(avoiding licenses costs), is easy to implement with general pur-pose programming languages, and is very flexible for problemswith nonlinear constraints or binary variables. The Appendixdescribes an alternative mathematical programming model forthe current problem, which could be solved with CPLEX. How-ever it can be check that the model is nonlinear (because of thepurchase cost to minimize) and has a rather large number of bi-nary variables for the residual offer curve representation (in thecase study of this paper at least 54 600 for S1 and S2, and up to145 600 for S6) that seriously compromise its real applicability.GA performs a stochastic search starting from an initial pop-

ulation of solutions (individuals) generated randomly. Each in-dividual, corresponding to a possible solution to the problem,was coded as a vector of real numbers that represent the deci-sion variables .The decision variables were forced to be within the search

domain . The optimization ofevery set was carried out separately on account of the differentnumber of decision variables that each set has. For instance,the individuals of the population of S1 contain the decisionvariables for the DM, the IM1 and theIM2 markets, while the individuals of population of S6 contain7 decision variables, one for each market. Fig. 2 depicts the

HERRANZ et al.: OPTIMAL DEMAND-SIDE BIDDING STRATEGIES IN ELECTRICITY SPOT MARKETS 1209

Fig. 2. Proposed GA structure.

overall algorithm for S6 case, where the individuals have 7genes to compute the 7 bids to submit to the 7 different markets.Fitness—that measures how good a solution is—and in-

dividual coding are the main links between the GA and theproblem to be solved. The minimization problem formulatedin Section III was turned into a maximization problem in orderto apply a GA, where fitness calculation entailed clearing themarkets.Individuals are selected from the previous population to

create the so-called mating pool. This selection was per-formed according to their fitness, using a roulette wheelwith a ranking mechanism. Individuals are selected ran-domly from the mating pool and offspring are generatedaccording to a crossover probability. Given two individuals

and of length , theiroffspring and arecomputed by interpolation and extrapolation as follows:

(21)

(22)

where and are random numbers in .Mutation is performed by randomly generating a new value

for a gene within its search domain, whose location is also se-lected randomly, and performs better if its probability is largerat the beginning and decreases with the number of iterations.Finally, an elitist replacement was applied to guarantee that thebest individual was always included in the new population.

B. In-Sample and Out-Sample Sets

Cross validation techniques [26] were applied to ensure thegeneralization capability of the proposed solution. A movingwindow is used as in-sample set for determining the bestcoefficients for minimizing the total cost of purchasingenergy in themovingwindow. The optimal coefficients arethen tested with the out-sample set of the following day. Thismeans that the GA determines the optimal strategy for the recentmarket behaviors implicit in , assuming that these behaviorswill still approximately hold in .The process applied consists in selecting a size (number of

days) for the moving window , optimizing the coefficientsfor this window, applying these coefficients to calculate

the bid for the 24 hours of the next day , and moving andone day ahead, so that the new in-sample and out-sample sets

are and , respectively. This process continues overthe whole period studied.

V. GA FITTING PROCESS

The case of a new incoming retailer with 100 MWh of max-imum hourly purchase capacity in the Spanish electricity marketwas used to fit the parameters of the GA and the size of thein-sample set . In the first step, the GA parameters (popula-tion size and crossover and mutation probabilities) were deter-mined by running the GA with different values and selectingthe best combination in terms of convergence performance andexecution times. Then the moving window size was empiricallyoptimized.

A. Setting GA Parameters

The parameters of the GA were set to obtain the combina-tion of its values that lead to the best convergences by run-ning exhaustive searches. Exhaustive optimizations were pre-viously performed (by sampling the decision variables rangesand testing all combinations) to verify that the GA was indeedfinding the expected global optimum.The population size is one of the key parameters of the GA.

Large population sizes may lead to very slow performances,whereas too small sizes may lead to insufficient exploration ofthe search domain and therefore to premature convergences. Inthis case its size was finally adjusted to 25 individuals.Roulette wheel with ranking selection improves the selection

process when the fitness values in a population are too differentor too similar. The individuals are sorted according to their fit-ness, and their ranking, raised to an integer power, is used tobuild the roulette wheel. The performance of the GA proved tobe better when the squared ranking was used.Using a PC with 2 processors, 3.16 GHz and 4 GB of RAM,

the optimal bid of a day is found in about 10 min, which makesthe procedure more than acceptable for its use in a real timeenvironment. The final parameters selected for the GA were apopulation size of 25 individuals, roulette wheel built from thesquared ranking, a crossover probability of 0.8, mutation prob-ability starting at 0.4 and linearly decreasing down to 0.1, anda maximum of 100 iterations. Convergence held in all the casestested.

1210 IEEE TRANSACTIONS ON POWER SYSTEMS, VOL. 27, NO. 3, AUGUST 2012

Fig. 3. Purchasing cost and price versus the moving window size.

B. Sizing the In-Sample Set

The in-sample set is used to determine the set of coef-ficients to build the bids for the following day. Its size,in terms of the number of past days used to determine the op-timal coefficients , was empirically optimized by testingdifferent window sizes for different maximum purchase capac-ities and different time periods. The optimal window size wasalways 4 or 5 weeks, with small differences between them. Awindow size of 5 weeks was finally selected and applied forall the studied cases. Fig. 3 shows how the total purchase costand the energy purchase cost vary with the number of weeks(from 1 to 9) using the data of year 2009 for a retailer with100 MWh of maximum hourly purchase capacity. Weeks offive days (Monday to Friday) were used, since previous anal-ysis showed that costs increased if Saturdays or Sundays wereincluded in the same strategy. As can be seen costs reach a min-imum around 5 weeks (25 days). Therefore it was decided to es-timate the decision variables for the bids of the day withthe residual offers of the 5 previous weeks (ignoring weekendsas already mentioned).

VI. RESULTS

The methodology formulated in this paper, designed for theSpanish electricity market, was tested with the years 2008 and2009. The case of a new incoming retailer with different max-imum hourly purchase capacities (50 MWh, 100 MWh, 200MWh, 300 MWh, 400 MWh, and 500 MWh) was further in-vestigated in this section. Weekends were removed, and onlyworking days were considered, simplifying the learning algo-rithm by eliminating the weekly seasonality. To preserve a sim-ilar pattern, the retailer energy forecast to be bought, , wasset to a proportion of the total electricity demand of the retailersof the Spanish electricity system. Retailers’ demand, the aggre-gated supply and the total demand were obtainedfrom public real data supplied by the MO and SO [22], [23].Indeed the MO publishes the selling and buying curves sent toeach market after its clearing. The stepwise residual offerscan then be built by aggregating these original functions sam-pled as described in Section II-B.In this study, the strategy optimized with the GA has been

compared with the strategy of trading uniquely in the DM. Thisstrategy is equivalent to setting to 1 for every market

TABLE IITOTAL COST OF A RETAILER WITH DIFFERENT CAPACITIES (M )

TABLE IIIENERGY PURCHASE PRICE ( /MWh)

and for every set of hours, and has been referred to as the“ ” strategy.Table II summarizes the results obtained, and shows the total

purchase cost saving for each retailer maximum purchase ca-pacity considered, and for both the optimized and thestrategies. A comparison of the different purchase capacitiesshows that 500 MWh for 2008 and 50 MWh for 2009 are thepurchase capacities that provide the lowest buying costs.Table III shows the energy purchase cost for the same cases. It

can be seen that this cost in 2008 is considerably higher than in2009. One of the main reasons is that the average final marketprice decreased by 38.7% in 2009 with respect to 2008. BothTables II and III show that better results are obtained when pur-chases are optimally allocated in the available markets ratherthan only in the DM, since the energy cost saving ranges from0.97 to 1.53 /MWh. These results raise the question of hownear the equilibrium the market is. Indeed, at the equilibrium noarbitrage possibilities should exist between the different tradingopportunities.Table IV shows the average market prices for each set of

hours. The real market prices are shown at the top of this table,thus not including the effect of the new retailer. The row with

shows the new DM prices when a 200 MWh retailerbuys all the energy in this market, which increases with respectto the real case. Obviously in this case intraday markets pricesremain the same. At the bottom of this table are the prices ob-tained when the same retailer applies the GA optimal strategy.It can be seen that, in general, original DM prices were

higher than IM prices allowing for arbitrage between them. Theamounts of energy that can be bought or sold in the availablemarkets depend on the relationship between the slopes oftheir residual offer curves, or equivalently, on how their pricesfluctuate for a same amount of energy. As can be seen fromTable IV, DM prices increase more for since with theoptimal strategy only 20% of the energy is bought in the DM.It can also be seen that the optimal strategy tends to produce

HERRANZ et al.: OPTIMAL DEMAND-SIDE BIDDING STRATEGIES IN ELECTRICITY SPOT MARKETS 1211

TABLE IV2009 HOURLY AVERAGE SPOT PRICES ( /MWh)

TABLE V2009 HOURLY AVERAGE CLEARED ENERGY (MWh)

much closer DM and IM market prices for each set of hours,logically reducing further arbitrage opportunities.Table V shows the energies bought in eachmarket for both the

optimal and strategies (positive sign indicates energypurchasing, while negative indicates selling). For the sets S1 andS2, the retailer finishes with a long position because of the lackof liquidity in the market. In particular, in S2 the retailer has, forsome days, bought too much energy in the DM and the IM1 thatit cannot sell in the IM2 and IM3. However the penalty applied[the excess of final cleared energy with respect to the initialforecast is sold at 0 /MWh; see (5)] is compensated by theprofits this strategy brings on other days of the moving window.With the proposedmethodology, the retailer tends to purchase

the energy in the cheapest markets, taking into account how hisown strategy affect their final prices. Indeed if all the energy ispurchased in the cheapest market, its price will increase due to alarger demand, and could become higher than for other markets.In this sense, for S2 it can be seen that it is worth purchasingmost but not all the energy in the IM1, which is initially thecheapest one.Finally, Fig. 4 shows the evolution of the coefficients of the

S2. For each market , coefficients correspond to the pro-portion of bought energy after this market with respect to thetotal energy to be bought, provided that liquidity holds. It canbe seen that the coefficients show significant variations overthe whole period, reflecting the market evolution, although they

Fig. 4. Coefficients in 2009 of the retailer of 200 MWh.

also present shorter periods of stability, corresponding to stablestrategic behavior on the part of most agents. One of the mainbenefits of the proposed methodology is that it is capable ofreadily adapting to the market changes, accounting for the in-fluence of most relevant factors. However, as in any adaptivestrategy, this response may be slightly delayed.It can also be seen that there are different strategic behaviors

over time. For example, at the beginning of the period, there aremany hours in which the DM coefficient is under 0.07, meaningthat most of the forecasted energy must be bought in the subse-quent markets, in particular in IM1 and IM3. Around the middleof the period, it becomes profitable to buy extra energy in IM1,which is sold in IM3, and near the end of the period, for somehours, it also becomes profitable to buy extra energy in DM, andIM1, which is sold again in IM3.

VII. CONCLUSIONS

This paper provides a novel and practical methodology fordetermining the optimal short-term demand-side bidding in anelectricity market with various trading floors, such as a day-ahead market and several intraday markets. It implements a ge-netic algorithm to find the proportion of load to be submitted toeachmarket for minimum purchase costs. The genetic algorithmperforms global searches and has proved to be very effective insolving the problem faced, whereas conventional optimizationtechniques are much more difficult to apply to these types ofnonlinear complex problems. The moving window of residualsupply curves used to fit the optimal strategy gives a dynamicperspective of the bidding problem and provides the necessaryadjustments to the evolution of the market. This allows the re-tailer to dynamically adapt his strategy to his competitors’ be-havior by learning from his recent past.The results obtained show evidence of arbitrage opportunities

in the Spanish electricity market for an incoming buying agent.However, to effectively benefit from these opportunities, theproposed methodology models how the agent’s own strategicbehavior modifies the market price. In this sense this method-ology shows the level of market maturity or equilibrium.The analysis of the case studies makes it possible to conclude

that the strategy designed is effective, feasible and robust in

1212 IEEE TRANSACTIONS ON POWER SYSTEMS, VOL. 27, NO. 3, AUGUST 2012

achieving the minimum cost of purchasing energy under the as-sumptions considered, even if the market behavior evolves overtime.Although this methodology has been developed for demand-

side bidding, it could also be applied for supply-side bidding,especially for renewable technologies with negligible marginalcost.Future research could focus on monitoring the strategic deci-

sion variables to detect and interpret changes in the market andin the competitor’s strategies, and applying this methodology tomeasure the degree of market equilibrium or arbitrage opportu-nities. Finally a comparative study of different GA encodingsand evolving strategies could improve the optimization perfor-mance for its practical implementation.

APPENDIX

This Appendix describes an alternative nonlinear and mixedBoolean mathematical programming model equivalent to(14)–(20) for obtaining the optimal purchasing strategy ofthe retailer under study. The mathematical formulation of themodel is as follows:

(23)

(24)

(25)

(26)

(27)

(28)

(29)

(30)

(31)

Equation (23) minimizes the total cost of purchasing the en-ergy over the markets for all the sets , taking into accountthe imbalance costs of (6). Constraints (24)–(26) represent theresidual offer curve, being if the purchased energy

is in the interval of this curve ( isa very small positive parameter). Constraint (27) models the re-sulting marginal price , being the marginal price

TABLE VIBINARY VARIABLES OF EACH GROUP OF HOURS

of the residual offer curve if . Finally, constraints(28), (29), and (30) are the same linear conditions of (11), (13),and (7) respectively.Note that the objective function is nonlinear and even non-

convex since themarginal price and the optimal purchaseare both decision variables (see for example [24] and

[27]). In the case study of this paper every day strategy computa-tion involves 614 250 binary variables (675 hours in all marketsby 5 weeks by 182 samples for each residual offer curve). If theproblem is solved separately for each , the number of binaryvariables is shown in Table VI.The nonlinearity of the objective function and the large

number of binary variables seriously complicate the use ofcommercial optimization software such as CPLEX, which isunable to find the solution. This is due to the fact that CPLEXis more suited for linear problems but performs very poorlywhen the number of binary variables exceeds . In [13], [24],and [28], the bidding and residual demand curves are approxi-mated with piecewise linear functions to simplify the proposedelectricity market model. Although a similar approach couldbe applied here for the residual offer curve modeling, a largenumber of binary variables would still be needed.

REFERENCES[1] A. Baíllo, S. Cerisola, J. M. Fernández-López, and R. Bellido,

“Strategic bidding in electricity spot markets under uncertainty: Aroadmap,” in Proc. IEEE Power Eng. Soc. General Meeting, 2006,pp. 1–8.

[2] Y. G. Rebours, D. S. Kirschen, M. Trotignon, and S. Rossignol, “Asurvey of frequency and voltage control ancillary services—Part I:Technical features,” IEEE Trans. Power Syst., vol. 22, no. 1, pp.350–357, Feb. 2007.

[3] A. J. Conejo, F. J. Nogales, and J. M. Arroyo, “Price-taker biddingstrategy under price uncertainty,” IEEE Trans. Power Syst., vol. 17,no. 4, pp. 1081–1088, Nov. 2002.

[4] C. P. Rodriguez and G. J. Anders, “Bidding strategy design for differenttypes of electric power market participants,” IEEE Trans. Power Syst.,vol. 19, no. 2, pp. 964–971, May 2004.

[5] J. García-González, J. Román, and J. Barquín, “Strategic bidding inderegulated power system,” in Proc. 13th Power Syst. ComputationConf., Trondheim, Norway, 1999, pp. 258–264.

[6] A. Mateo, E. F. Sánchez-Úbeda, A. M. S. Roque, J. Villar, A. Saiz-Chicharro, J. T. Abarca, and E. Losada, “Strategic bidding under un-certainty using genetic algorithms,” inProc. 6th Int. Conf. ProbabilisticMethods Applied Power Syst., Funchal, Portugal, 2000.

[7] A. J. Conejo, J. Contreras, J. M. Arroyo, and S. D. L. Torre, “Optimalresponse of an oligopolistic generating company to a competitive pool-based electric power market,” IEEE Trans. Power Syst., vol. 17, no. 2,pp. 424–430, May 2002.

[8] S. de la Torre, J. M. Arroyo, A. J. Conejo, and J. Contreras, “Pricemaker self-scheduling in a pool-based electricity market: A mixed-integer LP approach,” IEEE Trans. Power Syst., vol. 17, no. 4, pp.1037–1042, Nov. 2002.

[9] J. Contreras, O. Candiles, J. I. de la Fuente, and T. Gómez, “A cobwebbiddingmodel for competitive electricity markets,” IEEE Trans. PowerSyst., vol. 17, no. 1, pp. 148–153, Feb. 2002.

[10] V. P. Gountis and A. G. Bakirtzis, “Bidding strategies for electricityproducers in a competitive electricity marketplace,” IEEE Trans.Power Syst., vol. 19, no. 1, pp. 356–365, Feb. 2004.

HERRANZ et al.: OPTIMAL DEMAND-SIDE BIDDING STRATEGIES IN ELECTRICITY SPOT MARKETS 1213

[11] T. L. M. Shahidehpour and Z. Li, “Risk-constrained bidding strategywith stochastic unit commitment,” IEEE Trans. Power Syst., vol. 22,no. 1, pp. 449–458, Feb. 2007.

[12] F. Wen and A. K. David, “Optimally co-ordinated bidding strategiesin energy and ancillary service markets,” Proc. Inst. Elect. Eng., Gen.,Transm., Distrib., vol. 149, pp. 331–338, 2002.

[13] A. Baíllo, M. Ventosa, M. Rivier, and A. Ramos, “Optimal offeringstrategies for generation companies operating in electricity spot mar-kets,” IEEE Trans. Power Syst., vol. 19, no. 2, pp. 745–753, May 2004.

[14] A. Ugedo, E. Lobato, A. Franco, L. Rouco, J. Fernández-Caro, andJ. Chofre, “Strategic bidding in sequential electricity markets,” Proc.Inst. Elect. Eng., Gen., Transm., Distrib., vol. 153, pp. 431–442, 2006.

[15] J. García-González, A.M. S. Roque, F. A. Campos, and J. Villar, “Con-necting the intraday energy and reserve markets by an optimal redis-patch,” IEEE Trans. Power Syst., vol. 22, no. 4, pp. 2220–2231, Nov.2007.

[16] S. E. Fleten and E. Pettersen, “Constructing bidding curves for aprice-taking retailer in the Norwegian electricity market,” IEEE Trans.Power Syst., vol. 20, no. 2, pp. 701–708, May 2005.

[17] H. Yan and H. Yan, “Optimal energy purchases in deregulated Cal-ifornia energy markets,” in Proc. IEEE Power Eng. Soc. WinterMeeting, 2000, pp. 1249–1254.

[18] Y. Liu and X. Guan, “Purchase allocation and demand bidding inelectric power markets,” IEEE Trans. Power Syst., vol. 18, no. 1, pp.106–112, Feb. 2003.

[19] C. A. Díaz, J. Villar, F. A. Campos, and J. Reneses, “Electricity marketequilibrium based on conjectural variations,” Elect. Power Syst. Res.,vol. 80, pp. 1572–1579, Dec. 2010.

[20] A. B. Philpott and E. Pettersen, “Optimizing demand-side bids in day-ahead electricity markets,” IEEE Trans. Power Syst., vol. 21, no. 2, pp.488–498, May 2006.

[21] C. W. Richter and G. B. Sheble, “Genetic algorithm evolution ofutility bidding strategies for the competitive marketplace,” IEEETrans. Power Syst., vol. 13, no. 1, pp. 256–261, Feb. 1998.

[22] Market Operator of ElectricityMarket of the Iberian Peninsula, OMEL.[Online]. Available: http://www.omel.es.

[23] Transmission System Operator of the Iberian Peninsula, Red Eléctricade España, S.A., Sistema de Información del Operador del Sistema(e•sios). [Online]. Available: http://www.esios.ree.es.

[24] A. Baíllo, “Amethodology to develop schedules and offering strategiesfor a generation company operating in a short-term electricity market,”Ph.D. dissertation, Univ. Pontificia Comillas, Madrid, Spain, 2002.

[25] E. G. David, Genetic Algorithms in Search, Optimization and MachineLearning. Reading, MA: Addison-Wesley, 1989.

[26] M. Stone, “Cross-validatory choice and assessment of statistical pre-dictions,” J. Roy. Stat. Soc. B. Met., vol. 36, pp. 111–147, 1974.

[27] J. García-González, J. Barquín, and J. Román, “Building supply func-tions under uncertainty for a day-ahead electricity market,” in Proc. 6thInt. Conf. Probabilistic Methods Applied to Power Systems, Funchal,Portugal, Sep. 2000, pp. 25–28.

[28] J. M. Fernández-López, A. Baíllo, S. Cerisola, and R. Bellido,“Building optimal offer curves for an electricity spot market: Amixed-integer programming approach,” in Proc. 15th Power SystemsComputing Conf., Liège, Belgium, Aug. 22–26, 2005.

Rocío Herranz received the Industrial Engineeringdegree in 2008 and M.S. degree in electric powerin 2010 from the Universidad Pontificia Comillas,Madrid, Spain.She has been a research assistant at Instituto de In-

vestigación Tecnológica (IIT) of Universidad Ponti-ficia Comillas since 2008 to 2011. Her areas of in-terest include modeling and simulation of the elec-tricity market, the application of artificial intelligencetechniques, and time series forecasting.

Antonio Muñoz San Roque received the IndustrialEngineering degree in 1991 and the Ph.D. degree inindustrial engineering in 1996 from the UniversidadPontificia Comillas, Madrid, Spain.Currently, he is with the research staff at the

Instituto de Investigación Tecnológica and he is alecturer in analog electronics at the ICAI Schoolof Engineering. His areas of interest include theapplication of artificial intelligence techniques tothe monitoring and diagnosis of industrial processes,nonlinear system identification and time series

forecasting, analog electronics, and digital signal processing.

José Villar received the degree in electronic engi-neering in 1991 and the Ph.D degree in 1997 from theSchool of Industrial Engineering (ICAI) at the Uni-versidad Pontificia Comillas, Madrid, Spain.Since 1997, he has been a Researcher at the

Instituto de Investigación Tecnológica of ICAI, andteaches electronics in its Electronic Department. Hisareas of interest include the application of advancedtechniques such as knowledge based systems, softcomputing, intelligent information systems, anddata mining to very different areas such as online

monitoring and diagnosis of industrial processes, or operation and planning incompetitive electricity markets.

Fco. Alberto Campos received the degree in math-ematics in 1999 from the Universidad ComplutensedeMadrid, Madrid, Spain, and the Ph.D. degree in in-dustrial engineering from the Universidad PontificiaComillas, Madrid, in 2006.Currently, he is Research Fellow at the Instituto

de Investigación Tecnológica. His areas of interestinclude the application of possibilistic Nash games,simulation and risk analysis techniques to the opera-tion and planning of electric power systems.