It means that you do not have a reference bus defined in your case file. One of 
the buses should have the BUS_TYPE column (2) set to REF (3).

-- 
Ray Zimmerman
Senior Research Associate
419A Warren Hall, Cornell University, Ithaca, NY 14853
phone: (607) 255-9645




On Sep 14, 2012, at 1:41 AM, Richard Ngonga wrote:

> I am getting the following error message whenever I try running a user 
> defined program to minimize branch losses(min_power_exchange) using my case 
> file. This problem doesn't occur when I try running the program with a 
> Matpower supplied case file. Can you please tell me what the error message 
> means?
>  
> ??? Attempted to access Varefs(1); index out of bounds because 
> numel(Varefs)=0.
> Error in ==> mipsopf_solver at 127
> x0(vv.i1.Va:vv.iN.Va) = Varefs(1);  %% angles set to first reference angle
> Error in ==> opf_execute at 106
>     [results, success, raw] = feval(solver, om, mpopt);
> Error in ==> opf at 225
> [results, success, raw] = opf_execute(om, mpopt);
> Error in ==> runopf at 96
> [r, success] = opf(casedata, mpopt);
> Error in ==> min_power_exchange at 237
> [results, success] = runopf(mpc, mpopt);
> Error in ==> testng at 15
> results = min_power_exchange(mpc,mpopt);
>  
> Bellow is my program code
>  
> mpc = loadcase('case803.m');
> 
> mpopt = mpoption(
> 
> 'VERBOSE',0,'OUT_ALL',0);
> 
> mpc = runopf(case803,mpopt);
> 
> define_constants;
> % %% create map of external bus numbers to bus indices
> i2e = mpc.bus(:, BUS_I);
> 
> e2i = sparse(max(i2e), 1);
> 
> e2i(i2e) = (1:size(mpc.bus, 1))';
> 
> % %% ties lines 
> 
> ties = find(mpc.bus(e2i(mpc.branch(:, F_BUS)), BUS_AREA) ~= 
> mpc.bus(e2i(mpc.branch(:, T_BUS)), BUS_AREA));
> 
> ties_idx = [mpc.branch(ties, F_BUS) mpc.branch(ties, T_BUS)];
> 
> flow_t0 = [mpc.branch(ties, PF) mpc.branch(ties, QF)];
> 
> % % Reduction of the load at bus 26
> 
> %mpc.bus(26,[PD QD]) = 0.8*mpc.bus(26,[PD QD]);
> 
> results = min_power_exchange(mpc,mpopt);
> 
> flow_tf = [results.branch(ties, PF) results.branch(ties, QF)];
> 
> % % difference of the tie flows 
> 
> flow_t0 - flow_tf

Reply via email to