Re: Variable power factor

2015-09-21 Thread Carlos Marta Gonzalez Almeida
DEar Dr. Zimmerman,

I don't know how I should change the equality constraint to inequality
constraint. I'll be very grateful if you can help me.

Best regards,

Carlos

On Fri, Sep 18, 2015 at 4:12 PM, Ray Zimmerman  wrote:

> *Please address MATPOWER support questions (including followup’s to this
> e-mail) to the MATPOWER mailing list
> .*
>
> You simply have to change the equality constraint to an inequality
> constraint. Is there a particular part of that code snippet that you are
> having trouble understanding?
>
>Ray
>
>
> On Sep 1, 2015, at 11:58 AM, Carlos Marta Gonzalez Almeida <
> cgonzalezalme...@gmail.com> wrote:
>
> Dear Dr. Zimmerman,
>
> According to your previous posts on the following equation which makes the
> power factor constant. Now I want to have power factor varying between
> -0.95 and 0.95. What changes to the following equation to be made?
>
> Thank you very much.
>
> Carlos
>
>
>
> *ng = size(mpc.gen, 1);*
> *pf = 0.95;*
> *QPratio = sqrt(1/pf^2 -1);*
>
> *mpc.A = sparse([1:ng 1:ng]', [2*nb+(1:ng) 2*nb+ng+(1:ng)]',
> [QPratio*ones(ng,1); -ones(ng,1)], ng, 2*nb+2*ng);*
>
> *mpc.A = mpc.A(2:10, :);*
> *mpc.l = zeros(ng-15, 1);*
> *mpc.u = mpc.l;*
>
>
>


Re: convergence problem in runpf.

2015-09-21 Thread Mirish Thakur
Hello MatPower community,


I want to analyze monetary consequences of reactive power dispatch on
energy market which is already considering real power prices only. For this
I have data of conventional power plants dispatch for every hour in whole
year and respective variable cost of generation. I’ve active and reactive
power demand for each hour as well. For this case I want to keep generator
dispatch Pg=Pmin=Pmax (no change in active power generation) and Pd and Qd
(real and reactive demand) as per given for whole year. Also I want to keep
RATE_A value constant in opf. But I’m facing convergence problem in
runopf. runopf
doesn’t converge until and unless I make Rate_A value 1.5 times and some
changes in Pmax and Pmin values at input side. Is there any alternate way
to get convergence without making any changes in Pg, Pmax, Pmin and Rate_A
value? (For example any changes in line parameters or something else).
Thank you for your time.


Regards

Mirish Thakur

KIT University.

On Thu, Sep 17, 2015 at 9:27 PM, Ray Zimmerman  wrote:

> Yes, thanks, Jose. I’ve added another item to FAQ #5 with links to your
> posts.
>
>Ray
>
>
>
> On Aug 16, 2015, at 11:03 PM, Abhyankar, Shrirang G. 
> wrote:
>
> Thank you.
>
> On Aug 15, 2015, at 12:06 PM, "Jose Luis Marin" 
> wrote:
>
> Sure, of course I have no problem with that.
>
> Also, I realized I missed one detail:  if there were any phase-shifters in
> the network, I would also (initially) set their phase-shifts to zero.  That
> way you would obtain a truly "pure reactive" network.  Then, when you work
> your way ramping up real power, you would also want to ramp those
> phase-shifts back to their original values as well.
>
> --
> Jose L. Marin
> Gridquant España SL
> Grupo AIA
>
>
> On Fri, Aug 14, 2015 at 10:17 PM, Abhyankar, Shrirang G. 
> wrote:
>
>> Jose,
>>   Would it be fine with you if the steps you’ve mentioned below are added
>> to MATPOWER FAQ#5 http://www.pserc.cornell.edu//matpower/#pfconvergence
>> Many a times, useful and detailed suggestions, such as what you’ve
>> enumerated, get lost in email exchanges and someone trying to pull up this
>> information has to resort to digging it out of the archive. It’ll be good
>> to have your steps up on the FAQ.
>>
>> Thanks,
>> Shri
>>
>> From: Jose Luis Marin 
>> Reply-To: MATPOWER discussion forum 
>> Date: Wednesday, August 12, 2015 at 2:42 AM
>> To: MATPOWER discussion forum 
>> Subject: Re: convergence problem in runpf.
>>
>> Mirish,
>>
>> I couldn't help notice that you're building this model from scratch
>> (well, from a database) and you mentioned *"**To make the problem simple
>> I used all buses as PQ buses except one slack bus"*.   This actually
>> makes it harder to converge, unless you have *very* accurate data on what
>> the reactive injections Q (on generator buses) should be.
>>
>> May I suggest a different, incremental approach:
>>
>>1. Start by keeping all generator buses you can as PV, instead of PQ.
>>They will help holding up the voltage profile.  After all, a PV node is a
>>slack bus in what regards the reactive power injection.
>>2. For the loads, start by zeroing out PD (real power demand), but
>>keeping QD (reactive demand)
>>3. For generators, set the scheduled PG to zero
>>4. For lines & transformers, zero out the resistance R
>>5. The resulting network will be a "purely reactive power" model. Now
>>run a powerflow.  If this doesn't have a feasible powerflow solution, it 
>> is
>>because some branches have an X parameter that is too large (or
>>equivalently, some load QD is too large).  Ramp down the profile of QD
>>until you see convergence.
>>6. Look at the resulting Q flows across branches, and try to detect
>>anomalously large values (i.e. clear outliers). They will help you uncover
>>values of X that may be wrong (too large).  Also, keep an eye on negative 
>> X
>>coming from equivalents such as 3-winding transformers; they may also be
>>wrong.
>>7. Once you get that working, ramp up the values of PD on loads and
>>PG on generators (keeping an eye on the swing's resulting PG, in order to
>>redistribute big excesses).
>>8. Finally ramp up the resistance on lines.
>>
>> The whole idea is based on the fact that, for transmission networks
>> (lines with R<> power flows can sort of "ride on".  Get a healthy backbone first, and then
>> you can start transporting real power.
>>
>> Hope it helps,
>>
>> --
>> Jose L. Marin
>> Gridquant España SL
>> Grupo AIA
>>
>>
>> On Wed, Aug 12, 2015 at 2:36 AM, Mirish Thakur 
>> wrote:
>>
>>> Dear Mr.Shree,
>>>
>>> Thank you very much for your help. As per your suggestion and FAQ I
>>> tried to find out the problems.
>>> The 

Re: reactive power dispatch

2015-09-21 Thread vids
Hi Mirish,

I just finished my work that is somewhat related to yours. I did a reactive
power dispatch where the Pg of all generators are already known since it is
cleared separately in the electricity market.
What i did was i set one generator to be a "slack" generator to take
up/absorb the changes in losses due to the redispacth of reactive power. I
set the Pmin and Pmax of this gen to its true values while the rest of the
generators i set to Pg=Pmin=Pmax. It converged for the cases that i worked
on.

Vida
On Sep 21, 2015 10:57 PM, "Ray Zimmerman"  wrote:

> *First of all, when asking a new unrelated question, please don’t just
> reply to a previous message. Start a new thread with a new subject.*
>
> So, are you saying your are attempting to run an AC OPF problem where Pg
> is fixed and Qg are the only free variables? If so, the only way it really
> has a chance of working is if the loads and active power generation are
> feasible for the AC OPF problem (e.g. you got them from an AC OPF
> solution). In that case, the original Qg solution should also be feasible.
> However, this is a very constrained problem that may only have a single
> feasible solution point (corresponding to the original AC OPF values of
> voltage and reactive injection).
>
> If however, the Pg values and the loads are not guaranteed to be feasible
> (i.e. coming from an AC OPF solution), then branch flows may violate their
> limits and it may not be possible to dispatch reactive power in a way that
> results in system losses exactly matching the difference between specified
> load and specified generation. I.e. the problem may be over-specified and
> therefore infeasible.
>
>Ray
>
>
>
> On Sep 21, 2015, at 7:45 AM, Mirish Thakur  wrote:
>
> Hello MatPower community,
>
>
> I want to analyze monetary consequences of reactive power dispatch on
> energy market which is already considering real power prices only. For this
> I have data of conventional power plants dispatch for every hour in whole
> year and respective variable cost of generation. I’ve active and reactive
> power demand for each hour as well. For this case I want to keep generator
> dispatch Pg=Pmin=Pmax (no change in active power generation) and Pd and Qd
> (real and reactive demand) as per given for whole year. Also I want to keep
> RATE_A value constant in opf. But I’m facing convergence problem in runopf. 
> runopf
> doesn’t converge until and unless I make Rate_A value 1.5 times and some
> changes in Pmax and Pmin values at input side. Is there any alternate way
> to get convergence without making any changes in Pg, Pmax, Pmin and Rate_A
> value? (For example any changes in line parameters or something else).
> Thank you for your time.
>
>
> Regards
>
> Mirish Thakur
>
> KIT University.
>
>
>


Add measurement noise

2015-09-21 Thread Ji Chen
Hi Ray,
   I'm tring to do state estimation with measurements V and I in rectangular 
form. Measurement noise is simulated as independent zero-mean Gaussian with 
standard deviation per real component 0.01 and 0.02 for voltages and currents, 
respectively. Ir and Vr are real parts of I and V respectively. 
I'm not sure if the following codes are right. What's more, how to deal 
with the imaginary componets?


Ir=Ir+0.02.*randn(length(Ir),1);
Vr=Vr+0.01.*randn(length(Vr),1);


Best Regards!


Re: Variable power factor

2015-09-21 Thread Ray Zimmerman
You really do need to understand what that code is doing before you can make 
modifications to make it do something else. So, to repeat my main question … is 
there a particular part of that code that you are having trouble understanding?

It is setting up a constraint l <= A * x <= u, where x = [Va; Vm; Pg; Qg], so 
you need to define the A, l and u to restrict the Qg/Pg ratio in a way the 
enforces the power factor range you desire. You have an example of how to 
enforce the Qg/Pg ratio to a specific value that corresponds to a given power 
factor. Once you understand that, it should be trivial to get rid of the 
appropriate bound (l or u) to change it to an upper or lower bound on the power 
factor. Then you add a similar and opposite bound for another power factor 
value for the other end of your range.

But, as I said … the first step is to fully understand the example you have.

Ray



> On Sep 21, 2015, at 2:37 AM, Carlos Marta Gonzalez Almeida 
>  wrote:
> 
> DEar Dr. Zimmerman,
> 
> I don't know how I should change the equality constraint to inequality 
> constraint. I'll be very grateful if you can help me.
> 
> Best regards,
> 
> Carlos
> 
> On Fri, Sep 18, 2015 at 4:12 PM, Ray Zimmerman  > wrote:
> Please address MATPOWER support questions (including followup’s to this 
> e-mail) to the MATPOWER mailing list 
> .
> 
> You simply have to change the equality constraint to an inequality 
> constraint. Is there a particular part of that code snippet that you are 
> having trouble understanding?
> 
>Ray
> 
> 
>> On Sep 1, 2015, at 11:58 AM, Carlos Marta Gonzalez Almeida 
>> > wrote:
>> 
>> Dear Dr. Zimmerman,
>> 
>> According to your previous posts on the following equation which makes the 
>> power factor constant. Now I want to have power factor varying between -0.95 
>> and 0.95. What changes to the following equation to be made?
>> 
>> Thank you very much.
>> 
>> Carlos
>> 
>> 
>> 
>> ng = size(mpc.gen, 1);
>> pf = 0.95;
>> QPratio = sqrt(1/pf^2 -1);
>> mpc.A = sparse([1:ng 1:ng]', [2*nb+(1:ng) 2*nb+ng+(1:ng)]', 
>> [QPratio*ones(ng,1); -ones(ng,1)], ng, 2*nb+2*ng);
>> mpc.A = mpc.A(2:10, :);
>> mpc.l = zeros(ng-15, 1);
>> mpc.u = mpc.l;
> 
> 



reactive power dispatch

2015-09-21 Thread Ray Zimmerman
First of all, when asking a new unrelated question, please don’t just reply to 
a previous message. Start a new thread with a new subject.

So, are you saying your are attempting to run an AC OPF problem where Pg is 
fixed and Qg are the only free variables? If so, the only way it really has a 
chance of working is if the loads and active power generation are feasible for 
the AC OPF problem (e.g. you got them from an AC OPF solution). In that case, 
the original Qg solution should also be feasible. However, this is a very 
constrained problem that may only have a single feasible solution point 
(corresponding to the original AC OPF values of voltage and reactive injection).

If however, the Pg values and the loads are not guaranteed to be feasible (i.e. 
coming from an AC OPF solution), then branch flows may violate their limits and 
it may not be possible to dispatch reactive power in a way that results in 
system losses exactly matching the difference between specified load and 
specified generation. I.e. the problem may be over-specified and therefore 
infeasible.

   Ray



> On Sep 21, 2015, at 7:45 AM, Mirish Thakur  wrote:
> 
> Hello MatPower community,
> 
> 
> 
> I want to analyze monetary consequences of reactive power dispatch on energy 
> market which is already considering real power prices only. For this I have 
> data of conventional power plants dispatch for every hour in whole year and 
> respective variable cost of generation. I’ve active and reactive power demand 
> for each hour as well. For this case I want to keep generator dispatch 
> Pg=Pmin=Pmax (no change in active power generation) and Pd and Qd (real and 
> reactive demand) as per given for whole year. Also I want to keep RATE_A 
> value constant in opf. But I’m facing convergence problem in runopf. runopf 
> doesn’t converge until and unless I make Rate_A value 1.5 times and some 
> changes in Pmax and Pmin values at input side. Is there any alternate way to 
> get convergence without making any changes in Pg, Pmax, Pmin and Rate_A 
> value? (For example any changes in line parameters or something else). Thank 
> you for your time.
> 
> 
> Regards
> Mirish Thakur
> KIT University.