The mathematical model of the UPFC is defined considering the problem formulation proposed in OpenDSS to solve the circuit’s power flow. This way, the model proposed in Figure 1 is transformed into an equivalent based on current sources. This equivalent is shown in Figure 3.

Figure 3. Equivalent circuit for the UPFC model

The equations that rules the control routines of the UPFC in steady state depends on the control mode selected. In these equations Vin and Vout correspond to the input and output voltages (as complex numbers) measured at the UPFC terminals. These equations are described in this section.