Optimal Energy Management Solutions Using Artificial Intelligence Techniques for Photovoltaic Empowered Water Desalination Plants Under Cost Function Uncertainties

Two modern methods of the energy management system (EMS) based on a modified cost function are addressed in this paper. Fuzzy logic (FL) and Harris Hawks Optimization (HHO) is implemented to achieve the optimal performance of seawater desalination plants (SWDP) within the minimum feed-in tariff (FiT). The technical difficulties involved in the variation of energy price from one time to another and the system parameters uncertainties. For example, the price of energy is higher at the peak time and the price is lower at normal times. Also, the peak time can change from one day to another day. The proposed management system can deal with these variations and uncertainty cases. The suggested EMS is achieved through a bidirectional electrical energy interchange approach (<inline-formula> <tex-math notation="LaTeX">$\pi $ </tex-math></inline-formula>-EEIA). The main concept behind the proposed <inline-formula> <tex-math notation="LaTeX">$\pi $ </tex-math></inline-formula>-EEIA is how and when to inject the excess generated energy of renewable energy into the utility grid or charge the battery depending on the minimum dynamic cost criterion and vice versa. To accomplish this study a 700 m<sup>3</sup>/day SWDP located in Egypt fed on solar energy and a utility network has been constructed and analyzed. The system includes SWDP fed from a photovoltaic (PV) array as well as the utility grid in addition to a battery energy storage system (BESS). The main objective of this study is the management and coordination between the energy exchange process from the solar energy, the utility network, and BESS to provide sufficient electrical energy for SWDP within the minimum FiT. The system is constructed and validated using the MATLAB/SIMULINK™ software package. The proposed FL and HHO-based EMSs are investigated in the presence of the system uncertainties such as the change in the energy (excess or shortage) as well as the change in the energy price in the utility network (high or low) with (normal or peak) time. The attained results demonstrate that the proposed FL and HHO-based EMSs provide high dynamic performance and accurate coordination between various energy resources and BESS. The results show that FL-based EMS achieves a profit of 10.28 <inline-formula> <tex-math notation="LaTeX">$\$ $ </tex-math></inline-formula>but the HHO-based EMS achieves a profit of 10.11 <inline-formula> <tex-math notation="LaTeX">$\$ $ </tex-math></inline-formula> in the same period.

of energy from different sources and the time coordination 48 between them to reduce energy demand as well as the cost [2]. 49 Bo Zhao and Xiangjin Wang illustrated a central manage-50 ment system for coordination with several microgrids that 51 use RERs [3]. The obtained results proved the proper coor-52 dination of energy exchange between these networks. Rishi 53 Kant and Ebrahim discussed a standalone hybrid AC/DC 54 microgrid system that includes a photovoltaic (PV), fuel cell 55 (FC), and various ESSs such as supercapacitors, batteries, and 56 capacitors [4], [5]. The results provide better performance for 57 energy management.Adhithya Ravichandran showed a sys-58 tem for a microgrid that includes RERs, ESSs, and electric 59 vehicles [6]. The suggested EMS operates through a program 60 to coordinate the production of RERs and the process of stor-61 ing, consuming, and charging electric vehicles. The results 62 provide better development in the field of future energy fore-63 casts. Wen-Jye Shyr, et al, suggested a system that controls 64 lighting management via the internet using light sensors [7]. 65 Elsisi, et al, developed a novel energy management scheme 66 of controllable loads in multi-area power systems with wind 67 power penetration based on a new supervisor fuzzy nonlin-68 ear sliding mode control [8]. The attained results validated 69 the efficiency of the new supervisor fuzzy nonlinear sliding 70 mode control in achieving energy management among var-71 ious RERs. Fady and Olivier presented an algorithm using 72 the simulation horizon for several different scenarios as the 73 results showed a significant decrease in the cost of electricity 74 and demonstrated the efficiency of the proposed robust opti-75 mization algorithm [9]. Benmouna, et al, constructed a novel 76 energy management technique for hybrid electric vehicles 77 via interconnection and damping assignment passivity-based 78 control [10]. The developed EMS proved its capability in 79 continuous supply load balance while considering the con-80 straints of load and the different available sources. Giovanni 81 Pau, and Mario Collottasuggested a general study on energy 82 management technologies used in some countries, such as 83 Russia, the European Union, and America [11]. Sanjeev,84 Jinsoo Han, D. Westermann presented a study to develop an 85 algorithm to control energy sources through the use of hybrid 86 storage devices (batteries, capacitors) [12], [13], [14]. The 87 results showed an improvement in the battery life. However, 88 the selection of a suitable control approach represents a big 89 challenge for energy management systems. 90 Mahmoud H. and Matteo Boaro showed a system con-91 sisting of four houses, each containing a PV system, load, 92 and FC [15], [16]. The systems are controlled by exchang-93 ing information for the four homes via the internet through 94 the smart meter and the fuel cell system that is controlled 95 by artificial intelligence (AI) for the heat exchange with 96 the thermal load as a substitute for natural gas-based DC 97 power source. Zilong Yang suggested three systems each 98 system containing an inverter, PV array,and batteries, one 99 of which is wind energy [17]. The energy management pro-100 cess was achieved through controlling the output active and 101 reactive powers and also the frequency for each inverter. The 102 results show the stable operation of power and frequency 103 with enhanced redistribution. Maheswaran Gunasekaran pre-104 sented EMS for a hybrid DC microgrid comprised of a PV 105 array, wind energy, hydrogen cells, batteries, diesel gener-106 ator, and electrical loads [18]. This system is managed by 107 measuring the difference between the generated power and 108 load power to switch ON/OFF batteries to charge or discharge 109 the excess energy into the DC microgrid. The results showed 110 VOLUME 10, 2022 that the maximum power generated from RERs is employed 111 to feed loads or store them into batteries with a good per-    [30].In this research, another energy price has 171 been added (it could be another network at a different price 172 from the current price of the existing network) but in this 173 study, the alternative price is the price of storing energy in 174 batteries.

175
The main objective of this study is the management and 176 coordination between the energy exchange process from the 177 solar energy, the utility network, and BESS to provide suffi-178 cient electrical energy for SWDP within the minimum FiT. 179 In this paper, the energy management is performed by a new 180 Harris Hawks optimization (HHO) algorithm. The proposed 181 HHO algorithm is chosen because this algorithm requires a 182 few adjustable factors that improve the performance of the 183 energy system with a fast convergence rate and overcome 184 the trapping in local optima issue instead of other techniques 185 [31], [32]. Furthermore, the fuzzy logic system is dedicated 186 to validate the results of the proposed HHO that is commonly 187 used for energy management [33], [34], [35].

188
The major contributions of the presented article can be 189 summarized as follow: in this study to achieve the optimal performance of 193 seawater desalination plants. 194 2) A dynamic feed-in tariff (FiT) is considered in this 195 article instead of the fixed cost approach.

196
3) The suggested EMSs are applied to a real 700 m3/day 197 SWDP located in Egypt fed on solar energy and a utility 198 network.

199
The remaining parts of this paper are structured as fol-200 lows: the system description had been shown in Section II. 201 Section III discusses the real case study. Section IV presents 202 the cost function and energy balance mathematical formu-203 lation. Section V shows the energy management technique. 204 In Section VI, the results and discussion are demonstrated. 205 Section VII shows the conclusion.

207
The proposed system combined a grid with a PV array, two 208 stages of SWDP loads, batteries, and a management system. 209 Each stage of SWDP loads operates according to the village's 210 water use. The water pumping station is activated when the 211 potable water tanks are emptied automatically. In this case, 212 loads are supplied from the PV array, if energy is available, 213 otherwise, the management system withdraws the energy 214 from the utility network or ESSs based on the optimal min-215 imum cost criterion. The system injects excess energy into 216 the network or stores it in batteries when the SoC is less than 217 80% and it also discharges energy from batteries to load when 218 the SoC is higher than 20%. The feeding of load energy and 219 the control process is based on the energy price of the utility 220 network as depicted in Fig. 1.

222
In this research, loads are driven from real loads installed in  The daily load curve for the power consumption is con- The suggested photovoltaic array is constructed as follows: 252 five modules in series and one hundred ninety-one parallel 253 modules of 320.5-kW SunPower X21-335-BLK. The factors 254 of the applicable photovoltaic module are listed in Table 2.

256
The main objective of this paper is to find a method to manage 257 the system to achieve the highest profit while respecting the 258 constraints mentioned in the following section:  2) The energy must be purchased from the utility network 264 during an energy shortage such that the energy price 265 of the utility network is less than the energy price of 266 energy storage systems. 3) The battery switch is turned ON to charge at: (a) SoC  The general energy balance equation is as follows: where E w is the wind energy, E pv is the solar energy, E gen In this paper, diesel generators and wind turbines are not 299 used that means: E gen = 0 and E w = 0 therefore, The provided energy can be reformulated to be a function of 302 time as follow: The management system aims to achieve energy balance at 306 any time (t x ) in the day as follows: Md. Alamgir Hossain presented a dynamic penalty function 311 to the charging terminals of the cost function to efficiently 312 manage the battery energy and thereby reduce operational 313 costs [29]. The charging and discharging periods of the bat-314 tery are effectively controlled based on the solar power gen-315 eration and residential real-time electricity prices by using 316 particle swarm optimization (PSO). The performance index, 317 which is also known as the objective or cost function, is gen-318 erally formulated as buying and selling electricity costs of a 319 microgrid as follows: 320 where C (t) is the real-time grid electricity price, P grid is a pos-322 itive or negative value indicating Buying or selling energy? 323 The lowest energy costs are represented by the minimum 324 value of the objective function in case of the best control 325 policies that are given by: 326 where P load (t), P solar (t) and u(t) stand loads, total solar power, 330 and battery targets at the time (t), respectively. BL max is bat- As the optimal control is performed by formulating a cost 336 function, it is suitably analyzed and then a dynamic penalty 337 function (k) in order to obtain the best cost function is pro-  (5) and (12). 373 376 solar power (kW), P load is load power (kW). The equations 380 (11 to 15) are constructed using MATLAB/SIMULINK TM as 381 shown in Fig. 5.

383
Energy management systems must improve the system per-384 formance, reduce risks, ensure public safety and reduce 385 costs. However, in many circumstances, the application 386 of probabilistic risk analysis tools-based energy manage-387 ment systems may not give satisfactory results because 388 the risk data are incomplete or there is a high level of 389 uncertainty involved in the risk data. In this paper, two 390 methods are developed for energy management system as 391 follows: The fuzzy analytical hierarchy process (Fuzzy-AHP) Tech-394 nique is then incorporated into the cost model to use its advan-395 tage in determining the relative importance of profit-making 396 contributions. It is possible to advance in cost assessment. 397 It determines the appropriate decision to sell or purchase 398 energy from the grid or store excess energyin batteries or 399 discharge to complete the shortage to achieve the highest 400 profit.   cess [39], [40], [41], [42], [43], [44]. The most significant

449
The system under study containsmultiple sources of energy 450 like PV array, utility network, and batteries. There are two 451 scenarios as follows: 452 Excess Energy Scenario: 453 -Excess energy (loads less than PV array) and the energy 454 price of the utility network is higher than the energy price of 455 energy storage systems.

456
-Excess energy (loads less than PV array) and the energy 457 price of the utility network is less than the energy price of 458 energy storage systems.

459
Shortage Energy Scenario: 460 -Shortage in energy (loads higher than PV array) and the 461 energy price of the utility network is higher than the energy 462 price of energy storage systems.      Table 4 show the results.  Table 5.

486
Energy storage costs vary according to the type of storage 487 (Batteries, Compress air storage, Hydrogen storage, Pump 488 hydropower, Flywheels, Superconducting magnetic energy 489 storage, Supercapacitors). In this paper, energy storage in 490 batteries was used. The energy price in the utility network 491 at a normal time is 0.1 ($) and 0.15 ($) at peak times. The 492 average cost of storing energy in batteries is approximately 493 20%, the cost is a result of the price of batteries and losses 494 in batteries. A percentage is added by 20 % over the energy 495 price for the utility network at the normal time. The energy 496 price of the stored energy in batteries is 0.12 ($) as shown in 497 Fig. 9. Determination of the best decision based on the price 498 of the energy purchase at a lower price or sold at a higher 499 price is the main target of the proposed EMS to achieve the 500 highest profit. 501 FIGURE 9. Energy price for (grid and battery) the grid energy price range is 0.1 ($) and 0.15 ($) and the battery energy price is 0.12 ($).

502
The system was operated according to system constraints in 503 section (V-A). The system measured PV array output, load 504 power, energy price ($/ kWh) from the utility network, and 505 energy price of battery storage ($/kWh) normal at all times. 506 The control system closed and open the utility network and 507 the batteries switch to turn ON/OFF for HHO management 508 as shown in Fig. 10.

510
The system was operated by MATLAB as previously but 511 replaced the management method with a Fuzzy management 512 system. The system shows a similar operation. The control 513 system closed and open the utility network and the batter-514 ies switch to turn ON/OFF for Fuzzy management. This is 515 reflected by a change in power (charging and discharging the 516 batteries, taking from the utility network, and injecting the 517 energy excess into the utility network) by turning ON/OFF 518 as shown in Fig. 11. 519 VOLUME 10, 2022    4) At a period from 1.3 to 1.5, the load power is greater 541 than the PV array output, the SoC is less than 20 %, 542 and the shortage is fed from the grid because SoC is 543 less than 20 %. 544 5) During the period from 1.5 to 2, the utility network is 545 disconnected and the load power is less than the PV 546 array output which results in an energy excess of solar 547 energy. The energy excess is charged into the batteries 548 because the utility network energy price is less the than 549 battery energy price. 550 6) At a period from 2 to 2.5, the load power is less than the 551 PV array output resulting in excess solar energy. The 552 excess solar energy is injected into the utility network 553 because the utility network energy price is greater than 554 the battery energy price.

555
Remark: The control system works according to the previ-556 ous constraints. When the network switch was turned ON, 557 the battery switch turned OFF and vice versa. The deci-558 sion to switch ON/OFF is based on the difference in the 559 cost between the energy price of the utility network and 560 batteries, as well as the presence of an excess of solar 561 energy or shortage. Power coordination of HHO,andfuzzy 562 management systems is illustrated in Figs. 12 and 13, 563 respectively.

564
Batteries can be the condition of a load (-ive) that charges 565 energy or (discharge) a source (+ive) that feeds the load. 566 The grid can be a load (+ive) that takes up the excess 567 of solar energy, or it can be a source (-ive) that feeds 568 the loads at a shortening of the solar energy as shown in 569 Table 4.   Table 5.   loads operate under different and changing conditions. This 594 regionconsumes electricity from the main network. Maxi-595 mum load value (kilowatts) 19.9 MW. The suggested pho-596 tovoltaic array is constructed as follows: five modules in 597 series and 12000 parallel modules of 20.11 MW SunPower 598 X21-335-BLK. The aggregated system output power for PV 599 array, load, utility network, and battery power is introduced. 600 VOLUME 10, 2022 In addition, the management systems in terms of two system 608 conditions are listed in Table 4. It is clear from this