1. Introduction
Energy is vital for enhancing human welfare, promoting economic advancement, and stimulating economic prosperity [
1]. It is commonly recognized that energy is the benchmark for measuring economic growth and improving everyone’s living level [
2]. In contemporary society, energy ranks alongside fundamental human needs such as food, clothing, and shelter. It exerts both positive and negative influences on humanity. From a utility perspective, energy facilitates the alleviation of arduous tasks by providing convenient access to larger quantities of affordable, safe, and clean energy sources [
3]. Energy deficiency poses a significant challenge for many developing nations, stemming from issues like generation shortages, inefficient power transmission, and outdated distribution equipment. Consequently, affected countries resort to load shedding, a controlled measure of disconnecting the grid supply from specific regions for several hours daily; prolonged effects can significantly impact the economic advancement of a nation.
The World Bank notes that persistent electricity shortages have adversely impacted economies in Pakistan, Sri Lanka, South Africa, and India. The energy systems of most nations, whether already developed or in the process of development, predominantly rely on fossil fuels. However, this reliance contributes significantly to environmental issues such as global warming and air pollution. These environmental concerns not only pose health risks but also impact the overall quality of life for affected populations [
4]. As per the agenda of the Paris Agreement, leaders around the globe have agreed to restrain the increase in the average global temperature to stay “well below” 2 °C above pre-industrial levels and endeavor to remain below a warming of 1.5 °C [
5]. Nearly 90% of the entire GHG emissions stem from CO
2 released through the combustion of fossil fuels [
6].
Figure 1 illustrates that using fossil fuels generates CO
2 emissions, which are responsible for global warming and climate change and significantly impact our environment. Conversely, both developed and developing nations are fulfilling their energy needs by heavily depending on fossil fuels. This reliance not only harms the environment within their borders but also contributes to global climate change, which disproportionately affects underdeveloped countries. Located in Asia, Pakistan boasts the 10th largest economy in the region. Pakistan is grappling with significant challenges such as energy security and the environmental repercussions of energy consumption. Pakistan is heavily reliant on energy imports, accounting for nearly a third of its energy demand.
In the fiscal year 2017–2018, energy imports amounted to approximately USD 14.4 billion, marking an increase from USD 10.9 billion in the preceding year. About 75% of the USD 3.5 billion surge in energy imports resulted from elevated energy prices, with only around 25% attributed to increased import volumes. This significant price escalation ripples through the entire energy supply chain, leading to elevated business costs and a higher cost of living in Pakistan. Such heavy dependence on imported energy is unsustainable for Pakistan’s economy, which has grappled with a persistent current account deficit for over two decades [
8]. Pakistan has a global 0.8% share in CO
2 emissions and it has increased 114% since 2000 [
9]. This alarming trend is underscored by a notable rise in the consumption of natural gas, coal, and electricity, increasing by 41%, 52%, and 11%, respectively, within Pakistan [
10].
Figure 2 shows the categories and trends of CO
2 emissions in Pakistan and the percentage of energy supply by source and
Figure 3 shows the Pakistan’s energy supply by source.
Severe weather phenomena like heavy precipitation and flooding can inflict significant harm on both human communities and the natural world. The frequency of heavy precipitation events, which significantly contribute to flooding, has notably risen in various regions of the Northern Hemisphere in recent years, largely attributable to human-induced climate change and driven by heightened greenhouse gas emissions [
13]. Global warming stands as a primary catalyst for shifts in global climate patterns. Pakistan, ranking among the top ten nations affected by this aftermath phenomenon, is witnessing severe repercussions. Presently, the country grapples with extreme flooding, impacting approximately 33 million individuals and resulting in the destruction of 1.5 million residences, along with USD 2.3 billion in crop losses. Furthermore, over 2000 km of roads have been damaged, impeding connectivity to provinces and major urban centers. Notably, record-high temperatures, such as 40 °C in various regions and a staggering 51 °C in Jacobabad, underscore the intensity of the situation [
14].
The Khyber Pakhtunkhwa province in Pakistan has been a focal point for natural disasters, particularly floods, causing significant adverse effects on its land, infrastructure, healthcare, education, socioeconomic development, and human lives. While efforts towards recovery are underway, the province still lags behind others in terms of progress. Situated amidst the Karakoram, Himalayas, and Hindu Kush Mountain ranges, Khyber Pakhtunkhwa is home to glaciers and extensive high-altitude ice reserves.
Table 1 shows the loss incurred on Pakistan’s economy due to the flooding.
These towering mountains, coupled with Pakistan’s major rivers, including the Indus River, give rise to steep waterways such as Swat, Kabul, Kunhar, and Panjkora, traversing the plains of Khyber Pakhtunkhwa [
16]. Along with global warming issues, Pakistan is facing severe energy crises. Pakistan’s electricity industry grapples with several challenges, including a widening gap between supply and demand, frequent power cuts, escalating fuel import expenses, and rising environmental pollutants. To fulfill its commitments under the Paris Agreement to reduce carbon dioxide (CO
2) emissions, Pakistan has introduced various incentives and mechanisms to promote renewable energy production. Therefore, it is imperative to conduct a long-term evaluation of these policy incentives and mechanisms to determine their effectiveness in achieving the CO
2 emissions reduction target [
17]. A significant portion of the population, particularly in rural areas, lacks access to electricity and turns to the burning of fossil fuels to meet their energy demands. The situation is alarming, with only 60% of the country’s population connected to the grid. Presently, Pakistan is contending with a power supply shortage of 3–5 GW [
18].
The adoption of renewable energy holds paramount significance globally due to the escalating energy consumption, surpassing the capabilities of traditional energy sources and leading to energy crises. However, the fluctuating nature of solar radiation and wind speed, influenced by climate and weather dynamics, poses challenges to the consistent operation of renewable energy systems, resulting in output fluctuations. To address this issue, hybrid renewable energy (HRE) systems, integrating multiple renewable energy sources, emerge as a highly efficient solution with promising potential [
19]. Ensuring adequate electricity supply in rural areas is crucial for fulfilling basic living requirements and fostering economic development. However, extending the grid over long distances through challenging geographical terrain is often economically impractical as a solution to this challenge. Internal combustion engines and diesel generators, known for their rapid response to fluctuating demand and relatively low initial investment costs, are commonly employed for electricity generation in remote regions. Nonetheless, the utilization of traditional fuels leads to the emission of pollutants. Moreover, given the unfavorable economic conditions, procuring and transporting fossil fuels for power generation purposes proves to be economically unviable [
20].
Pakistan’s abundant solar potential, with high irradiance levels ranging from 5.0 to 7.0 kWh/m
2/day and 2200 to 2400 annual sunshine hours, offers a significant opportunity for electricity generation. Estimated at 2.9 million megawatts annually, solar energy exceeds current demand, presenting a sustainable solution for energy shortages. Government initiatives, including large-scale solar projects and residential subsidies, aim to harness this resource for environmentally friendly energy production and meet growing needs.
Figure 4 shows the solar irradiance levels in Pakistan.
Numerous studies have investigated hybrid energy systems from various angles. Tamoor et al. [
22] designed an on-grid photovoltaic system, particularly in the selection of a PV module type and size that can lead to notable energy losses within the system. The study compared PV units of different dimensions and power rankings but with similar effectiveness in two chosen sites. Helioscope simulation software was employed to model these PV systems, enabling the analysis of their monthly and annual energy production as well as system losses. Nawab et al. [
23] suggests a self-sufficient solar–biogas microgrid designed for rural communities in the Lakki Marwat district, Pakistan, which is reliant on agriculture and livestock. HOMER Pro simulated the electric power system, while RET-Screen analyzed its economics. The optimized system consists of a 30 kW photovoltaic system, a 37 kW biomass hybrid system, a 64 kWh battery storage capacity, and a 20 kW inverter, producing 515 kWh of electricity and 338.50 m
3 of biogas daily. Iqbal and Iqbal [
24] conducted thermal modeling of a standard rural dwelling in Pakistan using BEopt to establish the hourly load profile. These load data were then utilized to design a stand-alone PV system using HOMER Pro. The proposed system comprises a 5.8 kW PV array along with eight batteries with a 12 V and 255 Ah capacity, coupled with a 1.4 kW inverter. The analysis indicates that this system is capable of primarily supporting lighting and appliance loads in a rural household. Xu et al. [
25] examined the feasibility of electrifying rural areas in Sindh province, Pakistan, focusing on solar energy. The results indicate that these regions have favorable solar conditions for electricity generation. By optimizing tilt angles, the solar energy generation capacity can be significantly enhanced. An economic analysis reveals that off-grid solar PV systems offer electricity at PKR 6.87/kWh, which is far cheaper than conventional sources priced at PKR 20.79/kWh. Ur Rehman and Iqbal [
26] presented the development of an off-grid PV system for a rural household in Pakistan, aiming to meet its year-round electrical needs, targeting a monthly generation of 40 kWh. Utilizing HOMER Pro software, the system’s performance was simulated with location-specific solar data. It consists of four 140-watt solar panels, four 125 Ah batteries, a 1 kW inverter, and introduces a simple control and data-logging approach for monitoring. Elsaraf et al. [
27] worked for the electrification of remote communities in Canada in which the tailored energy systems are tailored to local consumption. Various renewable sources including solar thermal, PV, wind, hydroelectric, and fuel cells were utilized and the microgrid significantly reduced diesel usage by 71%, thus achieving a levelized cost of energy (LCOE) of −0.0245
$/kWh. Kumar et al. [
28] designed and installed an off-grid solar PV system in Pakistan’s desert region, where approximately 95% of the area lacks electricity access. This endeavor includes a comprehensive sizing and cost analysis to determine suitable specifications for PV solar panels, battery capacity, inverter size, and a charge controller based on the anticipated loads. Ali et al. [
29] presented an off-grid photovoltaic (PV) system tailored for a rural household in Pakistan, designed to meet its year-round electricity requirements with an anticipated monthly output of 40 kWh based on household electricity consumption data; the system’s performance is evaluated through steady-state modeling using HOMER Pro software. The simulation results forecast the system’s annual electrical output, accounting for solar irradiance, temperature, and humidity data specific to the chosen location. Rehmani and Akhter [
30] investigated the electrification of a rural community using various renewable resources and conducted an economic analysis under different scenarios. It was found that in the scenario utilizing all available resources including PV, wind, and biomass, the levelized cost of energy decreased to Rs 14.40. Although there was a slight increase in the net present cost to Rs 14.6 million, the payback period was notably reduced to just 2.54 years.
While previous research has primarily concentrated on optimizing and designing photovoltaic systems for site electrification, there is a noticeable gap in addressing the environmental impact stemming from fossil fuel usage, which is a significant contributor to recent flooding in Pakistan. Furthermore, there is a limited exploration of the reliability of hybrid power systems concerning the proportion of renewable energy integrated. Therefore, this study aims to illustrate the optimization and analysis of the design of a stand-alone hybrid power system required for the electrification of a rural area in Khyber Pakhtunkhwa province of Pakistan because of the reliability of the hybrid power system. The key contributions of this research paper to the existing research are as follows:
The projected HPS is designed with PVsyst and HOMER Pro software. This entails identifying system loss, the ideal capacity, and the setup of elements to fulfill the power requirements of a system. The procedure encompasses investigating the load profile, evaluating the accessibility of renewable resources, integrating energy storage capacity, establishing the generator capacity, and employing a control system.
Utilizing MATLAB Simulink r2023b, the dynamic modeling of the suggested hybrid power system is performed to assess its HPS behavior, voltage fluctuations, system load effects, and the quality of generated power across various settings, all tailored towards the selected site. The practical validation of the designed HPS is being performed by the OPAL-RT OP5707XG HIL real-time simulator.
The decreases in CO2 emissions through energy production from the hybrid power system contribute to environmental preservation, thereby lowering the likelihood of floods in Pakistan.
The structure of this study unfolds as outlined:
Section 2 explores the factors considered in site selection.
Section 3 details the scheme of the hybrid power system.
Section 4 discusses the performance analysis and optimization of the HPS utilizing PVsyst and HOMER Pro.
Section 5 illustrates the dynamic modeling and simulation of the proposed system using MATLAB Simulink, while
Section 6 demonstrates the testing of the system’s validity under consideration using HIL. Lastly, a thorough summary and discussion of the entire study are provided.
2. Site Selection and Description
The site selection process is integral to the design of a hybrid power system, playing a pivotal role in determining its performance and effectiveness. Key considerations include assessing the readiness of renewable resources for instance solar irradiation, wind speed, and hydro potential. Understanding the site-specific load profile is essential for appropriately sizing and configuring system components to meet energy demand. Environmental factors, including terrain, climate conditions, and regulatory requirements, also influence system design. Economic viability hinges on factors such as installation costs, potential energy savings, and payback periods, all of which are influenced by site selection. Ultimately, a well-chosen site maximizes energy generation potential while minimizing environmental impact and operational costs, laying a strong foundation for the hybrid power system’s success.
The selected site, “Berru Bandi”, is a small community consisting of 10 houses located in the rural area of Abbottabad District, approximately 25 km from Abbottabad city. Perched atop a mountain at coordinates 34°16′38″ N 73°15′18″ E and an altitude of 1456.79 m above sea level, accessing this site is challenging due to the lack of road access and basic amenities. As illustrated in Figure, approximately 66% of power in Pakistan is generated from natural gas and oil through power plants. The state-owned Sui companies, Sui Northern and Sui Southern, manage a combined network of 151,397 km (13,143 km of transmission and 138,254 km of distribution) for natural gas transmission and distribution [
31]. Additionally, the NTDC (National Transmission and Dispatch Company) oversees an electricity network spanning 28,805 km [
32]. Despite the extensive natural gas and electricity networks, providing an energy source to this remote area proves challenging due to its mountainous terrain and elevated location. Currently, residents rely on diesel generators (10 × 5 kW) to meet their energy needs, resulting in over 75,000 L of diesel fuel consumption, which ultimately results in CO
2 emissions that are harmful to the environment. Therefore, the most feasible solution for electrifying this rural community is the implementation of a hybrid power system. An overhead perspective of the location is illustrated in
Figure 5 on Google Maps.
Figure 6 presents different real-life views of the selected site. As we can see in the aerial view in
Figure 5, there is an ample area available around the community, which is sufficient for the setup of solar PV panels and other elements of the hybrid power system.
2.1. Solar Horizontal Irradiance
Solar horizontal irradiance (SHI) holds a crucial role in assessing the solar prospective of a location and determining the feasibility of solar energy projects. It represents the total solar emission obtained per unit area at the Earth’s surface in a horizontal plane, without considering the angle of incidence or orientation of surfaces. Moreover, SHI data are essential for conducting solar resource assessments, identifying suitable sites for solar projects, and making informed decisions regarding renewable energy investments. The solar horizontal irradiance data of the selected site are obtained using the NASA Surface Meteorology and Solar Energy Database, facilitated with HOMER Pro software.
Figure 7 represents the value of solar radiation which ranges from 2.79 kWh/m
2/day to 7.46 kWh/m
2/day, which shows that there exists sufficient sunlight energy at the selected site. Similarly, the clearness index is a dimensionless number that ranges between 0 (when the sky is completely covered) to 1 (when there is perfect sun) whereas at selected sites it ranges between 0.546 to 0.694.
The energy output of a photovoltaic (PV) system is significantly influenced by weather conditions including wind speed, humidity levels, temperature changes, and solar irradiance, along with additional factors like dust accumulation, localized heating, snow accumulation, and tiny fractures. However, the incline and orientation angles of PV setups are crucial in maximizing annual energy production. These angles directly impact the absorption of solar energy by the PV module surfaces, thereby affecting the performance of the installation [
33]. The solar azimuth angle is the angular distance between the direction of the sun and a reference direction, typically measured clockwise from true north in the horizontal plane.
It represents the direction along the horizon where the sun appears to rise and set. The solar azimuth angle changes throughout the day, as the position of the sun overhead shifts from east to west.
It is an important parameter in solar energy applications, as it determines the aligning of solar panels for optimal sunlight exposure and energy capture. The solar elevation, solar azimuth, day length, and solar zenith angle were computed using the online software tool “Solargis”, as depicted in
Figure 8.
2.2. Analysis of Electrical Load
The electrical load is of paramount importance in hybrid power systems, significantly shaping their design, operation, and overall efficiency. In the selected rural community, there are 10 houses with nearly identical electrical appliances. The details of these appliances, along with their connected loads, are presented in
Table 2 below:
Energy load profiles provide insights into the consumption patterns of energy over time, capturing the interactions between different subsystems at various spatial and temporal scales. Due to diverse factors, individual households exhibit distinct energy demand patterns, with peak energy usage occurring at different times.
As a result, when households are aggregated, the maximum demand from the group is typically lower than the sum of individual maximum demands due to the diversity in timing. Equation (1) shows the formula for the diversity factor.
This phenomenon reflects the likelihood that peak demands from different households do not coincide. Consequently, as more households are integrated into a system, the maximum demand per household decreases. The greater the diversity factor, the less likely it is that households will have peak energy demands at the same time [
35]. Considering the diversity factor, the hybrid power system is aimed at a peak load of 33.54 kW, and the system will be tailored accordingly.
Figure 9 demonstrates the monthly electricity consumption pattern of the selected site.
5. Dynamic Modeling of Proposed Hybrid Power System in MATLAB Simulink
Assessing the functionality and dynamics of a system heavily relies on dynamic modeling and simulation. MATLAB Simulink simulations are conducted to delve into the dynamic behavior of the envisaged hybrid power system, with a specific emphasis on power quality, voltage fluctuations, and load impacts. The PV array’s output characteristics, including V-I and V-P characteristics, exhibit non-linearity and are significantly influenced by environmental factors. These factors include solar irradiation levels, ambient temperature variations, and the extent of partial shading affecting the PV array. The dynamic modeling of a photovoltaic (PV) system, particularly in terms of the ASTM G173 spectrum, involves simulating its performance under varying atmospheric conditions. The ASTM G173 spectrum considers factors such as air mass, ozone content, and aerosol concentration, affecting the spectral distribution of sunlight reaching the Earth’s surface. In this modeling, the PV system’s reaction to changes in solar irradiance and temperature is analyzed using mathematical models implemented in the software. The Simulink MATLAB design of the proposed hybrid system is shown in
Figure 23.
Setting the initial irradiance value to around 1000 watts per square meter (W/m2) is common practice to simulate standard solar radiation conditions. Solar cell temperatures may fluctuate within simulations, ranging from approximately 25 °C to 60 °C. However, higher temperatures can also lead to an increase in current output due to enhanced electron excitation within the panel’s semiconductor material. These effects demonstrate the complex relationship between irradiance, temperature, voltage, and current in PV panels, ultimately impacting their overall performance and efficiency.
Table 10 represents the scenario of variations in solar irradiance and temperature of PV panels and how they will affect the dynamics of the proposed hybrid power system. This detailed analysis helps optimize PV system design and operation, contributing to the efficient utilization of solar energy resources and the advancement of renewable energy technologies. To visualize the effects of variations in solar global horizontal irradiance (GHI) and temperature, adjustments were made to the parameters of the PV array’s solar GHI and temperature within MATLAB Simulink. Initially, the system operated under standard conditions with a GHI of 1000 W/m
2 and a temperature of 25 °C.
Figure 24 represents the variations in solar GHI and temperature and their impact on the output voltage and current of the PV panel. Subsequently, at time 0.5 s, the GHI was reduced to 400 W/m
2 to mimic decreased sunlight, while the temperature was incrementally increased to 35 °C. As the irradiance level decreased the voltage and current level between 0.5 to 1.5 s, at time 2 s, the temperature increased to 55 °C and the irradiance level increased to 1000 W/m
2. Elevated temperatures result in a decrease in current and voltage, whereas higher GHI levels lead to an increased voltage output from the PV array. This analysis enhances the comprehension of the system’s behavior under diverse environmental conditions and facilitates performance optimization.
The charging process of batteries in photovoltaic systems is significantly influenced by variations in irradiance and temperature. Higher levels of irradiance typically result in increased charging currents and voltages, as more solar energy is available for conversion into electrical energy. Conversely, decreases in irradiance lead to reduced charging currents and voltages. Temperature also plays a crucial role, with higher temperatures generally accelerating charging rates due to enhanced chemical reactions within the battery. In
Figure 25, a shift in irradiance occurs at 0.5 s, leading to a discharge of the battery bank until 1.5 s. Subsequently, when the irradiance rises from 400 to 1000 W/m
2 after 1.5 s, the battery begins to recharge and stabilizes at 2 s.
During a power outage, the PV system activates the generator and integrates a Phase-Locked Loop (PLL) into the MATLAB simulation. The system continuously monitors power output to detect shortages, prompting immediate generator activation. Concurrently, PLL parameters, such as reference signal frequency and phase, are set. The PLL block, comprising phase detectors, filters, and oscillators, synchronizes the generator’s output with the grid or reference signal. This integration within the MATLAB Simulink model ensures efficient connectivity and interaction among system components.
Figure 26 demonstrates the consistent phase-to-ground voltage and current delivered to the connected load through the designed HPS.