Dear Idris,

Thank you very much.It worke finally! ..You are right.Although the power
flow doesn't use mpc.gencost matrix, it is necessary .so I added a script
as follows:
*
mpc.gencost(6,MODEL)=2;*

I mention again the all the scipts for other people who might face the same
problem:

*%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
mpc.gen (6,PG) = 10;              %add 10MW to bus 4
mpc.bus (6,BUS_TYPE) = 2;    %changes the type of bus 6 to PV
mpc.gencost(6,MODEL)=2;
runpf(mpc)*

Thank you again
Iman

On Thu, Nov 17, 2011 at 8:44 PM, Idris Musa <[email protected]>wrote:

> Hi iman,****
>
> You need to add the sixth row to the mpc.gencost matrix. Simply copy the
> fifth row and paste as the sixth row.****
>
> Then try this. I know power flow does not use the mpc.gencost matrix for
> computation. *But if it is defined in a case file and alteration is made
> to the the mpc.gen matrix then it has to be reflected on mpc.gencost matrix.
> *
>
> * *
>
> 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 10 0 10 -10 1.01 100 1 20 0];  %add 0MW to
> bus 4****
>
> ****
>
> mpc.gen (6,PG) = 10;              %add 10MW to bus 4****
>
> mpc.bus (4,BUS_TYPE) = 2;    %changes the type of bus 4 to PV****
>
> ****
>
> results= runpf(mpc)****
>
> ** **
>
> regards****
>
> ** **
>
> Idris ****
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *Idris Musa
> *Sent:* 17 November 2011 19:02
> *To:* 'MATPOWER discussion forum'
> *Subject:* RE: I want to add a 10MW generator to bus 7****
>
> ** **
>
> Hi,****
>
> To increase the real power demand at bus 4 ****
>
> mpc.bus(4,PD)=mpc.bus(4,PD)+10;****
>
> ** **
>
> Idris ****
>
> ** **
>
> *From:* [email protected] [mailto:
> [email protected]] *On Behalf Of *iman
> *Sent:* 17 November 2011 18:54
> *To:* MATPOWER discussion forum
> *Subject:* Re: I want to add a 10MW generator to bus 7****
>
> ** **
>
> Dear Idris,
> No the problem is not because of that.Even if you type scrpits as :****
>
> ** **
>
> *>>mpc.bus (4,BUS_TYPE) = 2;    %changes the type of bus  to PV*****
>
> * *****
>
> *>>runpf(mpc)*****
>
> ** **
>
> which is not correct,you still have the errors****
>
> ** **
>
> Looking forward to hear from you ****
>
> ** **
>
> Bye****
>
> Iman****
>
> ** **
>
> On Thu, Nov 17, 2011 at 6:35 PM, Idris Musa <[email protected]>
> wrote:****
>
> 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]> 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****
>
>
>
>
> --
> Best regards
> Iman****
>



-- 
Best regards
Iman

Reply via email to