Modeling and simulation of a small-scale hybrid energy system using genetic algorithm for Yolan-Bayara Village, Bauchi State

To mitigate the downsides of conventional energy generation systems, such as contaminants in the air and the release of greenhouse gases that contribute to environmental degradation, hybrid energy systems (HES) are absolutely essential for revitalizing areas that are rural or remote to obtain favorable technical and economic benefits. It is very difficult to establish a hybrid energy system's ideal size while still trying to meet the reliability requirements and consumer demands for electricity for powering their homes, schools, hospital, and businesses. Using a Genetic Algorithm (GA) optimization approach, this abstract describes a study on the modeling and simulation of a small-scale hybrid system that integrates renewable energy sources with energy storage for Yolan-Bayara village Bauchi state. Photovoltaic (PV) panels, wind turbines, and a battery storage system make up the system. The battery storage system enables energy storage and retrieval when necessary, while the PV panels and wind turbines generate sporadic electricity. A mathematical model is created that includes several system parameters, such as environmental factors, and energy demand profiles in order to arrive at the best sizing approach. However, conventional optimization approaches may have trouble locating the overall optimal solution due to the complexity of the system and the uncertainty surrounding renewable energy sources. A Genetic Algorithm is used to solve this problem. To ensure effective energy use and low operating costs, the GA successfully adjusts the control settings to changing environmental circumstances and energy demand profiles. The outcomes show how GA-based optimization methods can improve the functionality and financial viability of small-scale hybrid systems. Such technologies could be extremely important for promoting green energy options and reducing climate change.


Introduction
In power engineering, multiple energy production, preservation, and conversion approaches are merged into integrated energy systems through physical construction or through a unified management framework with the goal to help save money, boost functionality, comparable to the other possibilities in terms of values, utility, or environmental performance [1]. For power sector plants looking to improve their flexibility, maximize profits, or develop other useful products, hybridization is an alluring solution. Integrated hybrid energy systems' enhanced adaptability will hasten the addition of more integrated energy sources into the grid, to meet the 2035 zero-carbon grid goal in the world [2]. Photovoltaic panels, wind turbines, and other generator types like diesel, gas, and gasoline are employed as generators of electricity in integrated energy systems. An integrated energy system blends an energy source that is renewable to offer a steady supply of electricity such as solar PV cells, with a backup type of generator, a wind turbine, fuel cell, or battery storage system.
Yolan-Bayara village is located in the Northeast part of Nigeria, Bauchi state to be precise with latitude 10.43362° and longitude 8.77595° and this village has a high potential for solar and wind energy. Yolan-Bayara comprises a church, a mosque, a small health care center, a school, and houses. The dwellers of this village depend more on agriculture and livestock farming as a major means of earning with no access to electricity. The villagers use firewood as their source of energy with only a few using generators. We obtained information about Yolan-Bayara village, such as the load profile that the system should be able to handle, in order to model a power system for the village. These details include: solar radiation for Photovoltaic generation (solar resource availability), wind speed for wind power generation (wind resource availability), cost for each component (renewable energy generators, batteries, converters, etc.
The Integrated Energy System setup for Yolan-Bayara village consists of wind energy sources, photovoltaic array, battery storage, load, and an inverter for converting direct current energy sources to alternating current energy and a controller. The two principal energy sources are Solar Photovoltaic arrays and wind. Solar Photovoltaic arrays and wind power may not be able to provide the needed energy in a sufficient manner, hence the need for battery storage. The wind turbine is linked with the AC side of the bus bar, whilst the solar photovoltaic cells and battery storage are attached to the DC side of the bus bar. Figure 1 shows the setup of the proposed Integrated Energy System.  [3] Provided a cost-effective grid-connected hybrid power system for usage in rural areas using Homer software. The dynamic interactions between various components and their control mechanisms were not sufficiently captured. One of the most advanced RES are solar, hydro, and wind energy systems, which come with diesel generators and are frequently utilized in stand-alone and grid-connected applications. The sizing tool does system dimensioning, determining the ideal size for each of the many system components based on an energy need. 40% of the overall energy loss. [4] Developed a mixed integer linear programming model to optimize the size of the hybrid system and minimize the total life cost of a greenhouse farm. This work did not take into account demand uncertainty and system performance uncertainty for a reliable system that can handle different types of uncertainties. [5], and [6], evaluated the sustainability of off-grid Integrated Energy Setups in different countries using HOMER, HOMER Pro, and RAPSIM. This simulation software was very easy to use but had the limitation of not being able to select appropriate components without tedious calculations. Also, the algorithm and calculations are not accessible for viewing. [7] And [8], considered using Grey Wolf Optimization for ideal sizing of a hybrid system for the continuous power being provided to several homes of a collection of towns. The limitation is that the algorithm's performance tends to deteriorate as the size of the system increases which can lead to longer computation time and less accurate solutions.

Literature review
[9] Applied a hybrid genetic algorithm with particle swarm optimization (GA-PSO) for optimal sizing of an off-grid house with photovoltaic panels, wind turbines, and battery. This algorithm solves enhancement problems considering all objectives without transferring them. (Yang et al, 2023), This work used the Improved Artificial Ecosystem-based Optimization to analyze meteorological data from Kuala Lumpur, Malaysia, and construct a Hybrid Photovoltaic/Fuel Cell energy system based on hydrogen storage to handle the annual complicated Load.

Modeling of Photovoltaic system
The PV system has been modeled in terms of an equivalent circuit. The PV cell output current is represented by a non-linear mathematical exponential expression below Where is the output voltage of the photovoltaic cell, is the series resistance, is the parallel resistance, is the voltage across the diode, is the thermal voltage across the diode, an is the ideal diode constant (taken to be 1 = 1), and 1 diodes' saturation current.
The photovoltaic current due to irradiation is given by Where is for Standard Test Condition Temperature (298 K), and for Standard Test Condition Photovoltaic Current G = Solar radiation, = Solar irradiance at (= 1000 W/m2), = Ambient temperature, Ks = Shortcircuit current coefficient. The ideal diode model is shown in figure 2 below.

Stage-building for solar system
Solar photovoltaic (PV) system produces electrical energy output by converting solar irradiance and temperature on the solar cells. The output of a solar PV panel is a DC (between 32V to 38V) that varies in time with varying solar irradiance and the temperature. However, the appliances we need to power require stable pure sine wave 250 V-ac. Our solar must therefore be able to fulfill the following: The output voltage is low and requires to be stepped up by techniques such as a DC-DC converter.
The output is DC and has to be converted is by an inverter. The output of the inverter is pulsating AC and should be converted to pure sine wave by low pass filter. Figure 3 below shows the solar power generation process.

Figure 3 Solar power generation
To obtain efficient voltage and sufficient current level, a number of PV units are formed into an array of series, parallel or series-parallel combination. By having the complete solar system set-up, the most important terminal or output parameters to start the design of the system are the output power , maximum output voltage and the maximum output current . Consider the model for the PV solar panels in Figure 4: Series-parallel connection of solar PV panel Source: (AsoboLife)

The Storage System Modeling
Any renewable energy system must have a storage system. The weather conditions prevent the regular availability of sustainable resource-produced power. As a result, the energy storage system is employed to provide the missing power. The state of charge (SOC) of the battery depends on the sustainable energy resources produced power and can be calculated using • Charging state • Discharging mode Where ( ) is the total generated power, EL(t) is the total load demand, ⨅inv is the inverter efficiency, σ selfdischarging factor, and ⨅battery is the battery bank charge efficiency. The SOC (t) value must not be less than a minimum allowable energy point and be kept in the battery bank ( ). While charging operation is going on, the value of SOC (t) more than the maximum permissible energy point ( ) shouldn't be allowed. This can be expressed mathematically as: The maximum charge state, corresponds to the actual capacity of the battery bank, CBatt, and the minimum charge state, SOCmin, is based on the level of discharge of the battery bank, DOD: SOCmin = (1 − DOD) CBatt.

Modeling of Wind Turbine
The wind speed varies between 8m/s to 15 m/s in Yolan-Bayara village. This variation depends on the geographical location of deployment. This makes the output of wind turbines highly variable and stochastic usually modeled by Weibull distribution. The mechanical power output generated in watts (W) is given in the equation below.
where the following parameters in Eq. (7) are defined as follows: is the Air density (Kg/ 2 ), ( , ) is the Performance coefficient of wind turbine, is the area swept ( 2 ), is the wind speed (m/s), is the tip speed ratio and is the blade pitch angle. The constants in Eq. (8) are defined by Equation (9) to (10).
A close approximation to the model provided by Eq. (9) to (11) can be achieved by a wind turbine model with power characteristics in Figure 4. The performance coefficient of the turbine is the mechanical output power of the turbine divided by wind power and a function of wind speed , rotational speed , and a pitch angle . Cp reaches its maximum value at = 0. Figure 5 shows the block schematic for the wind power generation.

Figure 5 Wind power generation
The wind turbine output which is mechanical torque is used to drive a synchronous machine to generate AC output, but because the synchronous generator's output is AC, an inverter is used for conversion into DC which is passed to DC-DC converter to boost to voltage. Parameter used for the simulation of For 5 kW wind turbine: The parameters for DC-DC converter are given in Table1 below:

Model of PMSG Generator
Most manufacturers choose the PMSG wind turbine with a voltage source converter (VSC) because it is more dependable and efficient. Its benefits over a doubly fed induction generator (DFIG) are gearless construction, the capacity to capture the most wind energy, and the lack of a dc excitation mechanism. There is provided a condensed PMSG comparable circuit d -q coordinate frame model.
The generator is modeled in d-q coordinates, where equations (12) and (13) provide the current equations for the d and q axes, respectively, while equation. (14) Specifies the electromagnetic torque in the rotor, Where , and + , represents the d-aixs and q-axis voltage and current. In figure 6, a simplified d-q coordinate frame is shown. All the parameters for turbine model are given in Table 2.

DC-DC Boost Converter
The boost converter circuit can provide a sufficient voltage at the output side for a micro grid that uses photovoltaic (PV) systems and wind energy, which are known to have the lowest voltage output. High efficiency, simple control, and integration are perks of boost converters. The dc input voltage, Main switch, Coupled inductor and , Clamp diode 1 , Clamp capacitor 1 , Two capacitors 2 and 3 , Two diodes 0 , and Output capacitor are used in the enhance dc-dc boost converter. Coupled inductors includes magnetizing inductor , leaky inductor , and an ideal transformer is shown in Figure 7.
The following presumptions are made when conducting a circuit analysis. The capacitance of capacitors 1 , 2 3 4 and 0 is adequate. In one switching period, 1 2 , 3 , 4 , and 0 are therefore regarded as constants. Power devices are perfect, but the power switch's parasitic capacitor is taken into consideration and the turn ratio of the coupled inductor n is equal to / , while the coupling co-efficient of the coupled inductor K is equal to / ( + ).

Energy Management Strategy
The fundamental assurance for a hybrid energy system's cost-effective functioning is energy management. The modeling of a small-scale hybrid energy system for Yolan-Bayara village must meet certain requirements, such as maximizing the utilization of energy from renewable sources, ensuring steady supply of electricity, and lowering fuel consumption and pollutant emissions, among others. The research work will be founded on the ideas of clean energy and sustainable development. The suggested energy management plan is as follows:  Case 1: When power production from sustainable energy sources is sufficient to meet demand and load. The surplus power generated will charge the BSS if it isn't already completely charged.  Case 2: When power produced from sustainable energy sources is sufficient to meet demand and load. Output from the renewable energy will be scaled back to fit the load if the BSS is completely charged.  Case 3: Power produced from sustainable energy sources is not enough to meet demand. BSS will discharge in order to reach the load requirement if it is available at this moment.

Probability of Power Supply Loss
One of the metrics for statistical dependability which is Probability of Power Supply Loss (LPSP), can be used to calculate the likelihood of power supply failure. Technical issues or insufficient energy supply coming from the power source that cannot satisfy the demand might result in power outages. 0% LPSP demonstrates the non-supply to the load and 1% LPSP demonstrates that the supply to the load. This may be calculated as:

Sustainable Energy Fraction (REF)
As demonstrated below, this is the ratio of energy produced by the diesel engine to energy produced by both the wind and the PV system. The percentage shows how much sustainable energy is provided. An ideal system using exclusively renewable energy sources has a fraction of 100%. 0% is the amount of solar and wind energy that is used in place of diesel power, while the integrated energy source is represented by a fraction between 0% and 100%.

Implementation
A hybrid energy system's primary sizing optimization goal is to provide dependable power at a reasonable price. It has several competing goals, with system investment and reliability being the most prevalent. The optimization's goal is to be able to obtain the lowest possible Energy Cost (COE). The ratio of electricity unit prices to costs is known as the cost of energy.

Concept of Genetic Algorithm
An optimization method called a genetic algorithm (GA) draws its inspiration from the procedure of natural selection. A hybrid energy system, like a photovoltaic-wind hybrid small-scale system, can operate more efficiently with its use. Finding the optimal set of control parameters that maximize system performance while minimizing costs or other objectives is the major objective when utilizing a GA for hybrid energy systems. Figure 8 gives the flowchart of genetic algorithm.

Results and discussion
In light of their potential to increase energy sustainability and lower greenhouse gas emissions, the combination of renewable energy sources and energy storage systems has attracted a lot of interest recently. This chapter presents the simulation findings, data analysis, and performance parameters from the modelling and simulation of a small-scale hybrid system for Yolan-Bayara village. This chapter provides a thorough review of the integration of the major system parameters, environmental factors, and energy demand profiles as well as the ideal set of operating parameters to achieve the system's optimum performance. The performance of GA using selection, crossover and mutation operation to explore the solution space and converge towards the optimal operating cost while minimizing operational cost and maximizing system performance.    Figure 9 shows the power consumption of Yolan-Bayara village. The total power consumption in the case of a village is the average or steady power utilized by all the electrical systems and equipment used there, including lighting, appliances, and electronics over a specific period of one year. This power consumption can vary over time. Secondly, it shows the energy generated over time. The amount of energy produced for the village vary greatly based on a number of variables, including the size of the village, its energy requirements, the resources that are accessible, and the technology employed for energy generation which is solar and wind power. Power is supplied in order for energy to be consumed. The energy is stochastic due to the mean and variance of the wind and solar energy. In Figure 10, the lowpass filter magnitude and phase response are shown which is a fairly linear response. The low-pass filter's magnitude response demonstrates how the filter alters the amplitude (strength) of various frequencies. The magnitude response for a linear low-pass filter is fairly flat for low-frequency components and gradually rolls off for higher frequencies. The linear low-pass filter's phase response is virtually constant or varies smoothly across a range of frequencies, which shows that the filter does not contribute large time delays to the signal's various frequency components. The low-pass filter used in this work is the Butterworth filter. The Butterworth filter can be made to provide a nearly linear phase response as well as a maximally flat magnitude response in the pass band. Figure 11 is the filtered power and energy generated which show the real implementation of the work. The power output from a power source that has been filtered to remove harmonic distortions or other electrical noise can be described in this figure. In order to enhance power quality and guarantee that the electricity provided to consumers is reliable and clean, filters are frequently utilized in power systems. Figures 12 represents the wind power generated, the cumulative wind power generated and the pole zero plot. Wind availability determines how much energy can be produced by wind. Due to seasonal and daily variations in wind speed, wind turbines cannot always produce power at their rated capacity. Long-term wind speed data and statistical analysis was used for a more precise estimation of the energy output over time in figures 12. The pole zero plot helps to see the stability of the filter. From the plot, it is marginally stable because it is lying at the boundary of the circle. The voltage across each phase of a balanced three-phase system is shown in Figure 13. The voltages in a balanced system have equal magnitudes and a 120-degree phase difference between each other. The current flowing through a balanced three-phase electrical load is also shown in figure 28 and is known as the three-phase load current. The load currents in a balanced system have equal magnitudes but are phased differently by 120 degrees from one another. The threephase real power (P) in figure 13 is the active power consumed or generated by the three-phase electrical load. It represents the actual power used to perform useful work. Since it is a balanced system, the total real power is the sum of the real power in each phase. Figures   By optimizing the orientation, tilt, and tracking systems of solar panels, more sunlight is captured throughout the day, resulting in higher energy output, especially during the sun's peak hours. This increases the solar energy system's overall efficiency and maximizes the amount of energy that can be extracted from the solar resource. Optimizing the wind power provides a smoother power production profiles which can also lessen the intermittent nature of wind energy. This improves integrated system stability and makes it easier to integrate into the electrical system.

Figure 15 Accumulated Energy Generated
From figure 15 solar generation is typically stronger during the day while wind generation is frequently stronger at night or during cloudy conditions, solar and wind power complement one another. The system balances the intermittent character of each source by merging them, leading to a more reliable energy supply. This also increases the reliability of the Hybrid Energy System. Figure 16 is a comparison between the Optimized and unoptimized wind energy. In comparison to unoptimized systems, optimized wind power systems captures more wind energy and produce more power. The system increases the amount of energy it can produce from the available wind resource by using advanced control algorithms, pitch and speed management, and optimal turbine positioning. A higher percentage of wind energy is converted into electricity thanks to optimization, which enables wind turbines to run at their highest efficiency. Systems that are not optimized may be unable to utilize the available wind resources to their full potential, leading to decreased efficiency and energy losses.

Figure 16 Cumulative Wind Energy Consumed for Optimized and Unoptimized Energy
Site-specific elements including sun irradiation, shading, and regional climate are taken into account during optimization. The system is configured to maximize energy production at the specified area while making the best use of the available resources. More steady and predictable power output profiles are provided by optimized solar power systems A crucial component of the genetic algorithm is the fitness function. It assesses each individual's performance (a potential solution represented by a set of parameters) and assigns a fitness value. In figure 18, the population of viable solutions was iteratively evolved by the genetic algorithm throughout the optimization process, honing and improving them over generations. The best fitness shows that the solutions approaches the optimal or nearly optimal solution for this particular optimization issue. The convergence of the solutions to the ideal solution is also demonstrated by the mean fitness. The mean fitness which is largely consistent signify that the algorithm is nearing a convergence point or locating a local optimum.
The irradiance of photovoltaic energy decreases by 15% during 2 seconds. The load that needs to be met is 5kW for the majority of the time, except for every 4 to 5 seconds when it climbs to 6kW.
Wind turbines start out rotating at 5 m/s, but after 0.5 seconds, they slow down to a base speed of 12 m/s and then 25% of that speed. The maximum voltage of the photovoltaic array is approximately 640V. The following graph illustrates how the fluctuating irradiance explains the variable maximum voltage. The output from wind and solar power systems was converted into alternating current power output using an inverter. The combination of a wind energy system, photovoltaic energy systems, and batteries was able to meet the load requirement.
The circuit breakers were utilized to connect a 5kW additional load within a predetermined time frame. The hybrid was managed to deliver the highest output power possible to satisfy load demand under all operating circumstances. The battery supported the single operation of the wind system, the single operation of the solar system, and the single operation of the photovoltaic system.

Conclusion
From the results obtained, it can be concluded that, the modelling and simulation of a small-scale hybrid energy system utilizing a Genetic Algorithm optimization approach showed the efficiency of the approach in obtaining optimal control and enhancing system performance. The findings lend support to the design and operation of small-scale hybrid energy systems for environmentally friendly and economically advantageous energy production. The outcomes further showed that the GA-based optimization strategy offered adaptability to changing environmental factors and dynamic variations in energy consumption. Based on real-time data, the control strategy continuously modified the system's operation to ensure optimal energy generation and storage. Small-scale hybrid energy systems need to be adaptable in order to be able to respond to changes in the supply and demand for energy.