Closed YHLjun closed 5 months ago
See Section 6.3 and Chapter 7 of the MATPOWER User's Manual. To use the add_lin_constraint()
method of the opt_model
(om
) object, you would need to use the callback function approach. The direct method, where you specify A
, l
, and u
directly as additional fields in mpc
is often much simpler. The only thing is that the columns of A
must correspond to the full set of optimization variables. By default, that is [Va; Vm; Pg; Qg]
, that is bus voltage angles and magnitudes, followed by generator active and reactive injections.
FWIW, your example looks like simple bounds on the active generation, which you can accomplish with gen(:, PMIN)
and gen(:, PMAX)
.
Thanks for your timely response razman,
I have one question about what kind of constraints can be added, is it possible to add mix integer varibles into standard OPF and solve it?
Not in MATPOWER 7.1. With the new architecture of MATPOWER 8 it should be possible, but I don't have any examples yet of how to do that.
Hi,
I want to add additional constraints for Pg to original OPF. I use "add_constraints('name', A, l, u, varset)" to add. but the matlab always said there is no add_constraints function..... So how to add it? My version is is 7.1.
It would be appreciated thta a simple example can be provided, such as 80MW>=3*Pg+2MW>=15....
Kind Regards YHL