Thank you. On Thu, Oct 1, 2015 at 5:47 PM, Ray Zimmerman <[email protected]> wrote:
> I’m sorry, I’m trying to help you, but I can’t if you simply repeat > your request for me to explain how to modify the code, without ever > answering my question. > > *Which part of the code are you having trouble understanding?* > > Unfortunately, unless you can answer that, I’m afraid I can’t help you. > > Ray > > > > On Oct 1, 2015, at 7:57 AM, Carlos Marta Gonzalez Almeida < > [email protected]> wrote: > > Dear Prof. Zimmerman, > > I am really sorry about that. I really apologize for the way of writing. > So sorry about that. > > Would you mind letting me know how I can modify the code in order to have > variable power factor? I was not able to apply your comments. I'll be very > grateful if you can help me please. > > Once again, I do apologize. > > Best regards, > > Carlos > > On Fri, Sep 25, 2015 at 6:34 PM, Ray Zimmerman <[email protected]> wrote: > >> Please do not keep asking us to provide you with the modifications to the >> code. You haven’t told us which part of that code you are having trouble >> understanding. >> >> There is a big difference between … >> >> 1. Can you please help me understand so I can do it? and … >> 2. Can you do it for me? >> >> I’m happy to try to do #1. I’m not interested in #2 (except possibly if >> hired as a consultant). >> >> Ray >> >> >> >> >> On Sep 23, 2015, at 8:26 AM, Carlos Marta Gonzalez Almeida < >> [email protected]> wrote: >> >> Dear Dr. Zimmerman, >> >> What modifications I have to apply to the following code? Thanks >> >> >> *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;* >>>> >>>> >> >> Best regards >> >> C >> >> >> On Tue, Sep 22, 2015 at 2:25 PM, Ray Zimmerman <[email protected]> wrote: >> >>> That wouldn’t be correct anyway. The power factor is not the same as the >>> Q/P ratio. And you will need two separate sets of constraints, one for the >>> upper bound on the power factor and the other for the lower bound on the >>> power factor. >>> >>> Ray >>> >>> >>> >>> On Sep 22, 2015, at 2:56 AM, Carlos Marta Gonzalez Almeida < >>> [email protected]> wrote: >>> >>> My problem is that I cannot implement matrix A in order to have >>> -0.95*P<Q<P*0.95. What changes I have to apply to A matrix? >>> >>> Regards, >>> >>> Carlos >>> >>> On Mon, Sep 21, 2015 at 3:43 PM, Ray Zimmerman <[email protected]> wrote: >>> >>>> 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 < >>>> [email protected]> 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 <[email protected]> >>>> wrote: >>>> >>>>> *Please address MATPOWER support questions (including followup’s to >>>>> this e-mail) to the MATPOWER mailing list >>>>> <http://www.pserc.cornell.edu/matpower/#mailinglist>.* >>>>> >>>>> 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 < >>>>> [email protected]> 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;* >>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > >
