. International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 2020 71 International Journal of Energy Economics and Policy ISSN: 2146-4553 available at http: www.econjournals.com International Journal of Energy Economics and Policy, 2020, 10(2), 71-80. Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling Abdelfettah Kerboua1*, Fouad Boukli-Hacene1, Khaldoon A. Mourad2 1Department of Second Cycle, High School in Applied Sciences of Tlemcen, BP 165 RP Bel Horizon, 13000 Tlemcen, Algeria, 2The Center for Sustainable Visions www.c4sv.com and Lund University, 22100 Lund, Sweden. *Email: ab.kerboua@gmail.com Received: 15 August 2019 Accepted: 09 December 2019 DOI: https://doi.org/10.32479/ijeep.8568 ABSTRACT 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-shiftable needs of the smart city demand with a low operating cost. While the second PSO algorithm aimed at scheduling the shiftable 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 shiftable 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. Keywords: Particle Swarm Optimization Algorithm, Renewable Energy, Power Management, Operating Cost JEL Classifications: C61, C62, Q21, Q42 1. 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 Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 202072 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 Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 2020 73 (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. 2. 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). 2.1. 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. Figure 1: Architecture of the used micro-grid Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 202074 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: ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) 0 t t , 0 t t , 6kW t 30kW t t t t max max PV PV WT WT MT PV WT MT load P P P P P P P P P  ≤ ≤ ≤ ≤  ≤ ≤ + +  = (1) 2.2. 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 = [x1x2 … xi … xn]T” at the moment “k + 1” is adjusted by adding to its former position at the moment “k”, a velocity vector “vi(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 “yi(k)”. The social component is the experience of the particle represented by the best global position “ŷ(k)” (Engelbrecht, 2007). ( ) ( ) ( ) ( ) ( ) [ ] i i i i 0 i 1 1 i i 2 2 i x k 1 x k v k 1 v k 1 C v k C r y (k) x (k) C r y(k) x (k)ˆ  + = + +  + = + −  + −    (2) where “C0” is a positive constant of velocity weighting “C1” is a positive constant of so-called acceleration weighting of the cognitive component “C2” is a positive constant of so-called acceleration weighting of the social component “r1” and “r2” are random values in the range [0-1] to bring a stochastic character to the algorithm. The best personal position, “yi”, 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): ( ) ( ) ( )( ) ( )( ) ( ) ( ) ( ) i i i i i i i y k if x k 1 x k y k 1 x k 1 if x (k 1) x (k) f f f f  + ≥ + =  + + < (3) The best global position “ŷ(k),” at the moment “k”, is defined as follows: Table 1: Hourly data of micro-grid components Hour PV (€/kWh) WT (€/kWh) MT (€/kWh) Grid (€/kWh) PV Pmax (kWh) WT Pmax (kWh) Pload (kWh) 01H00 0 0.021 0.0823 0.033 0 64.04 52 02H00 0 0.017 0.0823 0.027 0 64.32 50 03H00 0 0.0125 0.0831 0.020 0 64.64 50 04H00 0 0.011 0.0831 0.017 0 64.68 51 05H00 0 0.051 0.0838 0.017 0 70.72 56 06H00 0 0.085 0.0838 0.029 0 64.68 63 07H00 0 0.091 0.0846 0.033 0 58.92 70 08H00 0.0646 0.110 0.0854 0.054 0.4 58.24 75 09H00 0.0654 0.140 0.0862 0.215 2.36 58.6 76 10H00 0.0662 0.143 0.0862 0.572 7.92 52.64 80 11H00 0.0669 0.150 0.0892 0.572 31 46.68 78 12H00 0.0677 0.155 0.09 0.572 39.2 40.6 74 13H00 0.0662 0.137 0.0885 0.215 42.6 46.68 72 14H00 0.0654 0.135 0.0885 0.572 38.8 40.6 72 15H00 0.0646 0.132 0.0885 0.286 32.48 59 76 16H00 0.0638 0.114 0.09 0.279 19.8 64.84 80 17H00 0.0654 0.110 0.0908 0.086 4.4 64.6 85 18H00 0.0662 0.0925 0.0915 0.059 0.4 76.52 88 19H00 0 0.091 0.0908 0.050 0 70.12 90 20H00 0 0.083 0.0885 0.061 0 75.8 87 21H00 0 0.033 0.0862 0.181 0 76.16 78 22H00 0 0.025 0.0846 0.077 0 76.44 71 23H00 0 0.021 0.0838 0.043 0 79.72 65 24H00 0 0.017 0.0831 0.037 0 76.6 56 Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 2020 75 ( ) ( ) ( ){ } ( )( ) ( )( ) ( )( ){ } 1 n 1 n y k y k , , y k / f y k min f y k , y ˆ ˆ , f k ∈ … = … (4) 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. 2.3. 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 Figure 2: Particle swarm optimization flowchart for distributed energies management Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 202076 of source. The objective function is developed so that the instant power demanded by the community is ensured at all times with the minimum operating cost. The flowchart of the PSO optimization used is represented on Figure 2. 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): ( ) ( ) ( ) ( ) ( ) ( ) ( ) i G i gi gi OM T N gi i it 1 i 1 grid grid u k P k B k K min S u k u k 1 P k .B k = =    +       + − −     +    ∑ ∑ (5) where; NG: Number of distributed generators types. Bgi (k): Energy unit price insured by the i eme generator at moment “k”. Pgi (k): Power generated by the i eme generator at moment “k”. Sgi: Start-up or shutdown cost of i eme generator. ui (k): Operation mode of the i eme generator (ON or OFF). K OM i : Factor dependent on the maintenance fee. Pgrid (k): The power inter-changed with the main grid at the moment “k”. Bgrid (k): Purchase cost of the main grid at the moment “k”. 2.4. 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. 3. 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. 3.1. 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: min t T i gi gi i N u k P k B k G = =∑ ∑ ( ) ( ) ( ) 1 1 (6) Table 2: Day distribution of shiftable and non-shiftable load powers and available distributed generators’ powers Hour PV power WT power MT power Non shiftable Shiftable load power 1 0 64.04 30 47 5 2 0 64.32 30 40 10 3 0 64.64 30 45 5 4 0 64.68 30 49 2 5 0 70.72 30 46 10 6 0 64.68 30 55 8 7 0 58.92 30 60 10 8 0.4 58.24 30 63 12 9 2.36 58.6 30 61 15 10 7.92 52.64 30 60 20 11 31 46.68 30 53 25 12 39.2 40.6 30 49 25 13 42.6 46.68 30 52 20 14 38.8 40.6 30 62 10 15 32.48 59 30 61 15 16 19.8 64.84 30 65 15 17 4.4 64.6 30 60 25 18 0.4 76.52 30 65 23 19 0 70.12 30 80 10 20 0 75.8 30 72 15 21 0 76.16 30 68 10 22 0 76.44 30 63 8 23 0 79.72 30 60 5 24 0 76.6 30 48 8 Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 2020 77 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. 3.2. 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 Table 3: Dispatching of hourly optimal powers’ set-points for each source and their unit prices Hour Non shiftable Shiftable PV set-point WT set-point MT set-point 1 47 5 0 46 6 2 40 10 0 44 6 3 45 5 0 44 6 4 49 2 0 45 6 5 46 10 0 50 6 6 55 8 0 33 30 7 60 10 0 40 30 8 63 12 0.4 44.6 30 9 61 15 2.36 43.64 30 10 60 20 7.92 42.08 30 11 53 25 31 17 30 12 49 25 39.2 4.8 30 13 52 20 42.6 0 29.4 14 62 10 38.8 3.2 30 15 61 15 32.48 13.52 30 16 65 15 19.8 30.2 30 17 60 25 4.4 50.6 30 18 65 23 0.4 57.6 30 19 80 10 0 60 30 20 72 15 0 75.8 11.2 21 68 10 0 72 6 22 63 8 0 65 6 23 60 5 0 59 6 24 48 8 0 50 6 Figure 3: Day profile unit prices of distributed generators and the obtained operating cost 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 Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 202078 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. Figure 4: Hourly dispatching set-points of distributed generators for non-shiftable load and their unit prices Figure 5: Day distribution of shiftable loads power and available distributed generators’ power remained after satisfying non-shiftable parts Figure 6: Day profile of PSO scheduled power set-points of shiftable load and energy unit prices Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 2020 79 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 × NG) 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 Figure 7: Day profile of the obtained operating cost using the classic particle swarm optimization management and using the proposed particle swarm optimization management scheduling lead to a moderate and a judicious use out of critical moments without compromising smart city residents’ comfort. Moreover, this technique gives possibilities to enjoy the most of renewable generation and to reduce greenhouse gas emissions when using MTs. 4. 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. 5. 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. Kerboua, et al.: Particle Swarm Optimization for Micro-Grid Power Management and Load Scheduling International Journal of Energy Economics and Policy | Vol 10 • Issue 2 • 202080 REFERENCES Abid, S., Zafar, A., Khalid, R., Javaid, S., Qasim, U., Khan, Z.A., Javaid, N. (2017), Managing Energy in Smart Homes using Binary Particle Swarm Optimization. Conference on Complex, Intelligent, and Software Intensive Systems. Italy: Torino. p. 189-196. Aghajani, G., Ghadimi, N. (2018), Multi-objective energy management in a micro-grid. Energy Reports, 4, 218-225. Ahmad, A., Khan, A., Javaid, N., Hussain, H.M., Abdul, W., Almogren, A., Alamri, A., Niaz, I.A. (2017), An optimized home energy management system with integrated renewable energy and storage resources. Energies, 10, 549. Banerji, A., Sen, D., Bera, A.K., Ray, D., Paul, D., Bhakat, A., Biswas, S.K. (2013), MICROGRID: A Review. 2013 IEEE Global Humanitarian Technology Conference: South Asia Satellite. IEEE: Trivandrum India. p. 27-35. Celik, B., Roche, R., Suryanarayanan, S., Bouquain, D., Miraoui, A. (2017), Electric energy management in residential areas through coordination of multiple smart homes. Renewable and Sustainable Energy Reviews, 80, 260-275. Cheng, X., Ciuonzo, D., Rossi, P.S. (2018), Multi-bit Decentralized Detection of a Weak Signal in Wireless Sensor Networks with a Rao test. 2018 IEEE 23rd International Conference on Digital Signal Processing. IEEE: Shanghai. Dharavath, R., Raglend, I.J. (2019), Integration of utility grid with hybrid generation for power quality conditioning using dynamic voltage restorer. International Journal of Renewable Energy Research, 9, 56-64. Engelbrecht, A.P. (2007), Computational Intelligence: An Introduction. 2nd ed. Hoboken: Wiley Publishing. Gomes, I.L.R., Pousinho, H.M.I., Melíco, R., Mendes, V.M.F. (2016), Bidding and optimization strategies for wind-pv systems in electricity markets assisted by CPS. Energy Procedia, 106, 111-121. Hirsch, A., Parag, Y., Guerrero, J. (2018), Microgrids: A review of technologies, key drivers, and outstanding issues. Renewable and Sustainable Energy Reviews, 90, 402-411. Hossain, M.A., Pota, H.R., Squartini, S., Abdou, A.F. (2019), Modified PSO algorithm for real-time energy management in grid-connected microgrids. Renewable Energy, 136, 746-757. Karger, C.R., Hennings, W. (2009), Sustainability evaluation of decentralized electricity generation. Renewable and Sustainable Energy Reviews, 13, 583-593. Katiraei, F., Iravani, R., Hatziargyriou, N., Dimeas, A. (2008), Microgrids management: Controls and operation aspects of microgrids. IEEE Power and Energy Magazine, 6, 54-65. Khalid, R., Javaid, N., Rahim, M.H., Aslam, S., Sher, A. (2019), Fuzzy energy management controller and scheduler for smart homes. Sustainable Computing: Informatics and Systems, 21, 103-118. Koltsaklis, N.E., Giannakakis, M., Georgiadis, M.C. (2018), Optimal energy planning and scheduling of microgrids. Chemical Engineering Research and Design, 131, 318-332. Li, W. (2018), Improving particle swarm optimization based on neighborhood and historical memory for training multi-layer perceptron. Information, 9(1), 16. Logenthiran, T., Srinivasan, D., Phyu, E. (2015), Particle Swarm Optimization for Demand Side Management in Smart Grid. 2015 IEEE Innovative Smart Grid Technologies Asia. Bangkok, Thailand: IEEE. Logenthiran, T., Srinivasan, D., Shun, T.Z. (2012), Demand side management in smart grid using heuristic optimization. IEEE Transactions on Smart Grid, 3, 1244-1252. Lund, H., Andersen, A.N., Østergaard, P.A., Mathiesen, B.V., Connolly, D. (2012), From electricity smart grids to smart energy systems a market operation-based approach and understanding. Energy, 42, 96-102. Mariam, L., Basu, M., Conlon, M.F. (2016), Microgrid: Architecture, policy and future trends. Renewable and Sustainable Energy Reviews, 64, 477-489. Motevasel, M., Seifi, A.R. (2014), Expert energy management of a micro- grid considering wind energy uncertainty. Energy Conversion and Management, 83, 58-72. Noor, S., Yang, W., Guo, M., van Dam, K.H., Wang, X. (2018), Energy demand side management within micro-grid networks enhanced by blockchain. Applied Energy, 228, 1385-1398. Quoc-Tuan, T., Ngoc, A.L., Tung, L.N. (2016), Optimal Energy Management Strategies of Microgrids. Athens, Greece: 2016 IEEE Symposium Series on Computational Intelligence. Shayeghi, H., Shahryari, E., Moradzadeh, M., Siano, P. (2019), A survey on microgrid energy management considering flexible energy sources. Energies, 12(11), 2159. Too, J., Abdullah, A.R., Saad, N.M., Tee, W. (2019), EMG feature selection and classification using a pbest-guide binary particle swarm optimization. Computation, 7(1), 12. Van-Ackooij, W., De Boeck, J., Detienne, B., Pan, S., Poss, M. (2018), Optimizing power generation in the presence of micro-grids. European Journal of Operational Research, 271(2), 450-461. Whei-Min, L., Chia-Sheng, T., Ming-Tang, T. (2016), Energy management strategy for microgrids by using enhanced bee colony optimization. Energies, 9(1), 5. Worku, Y.M., Hassan, A.M., Abido, A.M. (2019), Real time energy management and control of renewable energy based microgrid in grid connected and Island modes. Energies, 12(2), 276. Wu, X., Cao, W., Wang, D., Ding, M. (2019), A multi-objective optimization dispatch method for microgrid energy management considering the power loss of converters. Energies, 12(11), 1-19. Zhou, B., Wentao, L., Ka, W.C., Yijia, C., Yonghong, K., Xi, L., Xiong, W. (2016), Smart home energy management systems: Concept, configurations, and scheduling strategies. Renewable and Sustainable Energy Reviews, 61, 30-40.