长期电力市场仿真

2024-07-14

长期电力市场仿真(精选3篇)

长期电力市场仿真 篇1

0 引言

长期电力市场模拟是研究电源规划,市场规则长期影响的重要工具。随着电力市场中的容量充裕性问题日益显露出来,关于该问题的研究也越来越引起人们的重视[1]。

目前的电力市场长期仿真模型主要为系统动力学模型[3],智能代理仿真模型[4],Monte Carlo模型[5]和短期的电力市场仿真模型[6]。前三种模型是研究一般市场长期影响的主要手段,但是考虑电力系统本身的特点不够。而短期的电力市场仿真模型虽然考虑了详细的市场规则以及电力系统运行约束,但是主要适合短期市场的运行,而进行年度模拟则时间开销太大。

也正是基于此种情况,近年来有一些学者开始研究适合电力市场特征的长期电力市场模拟模型。其中一个方向就是改造一直在电力系统规划中得到广泛应用的电力系统随机生产模拟[7],以适应电力市场的要求。其中早期的研究主要是借用随机生产模拟进行边际成本的计算和方差估计[8,9],目前则希望改进该方法中一些与电力市场严重不相符合的假设[10,11,12,13]。

直接将随机生产模拟技术应用于电力市场仿真存在着明显的限制:随机生产模拟是基于成本的,且该模型的算法通过基于固定成本的排序来开展。而在市场环境下,调度是基于发电机组的报价,发电机组报价则会随供需关系发生变化。因此将随机生产模拟技术应用于电力市场仿真的主要障碍是其发电机组运行成本为常数的假设。

本文构造了一个长期电力市场仿真模型,与电力系统随机生产模拟一样,考虑了发电机组的强迫停运以及负荷随时间的波动。不同的是该模型假设发电机组的报价遵循离散的随机分布,且市场调度按照报价排序购买。在此基础上,本文进一步发展了一种等效机组的方法求解该模型。本文给出了该算法的数学证明以及速度的估计。

1 机组与负荷表示

设系统由n个火电机组构成,其中任意机组i的强迫停运率为FORi,机组的最大发电容量为Ci,分成三个容量段,表示为Ci,1,Ci,2,Ci,3。容量段Ci,1是机组i最小出力或者合同发电要求的容量,Ci,2是机组i在完全竞争的供需情况下的申报容量,而Ci,3表示机组在策略情况下的申报容量。且有Ci=Ci,1+Ci,2+Ci,3。本文为避免符号过于复杂仅仅使用三段负荷,如果需要,可方便地扩充到任意段。

机组不同的容量段的报价服从不同的随机性质。对于Ci,1而言,其按照成本申报,为常数。Ci,2和Ci,3对应的申报电价则用离散的随机变量表示,为避免符号复杂,本文随机报价用三段概率表示,可方便扩充到任意段。而文献[12]使用三段容量对澳大利亚电力市场进行了有效仿真,本文也采用该方式。将机组的申报价格与容量对应,可写成如式(1)的形式。

式中:bi,1表示Ci,1段的报价;表示Ci,1段报价为常数;bi,kl(k=2,3;l=1,2,3)表示第Ci,2,Ci,3段容量分别对应的报价,单位$/MWh;表示第Ci,2,Ci,3段容量不同报价的概率。

每段不同报价的概率之间有如式(2)的关系:

机组的强迫停运与随机报价相互独立,故而考虑强迫停运后,机组的容量概率密度函数为

式中:Ci,0=0表示机组强迫停运的状态,对应的概率pi,0=FORi,没有运行成本。pi,kl表示考虑机组的强迫停运后的各块的概率,有如式(4)的关系。

由式(2)、(4)可得到

系统的负荷采用小时间隔的时序负荷,记为

式中,Lj(j=1,⋅⋅⋅,T)为第j小时的负荷水平,单位MW。

在上述条件下,电力市场的运行将根据每个负荷水平按照排序好的申报价格购买发电量直到负荷平衡。但是由于机组申报价格是随机变量,而且机组的强迫停运也是随机的,这样的模型很难直接求解。文献[12]对这类模型采用了Monte Carlo方法求解。

2 等效机组与模型求解

2.1 等效机组

上述模型中虽然发电机组申报的价格是随机的,但由于采用离散的形式,对式(3)中任意一个容量块(Ci,k,bi,kl,pi,kl)而言,其价格bi,kl却是常数。按照容量块的价格bi,kl排序,然后从低到高购买则体现了按照申报价格最小开始购买的市场出清规则。机组实际运行是根据其被购买的容量块之和的容量出力发电。

上述这个过程与传统随机生产模拟技术中用优良加载序加载机组的原理是相同的。不同的则是,容量块(Ci,k,bi,kl,pi,kl)不是机组,仅仅是机组的一部分,而且还是以概率出现的一部分,此情况既不同于随机生产模拟多状态情况也不同于分段情况,直接采用电力系统随机生产模拟的方法是不行的。为此,本文提出了等效机组的概念,并应用等效机组参与计算来获得模型的解。

当容量块(Ci,k,pi,kl,bi,kl)被加载时,具体构造等效机组的方法如下。

首先计算Ci,1,Ci,2,Ci,3的加载概率。具体计算公式为

式中:pi,2d(d=1,2,3)为式(3)中机组iCi,2段状态d的概率;pi,3d(d=1,2,3)为式(3)中机组iCi,3段状态d的概率。

在此基础上,等效机组容量密度函数为:

其中,xi,3是等效机组容量最大的状态,其概率是概率集合中最小的概率。xi,2的状态是两者取其一,选择谁取决于集合中的最小概率。当为最小的时(也即),表示状态xi,3已经将Ci,3加载概率用完,则选择xi,2=Ci,1+Ci,2,且此时由于Ci,2有一部分已经在xi,3加载,则其概率为。否则为xi,2=Ci,1+Ci,3;同理可解释xi,1的选择。xi,0是机组强迫停运的状态,其概率为。

如此构造的等效机组具有如下的性质:

(1)等效机组所有容量的状态构成了一个完整的随机变量概率密度分布,即

(2)如果计算中,s=3,2则表示等效机组没有这个状态。

(3)块Ci2和Ci3加载时,Ci1必须先加载(该块是最小出力块),因的最大值是1-FORi,故有,相关性得到保证。如果则有加载Ci3时Ci2已被加载。但是否存在这种要求则要根据选择Ci2,Ci3的含义而定。按照本文的选择,应该有这个条件。这里为了表示本方法还可以考虑条件,也给出了考虑的构造方法。

(4)等效机组构造中保证了容量块(Ci,k,pi,kl,bi,kl)对应的机组i所有已经加载的概率与等效机组中容量的概率相等,且单个状态的容量值尽可能大,这为保证等效性提供了条件。等效性的证明则在本文的第3部分给出。

(5)等效机组表示了同一机组所有被加载的容量块的总的出力分布。也就是说,同一个机组的不同容量块的等效机组是相关的。

按容量块排序,用容量块的等效机组代替容量块,则等效机组的概率密度卷积构成有效容量的概率密度函数,并可进一步得到有效容量的概率分布函数,记为Fi,kl。其形状如图1所示。然后利用有效容量的概率密度分布函数计算各项指标。注意,由于上述的性质(5),计算有效容量时,需要卷出之前的同一机组的等效容量。当容量块(Ci,k,bi,kl,pi,kl)加载时,有效容量概率密度函数的计算过程可表示为:

式中:是容量块(Ci,k,bi,kl,pi,kl)的等效机组加载后系统有效容量概率密度函数;是容量块(Ci,k,bi,kl,pi,kl)的等效机组加载前系统的有效容量概率密度函数;gi,kl'为机组i先前一个等效容量机组的概率密度函数;gi,kl为此次加载的(Ci,k,bi,kl,pi,kl)的等效机组的容量概率密度函数;⊕表示卷积运算;⊗表示反卷积运算。

2.2 相关指标的计算

容量块(Ci,k,bi,kl,pi,kl)加载后面对负荷水平Lj系统中所有已经加载的机组的总期望生产电量,而容量块(Ci,k,bi,kl,pi,kl)面对负荷水平Lj的期望生产电量分别表示为

式中:Fi,kl为容量块(Ci,k,bi,kl,pi,kl)加载后的有效容量分布;为加载(Ci,k,bi,kl,pi,kl)前的已加载容量块总期望生产电量。

在考察期内,容量块(Ci,k,bi,kl,pi,kl)总期望生产电量EEi,kl为:

考虑机组的随机报价以及强迫停运后,市场面对确定负荷Lj的边际电价是一个随机变量。当容量块(Ci,k,bi,kl,pi,kl)加载后,市场边际电价大于bi,kl的概率可表示为:

式中,为面对负荷Lj的边际电价,随机变量。

面对负荷Lj,市场边际电价为bi,kl的概率则可以表示为:

式中,为加载(Ci,k,bi,kl,pi,kl)前的有效容量分布。

由式(15),所有机组的计算完后,就可得到边际电价的概率密度分布。

而系统的可靠性指标则在所有容量块加载完后得到的有效容量分布,记为Fall(x),可计算如下:

式中:LOLP为系统的失负荷概率;EUE为系统的期望不服务电量。

从上述讨论可看出,使用等效机组后,利用式(10)获得有效容量的概率密度函数,其计算在随机生产模拟技术的研究中已经发展了丰富的方法,例如直接积分,累积量法,Z变换法等[7,14,15],本文不做详细的讨论,本文将重点集中在等效机组认证上。

3 等效机组等效性证明框架

本部分给出等效机组等效性的证明框架和基本的方法。

设系统有7个机组,其中机组2的容量密度函数为式(3),其他的机组的容量模型是典型的两状态模型,其运行成本都是常数,表示为bi,(i=1,3,4,5,6,7)。即

运行成本的次序为:

对一般系统而言,所有排在b2,1之前的机组都可以等价地看成一个机组,而在机组2不同成本之间的其他机组也可等效为一个机组,故如果能够证明上述条件下的等效机组计算正确,也就证明了其正确性。

所谓等效性证明就是要证明按照等效机组计算的容量块期望生产电量,系统可靠性指标与实际情况相同。

首先证明可靠性指标一致。从等效机组的构造可以看出,当机组的最后一块容量被加载时,其等效机组就是式(18)的两状态模型,这样系统所有容量加载后的有效容量不变,故而系统的可靠性指标计算相同。

其次,证明机组的期望生产电量计算相同。按照机组2随机申报的概率密度函数,可确定可能出现的报价及概率。因为只有机组2的两段容量会随机报价,故有9种可能性,列在表1中。

表1的第2列是机组2的容量段C2,2选中的报价,第3列是其容量段C2,3选中的报价,第4列是出现行所表示的报价情况出现的概率。第5列是该情况下的机组排序,该排序是根据式(19),并考虑机组的报价已经确定时,排除了不出现的情况后的排序。例如表1的第一行事件1,表示机组2容量C2,2申报价格为b2,21,C2,3的申报价格为b2,31,此时机组2是一个多段机组,其计算是传统的分段计算方法计算,见文献[4]。

将表1的每种情况下机组的期望生产电量得到后,按各情况的概率加权可得到总的各容量块的期望电量。如果其与按照等效机组计算所得结果相同则等效性成立。

证明过程本身不困难,只是比较繁琐。由于篇幅有限,仅证明容量块(C2,2,b2,21,p2,21)按照等效机组与按照表1的计算结果一致。其他部分读者如果需要也可向作者索取。

3.1 按照等效机组的计算

按照等效机组计算容量块的期望电量计算步骤就是按照式(19)的加载序,使用等效机组分别计算各块加载后的有效容量密度函数然后求取期望电量。具体计算如下:

设机组1加载后的有效容量概率密度函数记为fg1(x),由式(19)的排序,加载机组2的第一块容量的等效机组。该块的等效机组概率密度函数为:

加载后的有效容量概率密度函数记为,可表示为:

再由式(19),加载机组3。该机组为一个普通机组,其容量概率密度函数由式(18)表示,其加载后的有效容量概率密度函数记为,即为:

以此可求前两个容量块的期望生产电量:

由式(19),继续加载容量块(C2,2,b2,21,p2,21),由式(8)可知的该容量块的等效机组概率密度函数为:

此时一方面要用该容量块的等效机组,另一方面则需要卷出机组2的第一块容量的等效机组概率密度函数。容量块(C2,2,b2,21,p2,21)加载后的概率密度函数为:

容量块(C2,2,b2,21,p2,21)加载后所有加载机组的期望生产电量为:

容量块(C2,2,b2,21,p2,21)的期望生产电量为:

还可以按照式(19)的顺序继续加载机组,计算过程同上述类似,篇幅限制,不再介绍。

3.2 按概率事件计算过程

从表1可看出,当事件1出现时,机组2的C2,2段报价为b2,21,机组2的C2,3段报价为b2,31,表1给出了此时的排序,排序中的b2,1,b2,21,b2,31分别表示机组2三段容量加载的次序。其加载方法是分段加载方法[4]。

设机组1加载后的有效容量概率密度函数记为fg1(x),按照表1第5列的顺序,机组2的第一段容量加载,其对应的有效容量概率密度函数为:

由加载顺序,机组3加载。其加载后的有效容量概率密度函数为:

前两个机组的期望电量为:

有表1的加载顺序,继续加载机组2的C2,2段。此时需要卷去C2,1段,再卷入此两段共同作用的情况。共同作用的容量概率密度函数为:

此时得到的有效容量概率密度函数为:

前三个容量块加载后的期望生产电量为

容量块(C2,2,b2,21,p2,21)在此种情况下的期望电量为:

由表1可知,容量块(C2,2,b2,21,p2,21)的加载仅与前三种情况有关,其他情况没有该容量块。且前三种情况,其加载过程一样。表1的9种情况下(C2,2,b2,21,p2,21)总的期望电量是其各种情况下的加权平均,即为:

比较式(20)、(21)可以看出,按照等效机组的计算所得到的(C2,2,b2,21,p2,21)的期望生产电量与实际的情况相等。

4 算例

以IEEE RTS数据为基础[16],对其中机组的成本数据用随机报价代替,对本文所提算法进行了测试。其中表2是系统的机组情况,负荷则使用第51周的数据。其中,每个机组的容量都分成了三块,且其第2,3块容量随机报价。按照公式(3)形式的数据显示在表3中。

按照本文给出的基于等效机组的计算方法,其中卷积用累积量之和进行。为了比较,同时进行了基于Monte Carlo方法的计算,其中期望生产电量的计算结果显示在表4中,容易看出,两种方法的最大的相对误差为3.91%。这些误差是计算中使用累积量产生的。

本文提出的方法在CPU采用AMD Sempron(tm)2500内存为1 G的条件下,计算需要11.65 s,而Monte Carlo方法为589.32 s。与固定成本时随机生产模拟的计算时间比较,本文方法大约是其的7倍。究其原因,本文提出方法比固定成本的情况多了7倍的等效机组(一个机组用7个等效机组替代)。即便如此,本文方法的计算速度对于市场长期模拟来说依然是可接受的。

5 结论

本文给出了一个长期电力市场理论计算模型,该模型具有如下的特点:

(1)该模型沿用了电力系统随机生产模型关于电力系统运行特征的描述,比较好地继承了长期电力系统模拟的优点;

(2)该模型用离散的随机变量描述机组的报价,比较好地考虑了电力市场的特征;

(3)该模型可以利用等效机组概念进行求解,其求解时间大约是传统电力系统随机生产模拟的m倍,m为随机申报电价的概率密度函数中表示的状态数。其计算时间开销将远远小于Monte Carlo类的模型,已可以接受。

本文给出的理论证明和实际计算证实了上述特点,而这些特点的长期电力市场仿真对于电力市场管理与电源投资等领域的研究是基础性的重要工具。(上接第23页continued from page 23)

长期电力市场仿真 篇2

Over the past two decades,many countries around the world have restructured or are restructuring their power industries by making energy markets competitive,unbundling electricity services and opening access to electrical networks.This reform process resulting in a shift from tight regulation in vertically integrated monopolies to light regulation of functionally separated operational units is an ever challenging task to the power industry.As stated in the July 2001 issue of the Wired magazine,the current power infrastructure is as incompatible with the future as horse trails were to automobiles,However,with concerted effort of public/private coordination,the present power delivery system and market structure can be enhanced and augmented to meet the challenges it faces.

Electrical energy is a unique commodity in the sense that it needs to match supply with demand instantaneously and yet there is no cost-effective means of storage support.Therefore,ancillary services have to be provided in the energy market to ensure stable and reliable power systems be maintained.The recent blackouts in Europe and the United States remind us that stable supply of electricity is indeed essential to sustain well-being in every metropolitan city.A prime concern is to ensure continuous supply of electricity from the point of generation to the end-point of use via sophisticated power delivery function which is changing and growing more complex with the exciting requirements of the digital economy,the onset of competitive power markets,the implementation of modern and self-generation,and the saturation of existing transmission and distribution capacity.Without appropriate investment and careful policy setting,the vulnerabilities already present in today’s power system will continue to degrade[1].

Simply stated,today’s electricity infrastructure is inadequate to meet rising consumer needs and expectations.Specifying and creating new electricity market infrastructure governing the operation of the energy markets is a major challenge since these markets have exhibited wide variation in form and operational characteristics.Computer simulation has been recognized as a useful approach for examining the impact and behavior of different market structures.In recent years,sophisticated market simulation tools have become made available to the industry.Although these tools can provide many useful insights for the power system operators,they are limited in their ability to adequately analyze the intricate interactions among all the market participants prevalent in the deregulated power markets.Driven by these observations,this paper presents a simulator by taking advantages of the Internet for simulating all the trading processes in the power pool.The simulator is developed based on.Net platform,a distributed computing environment with excellent ability of scalability,high efficiency and performance for facilitating market participants to communicate easily with each others through graphical interface[2,3,4].

1 Needs for such type of simulator

Since electricity market involves participants located in wide geographically separated regions,its transactions right from placing bid from generators up to the final settlement stage have been handled as a form of E-Commerce with full support of interfacing commands over the Internet.Such system can enable seamless data exchange between control system operators (include independent system operators,regional transmission operators,transmission system operators) and control area operators already adopted as standard practice in the US and Canada and being partially implemented in Brazil,Thailand,China and part of the United Kingdom.The interfacing of real-time data and control commands require the use of a standard communication protocol,such as CIM (Common Information Models),GID(General Interface Definition),and the ICCP(Inter-control Center Communications Protocol).It prompts the needs to develop the simulator by conforming to the required standard of information systems and procedures to handle the data communication complexity underlying the power system operations.Many of these systems need continuous upgrading,matching with advancement of technologies,and revising the procedures where appropriate[1].

2 Capabilities of this type of simulator

The functionalities of the simulator are asfollows:

a.Visualizing the power system in real time.Realizes real-time communication through an integrated electric and communication system architecture based on the Web.The data are required to be processed by fast computational engine and visualized in user-friendly formats for the system operators to respond and administer.

b.Increasing system capacity.The simulator can support more clients to participate in,making improvements on data infrastructure,upgrading the functions of each module,updating the database from online data and eliminating most of the bottlenecks that currently limit a truly functional wholesale market.

c.Enabling(Enhanced) connectivity to consumers through Web.Having defined the market model,connectivity among participants can be enhanced with improved communications.This enhancement will provide new areas of functionality:one relates directly to electricity services (e.g.,billing information or real time pricing),and another one involves what are more generally thought of as communications services(e.g.,data services)[1].

3 Feature highlights

Common type of market flaws originate from its structural design which can best be identified by means of a power market simulator.Different market rules and associated market-based mechanisms can be included in the simulator to reflect incentives of various market participants for finding ways that benefit stakeholders,facilitate efficient planning for expansion of the power delivery infrastructure,effectively allocate risk,and connect consumers to markets.For example,service providers need a new methodology for the design of retail service programs for electricity consumers.At the same time,consumers need help for devising means to optimizing their usage pattern and all market participants need to handle different sorts of risks.Since efficient operation of both wholesale and retail markets requires transparent and open system of data access,development of certain data and communications standards for emerging markets is necessary.Further,to test the viability of various wholesale and retail power market design options before they are put into practice,power market simulation tools should be able to help stakeholders establish equitable power markets.

4 Architecture and design

4.1 Market structure

Economic modeling is a process to capture economic behavior of a system with such an approach as much an art as science but avoiding complicated market rules so far if possible.Effect market simulator observes the economic characteristics of a market and helps avoid paying unnecessary high reform cost for settling up an optimal market structure.This paper illustrates the process of setting up a simple pool power market model as shown in figure l[2,5,6].

The electricity market participants include:

a.Gencos.All kinds of electricity provider to the network could be regarded as Gencos.Gencos could either bidding in the spot market of the Poolco mode or contract with customers in the bi/multi-lateral market or both.A Genco’s objective is to maximize its own profit by balancing the forward contracts,load and price forecasting,risk management,optimal unit commitment and bidding strategies.

b.Discos.All kinds of electricity consumers from the transmission network could be regarded as Discos,including distribution companies,large customers and retailers.Discos can either bidding in the spot market of the Poolco mode or participate in the bi/multi-lateral contract market or both.A Disco’s objective is to minimize its cost by balancing the forward contracts load and price forecasting,risk management and bidding strategies.

c.PX.PX is usually designed to deal with all sorts of market trading,administer and clear the Pool.PX establishes an energy day-ahead market to match energy supply bids and demand offers,balances the market and dispatch the generators in real time,which acts as a pool administrator and establishes the MCP(Market Clearing Price) or SMP(System Mariginal Price).It is also responsible for exchange settlement and information publishing.And the PX broadcasts the long-term and short-term load forecasting,trading and dispatch information in an electronic bulletin board through the Web.

d.ISO.ISO is independent of all market participants.It is responsible for the technical aspects of system operation,control and management,including security and transmission switching,frequency and balancing power,voltage and reactive power,congestion management and emergency control,and maintenance scheduling.

e.SCs.SC brokers run a separated marketfrom Pool for bi-lateral(multil-lateral contract).SCs could coordinate complicated transactions,offer futures and options contracts and provide attractive price deals.

These are generic constituents of any simulator model of which specific operation can be considered by interfacing among the generic units deemed appropriate to suit the market model under study[3,7,8].

4.2 The structure of the simulator

It is commonly found that simulator in the market is built by using JAVA/MAS-based components,CORBA (Common Object Request Broker Architecture) technology and even integrated software platforms.Also,object oriented structure is popular which has its advantages in distributed design for aspects on safety,robustness,scalability and flexibility.But this tool can support limited clients and has very long development span.The COBRA technology can be regarded as an object oriented tool which can provide a support platform to integrate various software and hardware materials.Owing to that the COBRA technology has serious shortcomings in cross-platform and Internet programming application,the power market simulator in this paper advocates on using.NET Framework based on the B/S (Browser/Server) structure for its excellent flexibility in Internet application[4].

In Internet applications,the B/S structure is widely used to publish huge volume of information on the Web or to provide dynamic information searching functions to client.This structure is compatible with traditional browser such as IE or Netscap.In the client side,their requests can be submitted as database by using the CGI (Common Gateway Interface) drivers on the Web server.In comparison with that developed based on the C/S(Client/Server) principle,the B/S structure has greater flexibility and can support more number of clients.Moreover,all it needs is linking up the client through the Web and subsequent maintenance or update of the system are very easy and flexible.Figure 2 shows a typical layout of the B/S structure[9,10,11]

4.3 Three-layer software architecture of the power market simulator

The simulator is designed with flexibility for establishing an electricity marketplace for one or more of the above three structures with five participants.Trading rules can be specified to suit various market architecture designs to cover a number of crucial issues such as:

a.Accurately evaluate the impact of different market structures and rules on the performance of the market and on the operation of the power system.

b.Analyze the market the operation based on a double-side auction scheme.

c.Determine the MCP and correspondingly the total CP(Cleared Power) for each generation company.

d.Simulate the settlement process.

e.Realize and mitigate market power if any andimpose penalties as required.

f.Specify long-term,day-ahead,or real-time operational frames.

g.Central exchange or tightly controlled dispatch,and so on.

With support of the Internet advancement,theWeb service system based on the layer architectures has proven advantages of high application compatibility and readiness of development tools.Figure 3shows the three-layer framework for developing the basic architecture of the simulator.

The special feature of this distributed module structure is that the configuration can easily be expanded,re-designed,maintained or operated in different platforms in case that the electricity market structures and rules are required to be changed.The functions of each layer are shown as follows:

a.View layer includes various soft components,programs and browser in the client side,which can provide plentiful and flexible interactive user interfaces to display and collect data,and fulfill the requests raised by the client according to the function modules provided in the controller layer.

b.Controller layer is the core of the distributed application system.It is responsible to process all the client requests from the view layer by applying the interfaces in the model layer and return the results to the view layer afterward.The controller layer also has to provide the rules for handling the services and function adjustments according to the clients’requirement.

c.Model layer fulfills the definitions,mainte-nances,access and update of data.The model layer accesses the database in the Microsoft.Net Framework with ADO.NET technology to manage and response the data request from the controller layer.

The design is particularly suitable for developing the graphic user interfaces required to separate the layers between database and display functions.Hence,the developer can modify each layer separately and reduce ambiguity.The structure of the power market simulator based on the.NET Framework can support multi-layer distributed process and make the data passing more readily[9,10,11,12,13].

5 Implementation and analysis

5.1 The development tool of the simulator

The power market simulator makes use of the advanced features of the B/S structure embedded inside the.NET Framework,which has been accepted as a new technology for realizing the distributed Web services based on open standards and heterogeneous platforms.The structure of the.NET Framework is shown in figure 4 with discussion provided in the following context:

a.The program codes are separated from the client UI (User Interfacing) codes.The developer can easily modify the object-oriented and modular based components.After setting the parameters and the rules,these components can be utilized and called upon repeatedly.As a result,it saves a lot of programming time and enhances its efficiency.

b.NET platform is easier to use Internet based development system which out-performs any other similar tools such as DCOM and CORBA.It provides distributed function components on different computer platforms and loosely integrate the system and the Internet.

c.It works with an efficient database that ensures integrity of the system for easy maintenance.

d.Its object oriented features,such as scala-bility and class inheritance,make it adaptive for supporting 10 times more users than J2EE and inter-operation of multiple programming languages.

e.It can recompile the program into a DLL document while modifying the program,which can realize the secrecy of the program itself and secure the safety of the market data.

5.2 Key technologies

5.2.1 CLR(Common Language Runtime)

The source programs developed by Common Language Specification can be compiled into the same MSIL (MicroSoft Intermediate Language) and be called by each others on the.NET platform.Whatever programs the system adopts,they will be decoded into MSIL format codes and transplanted on the.NET platform.In operation,the MSIL format codes would be loaded and translated into binary codes in the local computer by its CLR compiler.

5.2.2 Database accessing technology:ADO.NET

ADO.NET is the best database accessing technology based on Internet application program,which can support various databases with OLEDB data source,such as SQL Server2000,Oracle and Sybase etc..It boxes most of the database operations into a set of objects,which are ready to be called by other program for execution.Moreover,it is an excellent database accessing technology in the server side for it needs to handle less number of layers between the front end application program and the data source for normal operation.Also,it needs less memory and disc storage to manipulate the data,even without knowing its source.By comparing with other database technology such as CGI,ADO.NET is well established for its flexible operations and multithreading.

5.3 Design of the system

The ASP.NET 2.0 is employed for developing the interface of the display layer with C#as the program language and SQL Server2000 as the database.The flowchart of the simulator is shown in Figure 5.

In its operation the server-side technology is fully utilized to create the Web pages by converting the algorithm into appropriate classes and then complied it into DLL files.Hence,the database operations which are embedded into the classes are manipulated to generate the I/O as required.By so doing,the structural platform can easily be used to call the instance of the classes to run the market clearing algorithm[12,13,14].

5.4 A pool-model market simulation results

To test the features and performance of the simulator,the example in reference[7]is employed.In this example,there are five generators and single demand bidding over four time intervals.The algorithm for determining market clearing price is embedded into the class,which is called by graph forming module.The graph function module could easily get the results by calculating the sum of the supply and demand incremental curves’areas.In Tab.1,the dispatched power of each generator is listed.A case referring to the 2nd time interval of the example in reference[7]is shown in figure 6.

Both the Gencos and Discos can submit their offers through the bidding interface and get the trading results through the information publishing module.The administrator runs the calculating engine and dispatches the roles and rights of all participants,through which different participants can act on their own strategic bids and get corresponding private and public information based on their rights.

6 Findings and comments

It has been shown that the Web-based power market simulator is operationg in modular format and adaptive for use by different market participants,ISOs,market administrators (e.g.,PXs) and interested parties within the market covering a wide geographical area.It serves various purposes including developing market rules and trading strategies,operation and resources planning,etc..

The market simulator has also been proven to be a useful tool for developing market functional modules by making different Web-based,object-oriented and distributed network technologies.It allows market functions be provided through the grid and adaptive for heterogeneous platforms.

7 Conclusion

In this paper,the electricity market simulator designed to be adaptive for studies on different market behavior has been presented and demonstrated in operation on pool-model power markets.The simulator system is developed based on the B/S structure taking advantage of the Internet and.NET platform with good flexibility and extensibility.It has also been shown that the modular features make it adaptive for used by different market participants including the market operators.

长期电力市场仿真 篇3

基于代理的仿真主要由一系列代理和运行规则来模拟代理决策以及它们之间的相互影响,已经成为电力市场研究的一种重要方法。利用代理模型,通过在控制条件下的重复实验,可以实现对现实电力市场的精细模拟和量化分析,进而研究各种电力市场模式、市场机制的效率和潜在的不足[1]。

目前代理的学习方法有遗传算法、强化学习法等,其中,Roth-Erev(RE)法、Q-learning法等强化学习法是最常用的代理算法[2,3]。在强化学习算法中,代理的策略选择是一个重要环节,通常以轮盘赌的方式来实现,即根据各策略的效用值及由随机发生器生成的随机数来选择。随机发生器的不同,会在一定程度上影响代理的初始策略及之后各轮的策略选择,进而影响仿真的结果。因此,在基于代理的电力市场仿真中,随机发生器的类型及参数设置是需要考虑的一个重要内容。文献[4]制定了基于代理的仿真实验设计的一些标准,对随机发生器,文中指出为了实验结果的可检验性,应该说明随机数的生成方式及随机发生器中种子的设置。在现有的基于代理的电力市场仿真方面的文献中,有些对随机发生器的设置进行了说明,大多数则没有说明。

为了保证基于代理的电力市场仿真结论的有效性,在随机数方面,有许多问题需要研究,例如:随机数的生成方式会如何影响仿真结果?电力市场仿真中随机数生成应采用哪种方式?随机发生器中种子应该如何设置?计算机领域有一些关于随机数的研究,大多侧重于一些特殊要求的随机数生成方式[5,6,7,8]。文献[9]讨论了适应地理信息系统(GIS)要求的随机发生器,文献[10]讨论了随机数生成方式的不同对遗传算法效率的影响,并提出了改进的措施。电力市场仿真对随机发生器有一些特殊的要求,但在公开发表的文献中,尚未见到相关的报道。

本文以RE法为例,分析了随机数对基于代理的电力市场仿真结果的影响,比较了几种随机数生成方法在其中应用的优劣。此外,通过研究随机数与代理的关系,探讨了对随机数性质的要求,并提出一种改进的随机数生成方法以提高基于代理的电力市场仿真实验的效率和质量。

1 随机数在代理仿真中的应用环境

在电力市场代理仿真中,强化学习算法应用的步骤通常如下:

步骤1:选择各代理的策略集合,初始化各种竞标策略概率。

步骤2:按概率(如轮盘赌)选择各代理的竞标策略。

步骤3:根据电力市场规则进行出清。

步骤4:各代理根据市场出清结果计算各自的产量和利润(收益),对所选的策略进行计算以获得各代理竞标策略的学习效用。

步骤5:按照修正参数修改策略集合中各竞标策略的被选概率。

步骤6:若满足仿真轮数达到最大迭代次数,或策略的概率大于规定值,则输出最终结果;没有满足,则转步骤2。

步骤2中,策略选择的过程如下:根据各策略的选择概率形成各行为对应的选择概率区间,随机生成一个(0,1)间的随机数,判断此随机数在哪个概率区间,从而,此概率区间所对应的行为策略被选中。

2 随机数在Java中的产生方法

计算机不会产生绝对随机的随机数,只能产生伪随机数,即一种理想的有规律的随机数。因此,计算机产生的伪随机数既是随机的又是有规律的,大多程序语言(如Java,MATLAB,C等)都是采用线性同余法[10]生成随机数。下面以Java为例对常用的几种随机数生成方法进行简单介绍。

2.1 Random函数生成随机数

利用Math类中的Random函数生成随机数是Java中最简单的随机数生成方式,可以直接返回[0.0,1.0)之间的double类型的值。

2.2 Random类生成随机数

在Java语言中,还可以通过Random类来产生随机数。它有2种形式的构造函数,分别是Random()和Random(seed)。利用Random()实例化对象时,Java编译器会以系统当前的时间作为随机数生成器的种子[10]生成第1个随机数,然后通过调用不同的方法:nextInt(),nextLong(),nextDouble()等获得不同类型随机数。与其不同的是,Random(seed)采用的是指定的seed作为发生器的种子。

在仿真中,有很多随机过程,不同的仿真实验环境对随机数的性质要求不同,对随机过程应有更加深刻的认识,使具体应用的随机过程中的参数设置更加精细,改善相应的随机函数的生成方法,以得到适应于实验的最佳随机序列。

3 随机数在代理仿真中的影响分析

文献[9]提出合理选择一个适合空间分析的伪随机数发生器要遵循4项原则:面向应用原则、面向方法原则、精确高效原则、多重实验原则。针对基于代理的电力市场仿真实验的需要,本文对仿真中随机数的性质提出了3点基本要求。(1)可检验性:即重复性;(2)高效性:随机数生成的效率高;(3)均匀性:随机数在特定的区间均匀分布。

本文研究的电力市场仿真实验由参数相同(见表1)的6个发电商参与竞价,采用完全代理的方式,不考虑网络约束,市场出清价格(MCP)出清,代理的算法采用RE算法[11],报价方式是分段线性报价[12],段数取4,实验采取的收敛判据是仿真结果连续相同的次数达到设定值,此处设定值取100。

3.1 Random方法对代理仿真结果的影响

本实验中,实验盘数取10,r=0.03,e=0.97,k=0.1,统计每盘实验的收敛轮数和收敛时的MCP。其中,r为遗忘因子,其对于各行为倾向随时间的增加起抑制作用;e为一个经验参数,对代理在重复博弈早期学习阶段生成各种不同的报价策略起到鼓励作用;k是用来调整冷却系数的一个参数。表2列出了用Random方法产生随机数选择策略的实验结果。

注:收敛轮数和MCP的算术平均值分别为154.20和0.334 5元/(kW·h);标准差分别为55.45和0.105 1元/(kW·h);差异系数(标准差相对于算术平均值的百分比)分别为35.96%和31.42%。

从表2可以看出:不同的实验结果差距很大,收敛轮数的差异系数达到35.96%,且收敛轮数大多仅比设定值高出几十轮,说明很快就找到“最优策略”,学习时间太短;MCP的差异系数达到了31.42%,且平均出清价格为0.334 5元/(kW·h),远远偏离了边际成本价格0.23元/(kW·h)。实验过程中还出现4次不收敛的情况,可以看出随机数对实验的影响很大。

在电力市场仿真实验的设计方法中,为了减小实验的误差,一般采用多盘算术平均值的方法[11];为了使得优化问题尽量向全局最优收敛,往往在算法上加以改进[13]。本文将从随机数的性质深入研究其对实验的本质影响。

图1为Math.random()任意产生的一组随机数,可以看出随机数的随机率太大,第2个~第4个随机数都是落在(0.8,0.9)。对于实验而言,虽然随机数值不同,但落在同一个策略概率空间,即为重复现象。初始时,连续落在一个概率范围会导致该策略不断加强,很快收敛;或某2个策略不断交互加强,导致无法收敛,影响代理选择策略的判断能力。

实际上,计算机生成的随机数在整个可行域内并非均匀分布,例如:在文献[10]的例子中线性同余发生器生成的随机数区间为[0.058 8,0.941 1]。当参与者策略个数为20时,第1个和最后一个策略的选中率几乎为0,导致策略无效。

综上所述,利用本方法生成随机数的随机率太大,导致不同实验设置下实验结果间的比较不可靠,无据可循。

3.2 Random类生成随机数分析

3.2.1 无种子

以系统当前时间作为随机数生成器的种子,与3.1节方法近似,此处从略。

3.2.2 有种子

每个种子生成的一个随机序列就是一个代理学习过程中所获得的随机数序列。在选择策略的概率时,采用一个发电商分配一个种子的方法,这样可以确保在增加或减少发电商、增加或减少策略个数、算法变换时,随机序列不变,实验更具可比性。

附录A图A1所示为6个代理(各种子从0依次递增1)在学习过程中获得的随机序列。图中,随机序列第1个数值均为0.75左右,在后续的随机数中,发电商所获得的随机数重复的现象比较频繁,这意味着第1轮各发电商的初始选择策略相同,随后又同时加强相同的策略,最终很容易达到收敛。但实际情况是,即使发电机组参数、可选策略相同,对于不同的决策者,学习过程也是不同的。

通过大量的实验研究发现,限于篇幅,附录A图A2仅给出种子差为1 000的随机序列分布图,当随机种子间的差距为1 000(或呈较大倍数增加)时,差距拉开。

常规上要求产生的每个随机序列有足够长的周期,但进行电力市场研究时,算法配置某些参数所需要的随机数远小于这个周期(如当r=0.03,e=0.97,k=0.1时每个序列需要的随机数不超过50个),始终不可能完全用到整个周期内的随机数,因此所用的随机数并非均匀随机,每个策略所选的概率并非均匀分布。此外,Java生成的随机小数为16位,较小的分辨率容易导致多个数值接近的随机数落入相同的累计概率区间,多次选择并加强某一策略,降低了学习的能力。

利用这种方法,可以通过种子跨度的设置来控制各代理获得的初始随机数,使其相差较大。然而这种方法并不能控制固定种子下的随机序列在各策略区间均匀分布,因而不能提高代理在学习过程中择优的力度。

3.3 改进的带种子随机数生成方法的应用分析

基于代理的电力市场仿真中所需理想的序列是在每盘学习中,出现于各策略区间的随机数具有相同的概率,这与随机策略总数有关。本文提出一种利用带种子随机数生成方法生成整型数,通过基数来控制整型数的生成区间获得随机数的方法,其中,基数是指函数nextInt(int N)中的N:

表3描述了策略数为50时,不同的基数生成随机序列中各随机数落入各策略区间的概率的差异系数。当基数小于策略数时,一些区间随机数落入的概率为0,差异系数很大,各策略被学习的概率不等,导致相应区间的策略无效,实验过程中也可以发现,这样的情况不易收敛。当基数不小于策略数时,落入仿真实验需求的区间中的概率分布相对均匀,有利于策略获得相同的概率加强,从而降低容易陷入局部最优的可能性。

针对基数不小于策略数会获得较优结果,本文做了2组实验(盘数为20,r=0.02,e=0.97,k=0.1):

1)确定策略数,改变随机数的初始种子

以策略数50为例,不同种子下的电力市场仿真实验结果如图2、图3所示。图中所标种子皆指第1个代理的种子,+1 000表示后续各个代理依次以1 000递增获取种子,×10表示后续各个代理依次以10倍递增获取种子。

各代理种子间跨度设为10倍的方法下,出清电价和收敛轮数波动较大且无规律,结果不理想。初始种子间跨度设为1 000,不同初始种子下,基数N设在(50,200)即lg N值在(1.7,2.3)区间内,出清电价基本稳定在边际成本附近,收敛轮数均保持在500轮~700轮;随着基数增加,周期逐渐增加,生成随机数的性质逐渐接近前面介绍的2种方法,学习时间逐渐减少,出清电价也逐渐偏离边际成本。

2)确定种子,改变策略数

以初始种子设为16 500为例,当基数不小于策略数时,不同策略数下电力市场仿真实验结果如图4、图5所示。

收敛轮数和出清电价随策略数的变化而改变,这是由市场本身性质决定的。从图4、图5可看出,随着基数的变化,出清电价和收敛轮数仍有规律,如策略数为40时,lg N值在(1.6,2.1),即基数设在区间(40,150),收敛轮数保持在300轮~400轮,出清电价在边际成本价格0.23元/(kW·h)附近。随着基数的增加,收敛轮数迅速下降,学习时间逐渐减少,出清电价也偏离边际成本,呈增长趋势。

因此,将基数设在大于并接近于策略数的这段区间内均比较合适。根据实验结果,为简化研究,可以将基数设为策略数的2倍,此时,也可以延长代理的学习时间,避免过早收敛,提高了选择的力度。

4 结果分析

本文从随机数本身的性质和其在基于代理的电力市场仿真中的应用2个方面进行分析和研究,得出了如下分析结果:

1)随机数的随机性导致了实验结果的变化无规律,验证时无据可循;不同算法、不同参数下的实验结果受随机数影响很大,结果分析不严谨。本文采用种子生成固定随机数序列的方法,实现了实验结果的可重现性,为实验提供了一个降低随机性影响的设计方法。

2)实验中,一个种子分配给一个代理,该种子生成的随机序列即为该代理学习过程中获得的随机序列,故可以通过改变种子的方法来改变参与者的学习过程。从本文中可以了解,种子间跨度小,虽然不同,但所获得的初始随机数相差很小,拉不开所产生的随机数在整个序列中的距离,导致具有相同策略空间的代理选择的初始策略都是相同的。但是,代理算法是用来模拟人类的行为的,不同的人会有不同的选择方案,本文对不同种子生成随机数的周期规律进行研究,发现当种子间跨度较大(如相差1 000)时,生成的初始随机数差距较大。

3)对于某一代理而言,分配得到一个种子,获得一个随机序列。本文提出了一种新的方法,通过基数来控制随机数的分辨率,较优地实现了随机序列在初始策略累积概率区间的均匀分布,提高了各个策略都被强化的可能性,延长了学习时间,提高了选择力度。

5 结语

本文分析了随机数对基于代理的电力市场仿真结果的影响,研究了随机数与代理的关系,提出了仿真对随机数的要求,最后构建了一种改进的随机数生成方法,提高了实验的效率和可信度,在实现代理仿真实验的可重现性的同时保证了电力市场参与者行为的随机性。

对于实验方法的设计,还有很多问题需要研究,以使实验结果分析更为严谨,实验结论更为可信。

1)本文以RE算法为例进行分析,但RE算法本身具有一些弊端[11,13]。可以在本文研究的基础上,更有效地比较不同的学习方法,来进行对电力市场的研究。

2)除了本文讨论的随机数问题,还有很多影响基于代理的电力市场仿真实验结果的因素:策略空间的生成方式、策略数目、代理算法本身的参数,市场参与者的相关参数等。需要用因素分析法对多参数情况进行综合研究。

3)制定出基于代理的电力市场仿真实验的一系列标准,规范化仿真实验设计,使以后的改进实验更为可行。

附录见本刊网络版(http://aeps.sgepri.sgcc.com.cn/aeps/ch/index.aspx)。

上一篇:水处理工艺下一篇:作文教学对策