1. Introduction
A collection of linked loads and dispersed energy sources that operate as a single, controllable unit is known as a microgrid. It can function in two modes: connected to the grid (grid-connected mode) and disconnected from the grid (islanded mode). Microgrids can help customers become more dependable and resilient to power outages. Renewable resources are those that are known to replenish on their own over time. For this reason, it is viable even after human use. Renewable resources are considered especially important since they have the potential to replace non-renewable, or finite, resources in the energy production process. Examples of renewable resources are solar power and wind turbine generators. The reserve margin, which is typically used for load balancing or supplying important loads during times of supply scarcity, is the amount of an electric power system’s unused available capability expressed as a percentage of the total capability. Microgrids are essential parts of modern grids as they provide many advantages, including improved grid stability, reliability, and resilience. Hybrid renewable energy resource microgrids provide even more advantages as they assist in achieving the United Nations 2050 net zero goals by using natural resources to reduce the carbon footprint. Microgrids also assist in reducing energy poverty in communities in remote and isolated areas where the grid cannot reach. The intermittent nature of renewable energy sources poses challenges regarding microgrid operation and management. Studies should be performed to determine the optimal cost of operating microgrids, considering the grid integration costs, battery energy storage charging/discharging, renewable energy source usage, etc., while meeting load demand.
The optimisation of power system operation has a long history; it has been enriched over time by advances in mathematical programming techniques and computational methods, but predating the advent of digital computers, which revolutionised numerical optimisation and computation in general [
1]. The global maximum power point (GMPP) of standalone battery charging systems under partial shading conditions (PSCs) is tracked using a novel hybrid Series Salp Particle Swarm Optimisation (SSPSO) algorithm. Under PSC, photovoltaic (PV) characteristics such as power current (P-I) and power voltage (P-V) have a global peak as well as several local peaks with intricate forms [
2]. The construction of multi-energy microgrids, which include hydrogen and electricity loads, storage alternatives, and low-carbon energy sources, is required. To increase the economic feasibility of microgrid components, the size must always be measured exactly, and energy must constantly be delivered most economically. Here, we describe a two-level optimisation for energy management and sizing applied to an original multi-energy scenario employing electricity and hydrogen as energy vectors to promote the deployment of multi-energy microgrids in industrial areas. A financial profitability target is considered, together with restrictions relating to the cost, dependability, and accessibility of sources and storage alternatives [
3]. Microgrids can incorporate renewable energy sources (RESs) and provide local customers with electricity. However, microgrid operation is challenging due to load and RES uncertainty. Moreover, a precise nonlinear degradation cost model of battery energy storage systems (BESSs) ought to be put out, since BESSs are essential dispatchable devices for reducing the adverse effects of uncertainty. This study suggests an affine arithmetic-based microgrid interval optimisation (IO) technique that considers uncertainty and BESS deterioration to address these problems [
4]. Off-grid microgrids are often used for power distribution in rural areas. A mathematical model that integrates N-1 security analysis for topology design, capacity planning, and the operation of distributed energy resources in microgrids is created to address the dependability challenges for these microgrids. A rolling-horizon technique combined with scenario-based deconstruction is intended to effectively solve the model because the optimisation problem is too big [
5]. An efficient solution to the issue of local renewable energy consumption is the growing popularity of microgrids. In contrast, power fluctuations pose a serious risk to the widespread deployment of renewable energy-powered grid-connected microgrids. A mathematical model of a microgrid with grid-connected power constraints and a supercapacitor–battery hybrid energy storage system, as well as a novel rolling optimisation technique, is presented for smoothing grid-connected power fluctuations for microgrids [
6]. The growing percentage of electric vehicles on the road means that vehicle charging is having an increasingly detrimental effect on the power supply. The microgrid’s load dispatch multi-objective optimisation model and the vehicle charging–discharging model are set. By merging particle swarm optimisation (PSO) and the gravitational search algorithm (GSA), a hybrid modified GSA-PSO (MGSAPSO) method is proposed to optimise the load dispatch of a microgrid consisting of electric vehicles. The global search performance of the GSA algorithm is improved by the proposed method, which integrates the PSO’s global memory capacity into the GSA. Concurrently, the hybrid approach is improved by generating a chaotic initialisation population, a learning factor, and an adjustable inertia vector [
7].
An operation planning and management support management system for microgrids is being presented by the microgrid aggregator, the new electrical market agent. To achieve the best market participation, the aggregator controls the energy consumption, electric vehicles, energy storage, wind and photovoltaic systems, microturbines, and energy usage. As a crucial feature of a microgrid support management system, a support and information system are now necessary for decision making when participating in the electrical market. A stochastic mixed-integer linear programming problem that relies on understanding the stochastic processes defining the unknown parameters forms the foundation for the presented microgrid support management system [
8]. Academic and industrial interest in DC microgrids is growing due to advancements in power electronics, the growing usage of DC loads, DC renewable energy sources, battery storage systems, and a lack of reactive power or frequency stability issues. DC microgrids require careful consideration of demand response incentives for user participation and battery degradation cost modelling to operate efficiently. To achieve a practical degradation cost model for a Li-ion battery and optimise battery scheduling, a realistic operational cost is required. Apart from the energy price, a planned islanding responsive demand response incentive is put in place to incentivise customers to change their load during prearranged grid-tie periods [
9]. The fundamental electricity needs of remote and rural areas could be well served by renewable energy sources (RESs). An optimisation strategy and a potential power management plan (PMS) designed for a hybrid renewable energy system (HRES) that combines wind, a battery, and a converter to provide customers with highly reliable and high-quality power is required [
10]. Long-term access to electricity is ensured by an isolated microgrid system that is fuelled by renewable energy and energy storage technologies. This type of system is especially well suited to address inadequate electrical infrastructure in rural areas. The stochastic behaviour of electric vehicle (EV) users and the uncertainty surrounding residential user behaviour and renewable energy sources impact the system’s capacity design [
11]. Power quality (PQ) issues occur when non-linear loads and power electronic components are included in microgrids. These issues could also be brought on by an unequal load on the microgrid. They undoubtedly affect the daily operating schedule of the microgrid. An optimal harmonic power flow (OHPF) framework for the daily optimal scheduling of a grid-connected microgrid is created by combining an optimisation formulation with harmonic power flow (HPF). The framework for evaluating PQ uses three indices: voltage imbalance factor (VUF), voltage magnitude, and voltage total harmonic distortion (THDV) [
12]. Environmental harm and energy scarcity have become major issues for business and human progress. Thus, focusing on the research on distributed energy sources (DERs) and renewable energy sources is both advantageous and required. Because of its versatility, a microgrid can function in both isolated and grid-connected configurations. To maximise the economic benefits for MG users, optimisation models should balance energy usage, battery preservation, and other parameters while considering the limitations of the power infrastructure and the current price of electricity [
13]. A domain-enriched optimisation method was developed to enhance the overall dynamic resilience and small-signal stability of islanded microgrids. An exclusive eigen-value-oriented objective function and associated restrictions are used to optimise the controller settings for the power electronic interfaces of distributed energy resources (DERs). The system’s dynamic resilience depends on these interfaces. By utilising the comprehension of the microgrid domain, an additional loss component in the optimisation variables that functions as a multivariate polynomial is proposed to assist in resolving the resulting non-smooth and non-convex optimisation problem [
14].
Grid-tied microgrids play crucial roles in resilience and sustainability as they establish a balanced and efficient connection between renewable energy sources and the main power grid. The dynamic interaction between the intermittent nature of renewable energy sources and the volatility of load changes, however, presents a complex spectrum of technical energy management issues [
15]. Because renewable energy is erratic and electric vehicles (EVs) have an unorganised grid link, the power system will have challenges in maintaining stable and safe operations. The symmetry and dependability of the microgrid operation are ensured by the suggested microgrid optimisation scheduling method, which takes EV access into consideration. When examining each microgrid unit’s operating constraints, the network active power loss and node voltage variance are considered. To improve the efficiency of its solution, the developed microgrid model is accordingly modified by second-order cone relaxation [
16]. Examining microgrid scheduling for multi-objective optimisation is necessary to improve the comprehension of the multi-objective optimisation-based microgrid scheduling technique. Before they can manage the microgrid, each energy storage device’s maximum charging power, maximum discharging power, and remaining capacity need to be determined. Above all, a mathematical model of the microgrid is built. A multi-objective optimisation microgrid operating model was created for several microgrid states, including the grid-connected state and the island state, building on the previously produced microgrid mathematical model [
17].
In this paper, we provide an optimised microgrid operation solution that accounts for variable electricity prices, intermittent renewable energy resources, and battery energy storage system (BESS) charging and discharging schedules. This will help ensure that the reserve margins for critical loads are covered if the grid is unavailable and the generation from renewable energy sources is insufficient or unavailable. Two major contributions of this research are that it is the first of its kind in the literature to study reserve margins for important loads, and it proposes that instead of using the grid, excess renewable energy should be the only source used to charge batteries.
The work is organised as follows:
Section 1 contains an introduction, and
Section 2 presents the hybrid microgrid’s mathematical problem formulation, which includes information on the pricing, load profiles, and the size of the various generating units. A PSO algorithm is shown in
Section 3 in both the standard format and the hybrid microgrid-specific implementation. The results of the simulation for hybrid microgrid optimisation are shown in
Section 4 and
Section 5, respectively, along with a discussion of the results.
3. Particle Swarm Optimisation Method for Hybrid Renewable Energy Micro Grid
When the PSO algorithm is compared to classical mathematical algorithms and other heuristic optimisation techniques, its key advantages can be summed up as follows: computing efficiency, robustness to control parameters, simplicity of idea, and ease of implementation. These are some of the reasons why the PSO algorithm was chosen over the others.
3.1. Standard PSO Algorithm
The particle swarm optimisation (PSO) algorithm was first introduced by Kennedy and Eberhart in 1995. The method is based on the natural process of the school of fish or the flock birds follow when they are searching for food. When birds are flying and searching randomly for food, birds in the flock share their discovery and help the entire flock achieve the best hunt, which results in increased search efficiency. PSO is an optimisation algorithm that offers a population-based search method in which individual particles utilise the information supplied by other particles to adjust their positions over time based on their own experiences as well as the experiences of other particles. Finding a function’s maximum or minimum on a multidimensional vector space is the ideal application for PSO.
The PSO algorithm can be defined as a stochastic multi-agent parallel search technique, wherein individual particles within a swarm symbolise the potential solutions to an optimisation issue. Based on its own and the swarm’s collective flight experiences, a particle can be viewed as an autonomous intelligent agent that “flies” around a multi-dimensional issue space in pursuit of the best solution to the optimisation problem. Three n-dimensional vectors make up each particle
in the swarm (with
being the dimensionality of the search space,
), which, at time,
, can be represented as the current location,
, the previous best position,
, and the velocity,
[
18]. The iterative velocity update, which modifies each particle’s position to guide the entire swarm towards the best solution to the optimisation issue, is the fundamental portion of the PSO method, as shown in Equation (28).
whereby
r1 and
r2 are random numbers between 0 and 1;
w,
c1, and
c2 are constant PSO parameters; pbest is the best position that gives the best function evaluation; while gbest is the global best for all of the particles under evaluation. The current position of each particle
is assessed for “fitness” at each iteration using the optimisation problem’s objective function. The particle velocity
is used to update a particle’s position to move it towards a “better” position, as determined by the particle achieving an enhanced fitness evaluation. It represents the composite flying experience of the individual particle and the rest of the swarm. Every particle records the position that corresponds to its highest fitness value up to the most recent iteration, represented by the symbol
. This position is then updated to the current location whenever the current position has a higher fitness value than the most recent best. Like a flock of birds searching for food, the swarm is likely to move toward the ideal location in the search space as the iterations go on. One crucial aspect of the PSO algorithm is the social interaction and information sharing that occurs amongst the particles in the swarm. The swarm’s collective behaviour is what allows the program to search as efficiently as possible [
18].
Figure 2’s flowchart presents the standard PSO algorithm.
Table 1 lists the unique characteristics of the PSO algorithm when compared to other heuristic optimisation techniques.
3.2. PSO Algorithm Implementation to the Microgrid Optimisation Problem
The PSO algorithm’s mechanics must be transferred to the optimisation problem’s structure to be applied to any kind of optimisation problem. In particular, when looking for the best solution to the problem, a mapping between the particle positions and velocities and the optimisation problem’s decision vector must be constructed, as well as an adjustment process for the decision vector. The PSO method resolves the hybrid microgrid optimisation issue presented in Equations (4)–(12), subject to the limitations specified in Equations (13)–(25). The structure of the location and velocity Equation (26) must therefore be mapped to the structure of the hybrid microgrid optimisation problem. This is accomplished as follows:
The number of individuals in each distinct particle within the swarm is assigned to correspond with the number of generating units. The positions of the particle members represent the active power generated by the generators for the dispatch problem.
The velocities are variables that are used to search in the constraint’s domain, but they have the same meaning as the active power.
It is considered that the swarm has Np particles in total.
The PSO algorithm for the solution of an optimal hybrid renewable energy microgrid is developed using the following steps [
19]:
Step 1. Set the initial values for the PSO parameters, including the maximum number of iterations (MaxIt), uniform random number values, r1 and r2, acceleration constants, c1 and c2, and inertia weight ω.
Step 2. Determine the starting velocity’s lowest and maximum values by applying the generator limit constraint, as stated below.
whereby
Np is the number of particles in a swarm, and
is the number of members in one particle, which is equal to the number of generating units.
Step 3. Determine the starting velocities of each particle, as shown in Equation (28).
whereby
and
are the previously calculated minimum and maximum velocities, respectively.
Step 4. Determine the particle members’ starting positions as follows while ensuring the constraints are met:
A slack bus, Generator (PV) bus, and Load (PQ) bus are the three types of buses in the power system. Slack buses, also known as reference buses, are utilised in electrical power systems to balance the active and reactive powers of the system during load flow analyses. By delivering and receiving active and reactive power to and from the system, the slack bus compensates for system losses. In the microgrid simulation, two buses are regarded as slack buses (the grid bus and the BESS bus). The slack bus in the PSO algorithm serves to fulfil the power balance constraint provided in Equation (13).
Step 5. Calculate the objective function for the initial positions of the particles, as defined in Equation (14), which was modified to consider only the BESS and grid costs as the PV and wind system costs are constant.
Step 6. Choose the optimal starting point and the global optimal starting point in the manner described below.
Step 7. Calculate the new velocities using Equation (26) and check the constraints defined in Equations (13)–(25).
Step 8. Calculate the new position of the generator in the particles using the following equation and check the constraints:
Step 9. Determine the updated real power of the generators and use the limitations to verify the generator’s new location within the particles.
Step 10. Check the objective function results as defined in the PSO flow chart.
Step 11. Repeat Steps 5–10 until the maximum number of iterations is reached or the algorithm has converged.
5. Discussion
Hybrid renewable energy-based microgrids must run as efficiently as possible to guarantee that the full benefits of microgrid use are achieved. The particle swarm optimization (PSO) method, with the background given in [
22], is proposed as an optimal strategy to manage microgrids with hybrid renewable energy sources (HRESs) while considering microgrid reserve margins. The intermittent nature of renewable energy resources, such as wind and solar energy, has been simulated using weather data, wind speed for wind turbine generators, and solar irradiance for the solar PV system. During the summer, wind speeds are generally higher at night than they are during the day [
20]. This serves as the foundation for the simulation’s wind speed data. On clear days, the solar system’s production curve is understood, but on cloudy days, it is rather unpredictable. For this reason, two sets of solar irradiance data were used: one set for a clear day to generate power predictably, and another set for a partially cloudy day to generate power infrequently. The simulated curves for a clear and partly cloudy day using the given data are shown in
Figure 4 and
Figure 5, respectively. The wind turbine generation profile, according to the used data, is displayed in
Figure 6.
Figure 3 displays the electricity price data with three pricing tiers: off-peak, regular, and peak hours.
Figure 13 depicts both the electricity pricing schedule and the microgrid operation simulation on a clear day with a BESS connection. The simulation findings demonstrate that extra generated energy is sold to the grid operator during normal and peak periods, and buying electricity from the grid is entirely avoided during these times. This demonstrates that the PSO approach is operating correctly and optimally.
A partially overcast day with a BESS is depicted in
Figure 14 along with the microgrid operation simulation and electricity pricing schedule. It is challenging to avoid using the grid to purchase electricity during regular and peak hours due to the solar system’s irregular generation. Moreover, the BESS is utilised for extended periods as long as the predetermined 50% depth of discharge for critical loads is maintained. By protecting the established limitations, the PSO algorithm was able to maximise the microgrid’s performance.
Figure 15,
Figure 16,
Figure 17 and
Figure 18 illustrate the effect of the number of iterations parameter selected for the PSO algorithm. On a clear day, the PSO maximum iteration count is set to 10 and 100, respectively, as shown in
Figure 15 and
Figure 16. The PSO algorithm finds that the optimal cost is ZAR 1,283,990 per day when the maximum iteration is set to 10, and ZAR 1,281,040 per day when the maximum iteration is set to 100. This represents a difference of ZAR 2950 per day. For a partially overcast day, the same comparison is made, as shown in
Figure 17 and
Figure 18. The PSO algorithm determined that ZAR 1,025,005 per day was the optimal cost at a maximum iteration of 10, and ZAR 1,023,190 per day was the optimal cost at a maximum iteration of 100, resulting in a difference of ZAR 1815 per day. The contrast observed on partially cloudy and clear days emphasises how crucial it is to choose the right PSO parameters to guarantee the method’s successful and efficient operation. As seen in
Figure 15 and
Figure 17, an additional phenomenon to be observed is the PSO algorithm terminating early. Two techniques are employed as the stopping criteria in the PSO algorithm flowchart (
Figure 2): maximum iteration and convergence. The former has already been covered. PSO convergence is the term used to describe the effective convergence of swarm particles to a single solution. To decide how much the current global best can deviate from the prior global best, a threshold is typically imposed. Once it is determined that the optimal solution has not been altered by more than a specific amount, the algorithm is said to have converged.