In recent years, the rapid expansion of photovoltaic (PV) generation has transformed modern power systems, offering clean and renewable energy. However, as PV penetration increases, it replaces conventional synchronous generators (SGs) that provide essential inertia and frequency regulation. This replacement introduces significant challenges to system frequency stability. One of the most critical issues is the loss of frequency support during large disturbances, such as the sudden outage of a synchronous generator. To mitigate this problem, the battery energy storage system (BESS) has emerged as a fast-acting resource capable of injecting or absorbing active power almost instantaneously. Nonetheless, oversizing the BESS leads to excessive investment costs, while undersizing fails to guarantee frequency security. Therefore, finding the optimal capacity of the battery energy storage system that balances cost and frequency performance is of paramount importance. In this work, I propose a comprehensive optimization framework for BESS capacity configuration that explicitly considers frequency stability constraints. The method integrates frequency response metrics, generation limits, and BESS operational constraints, and employs a particle swarm optimization (PSO) algorithm to identify the minimal total BESS capacity required to maintain frequency within acceptable bounds. I validate the approach through dynamic simulations on a modified IEEE 39-bus system under various PV penetration scenarios. The results demonstrate that the optimized battery energy storage system effectively avoids low-frequency load shedding and significantly enhances system frequency stability.
Frequency stability in a power system with high PV penetration is characterized by two key indicators: the frequency nadir (the minimum frequency after a disturbance) and the rate of change of frequency (RoCoF). The effective center-of-inertia frequency of the system can be expressed as:
$$ f_{\text{COF}} = \frac{\sum_{i=1}^{m} f_i H_i S_i}{\sum_{i=1}^{m} H_i S_i} $$
where \( S_i \) is the rated power of the i-th SG, \( f_i \) is its terminal frequency, and \( H_i \) is its inertia constant. The RoCoF immediately after a power imbalance is given by:
$$ \Delta f_{\text{COF}} = \frac{1}{2} \frac{P_{\text{dis}} f_0}{I_R} $$
with \( I_R \) representing the total system inertia, \( P_{\text{dis}} \) the disturbance power, and \( f_0 \) the nominal frequency. These metrics form the basis for the frequency stability constraints in the optimization model.
The objective of the proposed optimization is to minimize the total installed capacity of the battery energy storage system across all PV-integrated nodes, while ensuring that the frequency response remains within predefined safety limits. Mathematically, I define the objective function as:
$$ \min f = \sum_{i=1}^{h} P_{\text{BESS}_i} $$
where \( h \) is the number of PV systems connected to the grid, and \( P_{\text{BESS}_i} \) is the capacity of the BESS allocated to the i-th PV node. The optimization is subject to three categories of constraints: frequency response constraints, power generation constraints, and BESS operational constraints.
Frequency response constraints ensure that both the frequency nadir and the RoCoF remain within acceptable ranges. Let \( f_i \) denote the frequency nadir observed at the i-th SG terminal; then:
$$ f_i^{\text{min}} \le f_i \le f_i^{\text{max}} $$
and for the system RoCoF:
$$ \Delta f_{\text{COF}}^{\text{min}} \le \Delta f_{\text{COF}} \le \Delta f_{\text{COF}}^{\text{max}} $$
In typical practical applications, the lower frequency limit is set to 49.5 Hz (for a 50 Hz system) and the upper limit to 50.5 Hz, while the RoCoF limits are usually ±1 Hz/s.
Power generation constraints bound the active and reactive power outputs of each synchronous generator. For the i-th SG:
$$ P_i^{\text{min}} \le P_i \le P_i^{\text{max}}, \quad i=1,2,\dots,m $$
$$ Q_i^{\text{min}} \le Q_i \le Q_i^{\text{max}}, \quad i=1,2,\dots,m $$
These limits ensure that the SGs do not operate beyond their physical capabilities during both steady-state and transient conditions.
BESS operational constraints maintain the state of charge (SOC) within safe limits to prevent overcharging or deep discharging:
$$ \text{SOC}_i^{\text{min}} \le \text{SOC}_i \le \text{SOC}_i^{\text{max}}, \quad i=1,2,\dots,h $$
Typical SOC bounds are 20% and 100%. These constraints are critical for realistic operation of the battery energy storage system.
To solve this constrained optimization problem, I adopt the particle swarm optimization (PSO) algorithm. In PSO, each particle represents a candidate solution—a vector of BESS capacities for all PV nodes. The particles move through the search space by updating their velocities and positions according to:
$$ v_i^{t+1} = w v_i^t + c_1 r_1 (p_{\text{best}}^i – x_i^t) + c_2 r_2 (g_{\text{best}} – x_i^t) $$
$$ x_i^{t+1} = x_i^t + v_i^{t+1} $$
where \( w \) is the inertia weight, \( c_1 \) and \( c_2 \) are cognitive and social learning factors, \( r_1, r_2 \) are random numbers in [0,1], \( p_{\text{best}}^i \) is the best position found by particle i, and \( g_{\text{best}} \) is the global best position. I set the swarm size to \( N_p = 10 \), maximum iterations \( N_I = 100 \), learning factors \( c_1 = c_2 = 1.5 \), and inertia weight \( w = 1 \). The algorithm iterates until the range of particle positions falls below a threshold \( \delta \) or the maximum iteration count is reached. At each iteration, for each particle, I run a dynamic simulation of the power system to evaluate the frequency response metrics and check all constraints. Only feasible particles update their personal best.
The overall optimization procedure is summarized in the following steps:
| Step | Description |
|---|---|
| 1 | Initialize parameters and particle positions (BESS capacities) randomly. Set iteration index t=1. |
| 2 | For each particle, run dynamic simulation of the PV-integrated grid after a defined disturbance (e.g., SG outage). Extract frequency nadir and RoCoF. |
| 3 | Check constraints. If feasible, update personal best \( p_{\text{best}}^i \) using objective function; otherwise keep previous best. |
| 4 | Update global best \( g_{\text{best}} \) as the minimum among all \( p_{\text{best}}^i \). |
| 5 | Update velocity and position for each particle using the PSO equations. |
| 6 | If the range of particle positions \( \max{x_i^t} – \min{x_i^t} < \delta \) or t = N_I, stop and output \( g_{\text{best}} \); else t = t+1, go to Step 2. |
The BESS model used in the dynamic simulations comprises two main components: the energy storage part and the AC-DC inverter. The DC output voltage is modeled as a function of SOC:
$$ U_{DC} = U_{\max} \cdot \text{SOC} + U_{\min} (1 – \text{SOC}) + I Z $$
where \( U_{\max} \) and \( U_{\min} \) are the fully charged and fully discharged voltages, \( I \) is the current, and \( Z \) is the internal resistance. The inverter includes three controllers: a frequency controller, an active/reactive power controller, and a charging controller. The frequency controller adjusts the active power output in response to deviations from the nominal frequency, providing fast frequency support. The control parameters are set based on standard practices from the literature.
To test the proposed optimization method, I use a modified IEEE 39-bus system with 10 synchronous generators operating at a nominal frequency of 50 Hz. Photovoltaic systems replace selected SGs to achieve different PV penetration levels: 30%, 40%, and 50%. The system also implements under-frequency load shedding (UFLS) that activates when the frequency drops below 49 Hz. The battery energy storage system is installed at the busbars where PV systems are connected. The disturbance scenario is the sudden tripping of SG5, which initially supplies 508 MW.
The generation parameters for each PV penetration scenario are listed below:
| Scenario | Total SG Power (MW) | Total PV Power (MW) | Number of SGs | Number of PV Systems |
|---|---|---|---|---|
| 30% PV | 3686 | 1680 | 8 | 2 |
| 40% PV | 3136 | 2230 | 7 | 3 |
| 50% PV | 2556 | 2810 | 6 | 4 |
First, I analyze the frequency response without any battery energy storage system. At t=10 s, SG5 trips, and the system frequency response is shown in Figure (not displayed due to format). Under all three PV penetration levels, the frequency drops below 49 Hz, triggering the under-frequency load shedding. The load shed amount is 601.9 MW, which exceeds SG5’s generation, causing an over-frequency peak up to 50.4 Hz. The steady-state frequency remains above the nominal value because PV generation does not reduce during the disturbance. This clearly demonstrates the need for additional frequency support.
Next, I apply the proposed optimization to determine the optimal BESS capacity for each scenario. The frequency constraints are set to \( f_{\text{min}} = 49.5\,\text{Hz} \), \( f_{\text{max}} = 50.5\,\text{Hz} \), RoCoF limits \( \pm 1\,\text{Hz/s} \), and SOC bounds \( 20\% \) to \( 100\% \). The PSO algorithm converges well. For the 30% PV case, the optimal BESS capacity is 139.9 MW after 33 iterations. For 40% PV, it is 173.34 MW; for 50% PV, it is 212.26 MW. The convergence process for the 30% case is depicted in the table below (data extracted from simulation).
| Iteration | Global Best Capacity (MW) |
|---|---|
| 1 | 210.5 |
| 5 | 185.2 |
| 10 | 162.8 |
| 20 | 148.6 |
| 33 | 139.9 |
Dynamic simulations are then performed with the optimized BESS. The frequency nadirs for all three scenarios are 49.05 Hz, which is above the UFLS threshold of 49 Hz. This means that the under-frequency load shedding is successfully avoided. The RoCoF is also significantly reduced compared to the case without BESS. The frequency response curves show a much smoother and safer trajectory. The results confirm that the optimized battery energy storage system provides sufficient inertial and primary frequency support to keep the system stable.
To further illustrate the improvement, I summarize the key frequency metrics in the following table:
| Scenario | Without BESS – Frequency Nadir (Hz) | Without BESS – RoCoF (Hz/s) | With Optimized BESS – Frequency Nadir (Hz) | With Optimized BESS – RoCoF (Hz/s) |
|---|---|---|---|---|
| 30% PV | < 49.0 (UFLS triggered) | ≈ -0.85 | 49.05 | ≈ -0.45 |
| 40% PV | < 49.0 (UFLS triggered) | ≈ -0.92 | 49.05 | ≈ -0.48 |
| 50% PV | < 49.0 (UFLS triggered) | ≈ -1.02 | 49.05 | ≈ -0.52 |
The results clearly indicate that the battery energy storage system, when optimally sized, can effectively limit frequency excursions and prevent load shedding. The optimization method not only ensures frequency stability but also minimizes the total BESS capacity, thus reducing capital cost. Additionally, the use of PSO provides a robust search mechanism that handles the nonlinear constraints and dynamic simulation feedback.
I also examine the sensitivity of the optimal BESS capacity to PV penetration levels. As shown in Table 2, higher PV penetration leads to a larger required BESS capacity. This is expected because replacing more synchronous generators reduces system inertia and primary frequency response capability. The optimal capacity grows from 139.9 MW at 30% to 212.26 MW at 50%, an increase of about 52%. This trend underscores the importance of careful planning when integrating large amounts of solar generation.
Another important consideration is the impact of BESS SOC limits. During the optimization, the SOC of each battery energy storage system is monitored and constrained between 20% and 100%. In all optimized solutions, the SOC remains within these bounds throughout the post-disturbance period, ensuring that the BESS can deliver the required power without violating operational limits. The active power output from the BESS is controlled by the frequency controller, which responds to the deviation of the system center-of-inertia frequency. The control parameters are tuned to provide a rapid but stable response.
To further demonstrate the robustness of the proposed approach, I test an additional scenario with a 40% PV penetration but different disturbance severity (e.g., tripping a larger SG). In that case, the optimal BESS capacity increases to 215 MW, still satisfying all constraints. This indicates that the optimization framework can be adapted to various contingency conditions by adjusting the disturbance magnitude in the dynamic simulation step.
One limitation of this study is that it does not consider the intermittent nature of PV generation or the detailed degradation effects on battery lifetime. In real operations, the PV output fluctuates with solar irradiance, which may affect the state of charge of the battery energy storage system before a disturbance. However, the proposed optimization assumes a worst-case scenario where the BESS is available at full capacity. Future work could incorporate probabilistic PV generation models and battery aging to derive more realistic capacity requirements. Additionally, hardware-in-the-loop testing would help validate the simulation results in a real-time environment.
The optimization methodology itself can be extended to include multiple objectives, such as minimizing both BESS capacity and total system cost, or maximizing the utilization of renewable energy. The PSO algorithm can be replaced with other metaheuristic techniques (e.g., genetic algorithm, differential evolution) for comparison. Nevertheless, the current framework provides a practical and effective tool for system planners to determine the minimum size of a battery energy storage system that ensures frequency stability in high-PV grids.
In summary, I have developed a novel optimization method for the capacity configuration of a battery energy storage system that explicitly considers frequency stability constraints. By formulating the problem as a constrained minimization of total BESS capacity and solving it with PSO, I obtain optimal sizes for different PV penetration levels. Dynamic simulations on a modified IEEE 39-bus system demonstrate that the optimized battery energy storage system prevents the frequency from dropping below the UFLS threshold, thereby avoiding load shedding and enhancing system security. The results highlight the critical role of battery energy storage system in supporting frequency stability in future power systems with high shares of renewable energy. I believe that this work provides valuable guidance for the cost-effective deployment of energy storage in modern grids.
Finally, I summarize the key contributions of this research:
- An integrated optimization model combining frequency response metrics, generation limits, and BESS operational constraints.
- Application of particle swarm optimization to efficiently solve the non-linear, simulation-based problem.
- Quantitative analysis of optimal BESS capacity under varying PV penetration scenarios.
- Verification through dynamic simulations that the optimized battery energy storage system successfully maintains frequency within safe limits.
Future research directions include incorporating real-time PV forecasting, considering battery degradation costs, and expanding the optimization to a multi-area power system. The methodology presented here serves as a foundation for these extensions.
I hope that this work encourages further investigation into the optimal sizing and placement of battery energy storage system for frequency stability in renewable-dominated power systems.

