There have been some changes in the OPF code since v6.0, but in the current 
development version on GitHub each set of constraints is computed in its own 
function. For example:

opf_power_balance_fcn.m 
<https://github.com/MATPOWER/matpower/blob/master/lib/opf_power_balance_fcn.m> 
- computes the power balance equality contraints
opf_branch_flow_fcn.m 
<https://github.com/MATPOWER/matpower/blob/master/lib/opf_branch_flow_fcn.m> - 
computes the branch flow inequality constraints

I also do not understand why you would be getting a different answer if you are 
using MATPOWER to build Ybus, since that really is the only place the 
transformer taps come into play. Unless you are building some of your power 
balance or branch flow constraints directly from parameters in the branch 
matrix, rather than from Ybus.

  Ray


> On May 22, 2018, at 5:10 AM, Aebi Stefanie <[email protected]> wrote:
> 
> More specifically, I found out that my issue is with the transformer tap 
> ratios. I'm running the code on case14, where branches 4 - 7, 4 - 9 and 5 - 6 
> have a ratio not equal to zero.
> I found out that when I adjust this (set the ratio to 0 or 1 for all 
> branches), I get identical solutions with my own OPF as I get when running 
> MATPOWER opf(case14).
>  
> However, I have no clue where the tap ratio actually has an effect (apart 
> from the calculation of the Ybus Matrix, which I already calculate using 
> MATPOWER code anyway).
>  
> Could you give me a hint? Is there an additional voltage constraint or so 
> where the ratio plays a role?
>  
> Thanks for your support.
> Best regards,
> Stefanie
> Von: Aebi Stefanie
> Gesendet: Freitag, 18. Mai 2018 12:50
> An: [email protected] <mailto:[email protected]>
> Betreff: Constraints implementation
> 
> Hi
> I am trying to program an OPF for my Master's Thesis and I want to check its 
> results against Matpower's results. Now I basically ended up with quite 
> different solutions even though I also programmed AC OPF.
> I would therefore like to check how you implemented the constraints in 
> Matpower.
> I know that this is described in section 6.1 in the manual, however I would 
> like to check with the code. Where do I find the formulation of the 
> constraints in the code? I tried to debug the matpower opf and found the 
> function add_constraints(). However, either I don't understand it or the 
> function just sets names and indices for the constraints without implementing 
> any equations.
>  
> I'd be grateful for your help.
> Best regards,
> Stefanie

Reply via email to