Hi ,
The Generator is at bus 4 so
mpc.bus(4,BUS_TYPE)=2;

Idris

From: [email protected] 
[mailto:[email protected]] On Behalf Of iman
Sent: 17 November 2011 18:28
To: MATPOWER discussion forum
Cc: [email protected]
Subject: Re: I want to add a 10MW generator to bus 7

Dear All,
Thank you for the responses. You have been a big help to me .I managed to add 
generators to other buses in case14 by adding a generator to bus 4 (row 6) as 
Dr Zimmerman suggested:

define_constants;
mpc = loadcase('case14');
size(mpc.gen, 1);   %gives the last row of generator data
ng = size(mpc.gen, 1) + 1; %Specifies the start point
mpc.gen(ng, GEN_BUS:PMIN) = [4 0 0 10 -10 1.01 100 1 20 0];  %add 0MW to bus 4

Now if I want to increase its real power demand at bus 4 to 10 MW I add scripts 
as follows:

mpc.gen (6,PG) = 10;              %add 10MW to bus 4
mpc.bus (6,BUS_TYPE) = 2;    %changes the type of bus 6 to PV
runpf(mpc)

But unfortunately again I receive error which I don’t know why???

??? Error using ==> subsref
Index exceeds matrix dimensions.

Error in ==> get_reorder at 50
B = subsref(A, s);
Do you have any ideas?

I am so greatful of your guidance and suggestions
Regards
Iman


===================================================================
On Thu, Nov 17, 2011 at 3:35 PM, Álvaro Jaramillo Duque 
<[email protected]<mailto:[email protected]>> 
wrote:
Hello

I think the error is due because there wasn't a generator at bus 7 and you 
didn't add all the information concerning a that generator.
Look in the manual, Appendix B Data File Format, or just open the case in a 
editor text and see what is required for a generator, this is the best way to 
understand the MATPOWER file format.


I think you mistook the "id" of the node with the position on the matrix mpc.gen


>> define_constants;
>> mpc = loadcase('case14');
>> size(mpc.gen)
ans =

    5   21

See that the dimension is 5 rows, 7 out of the dimension.

What I am not sure if is mandatory for a PF add the mpc.gencost information of 
the new generator.

The rest I think is OK, because you have to modify the node type.

Best regards.

Álvaro



--
Best regards
Iman

Reply via email to