The problem here is that you've made the problem infeasible by adding
conflicting constraints. Remember, dispatchable loads are implemented as
generators (with PMAX = 0 and PMIN < 0). Each dispatchable load already has a
constant power factor constraint, included automatically by MATPOWER, that
keeps the Q/P ratio equal to the original ratio. This ratio is not zero for the
loads in case9, but you have added another constraint to these "generators"
trying to force the power factor to equal 1 (Q/P ratio = 0) and these
constraints conflict. You need to modify A, l and u, to only include rows for
the original generators, not the dispatchable loads. Check out the isload
function to help you find which are the real gens.
I still question why forcing the power factor to equal 1 for all generators
except the reference gen is so important to you. Are any real power systems
ever operated under such constraints?
--
Ray Zimmerman
Senior Research Associate
211 Warren Hall, Cornell University, Ithaca, NY 14853
phone: (607) 255-9645
On Mar 16, 2011, at 7:04 AM, Carlos Gonzalez Almeida wrote:
> Dear Prof. Zimmerman
>
> I want to do runmarket with following offers and bids also with PF=1 for
> generators and the following error is occurred.
> Could you please help me?
>
> define_constants;
> mpc0= loadcase('case9');
> mpc = load2disp(mpc0);
> offers.P.qty = [200; 150; 180];
> offers.P.prc = [30; 40; 50];
> bids.P.qty = [70; 70; 70];
> bids.P.prc = [100; 90; 80];
> mkt.OPF = 'AC';
> nb = size(mpc.bus, 1);
> ng = size(mpc.gen, 1);
> pf = 1;
> QPratio = sqrt(1/pf^2 -1);
> mpc.A = sparse([1:ng 1:ng]', [2*nb+(1:ng) 2*nb+ng+(1:ng)]',
> [QPratio*ones(ng,1); -ones(ng,1)], ng, 2*nb+2*ng);
> mpc.A = mpc.A(2:end, :);
> mpc.l = zeros(ng-1, 1);
> mpc.u = mpc.l;
> [r, co, cb] = runmarket(mpc, offers, bids, mkt);
>
> Results
>
> Warning: Matrix is singular to working precision.
> > In mips at 422
> In mipsopf_solver at 145
> In opf_execute at 106
> In opf at 225
> In uopf at 154
> In smartmkt at 90
> In runmarket at 141
> Warning: Matrix is singular to working precision.
> > In mips at 422
> In mipsopf_solver at 145
> In opf_execute at 106
> In opf at 225
> In uopf at 154
> In smartmkt at 90
> In runmarket at 141
>
> SMARTMARKET: non-convergent UOPF??? Error using ==> mtimes
> Inner matrix dimensions must agree.
>
> Error in ==> smartmkt at 170
> price = mkt.lim.P.max_offer * ones(ng, 1);
>
> Error in ==> runmarket at 141
> [co, cb, r, dispatch, success] = smartmkt(mpc, offers, bids, mkt, mpopt);
>
> Best Wishes
>
> Carlos