Sustainable resources and geographic information
Jubail, a Persian Gulf seashore city of Saudi Arabia, within the Eastern Province (27° 00’ 00” N, 49° 39’ 16” E), was taken as the study area (Fig. 1). As of 2022, Jubail had a population of 474,679 and is recognized globally for hosting one of the largest industrial cities, including SABIC, the Middle East’s largest and the world’s fourth-largest petrochemical company.

Map of Jubail, Saudi Arabia, adopted from Maps Saudi Arabia – KSA.“https://maps-saudi-arabia.com27.
Solar energy
Accurate meteorological data on solar irradiance and wind speed was obtained from NASA’s database through the HOMER software application for this purpose to ensure accuracy in the data. Hourly solar irradiation time series for the Al Jubail area is shown in Fig. 2 and shows that it fluctuates with daily averages of 5.58 kW/m² /day. These reflect the highest potential of the area to utilize solar power.

Hourly time steps of solar radiation data for Jubail.
Biogas energy
The total daily Municipal Solid Waste (MSW) generation for the city of Jubail is estimated based on its 2022 population of 474,679 inhabitants. By applying Saudi Arabia’s national average MSW production rate of 1.4 kg per capita per day28, the city’s total calculated waste output amounts to approximately 664.55 tons. Table 1 estimates that nearly 37% of this MSW (245.88 tons/day) comprises organic fractions and can therefore be used as raw feedstock for AD to produce biogas.
The calculation of MSW production per year uses Eq. 1. The equation accounts for per capita MSW production per day (Gc) and population (Pc) of the municipality. Other factors include per capita increase in future generation of wastes (Xf) and population increase (Yf) in current (C) and future (F) years.
$$\:Annual\:generation\:of\:MSW(tons/year)=\frac{365}{1000}\times\:\left[{G}_{c}{\left(1+\frac{{X}_{f}}{100}\right)}^{F-C}\right]\times\:\left[{P}_{c}{\left(1+\frac{{Y}_{f}}{100}\right)}^{F-C}\right]\:\:$$
(1)
$$\:{G}_{c}=\frac{Total\:landfill\:waste\:\left(\:kg\right)}{Total\:population\times\:time\:\left(day\right)}\:\:$$
(2)
Furthermore, 66 m³ of biogas are produced from 1 ton of MSW29. Within the research area, 245.88 tons of available organic MSW is present, which can produce 16288.08 m³/day of biogas through an AD plant. A cubic meter of biogas produces approximately 6 kWh of electric power30, which leads to a potential daily power supply of 97368.5 kWh. Hourly load profile for biogas production is shown in Fig. 3.

Hourly load profile for biogas production.
Electric vehicle charging stations and community load analysis
The electrical energy consumption analysis in this study is based on the hypothesis of an EVCS, which is expected to consume 1200 kWh/day in summer and 504 kWh/day in winter, while the peak power demands are 120 and 62 kW, respectively. Charging patterns for 25 vehicles in summer and 13 in winter, each at 4.8 kW, were analyzed (Fig. 4). This kind of analysis helps in generating representative load profiles based on seasonal loadings.

Hourly load profile for EVCS.
The simulation of hourly load profiles for 1,000 representative households resulted in a total daily energy demand of 31,655 kWh on summer weekdays and 31,945 kWh on summer weekends, while the peak demand on the same days corresponded to 4,480 kW. In winter, daily consumption declined to 21,075 kWh on weekdays and 20,945 kWh on weekends, accompanied by a reduced peak load of 3,510 kW (Fig. 5a). For commercial units, summer weekday consumption was 7162.0 kWh, rising to 7864.5 kWh on weekends, while winter values were 5607.0 kWh during weekdays and 6276.5 kWh on weekends (Fig. 5b). Educational centers consumed more energy in winter (2595 kWh) than summer (1675 kWh), with winter peaks at 290 kW and summer at 250 kW (Fig. 5c). For an imaginary medical facility, the maximum power consumed was 2570 KWh per summer week-days due to HVAC loads, with minimum winter weekend power consumption of 1050 KWh, and maximum power of 90 KW (Fig. 5d).


Hourly load profile for (a) 1000 hypothetical households, (b) commercial units, (c) educational centers, and (d) medical center.
Furthermore, providing fresh water for 6500 people, whose daily requirement is 20 L each, making a total of 130 cubic meters per day12. An RO system needs 4.38 kWh of power to desalinate 1 m³ of freshwater12 therefore, 569.4 kWh of electrical power per day is needed to desalinate 130 m³ of water.
Hybrid system architecture
With regard to HRES, sector coupling can be defined as the integration of various energy carriers like electricity, hydrogen, and water, as well as the subsystems associated with them. These subsystems do not work independently; rather, they are interlinked in a manner that energy can be exchanged between several sectors. For example, excess electricity produced by renewables can be transformed into hydrogen using electrolysis, which can again be used as an energy carrier/storage medium. This process increases the overall flexibility of the system as well as the efficiency of renewable energy use. Hence, the proposed design of HRES architecture aims to support this kind of interaction between various energy carriers.
This study proposes an HRES that includes solar PV, a reverse osmosis unit, a hydrogen energy storage system, a biogas generator, and a grid connection. Figure 6 presents a schematic of the system architecture. The system is capable of managing intermittent renewables, therefore ably satisfying the stochastic load needs of a community as well as its EVCS. Peak shaving utilization of excess generation reduces aggregated loads, thereby preventing the grid overload typical of centralized charging systems. The system’s integration of hydrogen storage and affordable biogas backup provides a renewable and uninterruptible power supply.

Schematic of the HRES architecture.
To make the coupling between the electricity, hydrogen, and water subsystems explicit, Fig. 7 illustrates the multi-energy interactions and the directions of energy and mass exchange among these carriers. Surplus renewable electricity from the photovoltaic array and biogas generator constitutes the central coupling node, from which power can be directed to the electrolyzer for green-hydrogen production, to the reverse-osmosis unit for freshwater generation, or exported to the grid, according to the prevailing operational and market conditions. The hydrogen produced is stored and later reconverted to electricity through the fuel cell during deficit periods, while the desalinated water serves both the local demand and the electrolyzer feed. This depiction complements Fig. 6 by making explicit the functional coupling logic among the electricity, hydrogen, and water subsystems that underpins the dispatch strategy adopted in this study.

Schematic of the electricity-hydrogen-water multi-energy coupling, showing the energy and mass flows that link photovoltaic and biogas generation, the electrolyzer, hydrogen storage, the fuel cell, reverse-osmosis desalination, and grid interaction.
Mathematical modeling
Mathematical modeling of HRES utilizes financial and technical specifications for each component, detailed uniformly in Table 2.
Photovoltaic model
The PV panel is calculated using the following formula, which accounts for the degradation coefficient, solar irradiance, temperature, and standard test conditions38:
$$\:PV\text{}\left(t\right)={R}_{PV}\times\:{f}_{PV}\times\:\left[1+\mu\:\left({T}_{C}-{T}_{S}\right)\right]\:$$
(3)
Where:
-
PV(t) represents the photovoltaic module’s output power at time t.
-
RPV is the PV cell’s maximum power output.
-
TS is the temperature at standard test conditions.
-
fPV is the deterioration coefficient.
-
The temperature coefficient is denoted by µ.
-
PV cell temperature is denoted by TC.
Estimation for TC is crucial for the power calculation and is calculated by using the ambient temperature at Nominal Operating Cell Temperature (NOCT), solar irradiance at NOCT, and the PV panel efficacy (ηPV). For the selected cell type, ηPV is assumed to be 21.4%39:
$$\:{T}_{C}={T}_{a}+{I}_{T}\frac{\left({T}_{C,NOCT}-{T}_{a,NOCT}\right)}{{I}_{T,NOCT}}\times\:\left(1-\frac{{\eta\:}_{PV}}{0.9}\right)\:\:$$
(4)
Where:
-
The ambient temperature is denoted by Ta.
-
The sun irradiance is what it is.
-
TC, NOCT represents the cell temperature at NOCT.
-
The ambient temperature at NOCT is Ta, NOCT.
-
The sun radiation at NOCT is known as IT, NOCT.
Biogas generator model
The electrical energy generated by the biogas generator (BG), which constitutes an essential part of most HRES systems, is evaluated depending on the transformation of biogas into useful electric and thermal energy using the following formula18:
$$E_{{BG}} = \frac{{\eta \times LVH \times Q_{{br}} }}{{\gamma _{i} }}$$
(5)
Where:
-
The available electrical energy is represented by EBG.
-
The lower biogas calorific value is known as LVH.
-
The recoverable biogas flow is represented by Qbr.
-
η is the electrical efficiency of the BG.
-
γi is the conversion factor.
-
The overall efficacy of BG for the purposes of this analysis is considered to be 28.45%.
Then power generated (P) by the BG can be calculated by18:
$$\:\text{P}=\frac{{E}_{BG}}{\text{C}\text{F}\times\:8760}\:\:$$
(6)
In the above, CF is the plant availability, or the capacity factor, typically ranging between 80% and 90%.
Fuel cell model
Fuel cells are an integral component for balancing supply and demand for energy in an HRES. The difference between electrical demand, electric car charging, and PV is used to determine the energy delivered by the fuel cell (FC) in each timestep t40:
$$\:{E}_{FC}\left(t\right)=\frac{\left[\left({E}_{Elec}\text{}\left(t\right)+{E}_{EVCS\text{}}\left(t\right)\right)-\left({E}_{PV\text{}}(t\right)\right]}{{\eta\:}_{inv\text{}}}$$
(7)
Where:
-
EFC(t) is the energy delivered by the fuel cell at time t.
-
EElec(t) is the electrical load.
-
EEVCS(t) is the electric vehicle charging demand.
-
EPV(t) is the energy generated by PV.
-
ηinv is the inverter efficiency.
The HFC required volume for hydrogen to cover an energy deficiency is found by employing the electric conversion efficacy of the FC (ηFC), along with the calorific characteristic of the hydrogen (HHVH2)40:
$$\:{H}_{FC}\left(t\right)=\frac{{E}_{FC}\left(t\right)}{{HHV}_{{H}_{2}}\times\:{\eta\:}_{FC}}\:\:$$
(8)
With ηFC = 50% and HHVH2 = 39.4 kWh/kg.
Electrolyzer and hydrogen storage
An electrolyzer can be used to store excess electricity from renewable sources as hydrogen. The input electric power to the electrolyzer is given as40:
$$\:{E}_{Electrolyzer}\left(t\right)={\eta\:}_{inv}\times\:\left[{E}_{PV}\left(t\right)-{E}_{Elec\text{}}\text{}\left(t\right)\right]\:$$
(9)
The hourly hydrogen output of the electrolyzer (HElectrolyzer(t)) is then calculated from a quadratic relation40:
$$\:{H}_{Electrolyzer}\left(t\right)=1.43\times\:{10}^{-3}+2.39\times\:{10}^{-2}\:\:{E}_{Electrolyzer}\left(t\right)-4.32\:\times\:{10}^{-5}\:\:\:{E}_{Electrolyzer}^{2}\:\left(t\right)\:\:$$
(10)
Hydrogen storage is required to deliver system stability and reliability. The stored hydrogen quantity (HHS(t)) at any given time is the sum of consumption and generation. The quantity of hydrogen stored rises when renewable energy supply exceeds load demand:
$$\:{H}_{HS}\left(t\right)={H}_{HS}\:\text{}\left(t-1\right)+{H}_{Electrolyzer\:\text{}}\left(t\right)\:\:$$
(11)
Conversely, if hydrogen is removed from storage to make up for a shortage, the formula is as follows:
$$\:{H}_{HS}\left(t\right)={H}_{HS}\:\text{}\left(t-1\right)+{H}_{FC\text{}}\left(t\right)\:$$
(12)
Bi-directional inverter
A bi-directional inverter provides power conversion between AC and DC with unidirectional free energy flow in the HRES. The load side output power (Pout(t)) is determined from input power (Pin(t)) and the inverter’s efficiency (ηinv)41:
$$P_{{Out}} \left( t \right) = \eta _{{inv}} ~ + P_{{in}} \left( t \right)$$
(13)
Water storage tank and reverse osmosis desalination model
One of the most important design factors is the water tank’s volumetric capacity (VTC). The energy equivalent of this storage tank, is calculated through Eq. (14)33:
$$\:Power\:tank\:capacity={(S}_{D}{\left)\right(V}_{TC})$$
(14)
where SD (4.38 kWh/m³) represents the average power consumed that is utilized in producing one cubic meter of clean water12.
Hourly water consumption is linearly proportional to power demand, as shown in Eq. (15):
$$\:{P}_{dem}=\left({S}_{D}\right)\left({H}_{wd}\right)$$
(15)
Pdem is used to measure hourly water demand in kilowatts, and Hwd refers to hourly water demand in cubic meters.
The desalination unit capacity for daily water production is determined via Eq. (16):
$$\:\text{D}\text{a}\text{i}\text{l}\text{y}\:\text{W}\text{a}\text{t}\text{e}\text{r}\:\text{P}\text{r}\text{o}\text{d}\text{u}\text{c}\text{t}\text{i}\text{o}\text{n}=24\left(\frac{hours}{day}\right)\left(\frac{PFC}{{S}_{D}}\right)$$
(16)
In this formula, PFC is a crucial parameter for the desalination capacity unit. At the beginning of the desalination plant, there should be a minimum operating power (PFmin) to counteract osmotic pressure; in this work, PFmin was considered 25% of the rated power.
Economic indicators for performance assessment
Economic indicators can be divided into static, dynamic, and life-cycle indicators. The former, for example, includes capital cost and O&M cost per year, which refer to the direct costs and do not take into account the time value of money. Dynamic indicators, on the other hand, include, among others, replacement cost and salvage value of assets, taking into account future cash flows through discounting. Lastly, life-cycle indicators, which include NPC, LCOE, LCOH, and LCOW, integrate all costs and outputs associated with the investment over its life cycle. This hierarchy places capital, replacement, O&M, and salvage costs at the base of economic assessment; NPC combines the above-mentioned costs; LCOE is derived from NPC; and LCOH and LCOW are subsequently determined using LCOE and the annualized costs of the hydrogen and desalination subsystems.
Technical performance
Excess energy utilization factor
The efficiency of the usage of extra energy by the HRES in reducing losses and maximizing energy storage is calculated through the Extra Energy Utilization Factor (EUF)42:
$$\:EUF=\frac{Excess\:Energy-Dumped\:Energy\text{}}{Excess\:Energy}\:\:$$
(17)
A higher EUF indicates the efficiency of extra energy utilization and maximized storage capacity of energy.
HRES efficiency
The HRES’s overall efficiency can be calculated by dividing its usable generation by its total generation43:
$$\eta _{{HRES}} {\text{~~}}\left( {\text{\% }} \right) = \frac{{Total{\text{~}}Generation – Dumped{\text{~}}Energy}}{{Total{\text{~}}Generation}} \times 100$$
(18)
Economic performance metrics
Capital cost
$$\:{C}_{cap}=\sum\:_{j=1}^{n}\left({N}_{\text{j}}\times\:{C}_{j}\:\right)\:\:$$
(19)
Where:
-
Ccap represents the total original acquisition cost of the system.
-
Nj is the total number of type j components.
-
Cj is a component of type j’s unit capital cost.
Replacement cost
$$\:{C}_{rep,total\text{}}=\sum\:_{k=1}^{K}\left[{N}_{k}\times\:{C}_{rep,k}\:\:\times\:\:\sum\:_{j=1}^{{N}_{rep,k}}{\left(\frac{1+{f}_{k}}{1+i}\right)}^{{L}_{k}.j}\right]\:$$
(20)
Where:
-
Crep, total: The total NPC of all replacement costs for all component types over the entire project lifetime.
-
Nk: Specifies the quantity of identical units of component type k installed within the system.
-
Crep, k: The undiscounted, nominal cost associated with the replacement of a single unit of component type k, incurred at the time of the event.
-
j: A sequential index, ranging from 1 to Nrep, k, that enumerates the successive replacement events for a particular component type, k.
-
Nrep, k: The total frequency of replacement for component type k over the duration of the project’s designated analysis period.
-
fk: The designated annual rate of cost escalation (i.e., inflation) specific to component type k, modeling the prospective increase in its price over time.
-
Lk: The expected operational service life, measured in years, for an individual component of type k.
-
Lk.j: The specific point in time (in years) for the j-th replacement of component k, determined by multiplying the component’s lifespan (Lk) by the replacement index (j).
-
i: the annual interest rate.
Annual operational and maintenance cost
$$\:{C}_{O\&M\text{}}={N}_{comp}\times\:{C}_{O\&M,comp}\:$$
(21)
Where:
-
CO&M is the total yearly cost of the system’s operation and maintenance (O&M).
-
Ncomp is the system’s total number of components.
-
CO&M,comp represents the yearly O&M expenses related to a particular component.
Salvage value
$$\:{C}_{Salvage\text{}\text{}}={C}_{rep,comp}\times\:\:\frac{{R}_{rem,comp}}{{L}_{comp}}\times\:{\left(\frac{1}{1+i}\right)}^{L}$$
(22)
Where:
-
CSalvage: This is the resulting NPC of a component at the end of the project’s economic life, expressed in monetary units.
-
Crep, comp: This term represents the total capital cost required to procure a new, identical component.
-
Rrem, comp: It calculates the remaining operating time (typically in years) the component has at the completion of the project analysis period.
-
Lcomp: This is the estimated total life of the component, from installation to the end date of its service life, in years.
-
L: This is the duration of the project (in years) during which the economic analysis is being conducted.
Net present cost
NPC is a lifetime economic assessment of the system as a whole44:
$$\:NPC={C}_{cap}+\sum\:\left[\frac{{(C}_{rep}{\left(\text{t}\right)\:+C}_{O\&M}\left(\text{t}\right)\:)}{{\left(1+i\right)}^{t}}\right]-\left[\frac{{C}_{salvage}}{{\left(1+i\right)}^{L}}\:\right]$$
(23)
Where:
Levelized cost of energy
The useful unit average cost of electrical energy generated by the HRES is known as the LCOE45:
$$\:\:\text{L}\text{C}\text{O}\text{E}=\frac{\text{C}\text{R}\text{F}(\text{i},\text{L})\times\:\text{N}\text{P}\text{C}}{\sum\:_{t=1}^{8760}{E}_{s}}\:$$
(24)
Here, CRF (i, L) is the capital recovery factor, while Es is the annual energy supplied to the load and is defined as follows46:
$$\:CRF\left(i,L\right)=\frac{i{\left(1+i\right)}^{L}}{{\left(1+i\right)}^{L}-1}\:\:$$
(25)
Levelized cost of hydrogen
Through calculation of total life cycle cost of the specialized hydrogen generation system, LCOH estimates the average life span and production cost per kilogram (Eq. 26).
$$\:\text{LCOH}=\frac{({C}_{{\text{annual,\:H}}_{2}\text{system}}-{R}_{{\text{annual,\:O}}_{2}})+({E}_{\text{ELY}}\times\:\text{LCOE})-({E}_{\text{FC}}\times\:\text{LCOE})}{{M}_{{\text{H}}_{2}\text{production}}}\:$$
(26)
Where:
-
Cannual, H2 system: This item accounts for the annualized cost of the hydrogen subsystem. It calculates the value by annualizing the NPC for all hydrogen-related components.
-
Rannual, O2: This amount is revenue generated from oxygen sales. This revenue is counted as a credit, which directly decreases the net annualized cost of the hydrogen system.
-
EELY ×LCOE: This is the cost of electricity consumed by the electrolyzer on a yearly basis.
-
EFC ×LCOE: This is the annual value of its electricity production.
-
MH2 production: It is the total mass of hydrogen produced in a year.Levelized cost of water.
The LCOW is the average cost of one cubic meter of freshwater produced throughout the project lifetime. Equation 27 is set up so that it includes all the costs related to the desalination unit.
$$\:LCOW\left(\frac{\text{\$}}{{m}^{3}}\right)=\frac{\left({C}_{annual,\:RO\:system}\right)+\left({E}_{RO}\times\:LCOE\right)}{\sum\:_{h=0}^{h=8760}{V}_{Water\:production}}\:\:$$
(27)
Where:
-
VWater production: Total volume of freshwater produced annually (m³/year).
-
Cannual, RO system: This is the total of all annualized costs, other than electrical, of the RO desalination unit.
-
ERO×LCOE: This phrase measures the RO unit’s whole yearly electricity consumption expenses.
Environmental performance metrics
Life cycle emission
The LCE calculates the environmental impact of the HRES by summing the CO₂ emissions from all the components over their lifetime47:
$$LCE = \mathop \sum \limits_{m} \mathop \sum \limits_{{i = 1}}^{T} \psi _{m} E_{{m,i}} ,~m\epsilon \left\{ {PV,BG~,~FC,~RO,~Electrolyzer,and~water~storage} \right\}$$
(28)
where Ψm is component m’s life-cycle CO₂ emissions, and Em, i is the energy transformed or stored at time i by component m. Technology lifespan energy production and corresponding emission factors are taken into consideration for the calculation of total LCE, as shown in Table 3.
Renewable fraction
The RF metric, defined in Eq. (29), quantifies the use of renewable energy for load requirements, while Enonren represents non-renewable energy utilization, and Es denotes the total energy supplied to the load.
$$\:RF=1-\frac{{E}_{nonren}}{{E}_{s}}$$
(29)
Indicators for social performance
The indicators that have been chosen for the social performance assessment in this case study represent the key aspects of the influence of the studied hybrid renewable energy system on society due to its three-fold function: electricity generation, hydrogen production, and water desalination. In particular, Human health impacts (HHD) stands for human health impacts caused by the emission throughout the system’s entire lifecycle, ecosystem damage (ESD) refers to the damage to the ecosystem caused by the emission throughout the lifecycle, Human Development Index (HDI) stands for Human Development Index, and Job Creation Factor (JCF) stands for job creation factor.
Assessment of human health and ecosystem damage
Climate change, a result of emissions of CO₂, has a detrimental effect on human health and ecosystems50. The evaluation of human health damage (HHD) is assessed in terms of DALYs, whereas ecosystem damages (ESD) are evaluated on the basis of species diversity lost51.
$$\:HHD=1.40\times\:{10}^{-06}\:LCE\:\:$$
(30)
$$\:\text{E}\text{S}\text{D}=7.93\times\:{10}^{-09}\:LCE\:$$
(31)
Human development index
The Human Development Index (HDI) is a measure of the socioeconomic progress of a region. Local energy surplus contributes to HDI and well-being52:
$$\:\text{H}\text{D}\text{I}=0.0978\times\:\text{ln}\left(\frac{{\text{E}}_{\text{l}\text{o}\text{a}\text{d}}+min\left({f}_{\text{e}\text{x},\text{m}\text{a}\text{x}}\times\:{\text{E}}_{\text{e}\text{x},\text{f}\text{l}\text{o}\text{a}\text{d},\text{m}\text{a}\text{x}}\times\:{\text{E}}_{\text{l}\text{o}\text{a}\text{d}}\right)}{Number\:of\:People}\right)-\:0.0319\:$$
(32)
where Eload is the yearly average AC load and Eex is the annual energy surplus, and fex, max and fload, max are multipliers of 0.2 and 0.5, respectively53.
Job creation factor
The total number of jobs created by the system, as the JCF, is calculated by Eq. (33)52:
$$\:JCF=\sum\:_{n}{f}_{JCF,n}\times\:{P}_{n},\:n\:\in\:\:PV,\:FC,RO,BG\:,\:and\:Electrolyzer\:$$
(33)
For each component n, Pn is its capacity and fJCF, n is its specific employment factor. Their values are represented in Table 4.
Grid and commodity market modeling
Grid interaction model
The poly-generation node is linked to the national grid, enabling the buying and selling of electricity regulated by time-of-use (TOU) tariffs, reflecting market prices. The cost incurred by acquiring the necessary power to overcome the energy shortfall changes each hour based on peak and off-peak hours. Revenue obtained in the form of $/kWh comes from selling the excess energy to the electricity network under the FiT system.
The commodity market model
Alongside the sale of electricity, the commodity market of the hub involves green hydrogen and desalinated water, both priced according to the market value. Desalinated water and green hydrogen have an average market price that determines the viability and functioning of the poly-generation facility. The most appropriate economic parameters used as inputs in techno-economic optimization and energy management strategy are given in Table 5. The values are approximated from recent Saudi Arabian market data and relevant literature.
Integrated techno-economic energy management approach
A system utilizing both renewable energy sources needs an integrated approach to manage interactions between electricity production, hydrogen generation, and water consumption. The energy management system is responsible for making decisions about how energy is distributed throughout the system components based on operational conditions. For example, decisions made by the energy management system would determine whether surplus electricity produced is used for producing hydrogen through the electrolyzer or stored somewhere.By considering both energy availability and system constraints, the EMS enables efficient operational coupling between the electrical, hydrogen, and water subsystems. It should be noted that the present framework does not explicitly model physical network losses. Instead, grid interaction is represented through electricity import/export, feed-in constraints, and market-responsive dispatch decisions within the EMS. Therefore, the analysis focuses on the operational role of the grid rather than detailed transmission or distribution network behavior. Although the proposed EMS is formulated to respond to time-varying market signals, the present framework represents a system-level operational scheduling strategy and does not explicitly model implementation-related real-time challenges such as communication delays, forecasting errors, or stochastic market price volatility.
Based on the net power of Pnet(t), the EMS dispatches from among these three scenarios:
$$\:{P}_{\text{net}}\left(t\right)={P}_{\text{gen,RE}}\left(t\right)-{P}_{\text{load,total}}\left(t\right)={P}_{\text{PV}}\left(t\right)-{(P}_{\text{load,community}}\left(t\right)+{P}_{\text{load,EVCS}}\left(t\right))$$
(34)
Depending on the value of Pnet(t), the EMS calls one of the following dispatch scenarios:
Energy deficit scenario (Pnet(t) < 0)
In case there is energy deficiency, or the situation whereby the local load is higher than the generation by renewables, then the EMS dispatches power resources to cater for the energy deficit, that is:
The first priority in the dispatch schedule of the fuel cell system uses hydrogen stores to generate electrical power. The maximum energy generated by the fuel cell is based on its maximum power capacity and mass of hydrogen available. In case the fuel cell does not satisfy the deficit, then there will be operation of the gas generator only if the local load exceeds the minimum capacity of the latter. After all resources have been used, any remaining deficiency is calculated as Loss of Power Supply (LPS) for the hour.
Energy surplus scenario (Pnet(t) > 0)
If there is more renewable generation than local load, the surplus power Psurplus(t) = Pnet(t) is allocated according to an economic optimization process. The EMS calculates the possible hourly revenue for each of the three possible revenue streams:
Revenue from Grid Sale (Rgrid):
$$\:{R}_{\text{grid}}\left(t\right)={P}_{\text{surplus}}\left(t\right)\times\:{C}_{\text{grid,sell}}\left(t\right)\:\:$$
(35)
Revenue from Freshwater Production (Rwater):
$$\:{R}_{\text{water}}\left(t\right)=\left(\frac{{P}_{\text{surplus}}\left(t\right)}{{\text{SEC}}_{\text{RO}}}\right)\times\:{C}_{\text{water}}\:$$
(36)
where SECRO is the specific energy consumption of the RO unit (in kWh/m³).
Revenue from Green Hydrogen Production (RH2):
$$\:{R}_{\text{water}}\left(t\right)=\left(\frac{{P}_{\text{surplus}}\left(t\right)}{{\text{SEC}}_{\text{Ely}}}\right)\times\:{C}_{{\text{H}}_{2}}$$
(37)
where SECEly is the specific energy consumption of the electrolyzer (in kWh/kg).
The EMS allocates the surplus power to the activity that provides the maximum instantaneous revenue:
$$\:\text{Dispatch}\text{}\text{Action}\left(t\right)=\text{arg}{max}\left\{{R}_{\text{grid}}\left(t\right),{R}_{\text{water}}\left(t\right),{R}_{\text{H2}}\left(t\right)\right\}\:\:\:$$
(38)
This choice is subject to the below operation constraints:
-
If the hydrogen tank is full (HHS(t) ≥ HHS, max), it’s not possible to make a decision to produce hydrogen.
-
If the storage tank of freshwater is full, then a decision to produce water is not possible.
-
If the grid feed-in limit is reached (Pto grid(t) ≥ Pgrid, max sell), selling power cannot be decided.
If the most remunerative option is not available, the EMS selects the next most remunerative available option. If all options are either restricted or unavailable, the surplus energy is considered dumped or curtailed.
Energy balance scenario (Pnet(t) = 0)
In this case, the renewable generation precisely equals the local load. No further dispatch action is required, and the system is balanced. This intelligent, market-sensitive EMS turns the HRES into a flexible commercial node rather than a simple power generator, which is able to switch strategically between different commodity markets in trying to optimize its economic operation and investment appeal.
Optimization framework
Objective functions
The study uses a multi-objective optimization technique to enable an integrated sustainability analysis. It is formulated by minimizing the NPC and LCE while maximizing the ηHRES, the JCF, and the total hydrogen output simultaneously. The resulting objective function is defined as:
$$\:\text{F}=\text{m}\text{i}\text{n}\text{i}\text{m}\text{i}\text{z}\text{e}\:\left\{\text{N}\text{P}\text{C},\:\text{L}\text{C}\text{E},\frac{1}{{\eta}_{HRES}},\frac{1}{JCF},\frac{1}{Total\:{H}_{2}\:Produced}\right\}$$
(39)
Range of decision variables
To keep the optimization process within appropriate constraints, upper and lower bounds are defined for each decision variable. Specifically:
$$\:{N}_{m,min}\le\:{N}_{m}\le\:{N}_{m,max},\:m\in\:\left(PV,RO,\:BG,\:FC,\:Inverter,\:{H}_{2}\:Tank,\:Electrolyzer\right)$$
(40)
For the m-th system elements, Nm is the maximum value, Nm, max is the maximum value, and Nm, min is the minimum value. The boundaries of the computational speedup solution space are defined by the lower and upper bounds. The lower bound is considered as 1, and the upper bounds are defined in Table 6. Upper bounds are determined during the first stage of the optimization process after the procedure is carried out on a trial-and-error basis.
Constraints
System reliability constraints
Equation (41) is used to determine the LPSP61:
$$\:\text{L}\text{P}\text{S}\text{P}=\frac{\sum\:_{t=1}^{T}\text{L}\text{P}\text{S}\text{P}\left(t\right)}{\sum\:_{t=1}^{T}{E}_{L}\left(t\right)}$$
(41)
The following formula for T (8760 h) can be used to compute LPSP(t):
$$\:\sum\:_{t=1}^{T}\text{L}\text{P}\text{S}\text{P}\left(t\right)=\sum\:_{t=1}^{T}\left({E}_{L}\left(t\right)-\left[{E}_{Gen}\left(t\right)+{E}_{FC,max}\left(t\right)\right]\times\:{\eta\:}_{inv}\right)$$
(42)
The system reliability constraint may be stated as:
$$\:\text{L}\text{P}\text{S}\text{P}\le\:{\text{L}\text{P}\text{S}\text{P}}_{Desired}$$
(43)
Where LPSPDesired is the desired system reliability and is assumed to be 1 ± 0.5%.
Energy balance constraints
$$\:{E}_{PV}\left(t\right)+{E}_{FC}\left(t\right)+{E}_{BG}\left(t\right)-{E}_{Electrolyzer}\left(t\right)={E}_{L}\left(t\right)+{E}_{Excess}\:\left(t\right)+{E}_{EVCS}\left(t\right)$$
(44)
Energy storage capacity constraints
$$\:{H}_{HS,min}<{H}_{HS\left(t\right)\:}<{H}_{HS,max\:}\:$$
(45)
The minimum and maximum capabilities of the hydrogen energy storage system are referred to as HHS, min and HHS, max respectively.
Renewable fraction
The following constraint is applied to limit its output power:
$$\:RF\:\ge\:\:60\%\:$$
(46)
Daily water production
In this study, the minimum water demand is estimated to be 130 cubic meters per day.
$$\:\text{D}\text{a}\text{i}\text{l}\text{y}\:\text{w}\text{a}\text{t}\text{e}\text{r}\:\text{p}\text{r}\text{o}\text{d}\text{u}\text{c}\text{t}\text{i}\text{o}\text{n}\:\ge\:{\text{W}\text{a}\text{t}\text{e}\text{r}\:\text{D}\text{e}\text{m}\text{a}\text{n}\text{d}}_{min}$$
(47)
Grid feed-in power constraint
For feasible grid integration, the power exported from the HRES to the grid should be within the allowable feed-in power limit:
$$\:0\le\:{P}_{grid,sell}\left(\text{t}\right)\le\:{P}_{grid,max\:sell}\:for\:all\:t\:$$
(48)
where Pgrid, sell (t) is the power exported to the grid at time step t, and Pgrid, max sell is the maximum allowable grid feed-in power. This constraint prevents unrealistic electricity export levels and ensures that surplus power dispatch remains consistent with grid connection limits.
Baseline scenario
To ensure transparent interpretation of the multi-index assessment results, a baseline scenario is defined as a conventional supply configuration without integrated renewable-hydrogen-water coupling. In this reference case, the electrical demand of the community and EVCS is supplied by the utility grid, freshwater demand is met independently through a conventional water supply pathway, and no hydrogen production, hydrogen storage, or revenue-based multi-energy dispatch is considered. This baseline is used as a reference for evaluating the relative performance of the proposed HRES in terms of technical, economic, environmental, and social criteria. Accordingly, improvements in renewable fraction, life-cycle emissions, energy utilization, employment generation, and product-level costs can be interpreted as the added value of the integrated system architecture rather than as isolated absolute outcomes.
The proposed framework evaluates the HRES as an integrated multi-energy system rather than as a set of independent components. To this end, the coupling among electricity, hydrogen, and water is explicitly modeled through conversion, storage, and dispatch relationships; practical operational constraints, including grid feed-in limits, are incorporated into the optimization problem; and a conventional baseline scenario is defined to enable transparent comparative assessment across the selected technical, economic, environmental, and social indicators.
Optimization algorithm
NSGA-II is an improved version of the previous one by incorporating elitism and a crowding distance operator for higher accuracy and computational speed63. This improved NSGA-II method is employed to optimize hybrid energy systems. The algorithm offers strong convergence and diversity on the Pareto front thanks to its efficient complexity, O(MN²). In terms of global optimum finding and handling many parameters, NSGA-II has been shown to perform better than PSO. The values for the optimization parameters used are shown in Table 7.
After obtaining the Pareto front using NSGA-II, a fuzzy decision-making method was applied to rank the non-dominated solutions and determine the best compromise solution. In this process, the objective value of each Pareto candidate was transformed into a normalized membership function representing its degree of satisfaction. The aggregated membership score was then used as the decision criterion, and the solution with the maximum overall fuzzy satisfaction was selected as the final system configuration.
The developed optimization method was implemented using Python 3.10 (Python Software Foundation) with the help of the Pymoo library64. The Pymoo library is a special multi-objective optimization software suite implementing the NSGA-II algorithm, while the data analysis and plotting procedures were performed using NumPy, Pandas, and Matplotlib.
Fuzzy logic
A decision-making technique based on fuzzy logic was employed in order to find out the optimum solution after constructing the Pareto front by means of NSGA-II algorithm.
Fuzzy membership function calculation
Each non-dominated solution has a corresponding value for the objective functions which translates to a degree of fuzziness (χ) ranging from 0 to 1. The degree represents the satisfaction level of an objective. There are different approaches to calculating membership functions depending on whether there is minimization or maximization of a certain goal.
For Minimization Objectives: For objectives where lower values are preferred (e.g., cost), the membership function is defined as65:
$$\:\left\{\:\begin{array}{c}1\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:if\:\:\:{\text{F}}_{\text{j}}\le\:{\text{F}}_{j}^{min}\\\:\frac{{\text{F}}_{j}^{max}-{\text{F}}_{\text{j}}}{{\text{F}}_{j}^{max}-{\text{F}}_{j}^{min}}\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:if\:\:{\text{F}}_{j}^{min}<{\text{F}}_{\text{j}}<{\text{F}}_{j}^{max}\:\:\:\:\:\:\:\:\:\\\:0\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:if\:\:\:\:{\text{F}}_{\text{j}}\ge\:{\text{F}}_{j}^{max}\end{array}\right.\:$$
(49)
For Maximization Objectives: For objectives where higher values are desirable (e.g., efficiency), the membership function is defined as65:
$$\:{{\upchi\:}}_{j}=\left\{\:\begin{array}{c}1\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:if\:\:\:{\text{F}}_{\text{j}}\ge\:{\text{F}}_{j}^{max}\\\:\frac{{\text{F}}_{\text{j}}-{\text{F}}_{j}^{min}}{{\text{F}}_{j}^{max}-{\text{F}}_{j}^{min}}\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:if\:\:{\text{F}}_{j}^{min}<{\text{F}}_{\text{j}}<{\text{F}}_{j}^{max}\:\:\:\:\:\:\:\:\:\\\:0\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:\:if\:\:\:\:{\text{F}}_{\text{j}}\le\:{\text{F}}_{j}^{min}\end{array}\right.\:$$
(50)
Fjmax and Fjmin are the maximum and minimum objective values for that objective over the whole Pareto front, and Fj is the objective value of the j-th of the present solution.
Aggregation and final solution selection
After determining the membership degrees for all objectives in every solution, a single decision-making index is calculated for each solution. A normalized membership function (χk) is calculated as follows for every non-dominated solution k65:
$$\:{{\upchi\:}}^{\text{k}}=\frac{\sum\:_{j=1}^{{\text{N}}_{\text{o}\text{b}\text{j}}}{{\upchi\:}}_{\text{j}}^{k}}{\sum\:_{\text{k}=1}^{\text{M}}\sum\:_{j=1}^{{\text{N}}_{\text{o}\text{b}\text{j}}}{{\upchi\:}}_{\text{j}}^{\text{k}}}\:\:$$
(51)
where Nobj is the total number of objective functions, M is the total number of non-dominated solutions, and χjk is the membership degree of the j-th objective for the k-th solution. The Compromise Optimal Point is then determined to be the solution with the highest value of χk. Because it offers the highest overall normalized satisfaction of all objectives.
Based on the above modeling, optimization, and evaluation procedures, the reliability of the proposed methodology is reinforced by its integrated modeling and validation framework. The framework combines physics-based component models with an energy management strategy that explicitly captures the interactions among electricity, hydrogen, water, and grid exchange. In addition, NSGA-II is employed to represent the trade-offs among economic, environmental, technical, and social objectives, while fuzzy decision-making is used to select a balanced compromise solution from the Pareto-optimal set. The validity of the approach is further supported through convergence analysis, Pareto-front interpretation, and sensitivity analysis, which collectively confirm the robustness, consistency, and practical applicability of the obtained results.