*3.3. Objective Function*

The objective function in this study was selected to be the cost of energy of the penetrated system (COEPS) to reflect the price of the energy supplied by the on-grid hybrid wind hydropower system, as designed and sized to cover the load demand shown in Figure 3. It was computed by dividing the system's cost by the system's absorbed energy, as shown in Equation (15) [26].

$$COE\_{PS} = \frac{System's\text{ cost}}{System's\text{ absorbed energy}} \tag{15}$$

The system cost was computed by first constructing nominal and discounted cost cash flows for the project lifetime, i.e., 50 years. The nominal cash flow included the capital cost (CC), the replacement cost [22], the operation and maintenance cost (OMC), and the salvage cost (SC). These costs were discounted for the present in the discounted cash flow that represented the total current cost (TCC) of the renewable power system. The system cost calculation criteria are described in detail in [26]. The wind farm financial parameters are described in detail in [12]. The cost parameters of the PHS station are given in Table 1. The cost of the energy from the utility grid had the last priority to satisfy the load demand.

Thus, an economic comparison with one hour time steps was done to satisfy the load demand in Figure 3. However, there were priorities built into the design code to satisfy the load demand; the wind farm first, then the PHS plant, and, lastly, the necessity to purchase energy from the grid if the load was still not satisfied. Moreover, the number of wind turbines (WTs) was computed based on the rated power, as shown Figure 5.

### *3.4. Indicators of the Objective Function*

There are technical, economic, and environmental indicators that were computed based on the optimal value of the COEPS. These included the wind and hydro fraction (*WHf*), as shown in Equation (16), and carbon dioxide emissions (ECO2).

$$\% \text{NH}\_f = \frac{\text{Renevable generation}}{\text{System's absorbed energy}} \tag{16}$$

The ECO2 was computed by summing up the hourly multiplied grid energy purchases with a grid emission factor of 583.866667 gCO2/Wh.

### **4. Optimization Toolbox of Matlab**

The optimization toolbox in Matlab is a collection of functions that implement Matlab's numerical capability and computing environment. This toolbox provides functions to find parameters which minimize or maximize objectives to satisfy specific constraints. Therefore, the optimal solutions of continuous and discrete problems can be obtained, tradeoff analyses can be achieved, and optimization design tasks can be performed using this toolbox. In addition, parameter estimations and tuning can be done using this toolbox. Moreover, solvers for linear programming (LP), quadratic programming, nonlinear programming (NLP), constrained linear least squares, nonlinear least squares, and nonlinear equations are included in this optimization tool box [27]. In this paper, the genetic algorithm (GA), simulated annealing (SA), and pattern search (PS) optimization methods were used from the Matlab toolbox.

GA, which is a search technique based on a principle of biological genetics and natural selection, allows a composition of many individuals to evolve under specified selection rules to a state that maximizes fitness under a specific objective function.

As a Matlab tool, GA is a powerful tool capable of providing robust approximation for systems that may be subject to uncertainties [28,29]. Its research mechanism consists of the use of candidate solutions represented in a binary form, called chromosomes. Several genetic operators, such as crossover, mutation, and inversion, are used to adapt and fit the generated population of chromosomes in each research step [29].

The flow of the genetic algorithm can be summarized by the following steps [30].


Repeat the last three steps until the stopping criteria has been satisfied, where a certain fixed number of generations is obtained.

In summary, the GA toolbox has four main modules: The optimization problem definition module, the variables setting module, the generation of the initial population module, and the evolution module. These modules interact with each other by exchanging information that enables the operation of the algorithm. Before running the optimization algorithm, it is necessary to characterize the optimization problem. Then, the type and the representation of the variables used by the algorithm must be defined. GA works directly with real variables or with codified variables. Thus, depending on the type of variable defined by the problem and the type of representation used by the GA, there is a necessity for coding/decoding to pass from the actual workspace to the GA workspace.

Moreover, pattern search (PS), i.e., direct search or derivative-free search, is one of the Matlab optimization methods used to optimize functions that are not continuous or di fferentiable. Optimization attempts to find the best-match solution with the lowest error value in a multidimensional analysis space of possibilities [27]. Furthermore, simulated annealing (SA) is a Matlab toolbox method used to solve unconstrained and constrained optimization problems [31,32]. The models of this method simulate the heating process of the materials. At each iteration step of the simulated annealing algorithm, a new point is randomly generated. The distance of the new point from the current point is based on a probability distribution with a scale proportional to the temperature. An annealing schedule is selected to systematically decrease the temperature as the algorithm proceeds. As the temperature decreases, the algorithm extends its search to finally reach an optimal solution. The SA algorithm consists of two main options, namely, "AcceptanceFcn" and "TemperatureFcn". The first option accepts the worst case in order to achieve a global solution for the desired problem. The second option selects the suitable algorithm uses to update the temperature. Two stopping criteria are used for the SA algorithm, which are function tolerance and maximum iterations. In the first criterion, the algorithm runs until the average change in value of the objective function is less than the value of tolerance. In the second criterion, the maximum number of iterations can be determined [27].

### **5. Results and Discussion**

Every component shown in Figure 1 was modeled and coded in Matlab along with the objective function of the cost of energy of penetrated system (COEPS) and the rest of the corresponding indicators. Table 4 shows the results obtained using the GA, SA, and PS solvers. Also, many data corresponding to the optimal value of the COEPS are included in Table 4. The three aforementioned solvers of the Matlab optimization toolbox were selected to solve the problem described in this paper. The SA and PS solvers provided solutions that were 1.27634% and 1.98903% higher than the GA solution, respectively. Therefore, the GA solution was found to be feasible compared with the other solutions.


**Table 4.** Detailed results of the optimized system using genetic algorithm (GA), simulated annealing (SA), and pattern search (PS) algorithms.

The GA solution of 0.0955388 \$/kWh was economically feasible compared with the SA and PS COEPS values. The optimal value of the COEPS, which was found using the GA, is shown in Figure 6. This value was 28.7% less than the energy bought from the conventional electric network, which is an excellent indication for the economic feasibility of this suggested configuration.

**Figure 6.** GA to optimize COEPS.

Further, Figure 7 shows the current best point for the two decision variables found at the optimal value of the objective function.

**Figure 7.** Corresponding decision variables of the optimal configuration.

Note that the area of the wind farm was assumed to be rectangular and was therefore computed by incrementing the odd optimal number by one. Furthermore, the ECO2 in the suggested location was 634.645 kt/year [12], therefore, the emissions were mitigated by 68.66%, assuming that the renewable configuration in Figure 1 was adopted. Also, the geographical area of renewable plants (*ARenewables*) was increased. However, only 48.91% of the geographical area limit was used to install the designed hydro-wind energy system. Thus, the rest of the area (51.09%) could be used in the future as load demand and the system size grow.

The discounted payback period (DPP) is frequently used in renewable energy studies to find the length of time needed to retrieve the initial investment [33–35]. This was done in this paper by building the cumulative cash flow (CCF), as shown in Table 5. Note that the present value factor (PVF), cash flow (CF), and the corresponding discounted cost values (CFdiscounted) were calculated. The CF in Table 5 included the total cost found before in Table 4 using GA, and the energy savings of the renewable energy system. These energy savings were computed by multiplying the yearly renewable generation (436.438 GWh) by the energy purchased price of electric utilities in Jordan. Afterward, the CCF values were computed by cumulatively adding the discounted cost values. Then, the time to ge<sup>t</sup> back the total cost value was calculated using Equation (17). Note that Table 5 shows only 15 years of the 50-year project life-time, because the aim was to obtain a positive cost value from the CCF, which was held at the 11th year. This was just before the time when the total cost was retrieved. Table 5 shows that the DPP was computed to be around 10.271 years (10 years, 3 months, and 7 days).

$$DPP = n\_l + \frac{\left| \text{CCF} \left( n\_l \right) \right|}{\text{CF}\_{disround} \left( n\_l + 1 \right)} \tag{17}$$

where *nl* is the year number at the last negative cost value of the CCF.


**Table 5.** Calculation of the discounted payback period.

The study performed in this paper, after adding the hydro storage system, was compared to a previously studied scenario in [12] for a wind-only system connected to the utility grid at the same location. Table 6 shows the percentage increase/decrease for the parameters computed in Table 4. For the wind–hydro on-grid system, the COEPS and the grid purchases were reduced by 16.93% and 24.68%, respectively, showing the importance of the storage system for wind power that fluctuates naturally. These cost and emissions reductions are significant, especially for non-oil producing countries, such as Jordan, which imports around 96% of its energy needs as oil and natural gas. The carbon emissions reduction was improved compared with the wind-only system. Furthermore, renewable penetration increased by 56.64% as a result of adding the PHS system, resulting in a more environmentally friendly power system.

**Parameter Percentage Increase (**+**) or Decrease (**−**) in %** COEPS −12.26 ECO2 −24.69 COERenewables −1.52 Number of WTs +104.35 *ARenewables* (max) +71.14 *ARenewables* (min) +21.79 Total cost +110.83 WHf +56.64 Grid purchases cost −24.69 Gridenergypurchases −24.68

**Table 6.** On-grid wind farm with/without PHS comparison.
