Open hygge-coder opened 1 month ago
Does toggle_iflims()
, described in Section 7.6.2 in the MATPOWER User's Manual do what you want?
Does
toggle_iflims()
, described in Section 7.6.2 in the MATPOWER User's Manual do what you want?
Dr. Zimmerman, I understand it can be done, but I would like to become more familiar with MATPOWER by writing this example myself. Could you please guide me on how to use the add_var
statement to callPf
data? Thank you.
As you mention, Pf
is not a variable, but it is a linear function of the Va
variables. It can be computed using the Bf
and Pfinj
returned by makeBdc()
as Pf = Br * Va + Pfinj
.
So as you can see here ...
https://github.com/MATPOWER/matpower/blob/0ea002687d2e38eeca53aed2ea6a12c84363d075/lib/toggle_iflims.m#L134-L160
... we use that to build up the constraint matrices and bounds as functions of Va
.
Thank you, Dr. Zimmerman. I have resolved the issue, thanks to your assistance. I appreciate your help.
Hi Dr. Zimmerman, Here is my code,
I want to add a transmission section constraint by limiting the sum of the transmission power of a few transmission lines of the branch matrix, and then apply this simple linear constraint using
add_userfcn(mpc, 'formulation', @userfcn_case9lineartest, []);
however Since 'Pf' is not the default variable of matpower, unlike the default variable 'Pg' of matpower which is so easy to use, how should I use theadd_var
statement to reach the optimization of the branch matrix's transmission power Kind Regards hygge