#### 6.1 Standard AC OPF

The optimization vector for the standard AC OPF problem consists of the vectors of voltage angles and magnitudes and the vectors of generator real and reactive power injections and . (6.5)

The objective function in (6.1) is simply a summation of individual polynomial cost functions and of real and reactive power injections, respectively, for each generator: (6.6)

The equality constraints in (6.2) are simply the full set of nonlinear real and reactive power balance equations from (4.2) and (4.3). The inequality constraints (6.3) consist of two sets of branch ﬂow limits as nonlinear functions of the bus voltage angles and magnitudes, one for the from end and one for the to end of each branch: The ﬂows are typically apparent power ﬂows expressed in MVA, but can be real power ﬂows (in MW) or currents,31 yielding the following three possible forms for the ﬂow constraints: (6.11)

where is deﬁned in (3.9), in (3.15), and the vector of ﬂow limits has the appropriate units for the type of constraint. It is likewise for . The values used by Matpower’s OPF for the ﬂow limits are speciﬁed in the RATE_A column (6) of the branch matrix,32 and the selection of ﬂow constraint type in (6.11) is determined by the opf.flow_lim option.

The variable limits (6.4) include an equality constraint on any reference bus angle and upper and lower limits on all bus voltage magnitudes and real and reactive generator injections: The voltage reference angle and voltage magnitude bounds and are speciﬁed in columns VA (9), VMAX (12) and VMIN (13), respectively, of row of the bus matrix. Similarly, the generator bounds , , and are specﬁed in columns QMAX (4), QMIN (5), PMAX (9) and PMIN (10), respectively, of row of the gen matrix.
##### 6.1.1 Cartesian vs. Polar Coordinates for Voltage

Another variation of the standard AC OPF problem represents the bus voltages in cartesian, rather than polar, coordinates. That is, instead of and , the optimization vector includes the real and imaginary parts of the complex voltage, denoted respectively by and , where . (6.16)

The objective function remains unchanged, but the nodal power balance constraints (6.7) and (6.8) and branch ﬂow constraints (6.9) and (6.10) are implemented as functions of and .  In this formulation, the voltage angle reference constraint (6.12) and voltage magnitude limits (6.13) cannot be simply applied as bounds on optimization variables. These constrained quantities also become functions of and . In Matpower setting the opf.v_cartesian option to 1 (0 by default) selects the cartesian representation for voltages when running an AC OPF.33

##### 6.1.2 Current vs. Power for Nodal Balance Constraints

Another variation of the standard AC OPF problem uses current balance constraints in place of the power balance constraints (6.7)–(6.8) or (6.17)–(6.18). If we let and represent the real and imaginary parts, respectively, of the current, we can express the current balance functions for the polar form as and for the cartesian form as where , and is a diagonal matrix whose -th diagonal entry is , that is or .

In this formulation, which can be selected by setting the opf.current_balance option to 1,34 the objective function and other constraints are not aﬀected. This option can be used in conjunction with either the polar or cartesian representation of bus voltages.