The safest way to avoid dimension mismatch is to initialize the newly added 
row. For example:

 

define_constants;
mpc = loadcase('case30');
size(mpc.branch,1);
nb = size(mpc.branch,1) + 1;

mpc.branch(nb, size(mpc.branch,2)) =0; %% in this way even you extended the 
columns of the matrix somewhere, it will guarantee the same dimentison.
mpc.branch(nb , F_BUS:RATE_A, STATUS)=[13 8 0.06 0.18 0.02 65 1];
mpc.branchcost(42, MODEL)=2;
runopf(mpc);

 

From: [email protected] 
<mailto:[email protected]>  
[mailto:[email protected]] On Behalf Of MICHAIL 
STERGIDIS
Sent: Saturday, April 26, 2014 4:38 PM
To: MATPOWER discussion forum
Subject: Re: Branch Addition

 

Thanks for the response.

I tried to change that but it shows an error of dimension mismatch.

I find that peculiar since all the other lines on the branch matrix have these 
dimensions.

Any clues as to how I change that?

 

 

On Apr 26, 2014, at 4:44 PM, Huang Tao <[email protected] 
<mailto:[email protected]> > wrote:

 

status of the branch is still 0.

在 2014-4-26 下午3:25,"MICHAIL STERGIDIS" <[email protected] 
<mailto:[email protected]> >写道:

Dear all,
in order to reduce congestion on a line, my project demands an additional line 
with another bus.
Specifically, I want to add a line between busses 13 and 8 on the case 30 file.
In doing so, I should be able to reduce the amount of load the line has which 
is related to the rateA figure.
I have managed to make a bug-free bit of code so the opf runs and shows the 
matrix with the particular data, however when I run it the line I have added 
shows no power flow.
My code is the following:

define_constants;
mpc = loadcase('case30');
size(mpc.branch,1);
nb = size(mpc.branch,1) + 1;
mpc.branch(nb , F_BUS:RATE_A)=[13 8 0.06 0.18 0.02 65];
mpc.branchcost(42, MODEL)=2;
runopf(mpc);

I would really appreciate a helping hand as I am quite stuck,
thank you all very much in advance.

Best regards,
Michael Stergides

 

Reply via email to