Optimization of Solar/Fuel Cell Hybrid Energy System Using the Combinatorial Dynamic Encoding Algorithm for Searches (cDEAS)

: This study proposes a computational design method for determining a hybrid power system’s sizing and ratio values that combines the national electric, solar cell, and fuel cell power sources. The inequality constraints associated with the ranges of power storage exchange and the stored energy are reﬂected as penalty functions in the overall cost function to be minimized. Using the energy hub model and the actual data for the solar cell power and the load of the residential sector in one Korean city for one hundred days, we optimize the ratio of fuel cell energy and solar cell energy to 0.46:0.54 through our proposed approach. We achieve an average cost-reduction effect of 19.35% compared to the cases in which the fuel-cell energy ratio is set from 0.1 to 0.9 in 0.1 steps. To optimize the sizing and the ratio of fuel-cell energy in the hybrid power system, we propose the modiﬁed version of the univariate dynamic encoding algorithm for searches (uDEAS) as a novel optimization method. The proposed novel approaches can be applied directly to any place to optimize an energy hub system model comprising three power sources, i.e., solar power, fuel cell, and power utility.


Introduction
Recently, energy sources are being replaced by renewable energy sources, for instance, solar energy, wind energy, hydro-energy, and bioenergy. Because renewable energy sources have exhibited problems, such as low energy efficiency and reliability or high cost, the research on hybrid energy storage systems that connect to and use multiple energy storage devices is an active field worldwide.
During the design and installation of hybrid energy storage systems, the optimization of each component is significant for ensuring the reduction in the overall investment cost and ensuring the excellent performance of such components. To ensure the optimized design of a hybrid energy system, we must consider several inequality constraints and requirements regarding the minimal investment cost and the exact matching of the power supply and demand. To satisfy all these conditions, including nonlinearity, we should adopt an appropriate numerical optimization method. Because most optimization variables, such as the capacity of solar energy systems, are integers or discrete values, the methods for optimizing the performance of hybrid energy storage systems must have the ability to deal with integer optimization variables. In this study, we consider integer-based nonlinear programming problems, and there are a few known methods for addressing such problems, such as the generalized penalty function method and sequential linear discrete programming [1].
The aim of the paper is twofold. Firstly, we propose a computational design method for determining a hybrid power system's sizing and ratio values that combines the national electric, solar-cell, and fuel-cell power sources. The inequality constraints associated with the ranges of power storage exchange and the stored energy are reflected as penalty functions in the overall cost function to be minimized. Secondly, to optimize the ratio of fuel-cell energy and solar energy in the hybrid power system, we propose the modified version of the univariate dynamic encoding algorithm for searches (uDEAS), which will be called a combinatorial dynamic encoding algorithm for searches (cDEAS), as a novel optimization approach.
In this study, the sizing optimization of the hybrid energy system is conducted in two conditions in the case of a sufficient power supply. First, eight sizing values of the system and the ratio of a fuel cell are optimized together using the collected actual data for the solar cell power and the load of the residential sector in one Korean city for one hundred days. Second, setting the ratio from 0.1 to 0.9 in 0.1 steps, the eight sizing values are only optimized to validate the optimization result attained with the proposed approach. The optimization result, including sizing values and the fuel cell ratio in a hybrid system, minimizes the cost function, which reduces the cost for the power plants' construction.
Several papers have considered the optimization problem for the size of the hybrid energy scheme. In [2], a metaheuristic algorithm (Cuckoo Search) was presented to solve the hybrid energy system optimization problem of photovoltaic and wind batteries. Artificial intelligence methods [3] and computational intelligence algorithms [4] were proposed for the hybrid energy system of renewable energies such as wind and solar energy. Another optimization method of renewable energy resources is the stochastic technique [5]. An alternative hybrid-system model was proposed to meet any energy needs of a single-family house, including utility and transportation [6]. Mahmoudi, Maleki, and Ochbelagh gave the optimal ratio size of the solar and wind energy under the load demand based on integrating a fuzzy logic controller and harmony search algorithm [7]. We refer to [8] for a comprehensive review of the fuel cell stack, for example, the polymer electrolyte membrane and the proton exchange membrane-based fuel cell, and assess its potential in the fuel cell [9]. Several recent studies for diverse electric fuel cell vehicles using hybrid energy storage have been presented. The electric motor requires a dynamic power demand, which optimally combines the fuel cell system with hybrid energy storage systems, batteries, and ultracapacitors [10]. Recent works have focused on achieving stable battery charge sustenance for the energy management of a fuel cell hybrid vehicle [11].
The univariate dynamic encoding algorithm for searches (uDEAS), which the authors developed, executes optimization on binary matrix-like structures and produces precise optimization results for only real-value problems with the shortest optimization runtime [1, [12][13][14]. The decoding function of this approach is modified to ensure its effective application in solving integer or mixed-integer problems. The ability of the uDEAS was verified using well-known benchmark functions and various engineering applications, and the authors also proved the global convergence of the uDEAS [12]. Therefore, the performance comparison and convergence proof of the cDEAS is redundant, so it is omitted in this study.
In Section 2, we employ the energy hub concept to present the formulated mathematical approaches used to optimize the hybrid energy system associated with this study. In Section 3, we explain the search principle of the proposed optimization method, cDEAS. In Section 4, we apply the cDEAS to the optimal design of the solar/fuel cell hybrid system, after which we discuss the optimization results. In Section 5, we present the summaries, conclusions, and directions for future research associated with this study.

Hybrid System Modeling
The hybrid energy storage system used in this study comprises grid-powered, solarcell-powered, and fuel-cell-powered energy sources, as depicted in Figure 1. An energy hub is defined as an interface among energy producers, consumers, and the transportation infrastructure comprising three essential elements: direct connections, converters, and storage [15]. Figure 1 is converted into Figure 2 as a block diagram through these concepts.  As shown in Figure 2, P U , P S , and P F denote the hub elements of national electricity power, solar cell power, and fuel cell power, respectively. Considering the energy hub inputs P, the converter coupling matrix C, and the outputs L, we can derive the complete hub energy model as follows [16]: Here η DC and η AC represent the efficiencies of the DC and AC converters, respectively. Next, we define the storage coupling matrix S and the storage energy derivativeĖ to describe how changes in the storage energy derivatives affect the hub output flows: where Q B S and Q B F represent the power exchange between the solar cell and the fuel cell, which varies within the following boundaries of charging (ch) and discharging (dis): where Q B S ,ch and Q B F ,ch represent the limit charging rates, and Q B S ,dis and Q B F ,dis are limit discharging rates of solar cell and fuel cell, respectively. The storage energy derivatives in Equation (1) are defined as follows: whose values have the following limits: where E B S and E B F represent the sizes of solar cell and fuel cell batteries, respectively.

cDEAS
In this section, we explain the cDEAS, a novel global optimization method that comprises local and global search schemes and can be applied to solve mixed-integer problems. Each optimization variable of the cDEAS is expressed as a binary string, and they are stacked to create a matrix. If the number of the optimization variables is n, then a binary pseudo-matrix M is generated, and it is expressed as follows: where the row vector r i represents the i-th binary string, a ij denotes the (i, j) element of the matrix, and i represents the bit length of the r i string. As the cDEAS progressively conducts the optimization process, some binary string lengths become different from others. Because of this, we call M a pseudo-matrix.

Local Search
The cDEAS involves a session comprising a single bisectional search (BSS) and multiple unidirectional searches (UDS). In BSS, 0 or 1 is inserted in the right of each binary string as a new least-significant bit (LSB). On the other hand, only BSS remains on one side, and the search cannot escape from one branch. We use UDS to overcome this, which compares the branches' values (see Figures 3 and 4).  The BSS is implemented by the attachment of 0 or 1 to a binary string to generate a new LSB of a binary string, thereby decreasing or increasing its decoded real value from that of the original binary string [1]. To decode an m-bit-long binary string to a real value between λ and µ, we use the following function with an unbiased property [12]: For the cDEAS to decode an integer variable, only the decoding function presented in Equation (3) must be modified, as follows: where m 0 represents the minimum row length, whose maximum base-2 decoded value is more significant than the search range of an integer optimization variable. For example, if the search range of an integer variable is set as [−2, 13], then λ is −2, and the integral search range is 15. Therefore, m 0 is set at four because 2 4 − 1 = 15 means four bits are enough to cover the search range. The exponent of four can be calculated by logarithmic function, such as log 2 (13 − (−2)) . The first equation in Equation (4) is used until the current row length is smaller than m 0 , and the second one, the general base-2 decoding function, is used for the case in which the current row length becomes identical to m 0 . Figure 3 shows a tree structure of binary strings and their integer values decoded between 0 and 15 through Equation (4) for the reader's comprehension. The increase and decrease in the relationships between the decoded integers of the parent and child strings are therefore maintained. Figure 4 illustrates two successive sessions beginning from the string 0 for the problem whose local minimum is located at 101, which is presented to explain BSS and UDS. In the figure, BSS begins with the string 0 and generates its child strings 00 and 01. It then decodes them into real or integer values and calculates their cost values using decoded values. After comparing the two cost values, BSS decides that adding 1 (increase) results in an improved solution, after which it hands it over to UDS. Therefore, BSS demonstrates dual effects on the exploitation by increasing search variable resolution and determining promising search directions.
As shown in Figure 4, UDS is used for exploration between sub-branches, such as 01 → 10 → 11, until it finds a better point that has a lower cost value. Because the decoded value of string 11 has a a worse cost value than that of 10, UDS stops, and the current session finishes. Then, the next session starts with the best string chosen in the previous session, 10, and iterates the same procedure of single BSS and multiple UDS. After verifying the first UDS result, cDEAS concludes that the best point obtained after the two local sessions is string 101. Because the local search conducted using only BSS keeps going down from where the search begins, UDS jumps between adjacent sub-trees to resolve this search-scope limitation problem.
For a multi-dimensional problem, the cDEAS adds up the n strings to build a matrix of n rows with binary entries, whereas the genetic algorithm (GA) puts the strings together into a long-connected series such as a single chromosome [17]. Matrices with binary entries are more accessible to be dealt with and more intuitive than the connected string made by GA. The complete steps of the cDEAS for an n-variables problem can be described as follows: (1) cDEAS starts with a randomly chosen initial matrix A 1 with 0 or 1 entries and puts i = 1. (2) Step BSS. For given natural numbers n and i, we set the row index j (j = 1, 2, . . . , n) so that i = kn + j for some integer k. With this j, and from the current matrix A i , we choose the jth row (3) cDEAS inserts 1 or 0 into the right of the selected row, which gives two types of row vectors: (4) cDEAS decodes row + j (A i ) and row − j (A i ) using the function f R (row ± j (A i ), λ j , µ j ) defined in Euqation (3) (λ j and µ j are the lower and upper bound of the jth variable, respectively) or the function f B (row ± j (A i ), λ j ) defined in Equation (4) depending on the variable type, and substitute them with the corresponding jth entry of the current best vector v * i , which gives two types vectors, v + i and v − i . Next, cDEAS computes , then the direction is set δ(j) = +1, and otherwise, δ(j) = −1. We then load the improved new vector v * i . (5) Step UDS. Depending on the direction δ(j) = ±1, sDEAS repeats the following addition or subtraction to the binary string and check whether the cost value has been decreased. This operation is iterated until there is no more cost reduction.
Plug the resulting best binary string into a pseudo-matrix: As a result, cDEAS obtains the following change in the corresponding decoded vector: (8) Let i = i + 1, and go back to Step 2. Repeat these steps until the row length size attains the maximum size.
To see how cDEAS works in reality, we include a three-dimensional optimization example. Figure 5 shows a session of the cDEAS for a three-dimension case, and the starting matrix is  Consequently, an optimal solution is obtained after complete steps.

Global Search
For global search, the cDEAS adopts an escaping scheme called RESTART CHECK as a simple multi-start strategy, which is exactly stated as follows: If the row length of a current best matrix equals rowIndRestart and its cost is higher than costIndRestart, stop searching and start from a new random initial matrix whose row length is optInitRowLen. Otherwise, continue the current search.
We thereby obtain the multi-start indices rowIndRestart, costIndRestart, and optIni-tRowLen through a figure plotting after executing several local searches by varying initial row lengths, which is called a preparatory search. Here, rowIndRestart is the minimal row length, costIndRestart is an approximately intermediate value between the best and the second-best group of local minima, and optInitRowLen is an optimal initial row length.
The preparatory search using the cDEAS helps to determine the appropriate values of the three indices through a single experiment and informs the shape of the cost function of the problem. Figure 6 shows how the three indices are selected intuitively through several restarts for the well-known Goldstein-Price function [17]. During the operation of the cDEAS, the user can skip the preparatory search and execute the main search directly. Here, the optInitRowLen is fixed to a single length, and costIndRestart is automatically updated using the best-so-far cost value recorded when the row length of the current best matrix is rowIndRestart.
cDEAS repeats the local search routine numMaxRestart times for multi-start and regards the local minimum discovered so far as a global minimum (numMaxRestart is a pre-assigned number). We can describe the entire procedure of the searches in the execution of the cDEAS in Algorithm 1 (see also [1]).
In Algorithm 1, the initial row length is denoted by irl, and inside the multi-start loop, the final row length is denoted by frl. In particular, irl moves from 1 to 3 in the preparatory search, whereas iLen1 =iLen2 =optInitRowLen in the main search.  Choose a randomly generated initial matrix with binary entries 4: Run HISTORY CHECK for 5: for m = 1: numMaxRestart do 6: for k =irl:frl do frl is assigned by the user 7: T n×(k+1) = Session(T n×k )

Optimization Result
In this section, the sizing of the solar cell and fuel cell hybrid system is optimized using the proposed cDEAS. Therefore, nine optimization variables are selected, and their search ranges are listed in Table 1. The current hybrid energy system employs an adjustment strategy involving the charging/discharging ratio between fuel cell energy and solar cell energy explained in pseudocode (see Algorithm 2). Algorithm 2 Optimization of the current hybrid energy system 1: Initialize optimization variables and cost values 2: J dis = 0, J bnd = 0 3: for i = 1 : n sample do 4: P U (i) = P U , P F (i) = P F , P S (i) = P solar 5: L r : daily load 6: if P d (i) ≥ 0 then in case of excessive hybrid power supply to load 7: else in case of insufficient hybrid power supply 10: e B S (i) = 1/η B S ,dis , e B F (i) = 1/η B F ,dis 11: end if 13: Integrate E B S (i) and E B F (i) 16: Set J out _ bnd = 1000 for adding the penalty score to the cost function when the power exchange values and stored energy values are out of boundaries 17: if Q B S (i) > Q B S ,ch or Q B S (i) < −Q B S ,dis then 18: calculate supply voltage at load 32: (4) of Algorithm 2 represents the solar-cell power measured in Yechengun, a Korean city, for one hundred days. Figure 7 shows the solar-power data used to optimize the current hybrid energy system. P d in line (5) of Algorithm 2 denotes the discrepancy between load power and total input power transmitted without charge or discharge, which is used for power system management. For excessive and insufficient power supplies, Q B F is charged or discharged to take the r F fraction of P d , as shown in Equations (8) and (11) of Algorithm 2. Next, the remainder of P d is assigned to Q B S , and L r in the line (5) of Algorithm 2 represents the one-hundred-day load for the residential sector in Incheon, a Korean city (see Figure 8).  The aim of the current element-sizing optimization approach is three-fold. First, the discrepancy between the power supply and the load should be zero during the entire simulation time, as expressed in Equation (32) of Algorithm 2. Second, the manufacturing cost should be as small as possible, as shown in Equation (34) of Algorithm 2, and third, the power exchange values and stored energy values should vary within their limits, as described in Equation (18) of Algorithm 2. Because the third one corresponds to a constraint condition, a significant penalty value of 1000 is added to J bnd whenever the values are out of bounds during each sample time. As shown in Equation (34) of Algorithm 2, the five coefficients are related to the storage element costs, and their values are listed in Table 2 [16]. As shown in Equation (35) of Algorithm 2, all three cost values are added, and the optimization variables that minimize J total the most represent the global minimum variable. Depending on the importance of the cost, the weight factor, e.g., 100, is multiplied by each cost, , e.g., J dis , as shown in Equation (35) of Algorithm 2. The search parameters for the cDEAS main search are configured after the initial trials as follows:
numMaxRestart := 100 Figure 9 shows the cost function profiles obtained through the cDEAS after 100 restarts using the configurations mentioned above. As shown in the figure, there are at least fifteen local minima, meaning that the cost landscape of the current problem has a significantly rough surface. Additionally, the minimization progress seems to mature after 10 bits in terms of the row length of the binary matrix. This is why the value of rowIndexRestart is set to 10.  Figure 9 shows the cost function profiles obtained through the cDEAS after 100 restarts using the configurations mentioned above for both distribution rules. As shown in the figure, there are at least fifteen local minima, meaning that the cost landscape of the current problem has a significantly rough surface. Additionally, the minimization progress seems to mature after 10 bits in terms of the row length of the binary matrix. This is why the value of rowIndexRestart is set to 10. Table 3 lists the optimal variables attained by the cDEAS whose cost value is 1785.2. Figure 10 shows that the exchange charge and storage energy profiles simulated with the optimal variables where all the four quantities, Q B S , E B S , Q B F , and E B F , remain inside their boundaries during the 100-day period. Figure 11 validates that the energy supplied by the optimized hybrid system and load of the residential sector match precisely without error.  To check the accuracy and effectiveness of the proposed design approach for the hybrid energy system, we carry out additional optimal design experiments by optimization with fixed and various fuel cell ratios r F from 0.1 to 0.9 in 0.1 steps. In this case, the number of optimization variables is reduced to eight cases, excluding r F from the variables in Table 1. Table 4 lists the optimization results, and it is apparent that in the case of 0.5 for r F , the global minimum value has the lowest cost function value. This result supports the notion that the r F of 0.46 is optimal, as shown in Table 3.
For comparison of design efficiency of the proposed approach, cost improvement for each r F is calculated concerning the cost value when r F is 0.46, i.e., 1785.2. The average cost improvement is 19.35%, and its maximum and minimum percentages are when r F s are 0.1 and 0.5, respectively (see Table 5). This drastic decrease in construction cost validates the superiority of the proposed optimization method, cDEAS, and the strategy of employing a concept of an optimal charging/discharging ratio between fuel cell power and solar cell power.

Conclusions
In this study, we use a newly developed optimization algorithm called cDEAS to optimize an energy hub system model comprising three power sources, i.e., solar power, fuel cell, and power utility. We achieved optimization through the idea of the distribution of the total surplus/shortage of two fuel cell and solar cell batteries, and we successfully derived an optimal solution set that satisfies all conditions in both cases. As a result, because the ratio of fuel-cell power and solar power was optimized to 0.46:0.54, there was an average cost-reduction effect of 19.35% compared to the cases in which r F varies from 0.1 to 0.9 in 0.1 steps.
For practical applications, we used the actual data for the solar cell power and the load of the residential sector in one Korean city for 100 days, and hence this optimization method can be applied directly to any place. As mentioned in [18], the power-sharing of hybridization from diverse sources is connected to the properties of power sources and the demanding load. Hence, we can decide the size of each power plant by determining the exact distribution of renewable powers (for example, solar and fuel cell powers) according to the load characteristics. The resulting optimal cost of such hybrid power plant is compared with the equivalent solar and fuel cell systems, showing improvements in investment costs of 19.35% on average.
In our future studies, we shall add realistic factors to the cost function, and we shall elaborate a strategy for ensuring the effective distribution of the charge/discharge amounts of solar/fuel cell batteries. We shall also ensure the improved optimization of such energy sources using the cDEAS. We expect to apply our proposed approach to the improved design of cost-effective hybrid energy systems.  Data Availability Statement: Publicly available datasets were analyzed in this study. This data can be found here: https://www.data.go.kr/.

Conflicts of Interest:
The authors declare no conflict of interest.