The P absorbed by the dispatchable load is already an optimization variable, included in Pg, since dispatchable loads are modeled as negative generators. So you may not even need to add a variable. Furthermore, you can already impose costs on those variables via the gencost matrix.
If you simply want to maximize the power absorbed by the dispatchable loads, you just need to make sure that you use a large enough negative cost (on the negative injection). You may find load2disp()<https://matpower.org/docs/ref/matpower7.0/lib/load2disp.html> to be helpful. If you do need a new variable, it is introduced through the A matrix in the user-defined linear constraints. You simply define linear constraints that include extra columns corresponding to the new variables. They are related to the existing variables through this constraint matrix whose existing columns correspond to Va, Vm, Pg, Qg, for the standard formulation. See equations (6.5) and (6.38), (6.39) in the manual. Ray On Oct 8, 2020, at 11:09 AM, Davide Maglione <davide.maglion...@gmail.com<mailto:davide.maglion...@gmail.com>> wrote: Hi Ray Thank you for your kind and fast response! I think your suggestion is right, i should lean toward the direct specification. I will try to be more clear about what i am trying to do. I have only one specific case, but i have to see what happens in different periods of time. I would like to initialize dispatchable loads in specific times inside my loop, and during those times i am trying to optimize (maximize) the surplus energy absorbed, coming from the generators. So what i have in mind, and i am sure it’s possible to do with your software, is to create a new variable (the P absorbed by the disp. Loads), add some constraints based on the maximum demand and voltage of the dispatchable Load’s bus and finally add the cost function (function of the P absorbed by the loads and the maximum surplus available in that time) to be minimized by the algorithm. Am i on the right direction using the direct specification? When i add a new variable how can i refer it specifically to a variable in the mpc (for example the P absorbed by a load)? Sincerely, thank you again for all your help, Davide Da: Ray Daniel Zimmerman<mailto:r...@cornell.edu> Inviato: giovedì 8 ottobre 2020 16:02 A: MATPOWER-L<mailto:matpowe...@list.cornell.edu> Oggetto: Re: Bus, Loads and Generators question H [https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient> Mail priva di virus. www.avast.com<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=emailclient>