Hmmm … I see. I assumed PV buses when I saw the generators. You are absolutely 
correct. 

Took me a while to figure this out, but there is really only one thing you need 
to change …

1. Evaluate the Jacobian at the OPF solution.

J = makeJac(results_opf);

Alternatively, you can evaluate it at the power flow solution …

J = makeJac(results_pf);

… but currently there is a bug in makeJac() where it assumes that the voltage 
for all generator buses should be taken from gen(:, VG), which is only the case 
for PV and slack buses. I’ve fixed this in the latest version on GitHub.

   Ray




> On Apr 20, 2017, at 11:50 AM, Sarmad Hanif <[email protected]> 
> wrote:
> 
> Hi Ray,
> Many thanks for your response.
>  
> According to my KKT conditions, non-generator buses have only energy + loss 
> component as their LMPs.
> However, for the generator buses, they will be equal to the sum of binding 
> generation limits + energy + loss components.
> But in my opinion, the only PV bus defined in the system is the slack bus. 
> Hence with no voltage bindings at any other bus, the OPF solution should also 
> not bind any voltages for PQ buses, and hence not depicting their respective 
> influence in the shadow prices. Or is there some misunderstanding here ?
>  
> Best,
> Sarmad
> From: [email protected] 
> <mailto:[email protected]> 
> [mailto:[email protected] 
> <mailto:[email protected]>] On Behalf Of Ray 
> Zimmerman
> Sent: Thursday, 20 April, 2017 9:35 PM
> To: MATPOWER discussion forum
> Subject: Re: LMP Calculations MATPOWER
>  
> Hi Sarmad,
>  
> I spent a few minutes looking at this, but not enough to come to a definitive 
> conclusion. However, it seems to me that the sensitivities computed from the 
> power flow assume fixed voltage magnitude at the PV buses, while the OPF 
> solution has no such assumption. Furthermore, the OPF solution does include 
> binding real and reactive power limits on generators, which also affect the 
> LMPs.
>  
>     Ray
>  
>  
> On Apr 18, 2017, at 9:36 AM, Sarmad Hanif <[email protected] 
> <mailto:[email protected]>> wrote:
>  
> Dear MATPOWER users,
> 
> I have a question regarding MATPOWER's ACOPF calculations.
> 
> I tried decomposing the nodal mismatch values from ACOPF of MATPOWER as the 
> sum of energy + loss components (for the uncongested case).
> 
> The procedure adopted was:
> 1) to perform ACOPF and obtain nodal mismatch.
> 2) use generation setpoints from ACOPF to run AC power flow and calculate 
> loss sensitivities using get_losses function
> 
> I am a bit confused, as per my understanding, without the congestion and 
> nonbinding voltages, the only separation from the reference marginal cost is 
> due to loss contribution of each node. So at the exact operating point of the 
> grid (power flow with fixed generation from OPF), aren't the loss 
> sensitivities the true representatives of loss contributions ? 
> I have attached the example to show the approach and difference in MATPOWER's 
> ACOPF with my manual decomposition.
> 
> It will be great if I can have some help regarding it.
>  
> Best,
> Sarmad
>  
>  
>  
>  
> <MWE.M><case33_Example.m>

Reply via email to