1. Introduction
Modern power systems are facing various technical, environmental, and economic issues. Traditional power plants are not emission-free and create environmental pollution, leading to health problems and other global concerns. Therefore, the necessity of integrating renewable energy sources naturally emerges. Power system planners have been looking to distributed generation units as a solution to serve the distribution system’s needs. Small-scale generators built near load centers are distributed generation (DG) or distributed energy resource (DER) units. DER units are dispersed throughout a utility’s distribution system to reduce distribution losses and voltage disturbances [
1]. The International Energy Agency (IEA) describes DG as “a type of generating plant that is tied to the grid at the distribution level voltages to serve a customer on-site and at the same time to provide support to a distribution network” [
2]. This shift toward decentralized energy is also a trend in research because it helps create more reliable and sustainable energy systems. It is not just about being green; optimally sizing and allocating resources within distribution systems holds significance for several reasons. It is about making the energy system more reliable, adaptable, and self-sufficient.
Numerous studies have examined various optimization algorithms for the sizing and allocation of distributed generators (DGs) in radial networks, all aiming to enhance distribution system performance. A comprehensive review of these studies examines optimal allocation methods and their impacts [
3]. Among these methods, Particle Swarm Optimization (PSO) emerges as the dominant approach, as evidenced by its repeated utilization across multiple investigations. While some focus on minimizing total costs [
4], power losses [
4,
5,
6,
7,
8,
9,
10,
11], and voltage disturbances [
4,
9,
10,
12], others explore the flexibility of PSO through variant analyses [
6,
13], as well as its hybridization with complementary algorithms [
9,
10,
14]. Concurrently, strategies to enhance power factor correction have garnered attention, especially while addressing seasonal load fluctuations and overall system efficiency improvement [
15]. Moreover, the adoption of PSO in multi-objective frameworks, such as those emphasizing simultaneous optimization of cost, loss, and voltage quality, underscores its flexibility and effectiveness [
4,
9,
16]. As a more realistic case, integrating multiple DG units may cause scalability challenges in PSO frameworks [
17]. The recent advancements have led to the development of PSO variants [
11,
14,
18] showcasing improved convergence time and solution quality. Furthermore, emerging applications of PSO extend beyond traditional DG planning contexts, encompassing renewable resource planning in microgrid systems [
19], energy storage system optimization [
18], electric vehicle charging station (EVCS) integration [
11], and mitigation of distribution system challenges [
7,
8].
Alongside PSO, various heuristic and metaheuristic algorithms are also examined in the context of DG planning problems in distribution systems, aiming to enhance system performance. These include the Jaya Algorithm, the Genetic Algorithm (GA) [
20], the Firefly Algorithm [
20,
21], the Improved Harmony Search Algorithm (IHSA) [
22], the Hummingbird Algorithm [
23], the Artificial Bee Colony (ABC) Algorithm [
24], and Harris Hawks Optimization (HHO) [
25]. Each of these methods offers different strengths in optimizing voltage profiles and minimizing power losses while integrating DGs. Hybrid techniques, such as the KHO-GWO Algorithm [
26], aim to enhance network resilience during floods and earthquakes while achieving economic and operational improvements. Furthermore, the exploration of physics-based metaheuristic techniques showcases promising results. For instance, Black Hole Optimization (BHO) and the Lightning Search Algorithm (LSA) have shown potential performance in optimizing microgrid (MG) operations [
27]. Moreover, the Comprehensive Teaching–Learning-Based Optimization (CTLBO) Algorithm [
28] and the Shuffled Frog Leap Algorithm with the Ant Lion Optimizer (SFLA-ALO) [
12] can be used to address the simultaneous sizing and siting of DGs and energy storage systems. Bilevel Optimization and Unscented Transformation (UT) methods have been proposed to enable optimal siting and sizing of flexi-renewable virtual power plants (FRVPPs) in distribution systems while minimizing expected energy not supplied [
26]. Additionally, the Artificial Electric Field Algorithm (MOAEFA) consistently demonstrates superior performance in achieving optimal wind turbine placements [
29]. Finally, the Hybrid Soccer League Competition–Pattern Search (SLC-PS) Algorithm is used to size and site the DGs, EVCSs, and ESSs within the distribution system [
30].
The existing literature on the sizing and allocation of DGs limits discussions on integrated distributed resources, particularly hybrid renewables (solar, wind, etc.) and storage, which hinders the leveraging of their integrated sustainability and reliability benefits for the grid. Moreover, research often overlooks dynamic seasonal demand and generation scenarios. On the other hand, common metaheuristic optimization methods have limitations in addressing crucial electrical network characteristics due to their numerical bias. This limits their effectiveness because the numerical distance between two nodes in power systems might be different from the actual electrical distance.
The proposed bilevel optimization framework addresses these issues by incorporating energy storage and diversified renewable resources in the sizing module. Additionally, it introduces two algorithms to enhance PSO searching efficiency: the Connectivity-Driven Neighbor Generator and the Resistivity-Driven Candidate Generator in the sitting module to take into account the electrical characteristics during the searching process.
2. Problem Definition
Consideration of the realistic integration of diversified distributed resources and dynamic aspects of power systems in optimizing DG planning is crucial. This enables leveraging their integrated sustainability and reliability benefits. Moreover, common metaheuristic optimization methods, notably PSO, have limitations in addressing crucial electrical network characteristics due to their numerical bias.
Figure 1 illustrates a radial distribution network with nodes that exhibit disparities between numerical and physical connections. Certain nodes are physically connected despite lacking direct numerical connections (e.g., 3 and 23), while others are numerically but not physically connected (e.g., 18 and 19). This presents challenges for metaheuristic algorithms such as PSO when searching for optimal solutions. As the algorithm progresses towards convergence, the difficulty arises of navigating from numerically connected nodes to physically connected ones due to limitations in step size. For instance, transitioning from node 3 to a physically close optimal node like 23 with a small step size may lead to local optima traps. Therefore, instead of strict numerical connections, node connections can cause the classical PSO search step to overlook actual node neighbors and shift towards more numerical-based neighbors during the solution search.
Furthermore,
Figure 1 highlights a certain branch resistivity in this particular radial distribution network. Certain branches, such as those connecting nodes 1 and 2, 2 and 19, 3 and 23, and 6 and 26, exhibit lower resistance than others. These areas of low resistivity provide valuable guidance for PSO. By concentrating its search efforts in these regions, PSO can more effectively minimize power losses within the system. Leveraging this information enhances the algorithm’s efficiency in locating optimal solutions within the network.
A bilevel optimization module is proposed to fill the gap in the existing literature. First, the ‘sizing module’ contributes by incorporating energy storage to handle variations in renewables, providing storage dispatch, and operating as an integrated DER unit. This hybrid system can be extended to accommodate additional renewable units, making the proposed framework adaptable and scalable for evolving power system requirements. Second, the proposed framework introduces two innovative algorithms to enhance PSO’s efficiency in addressing power system challenges: the Connectivity-Driven Neighbor Generator and the Resistivity-Driven Candidate Generator.
The Connectivity-Driven Neighbor Generator analyzes electrical connectivity among nodes, generating solution candidates aligned with the grid’s physical topology. This ensures that the PSO explores spaces aligned with the electrical structure, prioritizing actual physical neighbors over numerical ones during the search. This approach prevents getting stuck at local optima, especially in later iterations where the step size is smaller. Additionally, the Resistivity-Driven Candidate Generator strategically targets low-resistivity regions, addressing resource allocation challenges and guiding the PSO toward regions with better potential for lower losses.
3. Methodology
The methodology employed in this study consists of two main modules: the Hybrid DER Sizing and the Hybrid DER Sitting Modules. The former utilizes a Mixed-Integer Linear Program (MILP) to determine the optimal sizes of renewables and BESSs, while the latter employs a network-oriented PSO to find the best locations for these resources.
3.1. Hybrid DER Sizing Module
The Hybrid DER Sizing Module aims to determine the optimal size for renewables and storage. The mathematical model is a Mixed-Integer Linear Program (MILP).
The Solar PV System has the following set of constraints. Constraint (1) defines the generated power at time t using the solar profile and sizing decision variable. Constraint (2) ensures that the solar generation can feed the load or be used to charge the battery or be curtailed. Constraints (3) and (4) set a maximum limit for each task. Constraint (5) restricts the curtailed solar power at time t to be within a fraction, γ, of the generated solar energy. Adjusting γ to 1 allows for the curtailment of the whole solar generation; however, changing it to 0 prevents curtailment. Thus, γ should be adjusted based on simulation preference.
The Wind Energy System has the following set of constraints. Constraint (6) is similar to (1) and defines the generated power at time t using the known wind profile for the location and the sizing decision variable. Constraint (7) ensures that the wind generation can feed the load or be used to charge the battery or be curtailed. Constraints (8) and (9) set a maximum limit for each task. Constraint (10) acts as a constraint, restraining curtailed wind power at time t to be within a fraction, γ, of the total generated wind power. Adjusting γ to 1 allows curtailment of the whole wind generation; however, changing it to 0 prevents curtailment. Thus, γ should be adjusted based on simulation preference.
The Battery Energy Storage System (BESS) plays a role in managing temporal supply and demand balance. Firstly, Constraint (11) tracks the state of energy (SOE) at time t by considering the previous state and the charging and discharging power, incorporating efficiencies
and
. The state of energy here is different from the state of charge. It tracks the amount of energy stored in the BESS. By doing so, the sizing of the BESS becomes a decision variable reflected as the maximum energy capacity,
, in Constraint (12). The depth of discharge can also be modeled as the minimum limit for the state of energy. Constraint (13) limits the charging power by the available energy capacity in the ESS, while Constraint (14) models the C-rate of the BESS by introducing a maximum limit on charging power. For example, an LFP-type BESS has a C-rate of 1, where the maximum charging power can be as much as
; however, a flow battery storage has a C-rate of ¼, where the maximum charging power is at most one-fourth of
. Constraints (14) and (15) are similar to (12) and (13) but from the perspective of discharging action. Constraints (17) and (18) prevent the simultaneous charging and discharging event at time t by introducing a binary decision variable,
. Lastly, the model assumes that the BESS can only be charged from either the solar PV or the wind, as given in Constraint (19).
After the asset modeling, the next step is maintaining the supply and demand balance at each time step. The supply side includes power from the grid, solar generation, wind generation, and BESS discharge. Meanwhile, the demand side consists of the hourly demand, BESS charging from solar and wind, and curtailments of solar and wind. These constraints contribute to a comprehensive formulation defining the demand components, including solar to load, wind to load, grid power, and BESS hourly discharge. This systematic approach ensures a balance, guiding the system towards optimal resource utilization.
The model’s objective function minimizes the potential investment’s combined capital expenditure (CAPEX) and operational expenditure (OPEX). Operational expenditure (OPEX), in (23), is calculated as the sum of the grid power consumption () multiplied by the corresponding coefficient () for each time period (t) within the optimization horizon (T). The coefficient ) accounts for the cost associated with grid power consumption at each time period.
Capital expenditure (CAPEX), in (24), is the sum of the initial investment costs related to the solar, energy storage, and wind systems. The overnight costs (
,
, and
) represent the upfront capital costs for installing each system type. These costs are then multiplied by the installed capacity of each system (
,
, and
) and the scaled lifetime coefficient (
) associated with each system type. The time factor is incorporated by considering the number of days
) in the 1-year optimization period (365 days). This enables the simulations to be performed in a shorter time, for computational simplicity, especially when introducing representative days for the whole 1-year horizon.
3.2. Hybrid DER Sitting Module
PSO represents an optimization method for the DER allocation problem. This technique operates on a swarm intelligence principle, where individuals (particles) iteratively navigate a solution space, guided by their own best positions and the collective best positions found by the swarm. PSO’s strength lies in its simplicity and ability to explore large solution spaces efficiently. The method’s working mechanism involves particles adjusting their positions based on their own historical best positions and the global best position found by the swarm, allowing for efficient convergence toward optimal solutions.
The improved, network-oriented Particle Swarm Optimization algorithm is illustrated in
Figure 2. A population of potential solutions is initialized randomly, including their positions and velocities. This population comprises renewable units and BESS allocation within the distribution network. For each initialized particle, the fitness function value is evaluated, indicating its overall quality with respect to the optimization objective. A network validation and cost function module, described in detail later, has been developed to assess power loss costs and costs related to power flow operational limits.
The particles then undergo iterative updates. Each particle adjusts its position within the solution space based on its previous best position and the best position found by any particle in the population. The PSO algorithm proceeds through multiple iterations, seeking to converge toward a solution that balances the trade-offs between costs, constraints, and the allocation of DER components across the network.
Convergence behavior is shaped by the adaptive parameters; the inertia weight, which determines the trade-off between exploration and exploitation; and, crucially, the diversity among the solutions.
The parameter k in the adaptive weight equation is crucial in PSO, determining the rate of weight reduction during optimization. A higher k promotes exploration, while a lower k emphasizes exploitation. Choosing the right k balance is essential for efficient convergence and problem-specific optimization. The equation of the adaptive inertia weight is shown in (25).
Updating the particle velocities with the new adaptive inertia weight takes place as in (26).
A particle’s position update occurs based on the current position and the new velocity calculated previously, as shown in (27).
The conventional application of PSO in power and energy system planning tends to exhibit specific drawbacks. It often showcases a numerical bias; it emphasizes numerical optimization over crucial electrical aspects intrinsic to the power grid. This narrow focus might lead to solutions that need more efficiency in complex electrical systems. Moreover, when confronted with large-scale problems, conventional PSO encounters scalability challenges, impeding computational efficiency and hindering its applicability in real-world scenarios.
For the basic PSO algorithm process (shown in green in
Figure 2), additional steps (the red boxes) enhance its effectiveness in generating network-based candidates. These steps allow PSO to better explore the complexities of the power network. During each iteration, PSO evaluates the network topology to identify potential solution candidates that meet its objectives. If these candidates outperform existing solutions, PSO incorporates them into its search process. Otherwise, they are retained for further exploration. To generate network-based candidates, PSO uses two specialized algorithms: the Connectivity-Driven Neighbor Generator and the Resistivity-Driven Neighbor Generator. These algorithms leverage the power network’s structure to enrich PSO’s search strategy and improve the discovery of optimal solutions for distributed energy resource allocation.
3.2.1. Connectivity-Driven Neighbor Generator
The Connectivity-Driven Neighbor Generator, a core algorithm in the proposed framework, operates by examining the electrical connectivity among nodes in the power grid. By analyzing the network topology, it generates solution candidates that align with the physical nodal connections within the grid. This ensures that the PSO algorithm explores solution spaces that are aligned with the grid’s electrical structure, addressing a critical limitation of conventional PSO, which tends to overlook the profound impact of the physical node connections. The provided pseudocode demonstrates the implementation of the Connectivity-Driven Neighbor Generator. It begins by importing the branch data and then creates a connectivity matrix representing physical node connections. When utilized within the PSO process, the algorithm provides actual neighbor candidates for the current solution. As a result, this algorithm significantly enhances the PSO’s efficiency in navigating the search space, enabling it to yield better solutions (Algorithm 1).
Algorithm 1: Connectivity-Driven Neighbor Generator |
|
3.2.2. Resistivity-Driven Candidate Generator
The Resistivity-Driven Candidate Generation algorithm addresses resource allocation challenges by targeting areas with lower resistivity indicative of optimal opportunities within the power grid. This algorithm initially identifies the least resistive lines, focusing on the lowest 25% based on resistivity values, and extracts unique nodes associated with these lines.
When generating multiple candidate solutions, shown in its pseudocode, the algorithm randomly selects nodes from this subset, promoting diversification while concentrating on areas favorable for optimal resource deployment. By introducing nodes from low-resistivity areas into the candidate solutions, the algorithm guides the PSO towards regions where the electrical properties suggest better potential for resource allocation. This strategy aligns to address PSO’s limitations related to purely numerical optimizations, providing a more directed and contextually informed search within the power network (Algorithm 2).
Algorithm 2: Resistivity-Driven Candidate Generator |
|
3.2.3. Network Validation and Cost Function
The intermittent nature of renewable generation and the varying charging and discharging patterns of batteries can introduce fluctuations and imbalances in the system. The Network Validation module and Cost Function Calculation are necessary when allocating battery and renewable systems to ensure operational safety, optimize hybrid system placement, maintain grid stability, and comply with regulatory standards. The module enables the effective integration of hybrid system technologies while preserving the reliability and performance of the distribution grid. Distribution systems have physical and operational limitations that must be considered to ensure safe and reliable operation. These constraints include voltage limits, thermal limits of power lines and transformers, and power flow balance requirements. The detailed process of the module is shown in
Figure 3. Given the PSO control variables, which encompass the allocation decisions, load data, and results from the sizing module, the function dynamically configures the IEEE network parameters for each time step. It updates the generator allocation for renewable units and storage, demands data, then performs power flow simulations to assess the network’s behavior. It calculates penalty factors for violations such as slack bus power, bus voltage, reactive power generation, and line capacity. These penalties are used to evaluate the quality of the allocation solutions. Finally, Network Validation accumulates penalties across all time steps, providing a comprehensive measure of the network’s performance. These penalties are used to evaluate the quality of the allocation solutions. Finally, Network Validation accumulates penalties across all time steps, providing a comprehensive measure of the network’s performance. These penalties are used to evaluate the quality of the allocation solutions. Finally, Network Validation accumulates penalties across all time steps, providing a comprehensive measure of the network’s performance. These penalties are used to evaluate the quality of the allocation solutions. Finally, Network Validation accumulates penalties across all time steps, providing a comprehensive measure of the network’s performance.
The resulting fitness value and other vital information are then used to guide the optimization process, ensuring that the proposed methods lead to efficient and reliable hybrid DER integration.
3.2.4. Power Flow Analysis
Power flow analysis is a vital component of this distribution-level hybrid system planning. It is integral to the Network Validation and Cost Function Calculation, optimizing renewable and BESS unit allocation. Power flow ensures technical reliability, economic viability, and network constraint compliance throughout the evaluation. Power flow analysis yields insights into voltage, power, and constraint respect. Violations trigger penalties to quantify their impacts. It also calculates power losses to minimize them, enhancing system efficiency. MATPOWER [
31] is used to execute power flow equations.
4. Case Studies
The simulations utilized a comprehensive dataset of 12 representative days of a year to validate the methods proposed in previous sections.
Figure 4 illustrates the time series input data used in the case studies. The data included time series electricity prices, specifically Time of Use (TOU) prices, which are crucial for capturing dynamic price variations throughout the day.
Additionally, an hourly demand profile expressed in per units was incorporated, as illustrated in the simulations. This demand profile was scaled by the nodal peak demand values provided by IEEE cases, enabling a time-varying demand representation. The hourly solar PV and wind profiles, expressed in per units, for the specific site were utilized. These renewable generation profiles were employed to identify the optimal sizes of solar PV and wind systems in MW based on the mathematical model proposed in previous sections.
Financial and technical assumptions extracted from [
32] were incorporated (and are given in
Table 1) to ensure the feasibility and applicability of the methods in real-world scenarios. These assumptions encompassed overnight capital costs, lifetimes, and technical details of renewable systems and BESSs.
Three different networks, the IEEE 33-bus, the IEEE 69-bus [
31], and the Norwegian medium voltage distribution network [
33], were used to assess the practicality and effectiveness of the planning and allocation strategies proposed in previous sections. Utilizing data from these networks, different case studies were implemented and simulated in MATLAB to assess the effectiveness of the strategy utilizing network-oriented PSO configurations. The detailed parameters of the designed cases are summarized in
Table 2.
6. Conclusions
The distribution grid is more vulnerable than ever with the increased share of distributed energy resources. While the initial deployment of DERs shows no destructive impact on grid performance, the widespread deployment may negatively affect reliability. Therefore, finding the best capacity at the best location in the grid is becoming important now and will be more important soon. This study proposed a bilevel optimization framework for integrating diversified renewable resources and storage in distribution systems. The sizing module determines the optimal sizes of hybrid systems that effectively manage variations in renewable energy generation through energy storage deployment. The siting module searches for the best location for the hybrid system while ensuring technical reliability. One of the solution methods for such a problem is using the PSO algorithm; however, the numerical convergence methodology of PSO does not fit with the concept of electrical connectivity. The bus numbers in the power grid do not necessarily reflect the order of connection in the network; therefore, the two algorithms proposed in this paper enhance PSO’s computational efficiency by considering the electrical characteristics of power grids to optimize resource allocation. The Connectivity-Driven Neighbor Generator ensures the exploration of the solution space aligned with the grid’s network topology and hence overcomes local optima challenges in PSO for such power system problems. Secondly, the Resistivity-Driven Neighbor Generator strategically targets areas with lower resistivity. Simulations of IEEE 33-bus and IEEE 69-bus cases demonstrated reductions in power losses, with the integration of PV, wind, and BESS achieving a 74% loss reduction in the IEEE 33 bus case. Notably, the regular PSO in the IEEE69 case with PV and BESS demonstrated convergence to an average fitness value of USD 6597, while the integration of network-oriented methods guaranteed convergence to a significantly lower average fitness value of USD 6409 in a shorter computational time. Additionally, integrating renewables and storage systems reduces the VDI, thereby improving voltage profiles and enhancing system stability. The Norwegian case study further validated these findings, indicating major improvements in voltage stability and loss reduction, affirming the effectiveness of the proposed approach in real-world applications. These outcomes underscore the significance of the proposed methods in balancing technical reliability, economic viability, and computational efficiency in addressing the complexities of distributed resource planning.
In future work, the scope of the proposed power network-based algorithms will be extended to assess their effectiveness across various evolutionary optimization methods. Additionally, efforts will focus on addressing uncertainties in renewable energy generation to optimize renewable distributed resource planning. This will involve exploring stochastic optimization techniques aimed at managing the variability and intermittency inherent in renewable energy sources, ultimately facilitating their sustainable integration into distribution grid.