thank you very much. That helps much. Now I will try to apply it and figure it 
out.
From: [email protected]
Subject: Re: Editing the Jacobian Matrix
Date: Tue, 26 Nov 2013 10:34:47 -0500
To: [email protected]

1. You should add it to Sbus in F(x0) and F(x).
2. You can either add it inside dSbus_dV.m, or you can modify the return values 
directly in newtonpf.m.
3. First, regarding notation, just to be clear, what you wrote as Vi and Vj are 
simply Vm(i) and Vm(j). Likewise θi and θj are simply Va(i) and Va(j). And 
dSbus_dV.m just gives a compact form for computing the partial derivatives 
using complex matrix notation. But you can write the partial derivatives of 
each of your functions (Pi, Qi, Pj, Qj) with respect to, and in terms of Vm(i), 
Vm(j), Va(i) and Va(j). Then you simply evaluate those partial derivatives 
using the current values of Vm and Va and modify the appropriate elements in 
dSbus_dVm and dSbus_dVa. For example, for Pi, you will have 4 partial 
derivatives which will be added to (or actually subtracted from, I suppose, 
since Sbus has a negative sign in the mismatch equation) the real part of the 
corresponding two elements in row i of dSbus_dVm and two elements in row i of 
dSbus_dVa. For Qi you’ll modify the imaginary parts of the same entries. For Pj 
and Qj, the elements will be those in row j.
Hope this helps,

-- Ray ZimmermanSenior Research AssociateB30 Warren Hall, Cornell University, 
Ithaca, NY 14853phone: (607) 255-9645



On Nov 26, 2013, at 10:05 AM, hussein Adel <[email protected]> wrote:I can 
summarize the issue in 3 points:Adding this variable P and Q means I have to 
add them to the jacobian as well as the mismatch equations.
1-  If I will add them to the mismatch equations, can I add them to Sbus in 
F(x) only? or Sbus in F(x0) and Sbus in F(x)?
2- If I have the power equation for example as Pj = constant*Vi*V j *Sin(θi −θ 
j +constant) and similar equations for Pi,Qi,Qj.newtonpf.m calls this code      
[dSbus_dVm, dSbus_dVa] = dSbus_dV(Ybus, V); I think to add those P and Q, I 
have to add their partial derivatives to that dSbus_dV file then, is that true?
3- I don't understand at all how I can convert the value or Pi for example to a 
partile derivative W.R.T. Vm or Va, even though I understand the partial 
derivative equation that already exists in the dSbus_dV file.From: 
[email protected]
Subject: Re: Editing the Jacobian Matrix
Date: Tue, 26 Nov 2013 09:38:36 -0500
To: [email protected]

Ok … so, is there a specific part of newtonpf.m that you don’t follow? It seems 
to me that you simply need to find and modify the corresponding element in F 
and row in J. Is the difficulty in finding the appropriate elements to modify? 
or knowing how to modify them?
-- Ray ZimmermanSenior Research AssociateB30 Warren Hall, Cornell University, 
Ithaca, NY 14853phone: (607) 255-9645

On Nov 25, 2013, at 9:11 PM, hussein Adel <[email protected]> wrote:I am not 
sure if replying this mail is the right way to put my reply on the archive, but 
I am sorry if it is wrong. What I meant by editing the jacobian matrix is:I 
want to add a device whose P and Q depend on the voltage magnitude and angle. 
This is why I want to insert it in the jacobian and mismatch equations. But 
this is to be done at only one bus. This is what I do not know how to do even 
though I tried many times with newtonpf.m , runpf.m , and dSbus_dV.m
I hope it is clear, and I hope you can answer me.Regards.

From: [email protected]
Subject: Re: Editing the Jacobian Matrix
Date: Mon, 25 Nov 2013 16:34:49 -0500
To: [email protected]

I’m not sure I understand what you want to do. If you mean that you simply want 
to modify the fixed net real and reactive power injections at a given bus, you 
can do this simply by changing the values in the PD and QD columns in the bus 
matrix. If you mean that you want to model some new devices whose P and Q 
depend on other variables (e.g. bus voltage), then you will need to get into 
the code, and anything is possible depending how deep you want to get. Have a 
look at newtonpf.m to get started.
-- Ray ZimmermanSenior Research AssociateB30 Warren Hall, Cornell University, 
Ithaca, NY 14853phone: (607) 255-9645

On Nov 22, 2013, at 5:29 PM, hussein Adel <[email protected]> wrote:I want 
to add components on the 14 bus system that exists in MATPOWER. The problem is 
that inquires me to add P&Q at specific two buses. The addition of those P&Q 
has to be done at the jacobian matrix and the mismatch equations directly. It 
is so unclear for me how to add components at specific buses on the jacobian 
matrix or the mismatch equations in matpower.It seems to me like it is done as 
a whole and I cant make a change at a specific bus alone in the matrix.Any help 
is appreciated.
                                          

Reply via email to