Your problem is that PMIN on each generator is larger than your entire load, so it starts shutting down generators looking for a feasible solution (which doesn’t exist) and it ends up shutting down everything, resulting in an empty gen matrix. If you turn on the verbose option you’ll see what I mean. I modified the code for the next release to avoid the crash.
-- Ray Zimmerman Senior Research Associate B30 Warren Hall, Cornell University, Ithaca, NY 14853 USA phone: (607) 255-9645 On Jul 24, 2014, at 12:13 PM, GengXinbo <[email protected]> wrote: > Hi, > Can anyone help me with the error message described below? Thanks! > > I want to use Matpower to simulate a small market (using the 6 bus system, > case6ww.m). > The key features of the system are: > the generators are at bus #1,#2,#3, > all the load are at bus #4,#5,#6. > > I'm using the ./extras/smartmarket/ code. > Some details: > 1. DC Power Flow > 2. auction type = 0: discriminative > If I set the loads at bus #4,#5,#6 as 1MW. There will be some error messages: > > Index exceeds matrix dimensions. > > Error in opf_setup (line 133) > Pg = gen(:, PG) / baseMVA; > > Error in opf (line 219) > om = opf_setup(mpc, mpopt); > > Error in uopf (line 127) > [results, success] = opf(mpc, mpopt); > > Error in smartmkt (line 87) > [r, success] = uopf(mpc2, mpopt); > > Error in runmarket (line 141) > [co, cb, r, dispatch, success] = smartmkt(mpc, offers, > bids, mkt, mpopt); > > Error in testMain (line 28) > [mpc_out, co, cb, f, dispatch, success, et] = > runmarket(mpc, offers, bids, mkt, mpoption); > > My code is attached. You can put it into the folder ./extras/smartmarket/ and > run it to test. > > Thanks! > > Best, > Xinbo Geng > > > > <testMain.m>
