Abstract
The environment, energy, and water are the three essential pillars of sustainable development. In light of the freshwater scarcity faced by numerous countries, desalination emerges as a practical solution. As a result, countries are increasingly establishing desalination facilities along their coastlines. However, these initiatives are energy-intensive, and their chosen locations may not be optimal for harnessing renewable energy resources. With a daily output capacity of 50,000 m3, the recently operational seawater desalination plant in Djerba, Tunisia, accounts for 13.6% of the region's total electrical energy consumption. In this study, we have considered both the specific and the overall desalination consumption to find the optimal architecture and assess the reliability of the hybrid energy generator supplying the unit. The economic optimization has been performed using hybrid optimization of multiple energy resources, and the dynamic study of the complete system has been achieved using the transient system simulation tool environment. On- and off-grid scenarios using various hybrid power system combinations with and without batteries were proposed and examined. Results showed that the optimum case consists of on-grid 60.513 MWp solar panels and 13.64 MW wind turbines with battery storage. The water produced by the most cost-effective strategy with regard to environmental protection for a 25-year project life cycle costs 0.414 $/m3 against 0.585 $/m3 for current consumption. This significant reduction in water production costs makes desalination more affordable and accessible. The dynamic behavior of the optimal architecture is designed by considering the real meteorological data of Djerba Island. In terms of productivity, the maximum photovoltaic and wind energy production reached 11.31 GWh in July and 0.51 GWh in April, respectively. The findings demonstrate the technical and economic feasibility of powering large-scale desalination plants with hybrid renewable energy systems, reducing their environmental impact and energy costs. The optimal system proposed in this study can serve as a model for future desalination projects in Tunisia and other water-scarce regions.
Introduction
Today, two main techniques are used to desalinate water. The first is thermal desalination, in which water is boiled, the steam recovered, the steam is condensed, and water freed from its salts is thus obtained. It is an old technique that has been perfected for 40–50 years until now, with in particular the multiple effect techniques such as multi-stage flash (MSF) or multi-effect distillation (MED). The second large family of techniques concerns desalination by membranes following the reverse osmosis (RO) type. In this technique, it is used very thin, semipermeable membranes, through which water naturally tends to pass with a phenomenon of osmosis linked to the difference in salinity. Fresh water crosses the membrane and dilutes the salty part. By applying pressure to the salty water to push the fresh one to the other side of the membrane, we thwart the phenomenon of natural osmosis by doing RO. Membrane desalination dates back 40 years. In recent years, it has developed strongly, while thermal desalination has rather slowed it down. Today, there is a very strong growth in the number of facilities that are built using the RO process. What has made the difference over time is the energy consumption performance of the membranes. Initially, these plants consumed a lot, between 10 and 15 kWh per m3 of purified water. In 25 years, we have managed to get down to about 2 kWh per m3 (Urrea et al., 2019). In reality, this remarkable reduction in the specific consumption of desalination units is the result of several technical and economic studies (Tawalbeh et al., 2023). However, if these techniques previously described use fossil energy, the cost of purified water is still high. Indeed, it is true that desalination solves the problem of water shortage, but it is no less true that desalination plants are energy-intensive and their environmental impact remains worthy of evaluation (Nasrollahi et al., 2023).
Since water and energy are the keys to sustainable development, several studies have shown that hybrid renewable energy sources may work in cascade to guarantee a steady supply of electricity. Elmaadawy et al. (2020) studied a large-scale RO desalination powered by hybrid photovoltaic (PV)/wind/diesel energy sources. According to their results, the proposed system performed better than the other options and had an important reduction potential, which reached 81.5% lower than that of the existing diesel in terms of economy and environmental impact. Li et al. (2019) conducted a multicriteria optimization with the aim of minimizing the cost and emission of a new design of a hybrid renewable energy system powering a RO system with different scenarios and fluctuating energy supply and water demand. Their forecasting algorithm results showed that optimized installation involves 111 PV panels and five wind turbines. Leijon et al. (2020) performed an experimental study of wave powered desalination. Their results from experiments demonstrated that RO desalination systems can operate at power levels lower than their rated values. They also suggested the use of ocean wave power in powering desalination plants. Wave energy conversion system based freshwater production has also been investigated by Burgaç and Yavuz (2021). Their investigations showed that the major problem to be solved in such systems is the discrepancy between the required power consumed by desalination and the required power produced by renewable energy-based systems. Eltamaly et al. (2021) studied the optimal design of a wind/PV-powered RO pant in Arar, Saudi Arabia, using particle swarm optimization, the bat algorithm, and social mimic techniques. Their analysis showed that the cost of production of fresh water reached $0.745/m3. Mito et al. (2022) used predictive control and a variable recovery model to control variable operation in a renewable energy-driven RO. Their results showed that the model predictive control improved hourly permeate production by 2.35% for a considered power input time-series. Atallah et al. (2020) performed both economic and environmental studies of conventional and unconventional energy sources based fresh water production. They used HOMER (hybrid optimization of multiple energy resources) software to investigate eleven different configurations of energy sources to find the optimal case at Sinai Peninsula, Egypt. They found that using 160 kW PV panels, 19 strings of lead-acid batteries, and a 50-kW diesel generator was the optimal configuration. This case achieved the lowest energy cost and net present cost. Gökçek and Özkan (2024) studied the technical, economic, and environmental feasibility of integrating hybrid autonomous renewable energy with a small-scale desalination system. They found that the ideal configuration included a 6.76-kW converter, a 10.3-kW wind turbine, 152 kWh of lead-acid batteries, and 25.7 kW PV panels. Vakili-Nezhaad et al. (2020) performed an optimization of hybrid green energy with and without generator backup for a 10-m3 desalination plant located in an arid area of Oman. Their experiments showed that a combination of a 12.5-kW PV panel with 335 W energy production for each panel, 12 batteries with 205 Ah capacity, and a generator as a backup gave a cost of 0.37$ per kWh. Zgalmi et al. (2022) used an artificial neural network-type management technique to study the coupling between the PV-wind system and a brackish water desalination plant. Their results showed that their developed parametric sensitivity algorithm can be effectively used to find the most appropriate power-sharing during a fast time with an acceptable root mean squared error. Okampo and Nwulu (2021) reviewed the state-of-the-art of renewable energy powered RO desalination systems. They suggested the use of optimization approaches that combine the sizing, operation, and thermodynamic effect when using geothermal, ocean, wind, and solar energy and their hybrids in order to maximize freshwater production. Rashidi et al. (2022) reviewed wind energy as a source of RO. Their results lead to the conclusion that wind turbines can be used to supply the necessary power for desalination processes in a clean and effective manner.
In fact, not only wind and PV energies have been used to overcome the total need of the RO units, but also the use of solar thermal and photovoltaic thermal (PV/T) collectors has attracted the attention of several researchers. Ebrahimpour et al. (2022) used both TRNSYS (transient system simulation tool) and ROSA (reverse osmosis system analysis) softwares to perform a techno-economic study of a solar RO desalination plant in the city of Chabahar. They used different configurations, namely a PV, a solar collector, and a PV/T collector with organic Rankine cycles. Their results showed that PV/T could produce the most. Gtari et al. (2023) used PV/T to power a RO unit with a water salinity of 10,000 ppm. Their economic study showed that the payback period of adding a PV/T into an existing RO unit was 6 years. It should be noted here that the energy gain from the use of the PV/T collector comes from the decrease in the temperature of the PV cells, which depends on the operating mode of the PV/T collector (thermosyphon or forced). In the case of large-scale water desalination, this advantage is not guaranteed since the volume pumped is very large and the cooling of the cells will require enormous power from the circulating pumps or even high flow rates to heat the feed water. Previously, Gtari et al. (2021) conducted an experimental study consolidated by numerical modeling of the behavior of the RO desalination unit using a PV/T collector. They found that the combined production of heat and electricity reduced the annual consumption of the osmosis unit to about 21% when the captured area is 40.5 m2 which can produce fresh water for 1200 people. PV/T can also power brackish water RO units.
The main disadvantage of renewable energy power desalination is the fluctuating of the source power, as it results in intermittent power to RO plants, which can lead to a range of problems, including negative effects on membrane performance, service life, complexity of configuration, operation, and control of the installation. Therefore, it is very important to find operating strategies that optimize freshwater production, avoiding the mentioned effects. It has been observed that few works on the coupling of RO plants driven by an intermittent power source have been published in the scientific literature so far, especially with regard to large-scale plants. The study of Kettani and Bandelier (2020) uses the Chtouka Ait Baha (in Morocco) as a case study to assess the cost-competitiveness of a 275,000 m3 per day solar-powered desalination. They obtained an acceptable cost of around 1 $/m3. They also found that storage based solutions are less competitive, and solar desalination without storage will still be the least expensive alternative for power supply by 2030. Elkadeem et al. (2021) used a desalination plant with 1135 m3/day capacity to examine the techno-economic, environmental, and appropriate size of various off-grid power systems. Their results revealed that a combination of PV, wind, diesel generator, and storage battery should be the optimal architecture of the hybrid system. According to their finding, the cost of energy of the optimal system reached 0.08 $/kWh, and the original cash investment can be recovered after 1.2 years.
In 2022, there was a notable increase in the total number of citations related to the use of renewable energy for simulating and optimizing seawater desalination processes (Pietrasanta et al., 2023). The reason appears obvious if we take into account the enormous energy consumption of desalination plants. Building upon the advancements in renewable energy systems, recent studies have focused on innovative approaches to enhance energy efficiency and sustainability. Zhou et al. (2024) developed a geothermal-powered trigeneration system that produces cooling, heating, freshwater, and electricity, utilizing Aspen HYSYS software. Their system combines a single-flash geothermal plant with a desalination unit, achieving zero CO2 emissions and saving 4,325,160 liters of petroleum annually, despite notable irreversibility mainly from heat exchangers. Zhu et al. (2024a) focused on enhancing solar-powered multigeneration systems through cascade heat recovery technology, achieving an exergy efficiency of 14.76% and significant outputs of electricity, cooling, and freshwater. Zhu et al. (2024b) introduced a biomass–geothermal intergenerational system that improved overall efficiency by integrating biomass digestion with a supercritical CO2 process. Zhu et al. (2024c) presented a hybrid renewable energy system for off-grid applications, utilizing an optimized algorithm to minimize costs and emissions. Lastly, Zhu et al. (2024d) analyzed a natural gas-powered combined cooling, heating, and power (CCHP) plant, finding it more sustainable than conventional fossil fuel systems, with significant energy and exergy efficiencies and reduced CO2 emissions.
In the Mediterranean basin, the demands for fresh water are constantly growing. The significance of renewable energy for desalination in Tunisia is underscored by the country's pressing water scarcity issues and its commitment to sustainable development. Tunisia, characterized by an arid to semi-arid climate, faces significant challenges in water resource management, with limited freshwater availability and uneven distribution across regions. The integration of renewable energy sources, particularly solar and wind, presents a viable solution for enhancing water supply through desalination technologies. Moreover, coupling renewable energy with desalination not only addresses freshwater scarcity but also mitigates the reliance on fossil fuels, thereby contributing to environmental sustainability. The potential for desalination units powered by renewables is especially relevant for remote and rural communities, where access to conventional water supply infrastructure is limited. By harnessing local renewable resources, Tunisia can improve water security while promoting economic development and resilience against climate change. A dependable and sustainable supply of water for Tunisia will be contingent upon the incorporation of renewable energy sources as the nation investigates and develops its desalination potential. Studies show that desalination systems driven by renewable energy can lower operational costs and environmental effects considerably when compared to conventional fossil fuel-based techniques. The incorporation of renewable energy sources not only improves the sustainability of desalination procedures but also corresponds with worldwide endeavors to shift toward more environmentally friendly energy alternatives. In this context, the objective of this study is then to find an optimal architecture from a technical, economic, and environmental point of view of the seawater desalination project recently started in the Djerba site in order to overcome the growing demand for drinking water in the region and to strengthen the capacity of the national water supply network. To achieve this objective, a technical and economic study of the coupling between on-grid hybrid PV/wind systems is carried out. The assessment also takes into account the environmental aspect and the climatic data of the Djerba site. The reliability of the chosen scenarios is analyzed by studying the unsteady behavior of the complete system.
The purpose of this study is to evaluate the autonomy and optimize the architecture of a hybrid energy generator supplying power to a recently installed large-scale saltwater desalination facility in Tunisia. Different hybrid power system combinations and architectures will be studied and analyzed for both on- and off-grid scenarios. The goal of the research is to find the most effective and sustainable power solutions based on both specific and total energy consumption of the desalination unit.
Power system optimization has greatly benefited from the development and enhancement of various algorithms aimed at improving the efficiency and reliability of energy systems. Paul et al. (2017) introduced a congestion management technique that incorporates wind farms using the gravitational search algorithm to minimize active power generation during congestion. Building on this, Paul (2022) and Paul et al. (2022) proposed a Hybrid Modified Grey Wolf Optimization-Sine Cosine Algorithm for optimal scheduling of hybrid power systems, accounting for risks due to renewable energy variability. Paul and Hati (2023) developed a hybrid Harris Hawk Optimization-Sine Cosine algorithm in 2023 with the goal of optimizing the use of smart appliances and lowering electricity expenses for home energy management. Paul et al. (2023) showed notable efficiency gains over earlier approaches by using an Improved Manta Ray Foraging Optimization algorithm to decrease congestion costs in power systems. Each study reflects the progressive refinement of optimization techniques in power system management.
In this study, HOMER's optimization algorithm used is particularly appropriate on the optimal sizing of a hybrid renewable energy system due to its ability to effectively handle multiple energy sources. The algorithm considers various economic factors such as capital, replacement, and operating costs, which are crucial for determining the most cost-effective system configuration. Additionally, HOMER allows for the specification of system constraints, enabling us to incorporate specific requirements relevant to the local context. Its sensitivity analysis feature helps assess the impact of uncertain variables on system performance, while its widespread use and validation in the field ensure reliable results. On the other hand, we used TRNSYS software for the dynamic analysis. TRNSYS is specifically designed for simulating transient systems, making it ideal for modeling the time-dependent performance of renewable energy systems and their interactions with the desalination process. This capability allows analyzing how the system responds to varying environmental conditions, such as fluctuations in solar irradiance and winding speed, which are critical for optimizing the performance of both the energy generation and desalination components. Also, the flexibility of TRNSYS allows for detailed modeling of each component's behavior and interactions, facilitating a comprehensive understanding of the system's overall dynamics.
The novelty of the work lies in several key aspects that contribute to both the technological advancement and environmental sustainability of desalination processes.
Integrated approach: This study employs a unique integration of HOMER for economic optimization and TRNSYS for dynamic behavior analysis. This dual approach allows for a comprehensive evaluation of both the economic viability and the operational dynamics of the hybrid renewable energy system. By combining these tools, the research provides a holistic view of the system's performance, which is often lacking in similar studies. Focus on Djerba Island: The case study focuses specifically on Djerba Island, Tunisia, a region characterized by unique climatic and geographic conditions. This localized analysis is critical, as it addresses the specific energy and water needs of the island while considering its renewable energy potential. The findings can be directly applicable to other similar regions facing water scarcity, thus enhancing the relevance and impact of the research. Techno-environmental optimization: The work emphasizes techno-environmental optimization, which is a novel approach that balances economic factors with environmental considerations. Dynamic behavior analysis: Utilizing TRNSYS for dynamic behavior analysis allows for the simulation of real-time operational scenarios, providing insights into how the system performs under varying conditions. This dynamic modeling is essential for understanding the system's responsiveness to fluctuations in energy supply and demand, which is critical for ensuring reliable water production. Contribution to existing literature: The research contributes to the existing literature by filling a gap in the understanding of hybrid renewable energy systems specifically designed for desalination. While many studies focus on either economic optimization or environmental impact, this work uniquely combines both aspects, providing a more comprehensive framework for future research and practical applications.
Background to water scarcity and energy demand in Tunisia
Tunisia faces several water problems, notably due to drought, dwindling water resources, and population growth. Most of the water used in Tunisia comes from groundwater, which is overexploited and is gradually drying up. In addition, in mid-March 2023, the water level in the country's 37 dams dropped by about 390 million cubic meters compared to the same period the previous year, due to the lack of precipitation. The international community has set up indicators for countries to take specific measures if it ever reaches a particular threshold. The first alert threshold is that of 1700 m3 per year and per inhabitant. It is the ratio between renewable water resources divided by the number of inhabitants. Tunisia has 4.2 billion m3 of renewable water (dams, lakes, and groundwater). Each year, this ratio decreases because of the increase in the population. At 1000 m3, there is a chronic lack of water, and this is a brake on development. At 500 m3 and less, this is the absolute water shortage limit. Tunisia is below 500 m3 and has been since the 90s. For this reason, the national company of water exploitation and distribution (SONEDE) seeks to strengthen the network of treatment plants, in order to meet the future needs of consumers until 2035, when it is expected the construction of numerous desalination plants in Tunisia. The water resources available in Tunisia no longer allow water to be pumped at a frequency of 24 h a day, which has imposed the adoption of the quota system in the distribution of water, in addition to the restriction of the use of drinking water in certain activities such as car washing, irrigation of green spaces, and road cleaning. The shortage of water supply under the quota system is between 20 and 25%, and this shortage of water supply will vary from one perimeter to another depending on the volume of available resources and the level of consumption. For most regions of the country, and in particular the major consumption centers, the adoption of the quota system will lead to an automatic water cutoff between 9 p.m. and 3 a.m., with the possibility of extending this period for the high summer season, depending on the evolution of water reserves and the climatic situation. To deal with this situation, SONEDE introduced a quota system for water cuts during the night, from 9 p.m. to 4 a.m., depending on the water resources available, urging citizens to better manage their consumption of this vital resource. It cannot be excluded that the partial interruption of drinking water will be prolonged during the summer peak, which generally sees an increase in the general rate of consumption of between 50 and 60%, depending on the climatic conditions, noting that the increase in consumption is more exacerbated in areas of the coastal strip, which generally experience a three to four times increase in water consumption. In fact, not only Tunisia is facing this problem. Desalination is becoming one of the essential solutions, along with the recycling of wastewater. Regarding the extent to which Tunisia needs to intensify seawater desalination plants to compensate for the degradation of traditional resources, and despite the legalization of desalination operations since 2001, this technology remains the last solution after having exhausted all the other alternatives, especially since seawater is restricted by several controls, in particular environmental assessments, which require that the activity not be overdesalinated in order to control the salt deposits that return to the sea, in addition to the high cost of infrastructure and resource-intensive operation. Parallel to the gradual progress of seawater desalination, several other options are being studied, the main one being to increase the rate of mobilization of rainwater through four dams under construction, in addition to two other dams whose work will begin during the next period.
The country's energy situation is also critical and is manifested by a remarkable growth of fossil energy demand. The contribution of renewable energy sources is still relatively small. The proportion of renewable energies in the production of electricity increased to 4.1% in 2021 (IRENA, 2021). Renewable energies continue to provide a very little contribution to the mix of energy sources used to generate electricity and are still reliant on the very erratic contribution of hydraulics, despite this encouraging progress brought on by the steady expansion of PV in the regime of self-producers. As a result, the achieved goals are still distant from being met. The Tunisian authorities in charge of the energy sector have established the minimum capacity for the sale of electricity produced from renewable energies subscribed to STEG (Tunisian Company of Electricity and Gas) at 2 MW. This ruling will enable businesses to sell a portion of their production to high customers, as specified by the law on the production of energy from renewable energies for self-consumption. It should be mentioned that the law permits the establishment of businesses for the self-generation of energy from renewable energies and the sale of the production to significant users as a result of government decrees. These businesses gain by having access to the national grid for the transportation of electricity. In accordance with the terms for granting authorizations, including those relating to the transport of electricity and the sale of surplus production to STEG, these businesses are entitled to the privilege of transporting power via the national grid. Therefore, it should be mentioned that it is possible that the locations where the power is produced and used are different. Aside from the fact that it is required to account for energy losses or line losses, extra fees, and the rights to transmit power via the national grid.
Being energy-intensive and essential components in sustainable development, more efforts are needed to better penetrate the renewable energy sector in the generators of seawater desalination plants. Started in 2018, the desalination project of Djerba (latitude=33° 51' 28.386", longitude=10° 58' 30.6804") seawater desalination plant will help to meet the increased demand for water, improve its quality, and prevent the shortage of drinking water experienced in recent years during the region's busiest summer months. Its production capacity is 50,000 m3 per day and is expandable up to 100,000 m3 per day. More than a million people living in the governorates of Gabès, Médenine, and Tataouine (southern Tunisia) will benefit from the construction of this station, which is a part of the strategic plan for the development and security of water resources in the region of the South-East by 2035 through the strengthening of the drinking water supply system.
The selection of solar and wind potential in the Djerba, Tunisia, area was guided by several key criteria. First, high solar irradiance levels and consistent wind speeds were prioritized to maximize renewable energy generation. Additionally, as displayed in Figure 1, the coastal location was deemed ideal for capturing both sunlight and wind, enhancing the overall energy yield. Moreover, the area's proximity to the desalination plant was crucial, as it ensured efficient energy integration and minimal transmission losses. Furthermore, the environmental impact was carefully considered to minimize disruption to the local ecosystem. Finally, economic viability was assessed to ensure that the deployment and operation of the renewable energy systems would be cost-effective. These considerations collectively made Djerba an optimal site for sustainable energy generation to support the desalination plant.

Location of Djerba desalination plant, south of Tunisia (North Africa).
Clearly, seawater desalination technology exists, but it is crucial to make it more sustainable and environmentally friendly due to its high energy consumption. Two major challenges are cost and durability. This study aims to optimize a hybrid PV/wind system and assess its feasibility to power the large-scale seawater desalination plant in Djerba, considering factors such as water scarcity, high energy demand, and environmental impact. In the following section, we detail the equations governing the desalination process and the operation of the various components used as energy generators.
Mathematical formulation
RO unit
The mathematical RO model employed in this study is based on that prescribed by El-Dessouky and Ettouney (2002) in which the pump shaft power is calculated from the feed flow rate
Renewable energy sources
The PV electrical efficiency expression is in the form:
Table 1 summarizes the technical specifications of the used monocrystalline JAM72S10 module under nominal operating cell temperature.
Electrical parameters JAM72S10 405/MR module at STC.
STC: standard test conditions.
In order to compute the wind turbines power output, TRNSYS uses an actuator disk wind turbine model based on the Bernouilli's equation (Spera, 1986):

The used 10 kW wind turbine power curve.
One can compute the number of batteries needed by using the following equation:
Optimization and design of the hybrid power system
Finding a simultaneous sizing and control technique is difficult when optimizing isolated sites. We may obtain the ideal sizing and distribution for this year's data without having to decide on a strategy by solving this model on deterministic hourly demand and wind data. In HOMER, each component has several types of costs: a capital cost, which includes the cost of purchasing, transport, and installation (foundations, network), and a cost of operation and maintenance, which represents the cost of upkeep, verification, and repair each year. A replacement cost if we reach the end of the life of the component. The demand parameter, which corresponds to the high-pressure pump
As illustrated in Figure 3, the optimization process begins by defining essential project parameters, including the resource data, the system components, cost information, and sensitivity analysis variables. The process then take into account the load profile of the desalination facility, available renewable resources (such as solar irradiance and wind speed), and the various system components, including PV arrays, wind turbines, and batteries. HOMER then simulates a vast array of potential system configurations, evaluating their technical feasibility and economic costs. During the optimization phase, these simulated systems are sorted to identify the least-cost options that satisfy specified constraints. Additionally, HOMER conducts sensitivity analyses to examine how uncertainties in resource availability may affect the optimal system design.

Flowchart of the optimization process for hybrid renewable energy system feeding the desalination unit in Djerba, Tunisia.
Table 2 presents the design parameters used for the optimization. In recent years, the Tunisian renewable energy market has become relatively mature if we compare current prices to those in previous studies (Maatallah et al., 2016). The wind turbine cost is 550 $/kW, and the cost of a kWp is about 1280.61 $ in Tunisia.
Design parameters used for the optimization.
PV: photovoltaic.
The resolution gives, for the considered site, an optimal couple (sizing distribution) as well as an updated cost of the project of the hybrid system, which is the value of the objective function.
Results and discussions
Economic optimization
Figure 4 shows the solar and wind potential throughout Tunisia. The country has a lot of potential, and its entire region is suitable for both solar and wind generators. Recent suitability index research identified significant portions of land as highly suitable for wind farms, designating these areas as ideal locations. Similarly, the research highlighted other extensive areas as the best suited for solar farms (Rekik and El Alimi, 2024a, 2024b). In fact, Tunisia possesses significant solar energy potential, as evidenced by recent studies highlighting its favorable climatic conditions for solar energy generation with different technologies (Elmosbahi et al., 2023; Messaouda et al., 2019, 2023, 2024). The majority of Tunisia's southern parts receive more than 3200 h of annual direct sunlight, with maxima in the Gulf of Gabes (southeast) at 3400 h with an average solar photovoltaic potential ranging from 1600 to 2000 kWh/kWp. However, in terms of wind energy, the desert region falls into the second group of prospective wind sites (Attig-Bahar et al., 2021), which have an intermediate wind potential. The available annual energy ranges from 268 to 433 kWh/m2, while the yearly mean speeds range from 2.7 to 3.6 m/s.

Maps of photovoltaic power potential (World Bank Group, 2023) and wind potential in Tunisia (GWA, 2023).
The sizing concerns the three variables corresponding to the number of PV panels, wind turbines, and batteries. HOMER has a fixed strategy and simulates all possible combinations until returning the one with the lowest cost. The central processing unit (CPU) time of the optimization depends on the number of combinations that we give it to calculate. HOMER provides the optimal sizing in approximately 50 mn for the chosen site.
Figure 5 presents the hybrid system model with and without a battery storage generation system feeding the prescribed RO plant. The RO load is about 129 MWh per day, which is a significant amount of electrical energy as it represents 13.6% of the region's overall electrical energy usage. It should be mentioned that HOMER allows using diesel generators as an energy source. Generators with the highest fuel consumption have a relatively low acquisition cost but a high operational cost (about 10 times their installation cost). These equipments also have the highest share of energy generation for the off-grid systems. Many studies showed that running a generator is expensive, even when using biodiesel, which is more affordable than traditional diesel. In addition to its high pollution rate, its expected working time (30,000 h is twice as long as its lifespan, and its end-of-life recovery cost is zero. For this reason, the generator is not used in the proposed model. The PV price is the greatest of the project's costs, but they are less expensive to operate because they have relatively low maintenance costs and do not need to be replaced because their lifespan is the same as that of the project. It is true that wind power is an energy intermittent source, but this sector is the second largest producer of renewable electricity. The amount of investment costs in wind power depends on how wind power installations are integrated into the power system. In addition, taking into account the wind potential of the site studied, it is important to economically evaluate the hybrid PV/wind system.

On-grid hybrid system model with (a) and without (b) battery storage generation system model feeding the reverse osmosis plant.
The cost-benefit analysis of battery storage versus no storage reveals significant advantages for incorporating battery systems in renewable energy setups. Battery storage allows for the accumulation of surplus energy generated during peak production times, which can then be utilized during periods of high demand or low generation, enhancing system reliability and efficiency. This capability not only reduces reliance on-grid electricity, which can be costly and subject to fluctuations, but also minimizes carbon emissions by enabling greater use of renewable sources. Although the initial investment in battery storage can be substantial—often requiring careful consideration of costs such as installation, maintenance, and replacement—the long-term savings on energy costs, coupled with potential revenue from energy arbitrage and ancillary services, can make battery storage a financially viable option. Additionally, the resilience and stability provided by battery systems can lead to further economic benefits that are difficult to quantify but are crucial for sustainable energy management.
We have chosen to control the simulation results based on the scaled wind speed, which corresponds to three cases where the system automatically responds to the demand. Table 3 presents the architecture of optimal configurations as well as the economic parameters with respect of the wind-scaled average. In all suggested scenarios, load-following dispatch control strategy (Kumar et al., 2021) in which PV is prioritized to satisfy the system's load demand is used. For the minimal scaled wind velocity of 3 m/s, the optimal architecture involves only PV panels with DC power of 36.618 MWp and 1056 batteries. The levelized cost of energy is 0.092 $
Architecture of optimal configurations with battery storage for the RO load.
CC: capital cost; COE: levelized cost of energy; COWRO: cost of purified water based on reverse osmosis consumption; IV: inverter; OC: operating cost; PE: purchased energy; PV: photovoltaic; RF: renewable fraction; RO: reverse osmosis; WSA: wind scaled average; WT: wind turbines.
In Table 4, we summarize the optimal architecture found using a hybrid source of energy without battery bank storage. In practice, the batteries often have problems, particularly in warm climates. The system used in this instance allows utilizing the naturally fluctuating solar/winding resource without the usage of batteries. From the table, it can be clearly seen that the levelized costs of energy is much lower than those obtained in the system with a battery. It is of the order of 0.1$ for all scaled wind speed conditions. While, the renewable fraction (RF) reached did not exceed 47.4%. This is obvious since excess energy cannot be stored. Purchased energies are of order of three times those obtained in the system with batteries. This implies the usefulness of the use of batteries for the storage of excess energy. The cost of purified water is of the order of 0.26 $/m3, which is a low significant price compared to the current RO consumption, which is about 0.335 $/m3. It should be mentioned that this result is significantly dependent on the price per kWh of electricity purchased, which is growing rapidly in recent years and may greatly exceed the price considered in this study in the coming years.
Architecture of optimal configurations without battery storage for the RO unit.
CC: capital cost; COE: levelized cost of energy; COW: cost of purified water based on RO consumption; IV: inverter; OC: operating cost; PE: purchased energy; PV: photovoltaic; RF: renewable fraction; RO: reverse osmosis; WSA: wind scaled average; WT: wind turbines.
Although the RO system consumes only 2.58 kWh/m3, the total consumption taking into account all the equipment is 4.5 kWh/m3 (Ajala et al., 2022). Actually, desalination is accomplished using an osmosis unit, a pretreatment unit, a pumping station, a distribution network, as well as a peak and sea intake station. The water intake is the seawater supply that drives the desalination system. It is performed 2.4 km from the edge of the beach, at a place where the depth of the water reaches 9 m. Indeed, the RO membranes need to be supplied with seawater without suspended solids, these insoluble materials that float on the surface. Table 5 presents the result of the economic evaluation based on the total consumption of the desalination unit with battery storage and an electric load of 225 MWh per day. Although the total consumption is multiplied by a factor of 1.72, the PV powers have increased by a factor of 2.02. As for the number of wind turbines, it has increased by a factor of 1.7. Capital costs, the levelized costs of energy, as well as the purified water cost increased significantly. This result confirms the linear programming-based energy dispatch character of Homer results even it involves nonlinear optimization techniques.
Architecture of optimal configurations of on-grid system with battery storage based on the complete desalination load.
CC: capital cost; COE: levelized cost of energy; COW: cost of purified water based on the complete consumption; IV: inverter; OC: operating cost; PE: purchased energy; PV: photovoltaic; RF: renewable fraction; RO: reverse osmosis; WSA: wind scaled average; WT: wind turbines.
Comparing the first and second architectures, the second architecture (with 1364 wind turbines) offers slightly better overall efficiency and cost-effectiveness than the first, which has no wind turbines. The second architecture achieves a marginally higher RF of 80.1% versus 78.5%, indicating a better utilization of renewable energy. Additionally, the second architecture reduces the amount of purchased energy (PE) required, at 16.376 GWh compared to 17.655 GWh in the first, while maintaining comparable capital and operating costs. The inclusion of wind turbines in the second architecture does not increase the O&M costs, which could be attributed to the balance between maintaining the wind turbines and the reduced strain on the PV system. In contrast, the first architecture relies solely on PV energy, which might have higher maintenance costs due to potential overloading and wear on the solar panels, especially during peak operation periods. Although the first architecture provides greater autonomy (13.8 h vs. 13.4 h), the overall benefits of the second architecture, particularly in terms of cost and renewable energy use, make it the more attractive option when wind speed conditions are favorable. More importantly, the obtained purified water cost is 0.414 $/m3 when using only PV or hybrid PV/wind generators. This result demonstrates that the specific consumption of RO is not a good indicator in the economic evaluation and the cost of the m3 of water produced by desalination units based on renewable energy power.
Table 6 shows the result of the economic evaluation based on the total consumption of the desalination unit without battery storage. The significant cost of purified water (of the order of 0.46$/m3) compared to the current total consumption confirms the importance of the battery usage, which is related to the good renewable energy potential of Djerba and Tunisia in general, especially the high productivity of solar PV systems in the considered location.
Architecture of optimal configurations without battery storage for the complete desalination load.
CC: capital cost; COE: levelized cost of energy; COW: cost of purified water based on the complete consumption; IV: inverter; OC: operating cost; PE: purchased energy; PV: photovoltaic; RF: renewable fraction; RO: reverse osmosis; WSA: wind scaled average; WT: wind turbines.
The comparison between the two architectures of the hybrid renewable energy system for the desalination plant reveals distinct differences in capital, operational, and maintenance costs. The first architecture, featuring 31.589 MWp of solar panels, no wind turbines, and a 9.432 MW inverter, incurs a total capital cost of 40.4 $M, with operational and maintenance costs totaling around 7.48 $M. In contrast, the second architecture, which includes 27.501 MWp of solar panels, 1624 wind turbines, and a 9.394 MW inverter, has a total capital cost of about 35.2 $M. However, its operational and maintenance costs are 7.32 $M. This analysis indicates that while the second architecture may be more cost-effective in terms of initial investment, the long-term operational costs could outweigh the benefits due to the complexities associated with wind turbine maintenance.
In the short term, it is widely recognized that grid-connected systems are generally less expensive than autonomous systems when comparing equal power outputs, primarily because they do not need batteries or regulators. However, this conclusion may not hold true over the long term, particularly throughout the project life cycle. We aim to compare these findings with those of an autonomous system. Figure 6 illustrates the hybrid system model, which supplies energy to the designated desalination plant. The total energy consumption for desalination is 225 MWh per day, and the desalination unit will not require additional energy since it operates entirely autonomously.

Off-grid hybrid system model system model feeding the complete desalination plant.
Table 7 compares the different architectures found for the off-grid hybrid system based on the economic evaluation and the total consumption of the desalination. The minimum cost of water produced (0.447 $/m3) is obtained using the third architecture where the wind speed is 5 m/s, which represents an extreme case and is not always valid based on meteorological data. For a wind speed of 4 m/s, which is more representative of the Djerba site, the price of produced water is higher than 0.5 $/m3. This result reflects the fact that using the autonomous system is not the right choice based on the components and electricity prices in its current state. Compared to the on-grid hybrid system, we lose about 0.117 $/m3 by using the same configurations with complete autonomy. It is also remarkable that all the suggested configurations based on the economic optimization involve wind turbines. If the average wind speed does not exceed 3 m/s, the price of produced water reaches 0.617 $/m3, which is higher than the current one.
Architectures of optimal configurations of the off-grid hybrid system based on the total consumption.
CC: capital cost; COE: levelized cost of energy; COW: cost of purified water based on RO consumption; IV: inverter; PV: photovoltaic; RO: reverse osmosis; WSA: wind scaled average; WT: wind turbines.
Based on the economic optimization, the lowest cost of energy and hence of the produced water can be obtained using the first and second architectures with battery storage bank, which allow obtaining a cost largely low compared to that paid today in the large seawater desalination project in Djerba. This result is reached by using both specific RO consumption and the complete desalination consumption as electric loads.
The two architectures, that is, the one comprising only PV panels and that cascading wind turbine with PV panels, allow the production of drinking water with the same cost, yet it remains to compare the impact of the two scenarios on the environment in terms of CO2 emissions to be able to find the right architecture. We used the US average emissions from energy sources of 0.371 kg CO2-eq per kWh to compute emissions from electricity generation using the Environmental Protection Agency (EPA)'s eGRID (Emissions & Generation Resource Integrated Database) emission factors (EPA, 2023). The carbon footprint of mono-Si panels is 436 g/kWh of CO2 for electricity based combined cycle technology and natural gas (De Gouw et al., 2014), while the carbon intensity of wind power is 4.429 g/kWh (Li et al., 2020). Figure 7 shows a comparison between carbon footprints in terms of tCO2-eq emissions associated with the hybrid system with battery and different architectures during the project life cycle. It is clear from the figure that the use of the first architecture is the result of the emission of the most important quantity of tCO2-eq in the atmosphere. This quantity is of the order of 7700 tCO2, compared to only 7142.48 tCO2 for the second architecture. If we consider the total consumption of the desalination unit, the result always gives higher emissions using the first scenario with an important amount of 6551.3 tCO2-eq. It is crucial to note that a significant portion of CO2 emissions will still result from the purchased energy. This is due to the fact that the desalination process operates continuously during both the day and night.

Comparison between tCO2-eq emissions associated with the hybrid system with different architectures during the project life cycle: only RO consumption (internal sector) and the complete desalination consumption (external sector).
In fact, the current cost of 0.585$/m³ for the desalination plant in this study falls within the lower end of this range, indicating that the plant is already operating efficiently compared to global standards. However, the hybrid renewable energy system feeding the desalination plant can produce purified water at a cost of 0.414$/m³ over a 25-year project lifespan, compared to the current cost of 0.585$/m³ using electricity alone. This represents a significant cost reduction of approximately 29% when utilizing the proposed hybrid system. The average cost of desalinated water in the global market ranges from 0.5$/m³ to 1.5$/m³, depending on factors such as plant size, energy source, and location. A study by Ghaffour et al. (2015) reported that the cost of desalinated water using renewable energy sources can range from $0.40/m³ to 1.6$/m³, with an average of $0.90/m³.
The cost of 0.414$/m³ for the hybrid renewable energy system in this study is at the lower end of this range, demonstrating the potential for significant cost savings compared to the global average. Another study by Caldera and Breyer (2017) projected that the cost of desalinated water using solar PV and wind energy could drop to 0.4$/m³ by 2030. The findings of this study, with a cost of 0.414$/m³ using a hybrid system, are already approaching this projected future cost, highlighting the immediate benefits of integrating renewable energy into desalination processes. As technology continues to advance and renewable energy costs decrease, the cost of desalinated water is expected to become even more affordable, making it an increasingly attractive option for addressing global water scarcity challenges. In addition to the cost savings, the hybrid renewable energy system offers significant environmental benefits by reducing greenhouse gas emissions and reliance on fossil fuels.
Dynamic study
At this stage, we obtained for the on-grid site, the combination corresponding to the optimal pair (sizing strategy). By considering both the results of the economic study, the environmental impact of the implementation of the electricity generation system, as well as the most likely wind velocity based on the meteorological data of the Djerba site, the most suitable, economically profitable, and ecological system is that using a combination of PV panels and wind turbines with battery storage. We then enter the pairs into the TRNSYS model in order to obtain the transient behavior of the optimized system. In this section, we aim to approach the prediction of the complete model. We launched the resolution for the data of one year (8760 h) hour by hour for the Djerba site. We decided to observe the evolution of the energy produced as a function of the resolution time and compare between the considered scenarios. As we can see in Figure 8, the model is composed of four elements: Meteonorm (Type 15–6), an electric load for high-pressure pumps (HPPs) (Type 14b), a PV panel (Type 103a), a turbine (Type 90), an inverter with battery (Type 48a) and without battery (Type 48d), a battery (Type 47), an integrator (Type 24), and a printer (Type 65d, Type 65c). The inverter/charge controller (Type 48d) is powered by the PV array and wind turbines. The inverter/charge controller compares electrical output to a predetermined electrical load. After that, the charge controller chooses to use the input whether to power the load or recharge the battery. It should be mentioned that the inverter/charge controller mode and the battery bank mode parameters must be compatible. For the system without battery storage, we used the same model while eliminating the battery component and changing the model of the converter to that of the Type 48a.

TRNSYS simulation model of a hybrid system feeding the large scale reverse osmosis seawater desalination unit of Djerba.
Figure 9 shows the hourly output energy and the battery fractional SOC of the hybrid system supplying the RO unit load. The power generated by PV panels varies between 14 and 21 MW on the least sunny days in winter and between 21 and 24 MW for the sunniest days in summer. The hybrid system fails to fully charge the battery during the winter seasons which results in a significant lowering of the SOC of the battery bank. The SOC in this season is equal to the low limit on fractional state of charge (FSOC) which is equal to 30%.

Hourly output energy changes and the battery state of charge of the hybrid system overcoming the RO load.
Figure 10 illustrates the hourly energy output and the battery fractional SOC for the hybrid system powering the entire desalination plant. The patterns of renewable energy generation and battery SOC follow a similar trend to those observed in the system that meets the demands of the RO unit, though on a different scale. Notably, wind energy production peaks at 12 MW, highlighting the substantial wind potential at the studied location.

Hourly output energy changes and the battery state of charge of the hybrid system overcoming the complete desalination load.
Figure 11 shows the monthly output energy changes of the on-grid hybrid system overcoming the RO and the complete desalination load. When considering only the RO process load, the maximum production of PV energy is reached during the month of July with a value of 6.46 GWh, while that of wind energy is reached during April with a production of 0.324 GWh. Since solar radiation is the most affecting factor in the production of the chosen hybrid system, the minimum electrical output of 2.47 GWh is reached during January. The required renewable energy productivity for the complete unit is greater than that based on the specific consumption of RO. The PV production reaches 11.31 GWh during July, and it reaches its minimum 3.81 GWh during December. The minimum wind energy production is reached during October and equal to 0.19 GWh. The maximum wind energy produced is reached during April, which does not correspond to the maximum productivity of the PV panels. This result confirms in such a way the synergetic behavior of the hybrid system.

Monthly output energy changes of the hybrid system supplying only the RO unit and the complete desalination plant.
Figure 12 shows the monthly PE changes using the hybrid system with and without battery. The maximum monthly electrical energy purchased to meet the desalination requirement for the system without a battery is 6.15 GWh during the least sunny month of January, and its minimum is 5.28 GWh during the sunniest month of July. The quantity of dumped energy is limited to 5.74 GWh when the hybrid system includes batteries. This amount of energy is significantly less than the values attained when batteries are not used. Economically speaking, this results in a gain of 53700 $ per month. All these observations confirm the usefulness of the use of batteries in the hybrid system. This is also linked to the significant drop in the price of batteries in recent years. Solar batteries offer many advantages and can contribute to achieving real substantial energy savings, mainly for installations requiring continuous consumption of energy like desalination plants. The chosen optimal system produces more electricity than what the station needs, and this is due to the significant potential in the Djerba site and in Tunisia in general. Without batteries, this surplus is delivered to the national grid without gain, and the desalination plant must then rely on its energy supplier once the sun has set.

Monthly purchased energy changes using the hybrid system with and without battery to overcome the complete desalination unit consumption.
Further researches and applications in different fields
While the study focuses on Djerba Island, the methodology and findings can be applied to other locations considering renewable energy-powered desalination projects. The optimal system configuration may vary based on local renewable energy resources, but the overall approach demonstrates a replicable model for integrating renewables into desalination. In summary, this research provides a valuable case study and framework for implementing hybrid renewable energy systems to power large-scale desalination plants in a cost-effective and environmentally sustainable manner. The implications extend beyond Djerba Island and can inform future decisions and investments in renewable desalination projects worldwide. Future studies on hybrid renewable energy systems can examine how they might be used in a variety of nonresidential contexts, including agriculture, radioactive waste disposal, water treatment and desalination, remote communication and monitoring, and disaster relief. As per the studies conducted by Saberi et al. (2017a, 2017b), hybrid systems have the potential to be combined with moving bed biological reactors for water treatment. Additionally, Saberi et al. (2017c) suggested using hybrid systems to power monitoring systems in radioactive waste disposal sites. Through the use of communication towers and surveillance, these systems could also be used to improve connectivity and security, increase food security in remote areas by powering greenhouses and irrigation systems, and provide dependable power for emergency shelters and medical facilities in the event of a natural disaster. The versatility and promise of hybrid renewable energy systems in satisfying the varied energy needs of different industries and communities can be further proved by broadening the area of research, especially in off-grid regions.
Conclusion
The objective of this study was to optimize a hybrid renewable energy system for an existing RO-based seawater desalination unit on Djerba Island, Tunisia. Through an analysis of the national renewable energy market and a focus on major energy sources available in Tunisia, we utilized HOMER software to model the system while considering various technical and economic constraints. The results indicate that integrating a hybrid system with battery storage into the national electricity grid can significantly reduce the cost of freshwater production to 0.414 $/m³, compared to the current cost of 0.585 $/m³. This is can be achieved by implementing 149,415 panels with 405 kWp power, 1364 wind turbines, each with a capacity of 10 kW, and a storage capacity of 178.9 MWh. The dynamic simulation, which incorporates real meteorological data for Djerba Island, demonstrated the ability of this configuration to effectively respond to fluctuations in energy demand and supply, ensuring reliable and consistent freshwater output. Given the high energy consumption of the desalination unit, the rising electricity prices, and inflation, it is crucial to transition away from the current energy consumption practices. To ensure the effective supply of clean energy to desalination plants without compromising cost and performance, it is essential to evaluate regulatory systems and streamline administrative processes. Future work should focus on conducting pilot projects to validate the proposed hybrid system under real-world conditions, exploring additional renewable energy sources such as tidal and geothermal energy, and developing comprehensive policies that facilitate the integration of renewable energy into existing infrastructure. This will not only enhance the sustainability of desalination processes but also contribute to the broader goals of energy transition and water security in Tunisia and similar regions. Additionally, research should focus on developing advanced control strategies that can dynamically adjust to varying renewable energy inputs and desalination demands. Exploring the long-term environmental and economic impacts of these systems under different operational scenarios is also crucial for their widespread adoption.
Footnotes
Declaration of conflicting interests
The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The authors received no financial support for the research, authorship, and/or publication of this article.
