Hi Malcolm, You should be able to use off2case to set up the piecewise linear cost functions. Here's how I think you'll want to do it. Suppose you have a 100MW generator with an output of 60 MW (you need a nominal dispatch, right?) who is willing to increase from 60 MW for $20/MW or decrease from 60 MW for $10/MW. You want to create an offer (bids are only for consuming energy) with a 60 MW block at a price of -$10 (note this is negative) and a 40 MW block at a price of $20.
I think that should give you the solution you want. Be aware that the price you get from the OPF is the price that should be paid to the generator on the quantity (Pg - 60). That price should be greater than or equal to $20 if Pg > 60. If Pg < 60, the price will be less than or equal to -$10. In both cases, the price times the quantity will be positive, i.e. the generator is receiving payment for moving from the nominal dispatch. You can either use runmarket to run the case, or use off2case to create the generator costs and then call runopf. -- Ray Zimmerman Senior Research Associate 211 Warren Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 On Jun 15, 2010, at 5:13 AM, Malcolm Barnacle wrote: Hi Ray, Thanks for the quick reply. I figured that I didnt add the path after I had sent the email so sorry about that. I am interested in finding the optimum generation mix/generation dispatch, to meet total demand, given a set of bids/offer prices for generation only. The offer's indicating the willingness of the generator to increase its generation and the bid's to indicate a willingness of the generator to decrease its generation. I am wanting to find the optimum generation mix/generation dispatch in order to obtain the optimum DC power flow given these cost statistics. Can any of the subprograms within Matpower, i.e. smartmarket etc... be used solely for this purpose? I was thinking that a possible solution would be for me to input generator bid's\offers into the off2case.m program in order to produce the equivalent piecewise linear generator costs and generator capacity limits, and then to input these new generator costs into the DCOPF. Is this the best way of achieveing my aim? Thanks Again Malcolm ________________________________ From: [email protected]<mailto:[email protected]> [[email protected]] On Behalf Of Ray Zimmerman [[email protected]] Sent: 14 June 2010 17:07 To: MATPOWER discussion forum Subject: Re: Obtaining optimum bid pricing using OPF(smart_market) It looks like you didn't add the extras/smartmarket sub-directory in your Matlab path. -- Ray Zimmerman Senior Research Associate 211 Warren Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 On Jun 14, 2010, at 10:02 AM, Malcolm Barnacle wrote: Hi Ray, Just a quick question. What type of input is required for gen and gencost for the case2off/off2case function to work? The reason why I am asking is that when I run your code in the email below, I get the following error: ??? Undefined function or method 'case2off' for input arguments of type 'double'. All case study examples included with Matpower, as well as my case study produce an input argument for gen and gencost of type double. So, I guess what I'm really asking is what can I do to solve this problem? Thanks for your time. Malcolm Barnacle --------------------------------- Malcolm Barnacle, MEng MIET PhD Research Student Institute for Energy and Environment Department of Electronic and Electrical Engineering University of Strathclyde Royal College Building 204 George Street Glasgow G1 1XW Email: [email protected]<mailto:[email protected]> Tel: +44 (0)141 548 4839 The University of Strathclyde is a charitable body, registered in Scotland, number SC015263 ________________________________ From: [email protected]<mailto:[email protected]> [[email protected]] On Behalf Of Ray Zimmerman [[email protected]] Sent: 24 May 2010 15:55 To: MATPOWER discussion forum Subject: Re: Obtaining optimum bid pricing using OPF(smart_market) Hi Anirudh, I think you misunderstand the purpose of case2off.m. I'm not sure where you got the idea that it does something "optimal". I simply converts the cost data ingencost into an offer consisting of a set of price/quantity pairs. In other words, it is the same data in a different format, essentially a representation of marginal cost instead of total cost (as in gencost). You can convert the data back and forth between the two formats using case2off.m and off2case.m. The purpose ofcase2off.m was simply to generate marginal cost offer inputs for runmkt. Here is one way you might use it. mpc = loadcase('t_auction_case'); [q, p] = case2off(mpc.gen, mpc.gencost); G = find( ~isload(mpc.gen) ); %% real generators L = find( isload(mpc.gen) ); %% variable loads offers = struct( 'P', struct( 'qty', q(G, :), 'prc', p(G, :) ) ); bids = struct( 'P', struct( 'qty', q(L, :), 'prc', p(L, :) ) ); [results, cleared_offers, cleared_bids] = runmarket(mpc, offers, bids); This runs an auction in which all generators are offering full capacity at marginal cost and all dispatchable loads are bidding their maximum quantity at the value of their marginal benefit. The OPF result is identical to simply running the case file directly (results = runopf('t_auction_case')), it's just that the result is also returned as a set of cleared offers and bids. Regarding your second question (b), as I said before, in MATPOWER's auction markets there is no such thing as a transaction between generators. The transaction is always between the generator and the ISO. The offer quantity determines the maximum amount the ISO can buy from a generator. -- Ray Zimmerman Senior Research Associate 211 Warren Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 On May 23, 2010, at 1:58 PM, Anirudh Raghavan wrote: Hello This is a query relating to the use of smart_market code to generate optimum bid pricing for a set of generators. I read that case2off.m is responsible for the conversion of 'gencost' and 'gen' data to an optimum set of bids to buy/sell power to minimize total cost of meeting demand. I'd like to know: a) How to run this code. b) How to apply a fixed transaction limit between any two particular generators. Any help will be greatly appreciated. Thanks Anirudh On Sat, May 22, 2010 at 12:30 AM, Ray Zimmerman <[email protected]<mailto:[email protected]>> wrote: MATPOWER 4.0b4 is available for download from the MATPOWER home page ... http://www.pserc.cornell.edu/matpower/ The primary changes from version 4.0b3 are: * New features: - Added support for the IPOPT interior point optimizer for large scale non-linear optimization. Use OPF_ALG = 580 and OPF_ALG_DC = 400 for AC and DC OPF, respectively. Requires the Matlab MEX interface for IPOPT, available from https://projects.coin-or.org/Ipopt/. - Added RETURN_RAW_DER option to control when OPF solver returns constraint, Jacobian and objective function gradient and Hessian information. - Refactored portions of opf() into opf_setup() and opf_execute(). * Bugs fixed: - Added check for invalid gencost model value in opf_setup(). For a complete and detailed list of changes from previous versions, see the CHANGES file in the distribution, also available at: http://www.pserc.cornell.edu/matpower/CHANGES.txt As always, please send any bug reports, suggestions and comments, to the MATPOWER mailing list (instructions on MATPOWER home page). Enjoy! Ray Zimmerman Senior Research Associate 211 Warren Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645
