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 in gencost 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 of case2off.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
