#### Abstract

In this research, a whale-optimized fuzzy PID controller was developed to manage automatic generation control in multiple-area electrical energy systems with an availability-based tariff (ABT) pricing scheme. The objective of this work is to minimize the power production costs, area control errors (ACEs), and marginal costs of the multiple-area electrical energy system with real-time load and frequency variation conditions. The generation of power, deviation of power in the tie line, and deviation of frequency of the interconnected three-area electrical energy system, including the hydrothermal steam power plant and gas power plant, will be measured and analyzed rigorously. Based on the output from the whale optimization, the fuzzy PID controller regulates the deviation of power in the tie line and the deviation of frequency of the interconnected three-area electrical energy system. The reliability and suitability of the proposed optimization, i.e., whale-optimized fuzzy PID controller, are investigated against already presented methods such as particle swarm optimization and genetic algorithms.

#### 1. Introduction

The importance of the responsibility of power and energy automatic generation control is in supplying the stipulated energy and power to the electrical loads with the least momentary fluctuation. However, the challenge is to regulate the power flow in the tie line and oscillation in frequency during various load demands. To damp out the oscillation, an optimal controller has been developed for automatic generation control (AGC) [1, 2]. In AGC, if no sufficient regulation is presented, the transients may be prolonged for a long time, and the electrical network may fall as a result. In order to attain better dynamic performance, several control techniques have been developed for load frequency controllers [3, 4]. The AGC solution formulation is illustrated in [5, 6], with traditional approaches for a remote environment having one source, such as a steam power generator plant. The effect of a single time delay on a single area controller response is presented in [7]. The issue of the AGC with different generation sources in a single region is addressed in [8]. Hydroelectric power plants with various controller responses under operating conditions, as well as plunk loads in a remote area, are defined in [9]. The AGC controllers’ gains tuning by the graphical methods, considering the time delay, internal model control with model reduction, and the response of the control under the dynamic load demand for a remote area with a one-source electrical system model, are explored in [10, 11]. The relevance of AGC studies under the different simulation scenarios of a remote electrical system model is presented in [12]. The solution to the AGC problem is proposed in [13, 14], in the four-region interconnected electrical system in each field, considering the nonlinearities. The load frequency control (LFC) issue with time delays for an interconnected three-area electrical system is addressed in [15]. In order to take into account the automated power production control system, the interconnected three-area electrical system modeled with separate generator numbers in the different contact delay areas is presented in [16]. The interconnected three-area electrical system load frequency management with multiple turbine units is discussed in [16].

Various currently synchronized markets are expected to develop into a multiple-source structure, the implications of power sector deregulation on LFCs [17] have been discussed. The decentralized LFC concept appeared to deal very well with some problems in the case of electrical system management, and several research papers subsequently discussed the use of this idea for discrete-time and continuous-time machine systems [18]. An interconnected four-area electrical model system of steam turbine reheat system with nonlinearity effects and lower and upper restraints of hydroturbine generation rate system with nonlinearity has recently been developed in [19]. In [20], Markov chain control issues and algorithms and stochastic multistage decision-making issues and algorithms are adopted for the LFC problem with a reinforcement learning technique. In [21, 22], the updated PID structures for the LFC for two nonheating areas with AC or DC lines for the thermal-thermal electrical network model are investigated.

To solve the problems of automatic production operation, an integral controller based on fuzzy logic is designed, and a hybrid genetic algorithm- (GA-) fuzzy controller is required for the multiple-area electrical system model of thermal power plants [23, 24]. In [25], the author identifies the interconnected electrical system AGC scheme. To obtain the finest AGC feedback advantage, stochastic search technology predicating GA is used. In [26], an incipient technique for assessing the objective function value of the GA-simulated annealing and GA optimization by cull was developed by the author. An objective function value, such as an area control error, directly relies on momentary output exclusivity uniform to undershoot, overshoot, and settle time. More weight was given to settling time and overshooting. By using the multiple fitness-valued proportional-integral-derivative control of LFC, it attempted to reduce the overshoot/undershoot and settle time [27]. Load frequency regulation for the GA technique-based three-area interconnected electrical system model is explored in [28]. Multiple-area electrical system AGC using biobjective nondominated genetic sorting algorithm and teaching-learning-based optimization of output and input scaling factor of sliding mode controller is discussed in [29, 30]. Multiarea electrical system AGC using a fuzzy GA-based controller and robust optimal controller is provided in [31, 32]. The problem of AGC using the GA for a multiple-area electrical system is explored in [33]. The LFC variable structure controller is introduced in [34], using the GA for the AGC problem.

In [35], the author introduces the multiple-area interconnected electrical system LFC that is listed using fuzzy logic controller- (FLC-) tuned PI, and the power system output is improved by tuning the fuzzy set parameter and fuzzy relation rule between input and output by the sophisticated GA for fuzzy control in [36, 37]. The GA for optimizing the AGC controller for two-area interconnected electrical systems and three-area interconnected electrical systems is provided, taking into account the impact of bilateral contracts. The topic of multiobjective optimization (MOP) and its outcome for AGC is studied using GAs tuned to the multiple-area electrical system PI controller [38]. In [27], an automated generation controller based on a GA for a self-governing hybrid generation system and energy storage system was premeditated. Regulation of the load frequency of two independent interconnections in three-area power systems using multiagent reinforcement based on GA is presented in [33].

In [39], a cull of variable structure input benefits was proposed by the author. A variable structure controller input benefit spectrum can be created as a problem statement for optimization, and the optimization approach uses GAs. Compared to traditional trial and error methods, the proposed approach also offers a better alternative to the normal way to remove the feedback gain of a vector structure controller. In [40], using GAs to dampen system oscillations, the author defined the tuning rule for the gin parameter of the proportional integral controller in LFC. In [41], where an LFC using an FLC-tuned PI controls, the author proposed an implementation of the fuzzy method. An incipient framework of LFC was established that was predicated on perspicacious methods [42]. The online neural network controller was powered using an FLC projected by a GA. Adaptive feedback is designed for the LFC quandary controller [43]. The implications of using a fuzzy logic control for the LFC dilemma were described in [44, 45]. Against the cognizance basis and the fuzzy inference, the fuzzy law signal was freely deducted. They contrasted the fuzzy controller with traditional controllers for PI and fuzzy scheduling controllers for benefit.

Adaptive weight is utilized in PSO to optimize the parameter of the PID-controller parameter for multiple-area electrical systems running in the open-market scenario [46]. Modified techniques of PSO have been considered for multisource electrical systems [47]. The PSO algorithm has been developed with tuned PID controllers for multiple-area electrical system gain adjustment [48]. The PI controller is configured by optimal gain for the deviation of the frequency of the two-area interconnected electrical system tuned by the PSO technique [49]. Compared with the traditional Ziegler Nicolas tuning approach for the AGC of interconnected electrical systems [50], a dynamic output of the PSO-tuned AGC is achieved. Optimization based on a PSO Optimum AGC Controller for HVDC connection multiple-area interconnected electrical systems was proposed in [51]. Tuning of the AGC PID controller of a multiple-area interconnected electrical system using bacteria foraging hybrid and the PSO technique [52] has been demonstrated. The automated generation control regulator for remote hybrid power systems based on PSO consists of various generation sources, such as thermal and variable-speed wind turbines [53]. In [54], the author introduced the expected algorithm for differential evolution in the nonlinearity AGC problem using a PI controller. The suggested approach was contrasted with the optimization algorithm for mad particle swarm.

The possibility has been raised of determining the results of physical limits, such as the governor dead band (GDB) and production rate limitation (GRT) nonlinearity of thermal device reheat turbines, by using a GSA to optimize the AGC PI/PID controller parameters with ITAE yield-improved performance [55]. In [56], the author introduced different findings using the cuckoo search algorithm in multiarea AGC, demonstrating that the system’s efficiency is effectively increased by other control methods. In [57], the author optimized the use of the pattern search algorithm and gravitational search in hybrid mode and for multiple-area electrical systems with nonlinearities of governor dead band (GDB) and production rate limitation (GRT) included. In multiple-area networks [58], GWO offers adequate damping efficiency under load demand and phase disturbances.

From the above literature review, there is ample scope in AGC for the availability-based tariff pricing scheme. In this work, whale optimization is utilized to find the optimal parameter of a multiple-area electrical system with a fuzzy PID controller to minimize the generation cost, marginal cost, and ACE of the multiple-area network with real-time load and frequency variation conditions. The overall system is developed in the MATLAB/Simulink toolbox. Various test analyses are investigated to test the suitability of the proposed whale-optimized fuzzy-controlled three-area power system.

#### 2. Modeling of AGC for a Three-Area System

A multiple-area electrical system can be separated into numeral power pools interrelated by a common link kenned as tie lines. The area frequency drops when the rise in perturbation, or, is kept at zero. Likewise, the frequency may rise if the load decreases, and vice versa. On the other hand, the desirable frequency to keep the constant is such that . It considers a three-area case linked by power lines (as shown in Figure 1).

In an interconnected electrical system consisting of quite a lot of pools, the responsibility of the AGC is to split the loads between the system, station, and generator to subsequently attain the most economy and in addition to controlling the scheduled interchange of tie-line powers. It does this while keeping the frequency sensible. Throughout major transient turbulence and emergencies, the AGC’s role is to bypass, and protective relays are activated to bring back the electrical network in normal mode. The bulky dimensions of the electrical system are usually separated into different power area stands on the standard of coherency. The control areas are interconnected through the common link and are called power tie lines. Under irregular conditions of the power grid, they are used for contractual energy sharing between the control areas.

Effective area management is needed for frequency variation in some regions of the united scheme in order to regulate its production and to reestablish the deviation of frequency and power in the tie line. Both control groups sustain the other control groups owing to significant generation or load changes. An interconnected power grid seeks to overcome ACEs for effective operation in terms of net power exchange and frequency [27].

Equipped with simplicity in the primary control loop, the LFC’s power shift in group 1 is met up by the generation rise in both groups combined with a shift in the reduction in frequency and power in the tie line. The power system is attained at the standard frequency in the usual working conditions in the demands of regions. For the usual mode, a simple control technique is to set the frequency at a standard level (50 Hz) and retain the power flow in the tie line while each area can take up changes in its individual load. The classical LFC relies on the influence of the tie line bias, where each region tries to nullify the ACE. The ACE is a combination of power in the tie line and frequency error in the linear scale and is expressed in Equation (1).

The overall number of interactions between the adjacent control areas is determined by the frequency bias . In this area, efficient operation is accomplished because the selection of bias factor is very critical for the regions [33].

As a result, ; the equation gives the ACE of the three-area scheme.

Here, , , and are the changes in power in the tie line in all areas. While the system is focused on small perturbations, the echoes are utilized to activate signals on the decrement of and to null. The controller input- and output-scaling factor should be preferred accurately to improve the momentary response of the system [33].

#### 3. ABT-Based Three-Area Electrical System Automatic Generation Control

The ABT typically contains the following balanced pricing scheme: the cost of capacity, electricity costs, and unplanned interchange (UI). All three payments are included in the AGC of the electrical system, and the lowest-cost activities are valued. The ABT with the integrated power structure is discussed in the manuscript. Hydrothermal, gas power plant, and steam power plant systems are integrated control systems. Centered on the ABT process, the functionality of AGC is resolutely investigated in a unified electrical system. The objective fitness is definitive for examining the ABT progression, and the frequency regulation is also specified for the assessment [39].

The cost of unscheduled interchange (UI) is often available in real time and is regulated by the inverse curve of cost-frequency [39]. The small variation in real-time UI costs relevant to small change frequency is expressed by the following equation: where is the gradient of cost-frequency curve. The details of the curve is depicted in Figure 2.

The marginal cost of the generation unit in the multiple-area electrical system is represented by the following equation, where is the marginal cost of the plant, is the power generation of the plant, and and are cost coefficients.

The small variation in marginal cost , with small variation in turbine generator output, , is expressed by the following equation:

The small change in profit, , is related with not contracted power generation, , and it is expressed in the following equation:

An AGC three-area device block diagram is shown in Figure 3. In this job, in the multiarea interconnected power structure, the three-area model is performed if the governor considers duplicating the strength of both the tie line and the synchronous generator. The system’s primary challenge in preserving the frequency inside the circumscription is intricate. The overall performance of the generation system also changes as the load varies, so it is not possible for long stretches of time to generate real electricity. The disparity in frequency control is based on the AGC’s whole scheme of true power balance. This corresponds to Figure 3, where , , and are the bias specifications, , , and are the area control errors, , , and are control inputs for the fuzzy PID controller, , , and are speed regulation of governor in p.u Hz, , , and are speed governor time constants in seconds, , , and are the governor output in p.u, , , and are the turbine time constants in seconds, , , and are the change in turbine output powers, , , and are step load perturbations in area 1, area 2, and area 3 in p.u, are the incremental changes in tie line power in p.u, , , and are the gain of the generator load model, , , and are the time constant of the generator load model, and , , and are frequency deviations in Hz [40].

The fixed structures of fuzzy PID controllers with steady gains are optimized to a particular operating point and provide optimal performance for that operating point. The design of a controller will require proper selection of fuzzy PID output gain constants accordingly, so that deviations in the ACE, UI cost, and marginal cost will be minimized, while profit cost is maximized. The deviation in frequency replication is due to the increase in demand of consumers. If the output replication is more prominent than the authoritative ordinance, the machine will incline to raise in speed, making the frequency elevate, and vice-versa. Hence, the control engineers take appropriate action in tuning the gain constants by monitoring the rise or fall in frequency. The gain constants of the controller depend on the number of loads predicted for that machine. The load prognostication is predicated on the injective authorization of the particular machine obtained during the particular period. In short, fuzzy PID controllers are included in the design of the LFC to enable the turbine-governor system to take corrective action immediately after the load. Figure 4 depicts the structure of a fuzzy PID controller. , , and are considered tuning parameters of the fuzzy PID controller. ACE, marginal cost, and UI const are minimized, and profit is maximized by optimizing these parameters using whale optimization.

The fitness function for the three-area AGC with the availability-based tariff pricing scheme is expressed in the following Equation (7), and based on this fitness function [2], the parameter of the fuzzy-tuned PID controller is optimized with constraints in Equations (8), (9), and (10).

The minimize objective function is focused to:

There is no need for gradient information due to its ease of implementation, and practically, it can be broadly applied to many disciplines using metaheuristic optimization algorithms to gain interest. The efficiency of humpback whales is part of the latest whale optimization metaheuristic optimization method. Two steps of the search process are discovery and exploitation. Maintaining a proper balance between these two search processes is a very difficult challenge during the development of every metaheuristic algorithm.

Typically, whales are the largest mammals and one of the world’s most majestic creatures. Researchers have discovered that within the brains of whales, there are certain cells that are identical to human spindle cells. Because of this testimony, whales with instincts are regarded as the most intelligent types. Humpback whales are some of the largest whales, and their exceptional hunting practice has made them popular above all other whales. By shaping individual bubbles along a “9”-shaped path called the bubble-net feeding process, searching is accomplished. First, in this process, whales dive 12 m down, continue to form a bubble in a spiral shape around the prey, and swim up to the surface again [53]. To apply the WOA optimization technique, which is described in the section below, you might require an understanding of encircling prey, spiral bubble-net feeding procedures, and checking for prey.

Whales are ready to surround their victims and inform them in order to haunt its place to arrive at the desired solution. The goal—prey, in this context—is believed to be the most excellent candidate result at present. In this way, various numerical equations are defined as follows [57]: where the current iteration is denoted by , the position vector at the current iteration is denoted by , the best candidate in the current iteration is denoted by , the position vector is denoted by , the absolute value is denoted by , and element-by-element multiplication is denoted by “”. in each step should be changed if a stronger solution emerges. The linearly varying constant is denoted by “”, and it decreases from 2 to 0 during each generation (in both the utilization and discovery stages); the random vector is denoted by in the range [0,1]. and are coefficient vectors.

The distance is determined between the whales situated at () and the victim situated at () for the spiral update location. To mimic the humpback whale movement in helix-shape, a spiral equation form is next generated between the location of the whale and prey as follows: where is the current iteration position vector, the logarithmic spiral shape constant is denoted by “”, the random distribution number is denoted by , and its range is between 0 and 1.

There is a 50 percent chance of deciding between the bubble-net hunt methods to inform the location of whales in optimization as humpback whales swarm through the prey. The following equations explain the method described in the mathematical model, where the probability for each surrounding mode is denoted by : To do a universal hunt, location information for search agents is measured based on certain randomly picked search agents instead of using the best search agent so far found. This procedure is used where random values greater than one are considered for . The mathematical model for the stated solution is represented in the following equations: where a random location or random whale vector picked from the present population is denoted by . The flowchart for the WOA algorithm is depicted in Figure 5.

#### 4. Results of Simulation and Its Discussion

In this section, the simulation result verification of a whale optimization algorithm-optimized fuzzy PID controlled three-area electrical system with an availability-based tariff pricing scheme is investigated and compared with GA and PSO. The parameters used for the three-area electrical system are shown in Table 1.

The three-area electrical system was designed and modeled in MATLAB Simulink, and it is depicted in Figure 6. The Simulink model of the fuzzy PID controller is depicted in Figure 7. The availability-based tariff pricing scheme Simulink model is shown in Figure 8.

The output-scaling factors of the fuzzy PID controller, i.e., , , and , are optimized using the GA, PSO, and whale optimization algorithms. Figure 9 depicts the convergence graph of the WOA, PSO, and GA. From the convergence graph, the global optimum value for GA is 1.233, PSO is 1.187, and WOA is 1.092. The WOA reaches the global optimum at the tenth iteration, but GA and PSO take a long time to find a global optimum value, i.e., GA took 45 iterations and PSO took 25 iterations. GA, PSO, and WOA were executed a hundred times, and the corresponding results are depicted in Table 2. From this table, the average computation time of the GA is 964 seconds, 850 seconds for PSO, and 752 seconds for WOA. The standard deviation and mean values are very small for WOA compared to GA and PSO. From the convergence graph and Table 2, it can be ascertained that WOA is outperformed by GA and PSO.

A developed three-area power system with an availability-based tariff system was tested in three different operating conditions: a constant load condition, with a sudden change in load conditions in each area and a sudden load change in conditions in all areas. The constant load condition and deviation frequency in each area was measured, and it is shown in Figure 10. In Figure 10, a green color response corresponds to GA-fuzzy PID, a blue color response corresponds to PSO-fuzzy PID, and a red color response corresponds to WOA-fuzzy PID. When examining the results, the undershoot of the frequency deviations is equal for GA, PSO, and WOA fuzzy PID. The settling time of frequency response is 37 seconds with GA fuzzy PID, 17 seconds with PSO fuzzy PID, and 4 seconds with WOA fuzzy PID.

The sudden load disturbance is created in area 1, i.e., the load change in area 1 is from 0.2 p.u to 0.4 pu at 50 seconds, and the load profile in area 2 and area 3 is maintained at 0.2 pu. The corresponding response of this tie line power deviation and the frequency deviation of the three areas is shown in Figure 11. The undershoot of the tie line power deviation and frequency deviation in all areas is equal for GA, PSO, and WOA fuzzy PID. The recovery time of WOA fuzzy PID is 53 seconds, 60 seconds for PSO, and 70 seconds for GA.

**(a) Frequency deviation**

**(b) Tie line power deviation**

The sudden load disturbance is created in area 2, i.e., the load change in area 1 from 0.4 p.u to 0.2 pu at 40 seconds, and load profile area 1 and area 3 is maintained at 0.2 pu. The corresponding response of such a tie line power deviation and frequency deviation of the three areas is shown in Figure 12. The overshoot of the tie line power deviation and frequency deviation in all areas is equal for GA, PSO, and WOA fuzzy PID. The recovery time of WOA fuzzy PID is 45 seconds, 50 seconds for PSO, and 67 seconds for GA.

**(a) Frequency deviation**

**(b) Tie line power deviation**

The sudden load disturbance is created in area 3, i.e., the load change in area 1 is from 0.5 p.u to 0.9 pu at 30 seconds, and the load profiles in area 1 and area 2 are maintained at 0.2 pu. The corresponding response to such a tie line power deviation and frequency deviation of the three areas is shown in Figure 13. The overshoot of the tie line power deviation and frequency deviation in all areas is equal for GA, PSO, and WOA fuzzy PID. The recovery time of WOA fuzzy PID is 33 seconds, 42 seconds for PSO, and 72 seconds for GA.

**(a) Frequency deviation**

**(b) Tie line power deviation**

The sudden load disturbance is created in all the areas, i.e., the load change is from 0.2 p.u to 0.4 p.u in area 1 at 30 seconds, the load change is from 0.4 p.u to 0.2 p.u in area 2 at 60 seconds, and the load change is from 0.5 p.u to 0.9 p.u in area 3 at 90 seconds. The corresponding response to such a tie line power deviation and frequency deviation of the three areas is shown in Figure 14. The overshoot of the tie line power deviation and frequency deviation in all areas is equal for GA, PSO, and WOA fuzzy PID. The recovery time of WOA fuzzy PID is small when compared with GA fuzzy PID and PSO fuzzy PID.

**(a) Frequency deviation**

**(b) Tie line power deviation**

#### 5. Conclusions

In this paper, a whale optimization algorithm was utilized to tune the parameter of a fuzzy PID controller to minimize the marginal cost, unscheduled interchange cost, and ACE while maximizing the profit of a three-area electrical system. The overall system model was designed and developed using the MATLAB Simulink software. The whale optimization algorithm was compared with GA and PSO to test the suitability of the whale optimization algorithm. The three-area power system with ABT was tested with WOA fuzzy PID, PSO fuzzy PID, and GA fuzzy PID controllers in different operating conditions. Based on the test result of the simulation, the three-area electrical system controlled by the whale optimization algorithm-optimized fuzzy PID controller has less overshoot, less undershoot, a faster settling time, and a faster recovery time than the GA fuzzy PID and PSO fuzzy PID control.

#### Data Availability

All data are available for readers.

#### Conflicts of Interest

The authors declare that they have no conflicts of interest.