An Optimal Energy Management System for University Campus Using the Hybrid Fireﬂy Lion Algorithm (FLA)

: As the world population and its dependency on energy is growing exponentially day by day, the existing energy generating resources are not enough to fulﬁll their needs. In the conventional grid system, most of the generated energy is wasted because of improper demand side management (DSM). This leads to a difﬁculty in keeping the equilibrium between the user need and electric power production. To overcome these difﬁculties, smart grid (SG) is introduced, which is composed of the integration of two-way communication between the user and utility. To utilize the existing energy resources in a better way, SG is the best option since a large portion of the generated energy is consumed by the educational institutes. Such institutes also need un-interrupted power supply at the lowest cost. Therefore, in this paper, we have taken a university campus load. We have not only applied two bio-inspired heuristic algorithms for energy scheduling—namely, the Fireﬂy Algorithm (FA) and the Lion Algorithm (LA)—but also proposed a hybrid version, FLA, for more optimal results. Our main objectives are a reduction in both, that is, the cost of energy and the waiting time of consumers or end users. For this purpose, in our proposed model, we have divided all appliances into two categories—shiftable appliances and non-shiftable appliances. Shiftable appliances are feasible to be used in any of the time slots and can be planned according to the day-ahead pricing signal (DAP), provided by the utility, while non-shiftable appliances can be used for a speciﬁed duration and cannot be planned with the respective DAP signal. So, we have scheduled shiftable appliances only. We have also used renewable energy sources (RES) for achieving maximum end user beneﬁts. The simulation results show that our proposed hybrid algorithm, FLA, has reduced the cost excellently. We have also taken into consideration the consumers’ waiting times, due to scheduling of appliances.


Introduction
Due to the recent advancements in technology, almost every walk of life is becoming altered by the technological revolution. Due to these fast paced advancements, people are reshaping their lifestyles as a result of utility providers, and industrialists and researchers are focused on making the customer's life easy and more comfortable. Most researchers and innovators are working to find new ways to improve the performance, reliability, efficiency, and comfort of the existing system, but all these attributes of a system have to be cost-effective in terms of optimized energy consumption. Energy optimization is a very important research area in many engineering fields. In this modern world, electrical energy is used in our homes (lights, air-conditioners, freezers, etc.), offices (computer, fan, lights, etc.), factories (heavy machines), most businesses (trade, company, etc.), universities, schools, colleges, laboratories, and hospitals, and so forth. It is also important to remember that energy consumption rises day by day. New houses, power consumption centers such as new factories, computers, machinery, and vehicles are manufactured every day. However, the energy-generating resources cannot be increased by the same proportion. All energy generating stations provide only a given quantity of energy for a limited time duration. Because of the intensification of energy demand, one cannot alter the whole structure. Instead, all power-consuming appliances must be supplied with electricity. Educational institutes are the most important energy consumers, and need an uninterrupted power supply. They also participate in the increase of carbon emissions [1]. The excessive and wasteful usage of electrical energy brings ecological problems such as economic progress, toxic emissions, and global warming to the forefront. Therefore, we must turn the traditional electric power grid (TEPG) into the smart grid (SG).
The integration of information and communication technology (ICT) into the TEPG is known as SG [2]. Controlling the system, information management and cyber protection are some of the advanced functionalities of SG. In TEPG, the energy flow is unidirectional while in the Smart Grid, the energy flows bi-directionally [3]. This enables consumers to take energy from the utility in times of need and supply it back to the utility provider when extra energy is generated at the consumer end. SG is a complex system that includes numerous smart devices; however, it provides beneficial services to both the consumer and the utility provider.
To minimize electricity consumption, reduce electricity bills, PAR, and the waiting time for the comfort of consumers are the main objectives of demand-side management (DSM). DSM is a service provided by SG that operates appliances as per the pricing signal of the utility. DSM has several techniques that help with peak cutting, load ever-changing, planned preservation, adjustable load ever-changing, and planned load progress, which resolves the energy optimization problem. Such techniques help with shifting the load from ON-peak hours to the Off-peak hours [4]. DSM is based on 'Energy Management (EM)' and 'Demand Response (DR). DR is the economic tactic, where the utility providers force their customers to decrease or change their energy usage from expensive hours to inexpensive hours. DSM mainly focuses on the usage of smart energy resources. DR uses two methods: Incentive-based [5] and price-based [6]. In the incentive-based method, consumers' devices are interrupted to an ON/Off state by sending a quick note to the smart house (SH) or Smart Building (SB). The consumers' devices are turned OFF in Peak Hours and after passing this phase the devices are switched ON in the Off-Peak hours when they are needed. This decreases the PAR of corporations, which is the key feature of the SG. During inexpensive hours or off-peak hours, the customer is encouraged to use their devices in the market-based program. As a result, customers could easily plan their use in inexpensive hours, which helps them to minimize their per-unit price and, as a result, there is a substantial reduction in their electricity bill. The Smart Grid does this all bidirectionally by exploiting its various components such as smart devices, that is, Smart Meters (SM), Energy Management Controllers (EMC), Self-Operated Devices (SODs), and secure communication infrastructure.
EMC gathers information regarding all connected users, then sets a proper energy usage plan as per the given pricing signal. SM transmits the pricing signal from utility to EMC, at the same time SM gathers the information about energy consumption of customers and sends these data to the utility provider. The communication of SM with the company is accomplished via radio communication links, for example, WiMAX, Bluetooth, ZigBee, WiFi, GSM, GPRS, or through Power Line Carrier Communication (PLCC) [3]. It enables the EMC to plan the operation of Smart Homes and Self Operated Devices (SODs) in an efficient and optimized way by exploiting various energy optimization algorithms. The working principle of some algorithms is based on mathematical models, while some other algorithms are nature-inspired and some are bio-inspired. These algorithms help researchers to find an optimized solution to the desired problem, modeled by the experts/researchers. In the last twenty years, these bio-inspired optimization algorithms have played a major role in solving many optimization problems, due to which they have become very popular. The following section provides a comprehensive literature review. Most researchers have focused only on the minimization of energy cost (electricity bill of the consumer), by scheduling appliances in the residential, commercial or industrial sectors. Usually, they have ignored the consumer frustration due to the scheduling of the appliances. When electricity price decreases, waiting time will increase. Therefore, an adoptive nature algorithm is needed to work for both types of consumers, that is, some consumers want to reduce their electricity bill, while others' priority is the minimization of their waiting time. That is why a hybrid algorithm can provide choice to the consumer. Secondly, it combines the benefits of both algorithms in a single platform. Therefore, in this work, we have proposed a novel hybrid algorithm, that is, a combination of FA and LA-namely, FLA-to achieve the advantages of both parent algorithms.
The rest of the paper is organized as follows. The literature review is presented in Section 2. The proposed system model architecture is shown in Section 3. Appliances' categorization and their specifications are tabulated in Section 4. Section 5 discusses the proposed algorithms, that is, FA, LA and FLA (hybridization of FA and LA). Section 6 presents the simulation results, that is, Pricing Signal, Hourly Load, Hourly electricity cost, Daily average load, Daily average cost, Total energy cost, Average waiting time, PAR and integration of RES. The conclusions and future work are presented in the last section of the paper.

Literature Review
Much research is carried out in the area of energy optimization in smart grids. Different algorithms are used for this purpose. Here, we mention a comprehensive study of existing techniques, along with their achievements and shortcomings.
In [1], the authors used the bacterial foraging algorithm (BFA) and the grass-hopper optimization algorithm (GOA). They reduced the electricity cost by 34.69% and 37.47% and PAR by 56.20% and 20.87% using GOA and BFA scheduling, respectively, for a single office. In [7], the author mixed integer non-linear programming to reduce PAR and electricity bills. With this method they have reduced the cost, but they do not give any importance to PAR reduction. In [8], the author discussed cost reduction and the storage of energy resources. They enable the end users to store extra energy during Off-peak hours and sell them to the utility provider during ON-peak hours, which is a very beneficial technique for both users and utility providers.
In [9], the author used two nature-inspired algorithms, named the Moth flame optimization algorithm (MFO) and the Genetic algorithm (GA). They reduced the PAR and electricity cost to a greater extent but the waiting time results are not good in the case of the MFO algorithm, while in the case of GA algorithm they reduced the waiting time as well as PAR, but the electricity cost increased in the simulation results. Similarly in [10], the author used a hybrid technique, BFA and GA, for energy optimization. When two or more algorithms are merged into a single one, it is called a hybrid algorithm. The simulation results of this algorithm show that the cost and PAR achieved by using a hybrid is less as compared to GA and BFA. While in case of GA and BFA, the cost achieved through BFA is low compared to GA while on the other hand, the PAR of BFA is greater as compared to GA. Thus, the cost and PAR achieved through the hybrid approach is far better and, similarly, the user waiting time response through the hybrid approach is also good.
In [11] the author used the cuckoo search algorithm (CSA) and the grasshopper optimization algorithm (GOA) to reduce the cost and PAR for the optimal usage of industry machines. They selected a woollen mill and proposed a model and conducted scheduling for the same model. Their cost and PAR using GOA is good as compared to CSA, but the waiting time for GOA is very high as compared to CSA. In [12], the authors used mechanisms to balance the load in commercial, residential and industrial areas. In DSM, they showed a comparison of electricity utilising GA against not using GA. They lowered peak-hour electricity use by employing GA-based DSM. They have, however, overlooked PAR and end-user comfort.
For most of the optimization problems the cuckoo search algorithm (CSA) is quite effective as a result of its generic and durable nature. The cuckoo search algorithm outperforms the genetic algorithm and the particle swarm optimization technique (PSO). In [13], the author used TLBO, Linear programming, the TLBO algorithm and GA for the scheduling of appliances to reduce PAR and electricity costs. In [14], the author used the swarm optimization algorithm and an improved adaptive evolutionary algorithm. They worked on the optimal economic dispatch solution for a micro grid by using the improved artificial bee colony optimization.
In [15], the authors used the multi-verse optimization (MVO) algorithm and sinecosine algorithm (SCA), and have extracted better results in terms of low PAR and electricity cost. The authors maintained a desired threshold level between the cost of electricity and the amount of time users must wait. The author of [16] employed a cooperative multi-swarm particle swarm optimization (PSO) technique to lower the PAR, but they overlooked the waiting time for appliances as well as the cost of electricity. The authors of [17] discussed the importance of smart grids in the future and highlighted some of the optimization techniques that could be used to solve various optimization problems, such as GA, Memetic Algorithm, PSO, ACO Algorithm, and Artificial Neural Networks. In [18], with the objective of achieving lower electricity costs and PAR, the authors used an autonomous and optimal domestic energy consumption scheduling technique. For various load scenarios, their simulation results demonstrate a considerable reduction in electricity costs. Both users and utility providers benefit from the implementation of their proposed methods. In [19], the author has taken a model of seven different appliances and made a scheduling mechanism for it by using GA. They divided the load into three categories: flexible, inflexible, and nighttime loads. Their simulation results reveal a cost reduction of 8% and a reduction in energy use of 2%.
DSM is a crucial function in a smart grid because it allows end-users to change their energy consumption in a variety of ways. In [20], in order to reduce PAR and electricity, a demand side management strategy was used; they created energy for users by employing RES or distribution generators. They used to charge their storage devices during low-cost hours and then use them during peak-cost hours. As a result, both the cost of electricity and the PAR were reduced.
In [21], the author used a demand response technique. Demand response is actually a method of shifting load or using appliances within a beneficial time duration, meaning in off-peak hours, so that the consumer would not suffer from ON-peak hours. The author of this research demonstrated that, by moving the load, unexpected peaks might be noticed at off-peak hours. They used multi-CPP (Critical Peak Pricing) and multi-TOU (Time of Use Pricing) pricing schemes, as well as DAP (Day Ahead Pricing) signal concepts, to analyse this later peak creation. In [22], the author used a demand side load management technique building in such a way as to increase the user satisfaction at a low cost. The author used the GA-based optimization technique to achieve their objective.
In [23], the author shifted the load from ON-peak hours to OFF-peak hours and used different meta-heuristic techniques, such as EDE, HSA, BFA, and GA. They achieved lower electricity costs and low PAR, but ignored user waiting time. In [24] the author used two algorithms, QoE-aware Cost Saving Appliance Scheduling (Q-CSAS) and QoE-aware Renewable Source Power Allocation (Q-RSPA), to reduce the electricity cost. Simulation results showed that the average energy cost savings using the proposed algorithms are 22% when there were no RES installed, and they increased it up-to 30% using RES.
In [25], the author used three heuristic algorithms, the GA, BPSO and ACO algorithms, to reduce electricity cost, PAR and user waiting time. Simulation results show that the GA based energy management controller performed very much more efficiently than the BPSO and ACO based energy management controller for the reduction of electricity cost, PAR and user waiting time. In [26], the author used a hybrid GA and PSO for energy management, and to minimize the user waiting time in smart homes.

Proposed System Model Architecture
DSM is responsible for the effective performance of SG. Through the DSM, we can manage our energy consumption and all the other activities that may take place on the customer side. In this section, we propose a model that will work on the scheduling of appliances for a university campus to achieve beneficial results by optimal scheduling of the appliances. The load is divided into two sessions-morning session and evening session. We have further distributed morning session load into classrooms, offices, labs, the main hall, staff hostel, students-hostel, canteen and search light as shown in Table 1. We considered that the campus is receiving a DAP signal from the utility provider, according to which we have to schedule our appliances to achieve our desired objectives. As discussed earlier, we divided the campus load into different blocks, as load units. These blocks have some non-shiftable appliances such as fans, tube lights, energy savers, exhaust fans, air conditions. All of them can be used in a specified time slot. Similarly, we have some shiftable appliances such as geysers, lab equipment, water pumps, water coolers, and so forth. We can shift all these appliances to another time slot if needed, to help in the reduction of PAR, cost and customer waiting time. This scheduling is beneficial for both consumer and utility provider. Smart meters are placed in each apartment to compute each hour's power consumption. The utility provider shares the price information with the users for the required energy consumption.
In order to meet our objectives, we have distributed our 24-h load into a morning session and an evening session. The morning session is 8 h from 8 am to 4 pm, and the evening session is 16 h from 4 pm to 8 am (next day morning). Each hour represents a single time slot, that is, eight slots and 16 slots respectively. Our proposed system architecture is shown in Figure 1.

Appliances Categorization
We have categorized our load into two groups, Group A and Group B. We call the group "A" appliances shiftable appliances and group "B" appliances non-shiftable appliances. Let A n represents all the appliances so that, where, "A s " represents shiftable appliances and "A ns " represents non-shiftable appliances. We can schedule all these appliances in the 24-h time duration as follows;  Table 1 depicts the campus load units, their power ratings, starting timings, finishing timings and the average length of operations times (LOTs).

Firefly Algorithm (FA)
The firefly is an insect that mostly lives in humid environments [27]. They generate limited intensity flashing lights of colors such as green, yellow and pale-red. They use their unique flashing light pattern for the purpose of communication. As a defensive cautionary mechanism, they use scent to lure their companions and potential prey. This flashing light mating pattern is used by some female species to track down other species. There are more than 2000 different species of fireflies in this biosphere. FA is used for the solution of optimization problems, in various fields, as FA generates precise and accurate results with respect to time and optimality [28]. The two main features of FA are attractiveness and movement.

Attractiveness
In FA, the attractiveness depends upon the intensity of light and the distance between two fireflies. The attractiveness of two fireflies, that is, fireflies "i" and "j", is related to the intensity of light and is inversely proportional to the square of their distance. i.e., where, I o shows the intensity of the flashing light at the origin and d ij represents the distance between firefly i and firefly j. The fireflies' flashing light intensity is inversely proportional to the distance between them and depends on the absorption of the medium (γ). So the above equation can be re-written as;

The Movement
The distance between any two fireflies i and j in 2-D can be found as; The movement of a firefly "i" towards a more attractive firefly "j" can be found using the following equation; The term β 0 e −γd 2 ij (x j − x i ) in the above equation shows the attraction while the term α(rand − 1 2 ) is known as the randomization term with a randomization parameter α, while rand is known as the random number generator.

Lion Algorithm
Unlike other felines, like cats, leopards, and so forth, lions have interesting behavior to keep the animals strong in every generation. There is a term used for lions' social systems, and that is pride, in which the females live and give birth to their off-springs. A cub needs 2-4 years to become mature. In between these 2-4 years, nomadic lions may try to take a pride, which is called a territorial defense. To defend the territory a war may start between the territorial lions and the nomadic lions. When the nomadic lion defeats the territorial lion, the nomadic lion kills the territorial lion or takes him out of the pride, and the nomadic lion becomes the territorial lion by killing his cubs and taking his female and using her to give birth to his offspring. Once the cubs of the pride become mature and stronger enough to defeat the territorial lion, they attack and take their pride back. On the basis of this nature, the Lion algorithm is composed of four major components. These are: Pride Generation, which is responsible for generating solutions; Mating, to derive new solutions; Territorial Defense; Territorial Takeover, indicates finding the new best solution if the existing solution is not good.
The searching procedure of the lion algorithm follows the basic structure of an algorithm. Consider an objective function: arg min f (c 1 , c 2 , ......., c n ); n ≥ 1 where c i ∈ (c min i , c max i ). (8) To indicate a search procedure, we have to generate a pride. It consists of C male and C f emale , with the structure:  (9) where "L" defines the length of the solution vector. The strength of the entire pride can be calculated as: ) show the strength of male and female cubs respectively. While the number of male cubs in the pride is shown as ||C mCubs ||, the Age mat shows the maturity age for mating.

Firefly-Lion Algorithm (FLA)
Hybrid algorithms are made up of two or more algorithms that work together and complement one another to create a profitable synergy. Hybridization tries to utilize the benefits of each method. The Firefly Algorithm is one the most simple, easy to implement and efficient bio-inspired meta-heuristic algorithms. On the other hand, researchers have put it in the slow convergence rate algorithms group. It also usually is trapped in the local optimum, particularly in multi-model operations. However, it is very appropriate for the parallel applications. LA is one of the bio-inspired meta-heuristic algorithms, used for optimization problems, especially in multi-model operations [29]. Therefore, making a hybrid version of both these algorithms, namely, FLA, to obtain the benefits of both, while evading their shortcomings, is currently needed. FLA not only handles multi-mode operations but also has a very short convergence time and is easy to implement. Therefore, In this paper, we have studied the nature of both these algorithms and introduced the combination of firefly and lion algorithms, namely, the Firefly Lion algorithm (FLA). We have achieved better results through the hybrid approach. In FLA, first, we applied FA for finding the local optimum solution. Then, we applied LA on these local best (l best ). Meanwhile, we generated random data as well, (as done at the start also), and compared the local best generated by FA with this randomly generated data. We have the condition that if l best is less than the generated data values, then it is considered to be l best , otherwise LA starts its own operation and finds its own l best . By moving forward, the global best g best is found.

Results and Discussions
In this section, the MATLAB simulation results are discussed. We have extracted better results from FLA and compared them with its variants FA and LA. The PAR reduction, cost minimization and reduction in the average waiting time for the user are the main focus of this work.

Energy Pricing Signals
Different energy pricing schemes are used in the literature to give energy costs either on a daily basis or an hourly basis such as time of use (TOU), inclined block rate (IBR), critical peak pricing (CPP) and day ahead pricing (DAP). We have used the DAP signal depicted in Figure 2d, reproduced from [30], for manipulation of the energy cost.

TOU
TOU is the energy pricing scheme that is used for a wide block of hours as shown in Figure 2a.    Figure 4 shows the hourly energy cost distribution for the unscheduled and scheduled with FA, LA and FLA algorithms. As compared to its variants algorithms, FA and LA, FLA reduced the hourly cost excellently.

Daily Average Load
The daily average load for the unscheduled and scheduled with FA, LA and FLA algorithm is shown in Figure 5. The Figure clearly shows that the daily average load, scheduled by all algorithms, remained the same.

Daily Average Energy Cost
The daily average energy cost for the unscheduled and scheduled with FA, LA and FLA algorithm is shown in Figure 6. It can be observed that, due to the scheduling of the load, the cost is reduced.

Total Energy Cost
The unscheduled and scheduled energy costs with FA, LA and FLA algorithms are shown in Figure 7. The simulation results show that the electricity cost of FLA is much less,as compared to the unscheduled load cost and the other Bio-Inspired algorithms.

Average Waiting Time
Waiting time plays an important role in the scheduling of appliances. Usually, when we reduce the cost, as a result, waiting time increases. A user cannot use an appliance when they desire, and has to wait for their scheduled time. Our simulation results show that consumer waiting time is reduced to a greater extent, which was our main objective. Figure 8 shows the average waiting time for scheduled appliances with FA, LA and FLA algorithms.

PAR
Not only average waiting time, but also PAR plays an important role in the optimal scheduling of smart appliances. During ON-Peak hours, high peaks of load are produced, due to which the utility provider uses extra generating sources, due to which per unit cost increases. Therefore, most researchers try to reduce PAR to find an economical solution for the user. Figure 9 shows a comparison between the unscheduled and scheduled with FA, LA and FLA algorithms. The simulation results show that we have not achieved better results in the case of PAR reduction, because of the cost and waiting time reductions.

RES
The use of renewable energy resources (RES) is the need of the day. It not only reduces our daily load demand, but also, the extra generated energy can be given back to the grid for the peak hours' high energy demand. So, PAR can also be reduced, and hence we can reduce the electricity cost to a greater extent. Figure 10 shows the estimated day-time solar energy generation, while Figure 11 depicts the unscheduled load without RES and with RES. It is clear from the figure that the load demand is not only fulfilled, but the extra generated energy is either stored or given back to the grid, using the two-way energy meter.   Absorption coefficient (γ) 1 Max. generation (gen max ) 100 5 Crossover prob. (P Crossover ) 0.2, 0. 6 6 Mutation prob. (P Mutation ) 0.5 Table 4 summarizes the performance of the proposed FLA algorithm in comparison to the unscheduled-load and the load scheduled with FA and LA algorithms.

Conclusions and Future Work
In this paper, we have applied two bio-inspired algorithms, the Firefly Algorithm (FA) and the Lion Algorithm (LA), and proposed the hybrid version of these two algorithmscalled the Firefly-Lion Algorithm (FLA)-for University campus appliances to extract beneficial results. We have compared their results in two different timing sessions, that is, a morning-session and an evening-session. We have taken the starting and finishing times for different appliances and have different power ratings and LOTs for different appliances. We have conducted our simulations using the day ahead pricing (DAP) signal. Our results show that we have reduced the total energy cost to a great extent. While there is always a bargain between electricity cost and waiting time-that is, when cost is decreased, the waiting time increases-in our FLA, we have reduced the cost without affecting the waiting time for the consumer. The cost and waiting time are very much lower as compared to the other algorithms used for comparison. In future, more efficient bio-inspired algorithms will be explored and hybridized to achieve better results.