## 3 Optimization Problem Definition  
The power systems nowadays, with the great achievements in technology, have to be operated in an optimal way. Due to the increase in the share of renewable energy in power systems, the presence of energy storage systems is essential.  
In this research, the sizing and optimal positioning of the energy storage systems acts as a variable to achieve the minimization of many cost objectives as a multi-objective optimization problem namely minimum power losses cost (\(C_{L}\)), minimum voltage deviation cost (\(C_{D}\)) and minimum peak demand cost (\(C_{P}\)).  
\[C_{L}=min((\sum_{K=1}^{N_{L}}G_{k}[V_{i}^{2}+V_{j}^{2}-2|V_{i}||V_{j}|cos\delta _{i}-\delta_{j}])\times\gamma_{L}) \tag{7}\]  
\[C_{D}=min((\sum_{i=1}^{N_{L}}1-V_{i})\times\gamma_{D}) \tag{8}\]  
\[C_{P}=min(P_{max}\times\Delta t\times\gamma_{P}) \tag{9}\]  
where \(N_{L}\) is the maximum number of power lines connected in the power system; \(G_{k}\) is the conductance value in the transmission line '\(K\)'; the sending-end as well as the receiving-end line voltages can be represented as \(V_{i}\) and \(V_{j}\); the voltage angles of the line can be given as \(\delta_{i}\) and \(\delta_{j}\); while \(P_{max}\) is the maximum real power at the reference bus in a certain range of time. \(\gamma_{L}\), \(\gamma_{D}\) and \(\gamma_{P}\) are the rate of the line losses cost, rate of the voltage deviation cost and rate of the peak demand cost, respectively. The rates of cost were assumed to be \(\gamma_{L}=284\) USD/MWh, \(\gamma_{D}=142\) USD/MWh and \(\gamma_{P}=200,000\)\(\frac{\text{USD}}{\text{MWh}}/\text{year}\) according to [4].  
The multi-objective optimization is solved by two different methods, namely, the weighting method (\(C_{W}\)), assuming all objectives have the same weights, and the normalization method (\(C_{N}\)), by solving each optimization problem as a single objective for each objective and then applying (11).  
\[C_{W}=\frac{1}{3}C_{L}+\frac{1}{3}C_{D}+\frac{1}{3}C_{P} \tag{10}\]  
\[C_{N}=\frac{1}{optimalC_{L}}C_{L}+\frac{1}{optimal\ C_{D}}C_{D}+\frac{1}{optimal \ C_{P}}C_{P} \tag{11}\]  
The variables of the optimization process are simply the buses that will host the energy storage systems and the capacities of the energy storage systems.  
The optimization process is subjected to many constraints related to energy storage boundary limits during operation and also power system operation constraints in terms of voltage limits, transmission lines' thermal limits and power stations' generation limits.  
* Energy storage constraints \[P_{Charging}^{t}\ \geq\ P_{Bmin}\] (12)  
\[P_{Discharging}^{t}\ \leq\ P_{Bmax} \tag{13}\]  
\[E_{Bmin}\ \leq\ E_{B}^{t}\ \leq\ E_{Bmax} \tag{14}\]  
The energy storage constraints in (12) and (13) are to ensure that the charging power over the time should not be less than minimum energy storage power while the discharging power should not be more than that of the maximum energy storage system power. The energy storage capacity should lie between the minimum and maximum capacities as shown in (14).
* Bus voltage constraints \[0.95\;PU\leq V_{i}^{t}\leq 1.05\;PU\] (15) Each bus voltage over the time should have a value ranging from 95% to 105% of its rated value.
* Transmission lines' limits \[S_{Li}^{t}\;\leq\;S_{Limax}\] (16) Each line's loading over time should not exceed its maximum limit.
* Power stations' operation limits \[P_{Gmin}\;\leq\;P_{G}^{t}\;\leq\;P_{Gmax}\] (17) \[Q_{Gmin}\;\leq\;Q_{G}^{t}\;\leq\;Q_{Gmax}\] (18)  
Each power station's active and reactive powers over time should have values between its acceptable maximum and minimum limits according to the capability limits.