Moreover, I am wondering what is the unit of Pg (as well as other variables) when calling g_fcn and hess_fcn? I tested the example in t_opf_mips.m and I found that Pg seems to be in per unit instead of MW. If so, does the baseMVA the same as that of the original mpc structure?
Thank you in advance. At 2023-04-01 15:03:40, "seuyxw" <[email protected]> wrote: Dear all, I am trying to add nonlinear constraints w.r.t. the voltage magnitudes and active generations of PV buses. To proceed, I need to calculate the gradients and hessian w.r.t. the variable sets specified through varsets. I found that there are only four valid names, i.e., ''Va","Vm","Pg","Qg", so in my case, I need to specify the varsets field as {'Pg', 'Vm'}. I am wondering: 1) What's the order of variables in each variable set? For example, does the order in 'Vm' set the same as that of the mpc.bus or the same as the bus number? 2) Can I rename variable set names to make the calculation of gradient and hessian more compact? For example, in my case, I only need the variables of PV buses (i.e., Pg and Vm of PV buses). Can I create and rename some variable subsets as 'PVg' and 'PVm' which contain the variables associated with PV buses? If not, how can I extract the Pg and Vm of PV buses in my nonlinear constraint function? Best regards, Yuanxi Wu
