## 2 Problem Formulation
### OPF Constraints
#### 2.1.2. OPF Inequality Constraints  
The inequality constraints, \(h(x,u)\), represent the constraints on all the network variables:  
* Constraints relating to the generation units: for all the generators, the voltage, as well as the reactive and active powers, should be defined in upper and lower limits as follows: \[\begin{array}{l}P_{Gi}^{\min}\leq P_{Gi}\leq P_{Gi}^{\max}\\ Q_{Gi}^{\min}\leq Q_{Gi}\leq Q_{Gi}^{\max}\\ V_{Gi}^{\min}\leq V_{Gi}\leq V_{Gi}^{\max}\end{array}\] (8) where \(V_{Gi}^{\min}\) and \(V_{Gi}^{\max}\) represent the allowable range limits of the voltage magnitude of the \(i\)th generator; \(P_{Gi}^{\min}\) and \(P_{Gi}^{\max}\) represent the acceptable range of actual power output of \(i\)th generator; and \(Q_{Gi}^{\max}\) and \(Q_{Gi}^{\max}\) describe the permitted limit of the reactive power output of the \(i\)th generator.
* Transformers' tap adjustments: transformers' taps can be altered in their approved limitation as in [13]: \[T_{i}^{\min}\leq T_{i}\leq T_{i}^{\max};\;\forall i=1,\ldots,\;NT\] (9) where \(T_{i}^{\min}\) and \(T_{i}^{\max}\) express the acceptable range for altering the \(i\)th transformer's tap.
* Constraints of VAR compensating units: the productions of these units are constrained in the following way [13]: \[Q_{Ci}^{\min}\leq Q_{Ci}\leq Q_{Ci}^{\max};\;\forall i=1,\ldots,\;NC\] (10)where \(Q_{Cl}^{\min}\) and \(Q_{Cl}^{\max}\) are the allowable range of VAR injection of \(i\)th compensating unit.
* Voltage limits: the acceptable range of load bus voltage magnitudes are known as a security constraint [13]: \[V_{Li}^{\min}\leq V_{Li}\leq V_{Li}^{\max}\] (11) The maximum and minimum ranges of voltage magnitudes for the \(i\)th load bus signify by \(V_{Li}^{\min}\) and \(V_{Li}^{\max}\), respectively.
* Transmission lines constraints: the apparent power flows across branches should be restricted by: \[S_{li}\leq S_{li}^{\max}\] (12) Moreover, the apparent power via an \(i\)th transmission line and its higher bound are represented by \(S_{li}\) and \(S_{li}^{\max}\), respectively.  
It is worth noting that the optimization process considers the allowable ranges of the decision variables. The penalty factors approach, which transforms a constrained optimization problem into an unconstrained one by applying penalized values of violated constraints to the objective function, is one of the most common practices for dealing with constrained problems, making an enlarged objective function [54]. This process is shown here as [25]:  
\[\text{J}=\sum_{i=1}^{NG}F_{i}(P_{Gi})+\lambda_{P}\Big{(}P_{G1}-P_{G1}^{\text{ lim}}\Big{)}^{2}+\lambda_{Q}\sum_{i=1}^{NG}\Big{(}Q_{Gi}-Q_{Gi}^{\text{lim}} \Big{)}^{2}+\lambda_{V}\sum_{i=1}^{NPQ}\Big{(}V_{Li}-V_{Li}^{\text{lim}} \Big{)}^{2}+\lambda_{S}\sum_{i=1}^{NTL}\Big{(}S_{li}-S_{li}^{\text{lim}}\Big{)} ^{2} \tag{13}\]  
where \(\lambda_{P}\), \(\lambda_{V}\), \(\lambda_{Q}\), and \(\lambda_{S}\) are the penalty factors; and the supplementary variable \(u^{\text{lim}}\) is given as [25]:  
\[u^{\text{lim}}=\begin{cases}u;\ u^{\text{min}}\leq u\leq u^{\text{max}}\\ u^{\text{min}};\ \ \ \ \ \ \ \ u\leq u^{\text{min}}\\ u^{\text{max}};\ \ \ \ \ \ \ \ u\geq u^{\text{max}}\end{cases} \tag{14}\]