Particle swarm optimization for micro-grid power management and load scheduling

A smart power management strategy is needed to economically manage local production and consumption while maintaining the balance between supply and demand. Finding the best-distributed generators’ set-points and the best city demand scheduling can lead to moderate and judicious use out of critical moments without compromising smart city residents’ comfort. This paper aimed at applying the Particle Swarm Optimization (PSO) to minimize the operating cost of the consumed energy in a smart city supplied by a micro-grid. Two PSO algorithms were developed in two steps to find the optimal operating set-points. The first PSO algorithm led to the optimal set-points powers of all micro-grid generators that can satisfy the non-shif table needs of the smart city demand with a low operating cost. While the second PSO algorithm aimed at scheduling the shif table city demand in order to avoid peak hours when the operating cost is high. The results showed that the operating costs during the day were remarkably reduced by using optimal distributed generators’ set-points and scheduling shif table loads out of peaks hours. To conclude, the main advantages of the proposed methodology are the improvement in the local energy efficiency of the micro-grid and the reduction in the energy consumption costs


INTRODUCTION
Renewable energies are a privileged vector of the fight against global warming.In addition to being environmentally friendly, they are inexhaustible and available.Electricity generation from renewable energy sources is stochastic and partially predictable, which is considered a challenge that is added to those of consumption to which grid operators are already facing (Dharavath and Raglend, 2019).The efficient use of renewable energy sources can be achieved through the integration of solar and wind technologies, which is more flexible between other renewable energy sources.Using decentralized generation resources, particularly renewable resources such as wind and solar energy are the better options for reducing greenhouse gas emissions and energy transport losses (Banerji et al., 2013;Mariam et al., 2016).
Micro-grids are introduced as a new concept in the operation and planning of modern electrical systems.They rely primarily on renewable resources and smart grid infrastructure.They are able to exchange energy with the main grid or with other micro-grids.In addition, the use of decentralized generation resources, especially renewable resources such as wind and solar energy, highly reduces greenhouse gas emissions and losses due to the transport of electric energy (Banerji et al., 2013, Mariam et al., 2016).
A micro-grid is a small-scale electric grid designed to improve the reliability and resilience of electrical grids at a better operating cost and a high quality to a reduced number of consumers.However, microgrids still face significant legal and regulatory uncertainties grids (Hirsch et al., 2018).A micro-grid, whether connected to the main grid or not, is made up of small interconnected local power plants of different types of energy resources, consumer This Journal is licensed under a Creative Commons Attribution 4.0 International License installations, storage systems and management centre for controlling and managing the flow of the electric energy.It is intended for urban and rural communities, islands and isolated activities that have limited or no access to the main electricity grid (Banerji et al., 2013).Whenever the local electricity generation is not sufficient, communities import the lack from outside power plants or of the main grid.Traditionally, micro-grids used conventional fuel generators (micro-turbines [MTs]), but recently, involving more renewable energies is the target for sustainability.These latter are highly adaptable to micro-grids as they are widely available and can be exploited by any community in addition, they have minimal impact on the environment (Banerji et al., 2013;Karger and Hennings, 2009).Koltsaklis et al. (2018) developed a mathematical model for the optimal design and operational scheduling of energy microgrids taking into account the technical, environmental and economic constraints.Different architecture and micro-grid control designs were proposed by many authors.Karger and Hennings (2009), for example, discussed the effectiveness of the micro-grid connected to a powerful electric distribution and listed a number of obstacles, so that more radical changes could be made to the regulatory and institutional framework for the development of the micro-grids.Katiraei et al. (2008) provided an overview of the modes of control of existing micro-grids and the importance of power and energy management strategies and describe potential approaches to market participation, by which they highlighted the main differences between micro-grids and powerful grids.
Dynamic electricity pricing involves the dynamic change of the energy price over short time steps to track electricity generating costs, depending on the time of a day (Lund et al., 2012).These costs are higher during peak consumption according to the type of the used energy.Distributed generators based on renewable energies can fluctuate and aggravate the power balance as they can increase electricity production.Lund et al. (2012) highlighted some recent developments in the functioning of the Danish electricity market.This article shows how such small installations can provide valuable stabilization of the grid for additional investment and operating low costs.Gomes et al. (2016) discussed the coordinated exchange of wind and photovoltaic (PV) energy to support management decisions to mitigate risks from wind and solar variability, electricity prices and penalties deficit or surplus production.
Some research works studied Multi-objective energy management in a micro-grid (Motevasel and Seifi, 2014;Aghajani and Ghadimi, 2018;Wu et al., 2019).Motevasel and Seifi (2014), for example, proposed an expert energy management system for optimal operation of MTs twinned with renewable energy generators and a system for storing energy in a micro-grid connected to the electric system.The main objective of the proposed system is to find the optimal set-points for generators and storage batteries, so as to simultaneously minimize the total operating cost and gas emissions of MTs.The authors proposed a modified algorithm for bee colony optimization to solve the multi-objective problem.In order to show the performance of this optimization algorithm, the average and standard deviation indices are evaluated, and the results are compared to other optimization algorithms such as the genetic algorithm and the particle swarm optimization (PSO).Whei-Min et al. (2016) presented a strategy for energy management of micro-grids constituting renewable energy sources and storage systems connected to the main grid.Wind power generation and solar power generation are integrated into the distribution electric system.The optimal management for that mixed energy generation has been formulated taking into account the scheduling the charge/discharge of storage systems.According to the time of a day and the technical constraints of the operation, the so-called bee colony optimization is developed to solve the daily economic dispatching set-points of all micro-grid resources.Logenthiran et al. (2012) presented load-side management strategy based on intelligent load profile shifting technique with a large number of devices of several types.The hourly charge shifting technique during a day proposed in this paper is mathematically formulated as a minimization problem.An evolutionary heuristic algorithm has been developed to solve this problem while reducing load peaks in a smart grid.Logenthiran et al. (2015) discussed a new approach to profile shifting for demand management in the smart grid.This approach optimized the profiles of domestic, commercial and industrial consumption curves using the particle swarm technique.The algorithm proposed in this article minimized user consumption costs while taking into account their individual preferences for loads by defining priorities and preferred time intervals for load scheduling.
In the work of Abid et al. (2017), an energy management strategy was proposed to minimize peaks of energy consumption and the operating costs of micro-grids, by which smart appliances of each house in the city were scheduled using the algorithm for binary PSO.For the same purpose and with a classification of the type of appliance consumption in the heaters, ventilation, air conditioning and lighting were controlled by fuzzy logic and the rest of the load demand is managed by heuristic optimization techniques (Khalid et al., 2019;Koltsaklis et al., 2018).
The efficient power management control for microgrids with energy storage should increase the reliability and resiliency of the microgrid based on the distributed energy resources (Worku et al., 2019).Energy management optimization problems in a future wherein an interaction with micro-grids have to be accounted for Van-Ackooij et al. (2018).Energy demand side management (DSM) can be optimized to improve system performance (Noor et al., 2018).Shayeghi et al. (2019) surveyed the microgrid energy management considering flexible energy sources based on based on the kind of the reserve system being used, including non-renewable, energy storage systems (ESS), DSM and hybrid systems.
Several researchers have used the PSO algorithm in micro-grids management of generation or demand side.So far, all these works deal either with only power resource management (production side) or the consumption shifting and scheduling (demand side) to achieve the best operating cost.However, our contribution in this paper is to use both methods in order to better economically manage local productions and consumption while maintaining the balance between supply and demand.Two PSO algorithms are developed to meet the best operating cost.The first algorithm develops a strategy of optimal management of the energies provided by each energy source used in order to satisfy the demand of the community with a minimum operating cost.The second PSO algorithm manages the scheduling of the power dispatching of load during the day to avoid consumption peaks.Managing the demand for electrical energy is a delicate task.However, effective scheduling of smart home appliances improves the energy efficiency of the micro-grid and significantly reduces the cost of energy consumption.
The rest of the paper is organized as the following: Section 2 introduces methods for PSO micro-grid power management and load scheduling after giving the architecture and data of the used micro-grid.Numerical results followed by discussions are provided in Section 3. Finally, concluding remarks and future directions are given in Section 4.

MATERIALS AND METHODS
Current micro-grids are designed to promote better different renewable technologies.They integrate PV generators and several other generators such as wind turbines (WTs), MTs, hydroelectric systems, storage systems and sometimes the main grid.Meeting the electricity needs of a community is a delicate task because of the random nature of the different renewable energy sources used and consumption.These needs can be met through distributed generation provided by renewable energy systems, in other cases, MTs and the main grid can be used (Banerji et al., 2013).

Architecture and Data of the Used Micro-grid
The energy system taken in our application is composed of three sources, two of which are renewable and the third is chosen as a conventional generator.Renewable powers of PV panels and WTs distributed throughout the community include powers of positive energy homes.Microturbines (MT) (diesel or gas) are used to fill at any time the lack between the power demand and the power produced by renewable sources (Mariam et al., 2016).Since the last is fluctuating and the production capacity of the conventional groups is limited, it is possible to include an ESS in an isolated site or to be connected to the main grid.In this work, we are interested in a hybrid system connected to the electrical grid, which does not need any ESS and will guarantee the distribution of energy even in case of lack of renewable energy sources (Karger and Hennings, 2009).
Figure 1 shows the powers flow in the micro-grid.Distributed generators based on renewable sources are connected to the DC bus.Micro-turbines are connected to the AC bus.The controlled DC-DC converter used for linking PV panels to the DC bus that converts the receiving variable DC voltage in the input to a constant boosted DC output voltage.Whereas the controlled AC-DC converter used for linking WT generators to the DC bus that converts the receiving variable AC voltage in the input to a constant DC output.The arrows indicate the direction of the energy flow.Single-headed arrows indicate that energy can only flow in one direction (corresponding to production or consumption).Likewise, double-headed arrows indicate that energy can flow in both directions.This corresponds to the case where distributed generators cannot satisfy the electricity needs of the community, so the main grid is called.However, in case of excess production, the surplus is returned to the grid without disturbing its operation.The advantage of this architecture is that it does not need any ESS (batteries + charge and discharge converters) which makes it more economical.
Table 1 shows hourly energy prices and maximum energy capacity of each sources injecting into the micro-grid during a day.In addition, we provide hourly consumption metering micro-grid load.These data are taken in a similar profile to that used by (Motevasel and Seifi, 2014).
The variation range of PV and WT generated powers is between zero (in the absence of renewable sources) and the maximum value specified for each source at any moment "t".However, the power of the MTs is limited between a minimum and a maximum.A minimum of 6 kW to don't stop the turbine and a maximum of 30 kW corresponding to its rated power.The balance between powers of distributed generators and total load power of the community must be insured at any moment "t".Those equality and inequalities constraints are formulated as follow:

PSO Theory
PSO is an evolutionary computation technique based on the imitation of the social behaviour of swarm species, such as a group of birds or a group of fish.Two characters must be taken into account.By analogy with evolutionary computation paradigms, a swarm is similar to a population, whereas a particle is similar to an individual (Engelbrecht, 2007).Particles evolve in a multidimensional research space, where the position of each particle is adjusted according to its own experience and that of its neighbours.Each particle must memorize its best personal position by which it has already passed, and it tends to return to that position.It represents "the best personal position" found since the beginning of the evolution towards the objective.In addition, each particle is informed of the best-known position within its neighbourhood or global swarm and they tend to move towards that point.It represents "the best local or global position" found by all the particles of the swarm since the beginning of its evolution towards the objective (Abid et al., 2017;Engelbrecht, 2007).
The current position vector "X = [x 1 x 2 … x i … x n ] T " at the moment "k + 1" is adjusted by adding to its former position at the moment "k", a velocity vector "v i (k + 1)".The latter is the weighted sum of its former value, the cognitive component and the global or local social component.We are interested in this work in the method using the global social component.The cognitive component represents the specific experience of each particle and designed by the best personal position "y i (k)".The social component is the experience of the particle represented by the best global position " ŷ(k) " (Engelbrecht, 2007).
where "C 0 " is a positive constant of velocity weighting "C 1 " is a positive constant of so-called acceleration weighting of the cognitive component "C 2 " is a positive constant of so-called acceleration weighting of the social component "r 1 " and "r 2 " are random values in the range [0-1] to bring a stochastic character to the algorithm.
The best personal position, "y i ", associated to the particle "i" is the best position the particle has visited since the beginning of evolution.Considering the minimization function "f(x)", the best personal position at the moment, "k+1", is calculated as follows (Engelbrecht, 2007): The best global position " ŷ(k)," at the moment "k", is defined as follows: Where "n" is the total number of particles in the swarm.
PSO has been successfully applied to solve a number of problems in research and application areas including problems of optimization of functions (Logenthiran et al., 2015;Abid et al., 2017), selection and classification (Too, 2019), wireless sensor networks (Cheng et al., 2018) and learning of neural networks (Li, 2018) etc.

PSO Management Algorithm for Generators Side
The use of hybrid systems combining these renewable energy sources with a conventional source and/or the main grid distribution is considered by all as a future solution, as it is efficient and reliable.The PSO optimization technique could manage in real time the distribution of the power instructions for each type The choice of the objective function to define the best personal position and the global position represents the most relevant action to be performed.Several functions have already been used (Motevasel and Seifi, 2014;Whei-Min et al., 2016;Quoc-Tuan et al., 2016).However, in the objective function, we use in this paper depends on the architecture of the micro-grid used and costs of energy consumption from locally distributed generators taking into account the production costs, the start-up of MTs and the purchase cost on the main grid as given by the following equation (Motevasel and Seifi, 2014): where; N G : Number of distributed generators types.B gi (k): Energy unit price insured by the i eme generator at moment "k".P gi (k): Power generated by the i eme generator at moment "k".S gi : Start-up or shutdown cost of i eme generator.u i (k): Operation mode of the i eme generator (ON or OFF).K OM i : Factor dependent on the maintenance fee.P grid (k): The power inter-changed with the main grid at the moment "k".B grid (k): Purchase cost of the main grid at the moment "k".

PSO Scheduling Algorithm for Demand Side
High tariffs during consumption peaks and, conversely, cheaper operating cost outside critical moments are willing and able to reduce consumption.They even commit to reducing industrial activities for a few hours of the day.Reducing consumption to minimize peaks can be achieved by reporting some activities outside these peak times without compromising the comfort of the community and without disrupting industrial activities too (Khalid et al., 2019;Zhou et al., 2016).
Effective and reliable energy demand scheduling by the community requires accurate knowledge of load models to estimate the impact of load management strategies.The residential community is assumed to be a load of smart homes that have fixed-line and other shiftable home appliances.These advanced devices are now commonplace in the Internet of Things revolution, with a multitude of accessories and appliances connected to the Internet.The Home Energy Management System is an important element of the smart grid that allows residential customers to run on-demand programs independently.These smart houses receive instantaneous operating cost from the micro-grid manager in advance, thus delaying the launch of household appliances that can be carried out during off-peak hours (Zhou et al., 2016;Celik et al., 2017).In fact, it is difficult to determine optimal operating points of a storage system in the real-time management of a converter-based microgrid, which helps in saving the costs and reducing energy waste (Hossain et al., 2019).
Different algorithms are used and compared to schedule loads of a smart city (Logenthiran et al., 2012;Abid et al., 2017;Li, 2018;Celik et al., 2017).The aim is to reduce the energy bill by taking into account the consumption and production data, but also the current pricing policies and any operating constraints imposed by the micro-grid manager.The PSO technique allows us to manage during a day the scheduling of shifted tasks for each device.The objective function is developed so that the amount of electrical energy required by the community of a day is provided with the minimum possible cost.

RESULTS AND DISCUSSIONS
The computation in PSO is very simple and without overlapping.During the evolution between several positions, only the most optimist particle can transmit information into the other particles, and the speed of the converging is very fast.

The Classic PSO Power Management
In this section, we apply PSO algorithm for the resource power management (production side).It is a question of finding power set-points for each source at each hour in order to minimize the objective function.During a day with no maintenance, no start-up or shutdown of MT, the objective function will be reduced as follows: obtained by applying the classic PSO algorithm after a mean of 50 to 70 iterations.
We find that a good balance is insured at any time between the power of distributed generation and demand (total load power) of the community.As well as the hourly dispatching powers are managed very economically so that the set-point of the cheapest source is the most important.It is clear that the power of the PV generator is fully exploited.This amounts to the encouraging energy unit price of this resource.Micro-turbines are present at all times (no shutdowns of MT) and serve as a reference for signal quality (well-defined voltage and frequency).The wind resource is more efficient and more regular than the PV resource but its unit price increases during peak consumption.In the absence of the PV resource, MTs play a major role in constantly bridging the lack between the hourly load demand and the generated system powers.
Figure 3 shows the variation curves of hourly unit prices of distributed generators during the day and the profile of the achieved operating cost.By this dispatching of distributed generators set-points, the day energy bill is found to be 123.41€.Likewise, the curve of variation of the energy operating cost is of average profile and remarkably reduced during peaks of consumption (hatched areas).When the unit price of wind energy has increased, the other cheaper (MT) is used to achieve the best operating cost but detrimental to clean energy.We can remark that if the community decreases consumption during peaks by delaying the shiftable part outside these critical moments, it can lead to an even better cost in addition to significantly improving the use of renewable energy generators and better energy efficiency of the microgrid.

The Proposed PSO Power Management
Our proposed PSO power management aims to achieve improvements could be brought by the last remark.This technique is intended for residential communities with a multitude of home accessories  To better present the situation, we first present the hourly distribution of shiftable and non-shiftable parts of the needed power (load) and available powers of distributed generators along the day (Table 2).
The classic PSO power management algorithm should calculate necessary hourly set-points for each distributed generator of the micro-grid in order to satisfy the hourly total load power (including the shiftable part and the non-shiftable part).Table 3 shows results and home appliances connected to the internet.The home energy management system is an important element of the smart grid that allows residential customers to run on-demand programs independently.Therefore, it helps in minimizing the electricity bill by scheduling the household appliances and ESS in response to the dynamic pricing of electricity market (Ahmad et al., 2017).This allows shifting and delaying the launch of those appliances out of peak hours so that avoiding critical moments.
Two algorithms might be applied in succession.The first PSO algorithm is applied to calculate necessary hourly set-points for each distributed generator of the micro-grid in order to satisfy only the hourly non-shiftable part of the load power.However, the second PSO algorithm is applied to calculate the rest hourly set-points for each distributed generator in order to satisfy only the daily shiftable load power.Keeping a balance between powers of distributed generators and shiftable needs of the smart city is keeping the energy scheduled during the day equal to the daily energy required by shiftable power of the city.So, we get energy dispatching of scheduling load during the day so that avoiding consumption peaks.
To achieve the goal of the first step, we redo the classic PSO algorithm to manage only non-shiftable load powers.It is a question of finding power set-points for each source at each hour in order to minimize the same objective function.Figure 4 shows the distribution of the hourly optimal powers' set-points for each distributed generator taking into account only non-shiftable load powers.
By this dispatching of distributed generators, the day energy bill is found to be 94.59 €.Same remarks could be seen on this figure like the balance insured at any time between powers of distributed generators and non-shiftable loads of the community.As well as the hourly dispatching powers are managed very economically so that the set-point of the cheapest source is the most important.
Now we have to proceed to the second step, which concerns the power scheduling of the shiftable part of loads.The main purpose of the objective function is to satisfy the demand of the community along the day in a better economic way.The PSO algorithm must lead to moderate and judicious use and a marked difference in the bill of consumption of the day.
To better present the situation, we first present the hourly distribution of shiftable parts of the needed power and available powers of distributed generators remained after satisfying non-shiftable parts along the day (Figure 5).It is clear that nothing left of the power of the PV generator (fully exploited in the first step).This amounts to the encouraging unit price of this resource.The second PSO technique allows us to manage the scheduling of shifted tasks for each device along the day.The objective function can't be reduced as it's done previously, but it is developed so that the amount of electrical energy required by the community of a day is provided with the minimum possible cost.This means that the cost of the day energy of shiftable home appliances is to be minimized.
The flowchart of the PSO optimization used is almost the same as the first one.The difference lies in the vector of the positions.This vector should evolve in order to find set-points of each distributed generator throughout the day (so its length equals to 24 × N G ) and to ensure the scheduled energy of shiftable loads during that day. Figure 6 shows the profile of PSO scheduled load demand and energy consumed unit price during a day.This shows the repartition of the shiftable load before and after scheduling by the second PSO algorithm.It's clear how peak hours are avoided without affecting the needs of customers along the day.All home appliances had to be launched at the time out of hatched areas are rescheduled to be launched during the hatched areas.
The energy consumed during the day before and after scheduling remains exactly unchanged at 1695 kWh which means that the comfort of the community is not compromised.We remark that the profile of the shiftable power load is significantly changed according to moments where the distributed generator powers price is relatively low (hatched areas).It's clear that the shiftable power load on the highest price moments are moved to be scheduled on lowest price moments.Those moments are characterized by the lowest price of wind generator so more of renewable energy would be exploited which means that less MTs energy used.
Energy bill obtained for the total load (including shiftable and non-shiftable parts) is found to be 106.87€.Comparing this bill with the other obtained by classic PSO optimization and the day profile of operating cost by using both methods (Figures 3 and 7), we notice the importance of our proposed PSO optimization technique.It's clear that load shifting and

CONCLUSIONS
To summarise, the paper proses a management strategy using PSO for optimal operation of distributed generators of the micro-grid and an optimal scheduling energy consumption of the smart city.
For this purpose, two PSO algorithms are applied in two steps.
The first algorithm seeks for the best set-points of distributed generators in such a way that the hourly non-shiftable power demanded by the community is ensured with the lowest cost.
The obtained curve of variation of the energy operating cost during the day is of an average profile and remarkably reduced during peaks of the consumption.At this stage, the micro-grid is managed to take into account variable pricing every hour of the day while completely omitting peaks of demand and the capacity of renewable production.The second step allows enhancing the autonomy and reliability of the micro-grid while further minimizing the daily energy bill.The use of the second optimization algorithm makes it possible by scheduling shiftable loads of the smart city without affecting the comfort of residents.Comparing the obtained classic PSO strategy results by the proposed PSO power management strategy results shows a reduction in the final electricity bills and a noticeable improvement of renewable generation.Further avenues of research will include the multi-objective optimization such a way, in addition to the operation cost, the greenhouse gas emissions of fossil fuel generators are simultaneously minimized.

ACKNOWLEDGMENTS
Authors may acknowledge the Centre for Middle Eastern Studies at Lund University for funding the publication of this paper in an open access journal through MECW project.

Figure 1 :
Figure 1: Architecture of the used micro-grid

Figure 2 :
Figure 2: Particle swarm optimization flowchart for distributed energies management

Figure 3 :
Figure 3: Day profile unit prices of distributed generators and the obtained operating cost

Figure 4 :
Figure 4: Hourly dispatching set-points of distributed generators for non-shiftable load and their unit prices

Figure 5 :
Figure 5: Day distribution of shiftable loads power and available distributed generators' power remained after satisfying non-shiftable parts

Figure 6 :
Figure 6: Day profile of PSO scheduled power set-points of shiftable load and energy unit prices

Figure 7 :
Figure 7: Day profile of the obtained operating cost using the classic particle swarm optimization management and using the proposed particle swarm optimization management