The bustypes() 
<http://www.pserc.cornell.edu//matpower/docs/ref/matpower5.1/bustypes.html> 
function expects the buses to be numbered consecutively (internal bus 
ordering), so you have to convert to internal ordering first.

mpc = loadcase(‘case300’);
mpc = ext2int(mpc);
[ref, pv, pq] = bustypes(mpc.bus, mpc.gen);

— Ray


> On Jul 1, 2015, at 9:45 AM, Houssem <[email protected]> wrote:
> 
> Dear All
> I am trying to run the following two lines :
> 
> mpc = case300;
> [ref, pv, pq] = bustypes(mpc.bus, mpc.gen);
> 
> And this is what I get:
> 
> Error using sparse
> Index exceeds matrix dimensions.
> 
> Error in bustypes (line 49)
> Cg = sparse(gen(:, GEN_BUS), (1:ng)', gen(:, GEN_STATUS) > 0, nb, ng);  %% 
> gen connection matrix
> 
> however If I run runpf('case300') there is no problem and the power flow 
> problem is solved!!!
> 
> Houssem
> 
> 

Reply via email to