Introduction

Conventional energy supplies are insufficient to meet the countries’ growing energy demand. Rapid exhaustion of conventional fuels, global climate change, and the necessity for a reliable energy source, clean energy alternatives have been investigated (Kiptoo et al. 2020). As a result of the worldwide phenomena of climate change, renewable energy sources are widely considered a crucial component of environmental recovery, and they are expected to promote the future process of sustainable development (Dimitriadis et al. 2021). Greenhouse gas (GHG) emissions, a primary factor in global warming, have been the most critical environmental challenge confronting the international community. Carbon dioxide gas, which is mainly derived from fossil fuels, is the most significant environmental pollutant, accounting for 76% of all GHG emissions. In this scenario, GHG emissions continue to pose a severe threat to human life and the environment. As a result of human-caused global warming, countries have attempted to lower GHG emissions in recent decades by addressing energy efficiency regulations (Wenlong et al. 2022). Renewable energy resources (RER) are viable substitutes for prevailing energy systems because of their broad availability and green energy source. RER increases energy security while reducing greenhouse gas emissions (Mosa and Ali 2021). RER promotes energy security by reducing dependency on fossil fuels, cutting greenhouse gas emissions, and diversifying the energy market for the end-users (V and Verma 2021).

The power industry benefits from economic development and job creation when power is generated from RER. The hybrid power generation system mixes energy resources to increase power supply reliability and minimize greenhouse gas emissions (Kamal and Ashraf 2021a). Conventional power systems, grid-connected or standalone, employ RER and storage technology to meet local demand. When utilized in combination with a storage device, a microgrid’s standalone mode of operation is often used to electrify rural regions. The battery system provides power at peak loads or low generation from RER.

The grid-connected technique is also widely used in metropolitan areas. Electricity is supplied from the grid with low energy rates during off-peak hours, while RER and battery provide power during peak hours (Habib et al. 2021). Consequently, the on-grid scheme of operation increases the participation of RER, improves power supply reliability, minimizes the fossil energy dependency, and reduces the \({{CO}}_{2}\) emissions in the environment (Kamal and Ashraf 2021b). RER is combined with diesel generators to provide power to the locality, but the prolonged operation of diesel sets increases the toxic gasses in the environment.

Local resources were integrated to develop an energy model capable of generating power from RER in grid-connected and isolated modes of operations. Developing an energy model aims to deliver low-cost energy to rural areas. Microgrid planning must be thorough and convenient to maximize consumer advantages and the system’s efficiency (Parag and Ainspan 2019). When constructing a hybrid RER system, PV arrays, wind energy, diesel generating units, converters, and batteries are essential components. Consequently, maximizing or reducing the provided objectives can be utilized to satisfy all constraints (Hakimi et al. 2021) fully.

Designing RER-based system is extremely difficult despite all of the advantages, variability, and uncertainty of renewable energy supplies, making it difficult for microgrid planning designers (Kumar et al. 2019). Researchers frequently propose hybrid techniques for the electrification of both urban and rural areas. For electrification, various RER and batteries are commonly used. It takes a new and practical look at the development of rural microgrids. The study is classified into two categories: the first is about strategies for optimal planning and arrangement of scattered energy resources, and the second is about energy scheduling.

For a remote location in Sichuan, China, the authors developed a microgrid using PV, wind, and batteries. Using particle swarm optimization (PSO), a techno-economic study of the model was performed. Several model alternatives become possible by introducing the most negligible supply power probability (LSPS). With an LSPS of 5%, the lowest energy cost is expected to be 0.091 $/kWh (Xu et al. 2020). For rural electrification, a diversified energy scheme has been proposed. They demonstrated a low-cost approach to establishing grid infrastructure in far rural areas, where such infrastructure is currently prohibitively expensive. Four different places in the southern part of the Indian village located in Karnataka were chosen to investigate the proposed energy model. Under various loading scenarios, the integrated RER model was created for the lowest energy cost (Ramesh and Saini 2020).

In (Sadeghi et al. 2022), a hybrid energy model was created for a village located in a rural region of Iran. The system consists of PV, biodiesel generator, wind energy system, and batteries. Using simulated annealing and the Harmony search technique, the suggested model was tuned for the lowest cost of operation. The energy potential of several resources is calculated and combined to produce a hybrid energy model. Solar, wind, diesel, and batteries were viable energy sources in a rural microgrid. Using the HOMER energy modeling tool, a techno-economic study was undertaken with various degrees of renewable energy combinations. The microgrid will be used to electrify rural areas in village Sadkeni located in South Africa. The utilization factor, efficiency, equipment cost, and additional energy produced were all used to assess the effectiveness of the microgrid (Xu et al. 2016). Dhundhara et al. (2018) proposed an energy system for the people of Bangladesh’s rural areas. The proposed method was tested using HOMER with various RER combinations to see if it was viable. The goal of the suggested framework is to give the best size while lowering energy costs. In a similar study, the HOMER tool was used for a few resorts in the South China Sea to construct a grid-connected energy system with storage for the residential load located in Malaysia. According to the findings, the optimized model’s per unit energy cost is 0.2794 $/kWh, with a renewable percentage of 41.60%. This study looked into different microgrid architectures for Malaysia’s rural population (Hossain et al. 2017).

Dahiru and Tan (2020) conducted a feasibility study on an isolated microgrid in Sudan that powered farm loads with wind, PV, battery, and DG. A rural microgrid has been proposed for various reasons, including fluctuating loads. They looked at several locations in Sudan for the case study and altered the system’s operation to achieve the lowest net current cost. In (Sanajaoba Singh and Fernandez 2018), the optimal scale of renewable energy resources was demonstrated in a Uttarakhand community (India). Photovoltaic and biogas have been proposed as rural electrification options. They developed a model for the optimal size of microgrid components using an iterative process that considers the entire area’s demand. In (Bukar et al. 2020), a rule-based microgrid is proposed, formed by integrating PV/DG/wind and battery systems. Four different scenarios are used to optimize the proposed objective for the least cost of electrification using a differential evolution algorithm. Kamal et al. (2021) suggest the efficient electrification of a rural population of an Indian village located in the state of Uttarakhand. The system used two-layer optimization to satisfy the load of the area. The suggested microgrid consists of PV, wind turbine, diesel generator, and diesel generator. GA, PSO, and DE are used to optimize techno-economic output). The proposed microgrid for the electrification of the rural community is shown in Fig.1.

Fig. 1
figure 1

schematic of proposed microgrid

Metaheuristic algorithms are frequently used in designing ideal microgrids that utilize renewable energy sources. Particle swarm optimization (PSO), bacterial forge optimization (BFO), genetic algorithm (GA), and other engineering optimization tools are examples. Natural process variables influence the majority of operations. These can be applied to various engineering target optimization issues (Kamal et al. 2022). They effectively lower the microgrid system’s cost and size. Pecenak et al. (2019) devised a microgrid system for illuminating rural areas in Uttarakhand (India). The MILP technique was employed to keep the project’s cost and size down. To enhance the scale of renewable energy suppliers, the authors employed cuckoo search optimization. They evaluated the number of battery, wind, and PV system combinations in a remote Indian community for optimal sizing and reliability. The GA investigates the lowest cost of operation for wind, PV, and storage in an isolated microgrid while the power loss probability is a constraint. The finding of optimization compared to the results of HOMER pro outcomes.

Electricity is a major source of economic activity. However, it is insufficient and unreliable in most emerging regions, forcing them to rely on captive electric generation, such as diesel power generators (DGs), to maintain their power supply during grid disruptions. High levels of ambient air pollution have resulted in a rise in premature death and negative consequences for the region’s agriculture, ecosystems, and climate. Reducing these pollutants, especially in urban areas, can be critical to attempts to improve air quality. Furthermore, to enhance energy availability, the United Nations’ Sustainable Development Goal (SDG) 7 advocates the use of clean, renewable, and efficient energy. In an unusual metropolitan region with intermittent grid power supply, DG-based and solar PV-based microgrid systems can reduce emissions and enhance power production efficiency under varied operating situations and DG capacities (Wu and Shang 2022). A similar study (Wenlong et al. 2022) studies the environmental impact of electrification of Asian countries using coal-based resources. Primary sustainable energy generation in Northeast India is solar and wind-based plants due to their widespread availability in the region. In terms of utilizing traditional fuels and the advantages of adopting alternative resources are widely discussed by the authors.

The use of conventional fuels dominates energy generation in this region. Natural gas is the most important of these, accounting for 74.65% of all electricity generated in the regime. The purchase of fossil fuels results in a significant expenditure of $566,317,950.00 paid annually. Furthermore, their combustion produces a large amount of pollution. From 2009–2010 to 2016–2017, the province’s estimated annual average GHG exhaustion for electricity generation was 12.67 Mt (Acharya 2022). Bhat and Mishra (2020) attempted to assess the potential impact of carbon taxes on the development of low-carbon emitting technologies and, as a result, on the possibility of substituting renewable and conventional energy sources. The empirical estimates of the impact of carbon taxes on green technology show that in our treated group, the renewable energy sector, carbon taxes incentivize to embrace of clean green technology (Ali et al. 2018). Yan et al. (2018) acquired important information on residential buildings and the socio-economic condition of 1092 households from 46 neighborhoods in Xiamen City, China; stratified random sampling was created, and a face-to-face questionnaire was performed. The emission of GHG from the residential building was studied in detail.

A hybrid microgrid with PV, wind, and storage technologies was investigated using various heuristic techniques. Particle swarm optimization was more reliable than the genetic algorithm (GA) and the firefly approach. PSO is a well-known method for tackling current optimization problems in the literature. Fioriti et al. (2021) used multi-objective particle swarm optimization for the planning of an off-grid microgrid to provide reliable electrification to the rural community. The technique is widely utilized to address a range of optimization problems due to its low initialization parameter, comparatively faster convergence rate, and ease of usage (Kerdphol et al. 2016). Traditional energy sources can be lowered by utilizing renewable energy sources. Renewable energy sources are a low-cost, ecologically beneficial form of energy that helps to reduce greenhouse gas emissions. Due to the limits, efficient planning of the rural grid is challenging. The new research contributes significantly to the field of rural planning.

The remainder of the paper is arranged as follows: “The main contribution of the study” section suggests the study’s most important contribution; the “Methodology” section suggests the steps used in the current study for energy optimization; the “Mathematical modeling of components” section deals with the mathematical modeling of energy sources used in the current problem; the “Area of study and load modeling” section suggests information about the study’s most important input; “Problem formulation” section deals the formulation of the energy optimization problem and discuss its constraints; “Optimization algorithm” section provides the overview of particle swarm optimization; “Simulation results and discussion” section explains the finding of the simulation work; “Sensitivity analysis, technical hurdles, and challenges” section discusses the effect of variation of variation of parameters on the cost of energy; “Limitations and policy recommendations” section suggests the insight of necessary policy for the successful implementation of current study; next section compares the finding with available literatures; and finally the manuscript ends with conclusion and future suggestion.

The main contribution of the study

Several metaheuristic algorithms have been developed and used in the literature to address microgrid-related difficulties. These methods are more flexible than deterministic methods, and they avoid local optima trapping. Thus, they produce superior results (Tooryan et al. 2020). According to the findings, PSO is one of the most successful and beneficial optimization methods used in microgrid planning because it can reduce interruption costs, increase reliability, and has more consistent convergence features than other stochastic approaches. The PSO method is proposed as a metaheuristic optimization technique for handling the size of the distributed generation problem in a residential hybrid MG in this paper. The goal of the optimization is to lower CO2 emissions, increase RER penetration, and lower total microgrid costs. In light of those mentioned above, the project aims to improve current knowledge of how to design rural electricity utilizing metaheuristic optimization. The current study suggests an optimal microgrid model for high-reliability, long-term electricity in a rural community in Uttarakhand, India, utilizing locally available energy resources (Seshu Kumar et al. 2021). The current contribution of this study is listed as:

  1. i.

    The microgrid framework for optimal configuration is to critically examine several energy models in terms of energy price, initial capital cost, running cost, pollution reduction, and net present cost.

  2. ii.

    This study provides a reliable, cost-effective, and sustainable solution for the electric supply to a remote area in the hilly area of the Indian region.

  3. iii.

    The multi-objective optimization is done to minimize the total energy cost for finding the optimal outcome. Particle swarm optimization algorithm is utilized.

  4. iv.

    Four different combinations of renewable resources are investigated for the feasibility analysis.

  5. v.

    Effects of variation of each parameter on the COE are studied for the better planning of the microgrid.

  6. vi.

    The developed model is evaluated in terms of environmental benefits and emission of greenhouse gasses.

  7. vii.

    The validity of the suggested framework is established by comparing similar studies in the existing literature.

Methodology

Energy management and component sizing are two ways to ensure that the region has an uninterrupted power supply. In this study, an integrated microgrid containing renewable energy resources provides reliable electricity to a remote rural population. Electrification attempts to use the minimum energy cost and produce the least pollution. The battery units provided in the hybrid system store extra power from renewable resources and supply when needed. Storage units can compensate for power shortages; hence, it increases the consistency of the energy supply. The energy optimization algorithm substantially affects the optimum sizing of the hybrid energy system. In the present methodology shown in Fig. 2, it has been emphasized that renewable energy resources satisfy the most energy requirements. Based on the energy requirement, the following four scenarios are formulated for the investigation of the proposed microgrid.

  • Scenario 1 (\({S}_{1}\)): The solar photovoltaic, DG, and storage units supply the electrical demand of the area.

  • Scenario 2 (\({S}_{2}\)): The PV and wind turbines cannot satisfy the demand. Hence, battery banks are used with renewables to supply the load.

  • Scenario 3 (\({S}_{3}\)): The renewable and DG units are used to supply the electrical demand of the area.

  • Scenario 4 (\({S}_{4}\)): Renewable resources are not working; hence, only DG and battery units are supplied the electrical demand to the area.

Fig. 2
figure 2

Flowchart of methodology

Mathematical modeling of components

The hybrid renewable energy model includes the resources available in the locality to satisfy the area’s power requirements. The performance of renewable energy resources and the equipment used to determine energy prices. The microgrid model contains a battery, PV system, and DG unit to ensure reliable power access. The following section explores each component’s mathematical modeling.

Solar photovoltaic system

The single diode model has been used to simulate solar PV systems. The PV array is made up of numerous solar cells connected to generate the necessary power. The device’s inexpensive expenses and the lack of fuel pricing and environmental friendliness make it a significant choice for energy planners. The working circumstances and surroundings of a solar module impact its effectiveness. As the light incident on the surface changes, the PV module’s output fluctuates. The solar module’s output may increase by 0.1 °C as the temperature rises. PV power output may be calculated using Eqs. (1)–(5) (Islami et al. 2021).

$${ S}_{ p}={{SP}}_{ r}{ y}_{ s}\left(\frac{{ I}_{ t}}{{ I}_{{st}}}\right)\left[1+\partial_{ p}\left({ t}_{{cel}}-{ t}_{ s}\right)\right]$$
(1)

The cell temperature \({t}_{cel}\) °C can be formulated as:

$$t\partial{ I}_{ t}={\eta}_{ s}{ I}_{ t}+{ g}_{ l}\left({ t}_{{cel}}-{ t}_\partial\right)$$
(2)
$${ t}_{{cel}}={ t}_\partial+{ I}_{ t}\left(\frac{ t\partial}{{ g}_{ l}}\right)\left(1-\frac{{\eta}_{ s}}{ t\partial}\right)$$
(3)

The value of \(\left(\frac{t\partial }{{g}_{l}}\right)\) is tough to determine; hence based on the manufacturer sheet, the nominal cell temperature at the 800 W/m2 with no-load state, the equation revised as:

$$\frac{ta}{gl}=\frac{t_{cel,nom}-t_{a,nom}}{I_{t,nom}}$$
(4)

The ultimate PV cell temperature can be found for the rate of \(\left(\partial t\right)=0.90\):

$${ t}_{{cel}}={ t}_{\alpha}+{ I}_{ t}\frac{{ t}_{{cel},{nom}}-{ t}_{\alpha,{nom}}}{{ I}_{ t,{nom}}}\left(1-\frac{{\eta}_{ s}}{0.90}\right)$$
(5)

The flat-type panel is utilized to simulate the current microgrid system. Table 1 shows the SPV system’s technical and economic specifications (Azerefegn et al. 2020).

Table 1 Specification of PV system

Battery system

Renewable resources are intermittent; therefore, electricity output cannot be expected all of the time. The system’s battery storage improves the power supply’s reliability. This approach can be employed when renewable energy generation is inadequate to cover demand (Al Garni et al. 2018). The energy model’s battery bank saves the extra power generated by the resources and delivers when renewable energy production fails to meet the demand. The configuration also comprises a diesel generator. The diesel generator is deployed when the renewable and battery systems cannot satisfy the load requirements of the rural population. System maintenance is meant to ensure the battery’s extended life (Ramesh and Saini 2020). The mathematical formulation of the energy of the battery is represented by:

$${ q}_{{bat}}={ q}_{{bat},0}+\int_0^{ '''}{ V}_{{bat}}{ I}_{{bat}}{dt}$$
(6)

The state of battery charge defined as:

$${{Bat}}_{{soc}}=\frac{{ q}_{{bat}}}{{ q}_{{bat},\max}}\times100\left(\%\right)$$
(7)

The specification of the battery used in the simulation is shown in Table 2.

Table 2 Specifications of battery

Diesel generator (DG)

The output power of renewable energy resources varies with climatic conditions. This may lead to an insufficient supply of power that may not satisfy the demand. In this situation, when energy production is not enough to meet the demand, battery and diesel generators can supply the load demand of the area (Ming et al. 2017). The per-unit cost of energy and effectiveness of microgrid reliability can be improved by using a diesel generator, which may be very useful in minimizing the number and size of batteries. For the cost-effectiveness and avoidance of toxic gas emission, the unloaded action of the DG must be avoided. The model with DG supplies the power when RER cannot satisfy the demand (Gaurav et al. 2015). The diesel generator has been designed with fuel economy and economical operation. The relationships could be stated as follows:

$$Y(t)=aw_d(t)+\beta P_{rat}$$
(8)
$${\eta}_{{dt}}={\eta}_{{db}}\times{\eta}_{{dg}}$$
(9)

where Y(t) signifies the fuel consumption (l/h), \({w}_{d}(t)\) is generated power in (kW), \({P}_{rat}\) is the rated power, α and β are the coefficient of fuel consumption, and \({\eta }_{dt}\),\({\eta }_{db}\), and \({\eta }_{dg}\) are the efficiency of DG. For simulating diesel generators, a standard 1-kW generator with initial and replacement costs of 385 $/kW is used. The O&M cost per kW for the generator is estimated to be 0.15 $/h. The generator’s life expectancy is projected to be 15,000 h based on its operational hours (Dhundhara et al. 2018). This study uses 1 $/l as the fuel price.

Wind turbine

The movement of the surrounding air generates wind electricity. Wind translates kinetic energy into electricity. The BWC EXCEL 1-R wind turbine is considered for the present case study (Veilleux et al. 2020). The hub height, operation height, component kinds, costs, cut-in speed, and type of power generated all play a significant role in wind turbine choice. The power characteristics of used wind turbines are shown in Fig. 3. \({V}_{1}\), \({V}_{2}\), and \({V}_{r}\) indicate the WT’s cut-in, cut-out rated speed. Equation (10) determines the needed wind speed at a given height. \({V}_{ref}\) is the wind speed at the hub reference height h and \({h}_{ref}\), respectively; is the ground surface friction, which varies between 0.10 for flat land and 0.25 for substantially dense forests; and \(\gamma\) is the ground surface friction, which ranges between 0.10 for flat land and 0.25 for densely forested areas (Dahiru and Tan 2020).

Fig. 3
figure 3

Characteristics curve of wind turbine

$$V={ V}_{{ref}}\left\{\frac{ h}{{ h}_{{ref}}}\right\}^{\gamma}$$
(10)

The power output of wind turbine mathematically formulated by Eq. (11):

$${ P}_{{wind}}\left( V\right)=\left\{\begin{array}{c}0{forV}<{ V}_1\\{aV}^3{{forV}}_1< V<{ V}_{ r}\\{ P}_{ r}{{forV}}_{ r}< V<{ V}_2\end{array}\right.$$
(11)
$$a=\frac{{ P}_{ r}}{\left( V_{ r}^3- V_1^3\right)}$$
(12)
$$b=\frac{ V_1^3}{\left( V_{ r}^3- V_1^3\right)}$$
(13)

The value of V1 varies in the range of 2.5–3.5 m/s, and the value of V2 varies 20–25 m/s. The actual power output of the wind turbine is calculated by using Eq. (14).

$${ P}_{{wt}}={ P}_{{wind}}{ A}_{{wind}}{\eta}_{{wind}}$$
(14)

For the microgrid system design, the specification of the used wind turbine is shown in Table 3 (Dhundhara et al. 2018).

Table 3 Specification of wind turbine

The region has enormous wind energy potential. Wind energy in India is built for a 10 m/s wind speed. The wind speed in the investigation region is 4–16 m/s, which is suitable for low-rate wind turbines. The monthly average wind speed in the research region is indicated in Figs. 4 and 5.

Fig. 4
figure 4

Variation of wind speed in the study area (NASA 2022)

Fig. 5
figure 5

Monthly average wind speed of study area (NASA 2022)

Area of study and load modeling

Uttarakhand is a state in India that was established in 2000. Its capital is Dehradun. It is India’s 27th state, neighboring China to the north, Nepal to the east, Utter Pradesh to the south, and Himachal Pradesh to the west. It is divided into 13 districts. Chamoli is chosen for the presented model’s case study. Chamoli is one of the Himalayan state’s central areas. According to the 2011 census, the region’s total population is 391 (Census 2011). Because it is steep terrain, several villages have a low population density. So, the energy pattern of the area is shallow in the area.

When evaluating the proposed model, the region is taken into account. The Dewal block of the district includes these settlements. Electricity is not available in these communities. These places can be electrified by a renewable energy system (Uttarakhand report 2022). The area’s load profile is carefully studied to construct an efficient microgrid for a specific site. The area’s load profile heavily influences the system’s performance. The system’s dependability is harmed by so much change in the load profile. The size of the generating system and storage units depends on the energy consumption of the region. The research site is in India’s mountainous state of Uttar Pradesh. As a result, daytime consumers and a few small-scale companies consume the most significant energy. Figure 6 depicts the load demand for the area. The region has a 13 kW peak load.

Fig. 6
figure 6

Load profile of the area

Problem formulation

Multi-objective problem formulation is used to optimize microgrid optimization. A microgrid with storage and a diesel generator system has been designed for the electricity of the rural settlement. The broad door-to-door survey simulates rural community needs. The proposed microgrid aims to electrify the town at the lowest possible cost and with the highest level of dependability. This research aims to lower the total cost of electricity while reducing environmental pollutants.

  • Objective 1: The cost of energy (COE) is a significant parameter for the economic analysis of a microgrid system. It is generally the sum of all the costs per unit. It is the most determining factor for computing the effectiveness of any energy model. It consists of total capital, operation replacement costs, and maintenance cost (Aziz et al. 2020). Renewable resources have less or no O&M and no fuel cost. COE is represented as the cost per unit generated electricity ($/kWh) and calculated by using the formula:

    $${COE}\left(\$/{kWh}\right)={TNPC}/\sum \nolimits_{ n=1}^{8760}{ P}_{ h}\left( n\right)\times{Cpv}$$
    (15)

\({P}_{h}(n)\) is the hourly energy consumed, and \(Cpv\) is the capital recovery factor (CRF).

The TNPC expressed is the summation of investment, replacement, fuel, and O&M costs. Mathematically, it can be represented by:

$${TNPC}= C^{ i}+ C^{ o\& m}+ C^{ r}+ C^{ f}$$
(16)

where \({C}^{i}\), \({C}^{o\&m}, {C}^{r}\), and \({C}^{f}\) are the initial cost ($), operation and maintenance cost ($), replacement cost ($), and fuel cost ($/l), respectively.

The initial capital cost of the microgrid system calculated by:

$$C^{ i}= C^{{PV}} N^{{PV}}+ C^{{WT}} N^{{WT}}+ C^{{DG}} N^{{DG}}+ C^{{BT}} N^{{BT}}+ C^{{con}} N^{{con}}$$
(17)

where \(C^{PV}{,N}^{PV},C^{WT}{,N}^{WT},C^{DG}{,N}^{DG},C^{BT}{,N}^{BT},C^{con},{{and}\;N}^{con}\) are the capital cost of PV ($), number of PV array, capital cost of wind turbine ($), number of wind turbine, capital cost of diesel generator ($), number of DG units, capital cost of battery ($), number of battery units, capital cost of converter ($), and number of converter, respectively.

The O&M costs ($) of components of the microgrid are calculated as:

$$C^{ o\& m}={Cpv}\left( C^{{PV}, o\& m} N^{{PV}, o\& m}+ C^{{WT}, o\& m} N^{{WT}}+ C^{{DG}, o\& m} N^{{DG}}+ C^{{BT}, o\& m} N^{{BT}}\right)$$
(18)

The replacement cost ($) of the microgrid is represented as:

$$C^{ r}={Cpv}\left( C^{{PV}} N^{{PV}}+ C^{{WT}} N^{{WT}}+ C^{{DG}} N^{{DG}}+ C^{{BT}} N^{{BT}}\right)$$
(19)

Fuel cost is calculated by Eq. (20).

$$C^{ f}=\left( F^{ p}\sum{ F}_{ c}\;\left( t\right){CPV}\right)$$
(20)

where \({C}^{f}\) is the fuel cost, \({F}^{p}\) is the current fuel price/liter, and \({F}_{c}\) fuel consumption.

\(CRF=\frac{{i\left(1+i\right)}^{n}}{{\left(1+n\right)}^{n}-1}\times CRF\), where i is the interest rate, and n is the number of years.

  • Objective 2: \({{CO}}_{2}\) emission in a hybrid electric system results from the production of toxic gasses during electricity generation. The annual emission is calculated for the generator by multiplying the emission factor by the total annual fuel consumption. It is represented in mathematical form by the equation:

    $${{CO}}_2\;{emission}= N^{{CV}}\times E^{ f}\times{ f}_{ c}$$
    (21)

\({N}^{CV}\) is the net calorific value (TJ/ton); \({E}^{f}\) emission factor (kg \({{CO}}_{2}\)/TJ).

Constraints

The design variable constraints determine the range of the decision variable, supply–demand energy balance, reliability requirements, and the number of components employed. The following restrictions should be met by the objective function described above.

$$\left\{\begin{array}{c} N^{{PV},\min}\leq N^{{PV}}\leq N^{{PV},\max}\\ N^{{WT},\min}\leq N^{{WT}}\leq N^{{WT},\max}\\ N^{{DG},\min}\leq N^{{DG}}\leq N^{{DG},\max}\\ N^{{BT},\min}\leq N^{{BT}}\leq N^{{BT},\max}\end{array}\right.$$
(22)

Renewable fraction (RF)

The RF is also a constraint in the optimization. It is the parameter to measure the fraction of power delivered to load. It can be represented as the ratio of the amount of power produced from the DG units compared to the quantity of power produced from renewable energy resources, which can be represented as:

$${RF}=100\times\left(1-\frac{\sum{ P}_{{DG}}}{{ P}_{ R}}\right)\%$$
(23)

where \({P}_{DG}\) is DG power and \({P}_{R}\) is renewable power. A value approaching 100 is the more suitable configuration for electricity generation.

Optimization algorithm

For the above-suggested model, the prime objective is to provide the least power supply cost to the community (Askarzadeh 2017). In the literature, numerous optimization processes are described. Due to its simplicity and lower parameter requirements for optimization, particle swarm optimization is widely used in various engineering optimization applications. Particle swarm optimization is utilized to optimize the microgrid problem for the lowest energy cost in this optimization assignment. Particle swarm optimization (PSO) is a technique that mimics natural behaviors such as bird and fish schooling. It was created in 1995 by Kennedy and Eberhart (Radosavljević et al. 2016). Unlike GA, where mutation and crossover transfer information rely on the unpredictability of real numbers for communicating within the swarm, it is extensively used in numerous optimization problems because of its simplicity and versatility. Consequently, it is simple to set up and does not require any encoding or decoding expertise. Kraiem et al. (2021) used PSO for optimization problems of rural electrification. The flowchart of optimization is shown in Fig. 7.

Fig. 7
figure 7

Flowchart of particle swarm optimization

Simulation results and discussion

The isolated microgrid was built to offer rural regions an optimal power supply. In the MATLAB environment, the suggested energy framework is simulated. The goal of the modeling is to ensure that the area has a steady supply of power. The particle swarm optimization technique reduces the cost of power per unit in the area. A PV system, wind turbine, storage, and DG are all included in the model. Storage units are given to improve the power supply’s dependability and ensure that the region has constant access to electricity. Renewable energy resources have intermittent production because they rely on climatic conditions. The appropriate energy supply is delivered to DG and storage units to reduce power supply irregularities. When constructing a microgrid system, the battery system is crucial. When the generated power exceeds the local energy need, many situations develop. Storage devices can be used to store the extra power. In a power outage, energy from a battery may be used to power the region. A lead-acid battery was utilized to represent the microgrid system. Diesel generators are extremely useful in designing a microgrid system. It provides power when no other source is available. It is used as the secondary energy source in the system. The proposed model’s goal is to provide an uninterruptible power supply to the community at the lowest possible cost of electricity. The operation conditions of the components in four scenarios are produced by combining renewable energy resources based on the availability of renewable resources. Table 4 shows the parameters utilized in each scenario’s simulation.

Table 4 Parameters used in optimization

The configuration \({S}_{1}\) consists of DG, PV, and energy storage systems that supply power to the area. The 300-W solar PV panel is coupled to satisfy the maximum power requirement of the area. Table 5 suggests the simulation results for each configuration. The results suggest that \({S}_{1}\) has the total net present cost (TNPC) of $53,892.07 with COE of 0.24 $/kWh. The model has only depended on one renewable resource, i.e., SPV, which is very sporadic. Hence, if SPV is not producing energy, then most of the energy is supplied by the DG units, which causes more greenhouse gas emissions in the environment. \({S}_{2}\) is formed by combining PV/DG/battery and wind energy systems. Figure 8 suggests that the TNPC of \({S}_{1}\) and \({S}_{2}\) are comparable. Maximum participation of renewable resources makes the system more feasible for the electrification of the rural community.

Table 5 Simulation results in different scenarios
Fig. 8
figure 8

Cost variation of the components for different scenarios

The system has a TNPC of $59,195.61, nearly 1% higher than the previous case. The LCOE of the second system is 0.20$/kWh, which is the least among all four configurations. \({S}_{3}\) and \({S}_{4}\) have a higher cost of electrification, and COE makes them unfeasible for electronation of the rural community. All the above scenarios are evaluated in terms of COE, TNPC, and the operating cost of the microgrid.

The comparative study in Fig. 8 suggested that maximum RER participation is necessary to curb the high operating cost and per-unit energy cost. The configuration \({S}_{2}\) that has PV/WT/battery and DG units has maximum RER participation and comparable operating cost. The PV and WT are used to supply the energy, but if one of the sources is not working, other renewable resources, in conjunction with DG and battery units, satisfy the area’s demand. Figure 9 shows the convergence of \({S}_{2}\).

Fig. 9
figure 9

Convergence curve for \({S}_{2}\)

The only means to electrify the region is through a standalone microgrid system due to the exorbitant expense of developing grid infrastructure. The intermittent nature of RER directly impacts the plant’s total efficiency.

Hence, it is not always possible to supply energy using a renewable-based system. The battery and diesel generator are provided in the system to enhance reliability. It provides the energy when RER is insufficient to satisfy the energy need of the locality. Figure 10 shows the energy production due to the microgrid components.

Fig. 10
figure 10

Power delivered by all components

An energy storage system (ESS) is employed in the power system to improve the power supply’s dependability. ESS is critical to power generation since it supports a variety of energy sources to meet load needs. ESS can help with power intermittency because most renewable energy sources generate electricity dependent on atmospheric conditions. Consequently, ESS such as batteries, ultracapacitors, flywheels, and thermochemical storage devices may be widely used to offer clients a constant power source. Historically, fossil fuels have provided electricity whenever the customer needed it, and they can be easily stored. Unlike fossil fuels, renewable energy sources provide electricity only when the wind or sun blows. As a result, ESS may store energy while not in use or during periods of high generation. Power quality, frequency and voltage control, power fluctuations, and auxiliary services may all be improved by ESS. A lead-acid battery is utilized in the current system modeling (Tan et al. 2021). The minimum SOC of the battery is 40%, and the maximum SOC is 100%. The battery unit stores the energy when extra power is produced and supplies the power when needed. Figure 11 shows the battery’s state of charge, and Fig. 12 shows the battery status (input power, charging, and discharging power).

Fig. 11
figure 11

State of charge of the battery

Fig. 12
figure 12

Power status of the battery

The proposed microgrid is computed for the least cost of optimization using PSO for the off-grid operation. The microgrid operation is based on the user requirement of the energy in the area. The DG operation emits toxic gasses into the environment. Hence, the planner designed such a way that minimum operation of DG was permitted. Furthermore, the amount of hazardous carbon dioxide emissions in Table 6 compares total renewable production per load demand to carbon dioxide (\({{CO}}_{2}\)) and nitrogen oxides (NOx). This table shows that the model of \({S}_{2}\) is the most environmentally beneficial, as \({{CO}}_{2}\) emissions are comparatively low. However, the 100% renewable concept is not viable in terms of reliability, as the backup diesel generator is required to improve system reliability when clouds cover the PV panels for an extended period. The DG units in the backup provide the electrification to the area. The \({{CO}}_{2}\) emission is examined in the different scenarios listed below in Table 6.

Table 6 Emission of greenhouse gasses

The comparative investigation of Table 6 suggests that maximum participation in renewable energy resources produced less pollution to the environment. Scenario 2, which has a more significant participation of renewable, shows that \({{CO}}_{2}\) emission is 5994 kg/year. The maximum emission of \({{CO}}_{2}\) reported in scenario 4, which is (10,742 kg/year).

Hence, microgrid planning always suggests that planners keep maximum participation of renewable resources to curb GHG emissions and increase energy security.

Sensitivity analysis, technical hurdles, and challenges

Since renewable power supplies are inherently uncertain regarding power generation, the best configuration is subjected to sensitivity analysis to see how the COE would vary if the solar radiation and fuel price were changed. Figure 13 depicts the impacts of the variation on the COE during the simulation. The higher and lower scaled values are determined from the reference values by subtracting and adding the specified (percent) from the average values, with the average value scaled up/down by 10%. The 10% is chosen for examination as it may demonstrate the general performance and its influence on COE while adjusting resource capacity for the best configuration. The variation in energy cost with PV, wind turbine, DG power, and load is explored in an economical solution. Figure 13 displays the anticipated variance for the optimal energy configuration. When the cost of certain factors changes, the model’s energy cost varies. The 25% or more indicators parameter variation is applied to estimate energy costs’ impact as the change in DG power, PV power, and load fluctuation.

Fig. 13
figure 13

COE variation as a function of change in parameters

As shown in Fig. 13, the COE is highly impacted by the variation of DG power. Throughout the decade, the cost of diesel power raises by more than 45%, increasing the COE by 0.1 $/kWh. As a result, it is feasible that the COE and GHG emissions will rise as the number of diesel generators increases. To reduce energy expenses, RER must be included. The COE is significantly reduced when the quantity of PV panels is increased. The system’s economics are sustained by raising the size of PV array and energy storage. In actuality, COE sensitivity to loads diminishes until it reaches 50%, after which it rises as load variations grow. COE varies by a factor of 75% higher than PV and DG characteristics. As a result of the reduction in RER units, energy prices will rise. The cost-effectiveness and long-term viability of a microgrid are determined by the optimal performance evaluation of RER and DG units.

Even though Uttarakhand (India) has rich in the availability of renewable energy sources, power access to the rural regions is influenced by the specific barrier in terms of human resources, technology, policy framework, and economics. The few difficulties and challenges in the deployment of the renewable-based electrification are stated below:

  • The area’s geographical structure affected the development of projects and infrastructure necessary for the electrification.

  • Energy access in remote places, a lack of resource evaluation databases, the low maturity level of RER, and the requirement for energy storage are all technological barriers.

  • There is a limited supply of comprehensive and reliable information about renewable energy sources. There are just a few wind speed, solar radiation, and mean rain waterfall measurement stations in the state.

  • Investors are hesitant to invest in renewable energy systems since they are a new technology with a low level of maturity. The intermittent nature of renewable energy supplies has constantly threatened to meet the area’s peak demand. As a result, energy storage is required.

  • The economic barrier includes the high initial cost of renewable products has high transportation costs in hilly areas. So, this sector needs highly subsides investment.

  • In India, renewable energy-based projects offered a weak intuitional framework for financial management.

Limitations and policy recommendations

Supporting economic activity and providing reliable supply are the primary vital outcomes of energy planning, but they must be pursued under the appropriate environmental policies. This offers a problem for policymakers working in the current carbon energy economy, who must strike a balance in energy policies that justify human progress and environmental protection based on carbon pollution and climate change. The centralized fossil generating and distribution networks have resulted in significant socio-economic benefits nationally and Uttarakhand.

On the other hand, this policy agenda rapidly reaches its geographic, technical, and budgetary boundaries. A significant move to cleaner, lower-carbon generating technologies is required. As a result, the policy must shift toward decentralized off-grid and grid-compliant technologies. The transition to decentralized PV systems with grid connectivity will help achieve sustainable development goals and environmental justice. State policies can either follow the central government’s centralized priorities or dualistic policy agendas that support centralized and decentralized methods. However, a dual strategy must account for weak grid dependability in rural areas and financially distressed distribution businesses in the state. We offer a tiered hierarchy of techniques based on literature and expert interviews that, while particular to India and Uttarakhand, apply to other jurisdictions:

  • The above explanation shows that renewable energy resources reduce GHG emissions in the environment while also decreasing the cost of power per unit. As a result, the expansion of renewable energy is an inexorable trend in the fight against GHG emissions. A long-term policy framework is necessary to implement renewable technologies in electricity generation.

  • Most rural communities still lack access to modern forms of electricity since they live in secluded highland places distant from the plane region. These folks rely on kerosene for their cooking and lighting requirements. Currently, the state’s rural areas demand an innovative energy supply plan. Under the planned program, solar energy, bioenergy, hydropower, and other RER will be encouraged to replace non-renewable energy sources such as diesel, gasoline, and kerosene.

  • Implement policies that use flexible and incentive taxes to stimulate and reward private investment in developing renewable technologies.

  • The long-term influence of renewable energy on carbon emissions is significant. As a result, a long-term mechanism for renewable energy consumption must be devised and long-term regulations.

  • As a result of the exponential rise of the Indian energy industry in recent years, several programs and strategies have been developed to meet energy objectives in renewable industries. This creates a massive opportunity for emerging energy storage technologies, posing considerable obstacles.

  • Every state in India has its renewable energy agency and electrical regulation, resulting in state-specific policies and laws lacking coordination.

  • It is necessary to build specific transmission lines to analyze the energy stored in renewable energy facilities.

  • It is critical to producing research, development, and demonstration projects in energy storage and renewable energy integration.

  • These conclusions are important for policymakers in the energy and carbon markets. According to the findings, India should preserve monetary policy stability by fully considering renewable energy and the environment. The reasoning behind this is that changes in monetary policy will offer up new opportunities for renewable energy usage, which will assist in increasing clean energy consumption.

  • Organizations may help reach carbon reduction goals by supporting the use of renewable energy and maintaining stable monetary policies. Understanding the long-term effects of monetary policy uncertainty on renewable energy use is critical for environmental management.

  • A database of renewable energy sources (solar, wind, small hydro, biomass etc.) must be built, maintained, and verified systematically in partnership with specialists and specialized institutions for on-site resource evaluation.

  • Demand-side management (DSM) is a central idea in energy consumption at the user end that aids in creating an energy-efficient system.

  • The majority of rural families use energy-inefficient electric bulbs for lighting. For lighting, CFLs are more efficient and cost-effective than bulbs. The appropriate sizing of renewable energy systems in an integrated renewable energy system is also required for an energy-efficient system; this will aid in minimizing excess energy and enhancing system reliability.

Analysis of the findings to the existing literature

The current study shows how a rural microgrid may be used to electrify remote locations when no grid expansion is available. The system is made up of locally accessible energy resources. This study compares the proposed microgrid model’s findings to those of similar studies in the literature. The comparisons are listed in Table 7. A close examination of the table reveals that the present study’s per-unit energy cost is lower than the literature indicated.

Table 7 Proposed microgrid compared with existing literature

Conclusion and future scope

Renewable energy-based generation used around the world for the energy solution of rural populations. In developing countries like India, a large section of the inhabitants still needs access to electricity. The current research looked at electrifying hilly terrain where grid infrastructure construction is costly. This paper proposes a hybrid RER model that includes a solar PV system, diesel generators, batteries, and a wind turbine. The suggested microgrid worked in an independent mode. The suggested microgrid will serve Uttarakhand’s rural population (India). Four distinct scenarios are evaluated based on the available energy demand and available renewable energy supplies. According to the simulation findings, the integration of PV/WES/battery and DG units produces the lowest energy cost in scenario 2. The optimal case has a 90% renewable fraction, and COE is $0.20/kWh. For the least environmental emission of pollutants, the high penetration of renewable energy resources is essential.

Several governments are promoting PV-based energy solutions for electrifying remote rural areas. Traditional fuel-based generation provides a larger share of our energy requirement. It would indeed be difficult to replace such an energy source completely. It should be introduced progressively to decrease greenhouse gas emissions and total energy expenditures.

To make the above study more applicable to the rural electrification, future studies focus on the following key areas.

  • To develop a more sophisticated energy management system considering microgrid poll (connecting to or more microgrid tougher), which enhances power supply reliability.

  • The present study only considers PV and wind turbines as renewable resources; more resources such as biogas, biomass, and hydro can be integrated into the system to enhance the power supply capability.

  • In the present system, the modeling does not consider the uncertainties of renewable energy power output. This can be taken into account in future research and modeling.

  • The present study considers only a single storage facility, multiple storage planning be implemented in the future study.