7 Extending the OPF

The extended OPF formulation described in Section 6.3 allows the user to modify the standard OPF formulation to include additional variables, costs and/or constraints. There are two primary mechanisms available for the user to accomplish this. The first is by directly constructing the full parameters for the addional costs or constraints and supplying them either as fields in the case struct or directly as arguments to the opf function. The second, and more powerful, method is via a set of callback functions that customize the OPF at various stages of the execution. Matpower includes several examples of using the latter method, for example to add a fixed zonal reserve requirement, to implement interface flow limits, dispatchable DC transmission lines, or branch flow soft limits.

 7.1 Direct Specification
  7.1.1 User-defined Variables
  7.1.2 User-defined Constraints
  7.1.3 User-defined Costs
  7.1.4 Additional Comments
 7.2 Callback Functions
  7.2.1 User-defined Variables
  7.2.2 User-defined Costs
  7.2.3 User-defined Constraints
 7.3 Callback Stages and Example
  7.3.1 ext2int Callback
  7.3.2 formulation Callback
  7.3.3 int2ext Callback
  7.3.4 printpf Callback
  7.3.5 savecase Callback
 7.4 Registering the Callbacks
 7.5 Summary
 7.6 Example Extensions
  7.6.1 Fixed Zonal Reserves
  7.6.2 Interface Flow Limits
  7.6.3 DC Transmission Lines
  7.6.4 OPF Soft Limits