I think what you meant to do was something like the following …
define_constants;
mpc = loadcase('case14');
gen_idx = 8;
bus_idx = find(mpc.gen(gen_idx, GEN_BUS) == mpc.bus(:, BUS_I));
mpc.bus(bus_idx, BUS_TYPE) = PQ;
mpc.gen(gen_idx, QG) = 50;
results = runpf(mpc);
… except that case14 has only 5 generators, so you’ll have to set get_idx to
something between 1 and 5.
Ray
> On Aug 17, 2016, at 10:08 AM, siddique tomal <[email protected]>
> wrote:
>
> Thanks but i got just new problem..
>
>
> define_constants;
> mpc=loadcase(case14);
> mpc.gen(8,PV)=PQ;
> mpc.gen(8,QG)=50;
> rslt=runpf(mpc);
>
>
>
> and they are showing the following error:
>
> Subscript indices must either be real positive integers or logicals.
>
> Error in ext2int (line 175)
> gs = ( mpc.gen(:, GEN_STATUS) > 0 & ... TCL MERGE ERROR (
> 08/17/2016 11:14:46 ): "extra characters after close-quote"
OutmailID: 120695916, List: 'matpower-l', MemberID: 75174736
SCRIPT: "gen status > > Error in runpf (line 131) > mpc = ext2int(mpc); > >
> > what is the wrong here going on ?? > > > On Wed, Aug 17, 2016 at 7:54
PM, Ray Zimmerman <[email protected] <mailto:[email protected]>> wrote: >
define_constants; > mpc.bus(BUS_NO, BUS_TYPE) = PQ; > > > >> On Aug 17,
2016, at 9:47 AM, siddique tomal <[email protected]
<mailto:[email protected]>> wrote: >> >> Thank you Sir but still
having problem. >> For setting a bus as a PQ bus i command the following: >>
>> mpc.gen(BUS_NO,GEN_STATUS)= 1; >> >> is that command is correct for
assigning a bus as a PQ? >> if so then i also have tried with that command like
following: >> >>> define_constants; >>> mpc=loadcase(case14); >>>
mpc.gen(BUS_NO,GEN_STATUS)=1; >>> mpc.gen(BUS_NO,QG)=45; >>> result=runpf(mpc);
>> >> but still no change.. >> >> On Wed, Aug 17, 2016 at 7:35 PM, Ray
Zimmerman <[email protected] <mailto:[email protected]>> wrote: >> When running a
power flow, the reactive injection of a generator at a PV bus is an output,
solved by the power flow, not an input. If you want to set the reactive power
injection as an input you have to make the bus a PQ bus and allow the voltage
to deviate from the setpoint. >> >> Ray >> >> >>> On Aug 16, 2016, at
8:48 PM, siddique tomal <[email protected]
<mailto:[email protected]>> wrote: >>> >>> Dear Sir, >>>
define_constants; >>> mpc=loadcase(case14); >>> mpc.gen(BUS_NO,QG)=45; >>>
result=runpf(mpc); >>> >>> After running this whenever i run the command
losses=sum(real(get_losses(result))) it just shows the same result of power
losses as before injecting the reactive power. >>> >>> What's the problem here
i'm missing? Please need your help. >> >> > >
--Apple-Mail=_C902470B-BB6B-4FAC-95F7-EE3FE09A5F85 Content-Transfer-Encoding:
quoted-printable Content-Type: text/html; charset="utf-8"
<html><head><meta http-equiv="Content-Type" content="text/html
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode:
space; -webkit-line-break: after-white-space;" class="">I think what you meant
to do was something like the following …<div class=""><br
class=""></div><div class=""><div class=""><font face="Courier"
class="">define_constants;</font></div><div class=""><font face="Courier"
class="">mpc = loadcase('case14');</font></div><div class=""><font
face="Courier" class="">gen_idx = 8;</font></div><div class=""><font
face="Courier" class="">bus_idx = find(mpc.gen(gen_idx, GEN_BUS) == mpc.bus(:,
BUS_I));</font></div><div class=""><font face="Courier"
class="">mpc.bus(bus_idx, BUS_TYPE) = PQ;</font></div><div class=""><font
face="Courier" class="">mpc.gen(gen_idx, QG) = 50;</font></div><div
class=""><font face="Courier" class="">results = runpf(mpc);</font></div><div
class=""><br class=""></div><div class="">… except that case14 has only 5
generators, so you’ll have to set <font face="Courier" class="">get_idx</font>
to something between 1 and 5.</div><div class=""><br class=""></div><div
class=""> Ray</div><div class=""><br class=""></div><div
class=""><br class=""></div><div class=""><br class=""></div><div class=""><br
class=""><div><blockquote type="cite" class=""><div class="">On Aug 17, 2016,
at 10:08 AM, siddique tomal <<a href="mailto:[email protected]"
class="">[email protected]</a>> wrote:</div><br
class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Thanks
but i got just new problem..<div class=""><br class=""></div><div class=""><br
class=""><b class=""><i class="">define_constants;<br class=""></i></b><div
class=""><b class=""><i class="">mpc=loadcase(case14);</i></b></div><div
class=""><b class=""><i class="">mpc.gen(8,PV)=PQ;</i></b></div><div
class=""><b class=""><i class="">mpc.gen(8,QG)=50;</i></b></div><div
class=""><b class=""><i class="">rslt=runpf(mpc);</i></b></div></div><div
class=""><b class=""><i class=""><br class=""></i></b></div><div class=""><b
class=""><i class=""><br class=""></i></b></div><div class=""><b class=""><i
class=""><br class=""></i></b></div><div class="">and they are showing the
following error:</div><div class=""><br class=""></div><div class=""><div
class=""><font color="#ff0000" class="">Subscript indices must either be real
positive integers or logicals.</font></div><div class=""><font color="#ff0000"
class=""><br class=""></font></div><div class=""><font color="#ff0000"
class="">Error in ext2int (line 175)</font></div><div class=""><font
color="#ff0000" class=""> gs = (
mpc.gen(:, GEN_STATUS) > 0 & ..."
gen status</font></div><div class=""><font color="#ff0000" class=""><br
class=""></font></div><div class=""><font color="#ff0000" class="">Error in
runpf (line 131)</font></div><div class=""><font color="#ff0000" class="">mpc =
ext2int(mpc);</font></div></div><div class=""><b class=""><i class=""><br
class=""></i></b></div><div class=""><b class=""><i class=""><br
class=""></i></b></div><div class=""><b class=""><i class=""><br
class=""></i></b></div><div class="">what is the wrong here going on ??<br
class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div
class="gmail_quote">On Wed, Aug 17, 2016 at 7:54 PM, Ray Zimmerman <span
dir="ltr" class=""><<a href="mailto:[email protected]" target="_blank"
class="">[email protected]</a>></span> wrote:<br class=""><blockquote
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><font
face="Courier" class="">define_constants;</font><div class=""><font
face="Courier" class="">mpc.bus(BUS_NO, BUS_TYPE) = PQ;</font></div><div
class=""><div class="h5"><div class=""><br class=""></div><div class=""><br
class=""></div><div class=""><br class=""><div class=""><blockquote type="cite"
class=""><div class="">On Aug 17, 2016, at 9:47 AM, siddique tomal <<a
href="mailto:[email protected]" target="_blank"
class="">[email protected]</a>> wrote:</div><br class=""><div
class=""><div dir="ltr" class="">Thank you Sir but still having problem.<div
class="">For setting a bus as a PQ bus i command the following:</div><div
class=""><br class=""></div><div class=""><b class=""><i
class="">mpc.gen(BUS_NO,GEN_STATUS)= 1;</i></b></div><div class=""><br
class=""></div><div class="">is that command is correct for assigning a bus as
a PQ?<br class="">if so then i also have tried with that command like
following:<br class=""><br class=""><blockquote type="cite"
style="color:rgb(80,0,80);font-size:12.8px" class=""><div dir="ltr"
class=""><div class=""><b class=""><i
class="">define_constants;</i></b></div><div class=""><b class=""><i
class="">mpc=loadcase(case14);</i></b></div><div class=""><b class=""><i
class="">mpc.gen(BUS_NO,GEN_STATUS)=1;</i></b></div><div class=""><b
class=""><i class="">mpc.gen(BUS_NO,QG)=45;</i></b></div><div class=""><b
class=""><i
class="">result=runpf(mpc);</i></b></div></div></blockquote></div><div
class=""><div dir="ltr" class=""><div class="">but still no
change..</div></div></div></div><div class="gmail_extra"><br class=""><div
class="gmail_quote">On Wed, Aug 17, 2016 at 7:35 PM, Ray Zimmerman <span
dir="ltr" class=""><<a href="mailto:[email protected]" target="_blank"
class="">[email protected]</a>></span> wrote:<br class=""><blockquote
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc
solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div
class="">When running a power flow, the reactive injection of a generator at a
PV bus is an <b class="">output</b>, solved by the power flow, not an input. If
you want to set the reactive power injection as an input you have to make the
bus a PQ bus and allow the voltage to deviate from the setpoint.</div><span
class=""><font color="#888888" class=""><div class=""><br class=""></div><div
class=""> Ray</div></font></span><div class=""><div class=""><div
class=""><br class=""></div><br class=""><div class=""><blockquote type="cite"
class=""><div class="">On Aug 16, 2016, at 8:48 PM, siddique tomal <<a
href="mailto:[email protected]" target="_blank"
class="">[email protected]</a>> wrote:</div><br class=""><div
class=""><div dir="ltr" class=""><div class="">Dear Sir,</div><div class=""><b
class=""><i class="">define_constants;</i></b></div><div class=""><b
class=""><i class="">mpc=loadcase(case14);</i></b></div><div class=""><b
class=""><i class="">mpc.gen(BUS_NO,QG)=45;</i></b></div><div class=""><b
class=""><i class="">result=runpf(mpc);</i></b></div><div class=""><b
class=""><i class=""><br class=""></i></b></div><div class="">After running
this whenever i run the command <i style="font-weight:bold"
class="">losses=sum(real(get_losses(res<wbr class="">ult)))</i> it
just shows the same result of power losses as before injecting the reactive
power.<br class=""><br class="">What's the problem here i'm missing? Please
need your help.</div></div>
</div></blockquote></div><br class=""></div></div></div></blockquote></div><br
class=""></div>
</div></blockquote></div><br
class=""></div></div></div></div></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></body></html>