Flexible batch electrodialysis for low-cost solar-powered brackish water desalination

Globally, 1.6 billion people in rural regions face water scarcity. Expanding freshwater access via brackish groundwater desalination can provide additional resources to address this challenge. In this study, we have developed a time-variant electrodialysis reversal (EDR) technology that flexibly uses available solar energy for desalination. Our proposed photovoltaic-powered desalination system can vary pumping and EDR power to match the availability of intermittent solar power, maximizing the desalination rate. Our results show improved system performance with the direct use of 77% of available solar energy—91% more than in conventional systems—and a 92% reduction in battery reliance. In a village-scale desalination case study in India, these system improvements lead to a 22% reduction in water cost, making the technology competitive with the currently used on-grid, village-scale reverse osmosis systems that are mainly powered by fossil fuels. Future advances could further reduce costs, providing an improved, sustainable solution to water scarcity in remote areas.

Providing affordable access to clean water on a global scale was set in the United Nations 2030 Agenda for Sustainable Development 1 .Recent surveys indicate that 17 countries that are home to a quarter of the world's population face 'extremely high' water stress 2 .Water scarcity is particularly severe in developing countries and emerging markets such as India, the focus region for the present study.
Over two billion people depend on groundwater for drinking 3 , yet around 1.7 billion reside in areas with stressed groundwater supplies, notably in India and China 4 .Groundwater quality is further compromised by natural and human-induced salinization, turning much of it brackish or saline.Worldwide, 56% of groundwater is saline and unsuitable for consumption 5 .This issue is prevalent in India, where 60% of the land harbours brackish or saline water 6 .Consequently, there is a pressing need for affordable, efficient methods for the desalination of brackish underground water to mitigate water scarcity and groundwater depletion.
Reverse osmosis (RO) systems and electrodialysis (ED) or electrodialysis reversal (EDR) are two widely used techniques in brackish water desalination.RO uses pressure to force water through a polymer membrane, while its constitutive ions are blocked by the membrane.Unlike RO, an EDR module is made up of a stack of ion exchange membranes and uses an electric field to move ions from the diluate flow channels to the brine flow channels between each membrane (Fig. 1a).This electric field can be intermittently reversed to prevent the build-up of scale on the membrane, thus adding 'R' to EDR.
For village-scale systems, previous studies have shown that EDR has a lower specific energy consumption and a higher water recovery than RO for salinity levels of less than 5,000 mg l −1 (ref.7), making it well suited to desalinating brackish groundwater.However, ED does not have the capital expenditure (CapEx) advantage of a mass-produced technology, the estimated market size of ED equipment being less than 6% of the RO market in 2019 8 .ED/EDR contribute about 3% of the total desalinated water produced globally; 60% of this water is produced from brackish water, and 20% comes from rivers 9 .
Unreliable energy sources in the rural areas of developing countries complicate brackish groundwater desalination.The lack of access https://doi.org/10.1038/s44221-024-00213-w The problem of intermittency can also be addressed by optimally resizing the desalination load or by investigating hybrid solar and wind power to smooth the overall intermittent energy supply 25 .Bian et al. 26 co-optimized the number of cell pairs in the EDR stack, the solar panel area, the battery capacity and the storage tank size for a small-scale brackish groundwater PV-EDR system.They showed that a 40% reduction in capital cost can be achieved compared with conventional design practices by combining load-scheduling and system-sizing insights.
These concepts of desalination flexibility have been taken one step further with methods to continuously vary the energy consumption of the desalination system.Atia and Fthenakis 27 investigated the active control of input water salinity by mixing solutions with different salinities, and several other researchers [28][29][30] investigated variable pump flow rate over time to accommodate variable solar and wind resources.In these studies, a control strategy was defined that maximizes both renewable energy use and water production 31 .However, this work was performed only with seawater RO systems, often on large scales; little research has been proposed to increase the flexibility of ED/EDR desalination.Our recent investigation of EDR technology for small-scale point-of-use applications has shown that actively controlling the voltage of the EDR stack can expand the EDR operation and increase desalination performance 32 .
The motivation of this study was to substantially reduce the water cost of PV-EDR brackish water desalination systems at a community scale by increasing the direct use of intermittent solar energy, thus reducing the dependence on batteries, with the purpose of greatly improving water access in remote areas.To this end, we have developed a novel PV-EDR technology that enables flexibility of the desalination load while guaranteeing a maximized water production at any solar irradiance level.We show experimentally that this improved performance can potentially lead to cost parity of PV-EDR brackish water desalination with the existing on-grid RO brackish water desalination systems currently used in rural India.Because India's grid electricity is heavily dependent on fossil fuel-based generators (more than 75% of the country's electricity generation was from fossil fuels in 2020 33 ), PV-EDR could help to notably reduce carbon emissions while improving water security, especially in remote communities.This cost-competitive, low-emission, solar-powered brackish water desalination technology can also reduce water waste through increased recovery ratios and enable the independence of water supply from grid infrastructure for rural areas in India and other resource-constrained countries.
to energy resources hinders water scarcity solutions as electricity is crucial for most desalination methods.Renewable energy, particularly solar, has proven effective for the supply of energy for potable water provision in remote or off-grid locations 10,11 .With the substantial reductions in the cost of solar photovoltaic (PV; 82% reduction from 2010 to 2019 with an expected additional 55% drop by 2030) 12,13 , solar energy is increasingly viable for water-stressed regions.
However, solar desalination systems must address the intermittency of solar power, often managed by costly, high-maintenance batteries, posing challenges in resource-limited communities.EDR, more energy efficient and with higher water recovery than RO, is advantageous for renewable-powered desalination.Wright and Winter 14 suggested that EDR could operate with half of the solar and battery capacity needed for a comparable PV-RO system, achieving up to 90% water recovery.In this context, we have developed a flexible EDR technology that adapts to the variability of solar energy, potentially reducing the costs for PV-EDR brackish water desalination systems.
Previous studies on solar-powered desalination examined both practical PV desalination systems and theoretical cases to evaluate their technical and economic viability across different locations.There are two main types of solar desalination system: direct-drive systems, which operate without energy storage, and integrated systems, which use energy storage.Research on direct-drive systems includes PV-RO 15,16 and PV-EDR 17 , with Bilton et al. 15 estimating the lowest cost of water for small-scale, batteryless PV-RO systems at US$2.17 m −3 , excluding detailed costs such as piping and sensors.Research on solar desalination systems with energy storage has explored various technologies, such as pumped hydro 18 , compressed air 19 , hydrogen 20 , flow batteries 21 and lithium-ion batteries 22 .These storage-integrated systems can surpass diesel-based desalination in terms of cost-effectiveness [20][21][22] and offer benefits such as fresh water provision, grid stability and regional job creation 18,19 .
Unlike these previous two methods, which focus on solar power supply to address intermittency, researchers have also investigated ways to manage power consumption on the desalination side.The aim of their studies was to avoid the use of batteries, potentially leading to lower costs compared with energy storage-integrated solutions, and included load scheduling, allowing the operation of the system to vary from one day to another, for example, by implementing a simple on/off control rule where the system is turned on only under sufficient irradiance conditions 23,24 .In this case, a variable amount of product water is produced every day depending on the daily available solar energy.The mismatch between the solar power and EDR power profiles requires a 6 kWh battery capacity (for a representative community-scale system) to discharge solar energy (bottom).The corresponding integrated flow into the battery during the day is shown in red.The x axis label in the bottom plot also applies to the top plot.

Flexible batch EDR
Conventional batch EDR systems, typically grid-operated with a fixed voltage and flow rate for energy efficiency, lack flexibility once powered by solar energy (Fig. 1).This rigidity leads to solar energy inefficiencies due to its weather-dependent, intermittent nature.Figure 1b shows the mismatch between the power profile of an EDR system, operated under 'constant' or 'conventional' operation, and available solar power.These mismatches require energy storage, particularly at the start and end of the day when solar power is low.This results in high battery costs and 'oversized' solar systems to compensate for low irradiance periods, as well as energy waste during peak solar times 34 .
To overcome these problems, we have developed a flexible batch EDR technology that incorporates a time-variant voltage and flow rate adjustment.A model-based control method enables the EDR system to align its power consumption with available solar power at each time step while optimizing water production under varying solar conditions.

Prototype PV-EDR system
A prototype PV-EDR system was built and tested at the Brackish Groundwater National Desalination Research Facility (BGNDRF), Alamogordo, NM, United States.We designed and built a real-time monitoring and control architecture to implement flexible operation (Fig. 2).The specific hardware components used for these experiments are detailed in Supplementary Table 1.The architecture comprises: • A feed-forward, model-based main controller running in Python 3.6 in real time.It uses sensor readings (100 Hz sampling rate) and time-variant EDR control theory to compute the optimal pump flow rate (and the corresponding pump speed σ) and the EDR stack voltage V that maximizes the desalination rate and instantaneous use of solar energy every 3 s.• A programmable logic controller (PLC) communicating with the main controller, sending sensor readings and receiving optimal values for V and σ with the system control hardware, sending analogue control signals for V and σ, and sampling analogue signals from sensors.• A pyranometer located at the centre of the solar array that senses the incoming irradiance on the solar array and is calibrated to convert the irradiance into the generated electrical power.
• Four inline probes detect the diluate and brine conductivities at the inlet and outlet of the EDR stack.• A programmable DC power supply that supplies the voltage V dictated by the PLC signal to the EDR stack using an internal feedback control loop.• Two variable frequency drives (VFDs) that control the motor speed of two high-speed pumps with an internal feedback control loop using the PLC signal as reference.The curves of the two pumps at different speeds can be experimentally measured to build relationships between the pump speed, flow rate and c.The experimentally fitted pump curves can then be used in the model-based control.
The experimental system (Table 1) closely reflects the typical design parameters and operational conditions for a community-scale PV-EDR system sized to produce 6 m 3 freshwater per day 26,34 .Real groundwater available in the BGNDRF from well number 1 was used as feed water with an average starting salinity of 970 mg l −1 (a detailed report of the water constituents is presented in Supplementary Table 2).This pilot system was built with a 20 kWh battery capacity, which is more than the capacity needed for constant operation according to the results of our simulations.This allowed us to seamlessly run tests in constant or flexible operation to compare their performance.A conservatively low recovery ratio of 60% was chosen for EDR (still higher than the 25-50% recovery reported for RO systems 35 ) as the experimental set-up did not include an automated acid rinse to mitigate scaling in the brine channels.

Single day analysis
Figure 3 shows the single-day testing results of a full-scale PV-EDR pilot system, including the power profile of the solar power system and the power profiles of the prototype in both flexible and conventional operation, each producing the same quantity and quality of product water.The flexible strategy was tested for six full days in March 2019 under various weather conditions, representing a wide spectrum of daily input solar power profiles in terms of both the total solar energy available for the day and the variability of the solar power (see Fig. 4).The solar power available, the power consumption of the EDR system and the cumulative water production were recorded every 1 s for the duration of the operation (on average 8.9 h).As a benchmark,  https://doi.org/10.1038/s44221-024-00213-w the system was also run for one day in conventional constant operation.Constant and flexible operations could not be run on the same day (as we had only one EDR desalination system); however, in constant operation, the same voltage and flow rate were used for each batch, and thus each batch exhibits the same power consumption pattern.
The power consumption profile to achieve a given number of batches is independent of the shape of the input solar power, and therefore single batch data can be extended to multiple batches and compared with flexible operation on any day.Figure 3 shows that on the day of the experiment, the power consumption of the flexible system closely follows the variable solar power during EDR desalination.This close agreement contributes to the increased level of power use compared with the conventional EDR system, which maintains a consistently low power profile throughout the day.Between batches, the recirculation tanks were drained and refilled, when the water pumps were controlled.At the beginning and end of the day, the power consumption of the flexible system is nearly identical to the measured solar power.In the middle of the day, when the available solar power is high, the power consumption deviates slightly below the measured solar power as each batch progresses.These deviations reflect times when the EDR system has reached the maximum voltage and/or flow rate constraints of the system's hardware.Within a batch during solar peak generation, this deviation between the desalination load and the solar energy tends to occur more as the batch progresses and the limiting current density decreases at the maximum flow rate.
The specific energy consumption (SEC) of the flexible EDR batches (3.3 ± 0.17 kWh m −3 on average over the 15 flexible EDR batches measured experimentally over a day) is about 40% higher than the SEC of the constant EDR batches (2.4 ± 0.12 kWh m −3 on average over the eight constant EDR batches measured experimentally over a day).However, SEC may not be the only factor that can be used to assess the energy efficiency of desalination, particularly when solar energy generation is considered as the energy input.In conventional PV-EDR systems, a lot of solar energy is wasted when the PV panels produce more electrical power than the system can accept, even though the conventionally defined SEC (which does not consider 'wasted' solar energy) is low.In contrast, the flexible EDR system can use the 'wasted' solar energy that cannot be harnessed by conventional constant EDR systems, thus producing more water for a given capital cost investment in a solar power system.For these reasons, the Cost analysis uses monetary costs to compare system architectures, providing a single metric to capture the capital and operational costs associated with energy and the effective cost of wasted energy.Therefore, the flexible system can directly use much more of the available solar energy than the conventional system (75% versus 40%).This significant increase demonstrates that the flexible controller is able to substantially improve the productive use of the system's solar generation capacity in real hardware and environmental conditions.
These experimental results also indicate that the field-tested PV-EDR system reached its operational boundaries during flexible operation, subject to the system's limitations in maximum power consumption (this can be seen by the gaps between the power consumption and the solar supply during batches in the middle of the day).These operations reached the maximum voltage and flow rates that were allowed for the PV-EDR prototype.In other words, the results in Fig. 3 represent the full operational range of the prototype PV-EDR system, from the minimum power level (for example, start-up from the shut-down status) to the maximum power level with the highest voltage and flow rate applied.As this full operational range was demonstrated experimentally in the field, we considered and used the same performance parameters in a further cost analysis when the system was simulated using varying solar energy throughout the seasons (see Cost analysis for further details).
As shown in Fig. 3, there are periods of relatively poor power use between batches when there are drain and fill events for both flexible and conventionally operated systems.During these periods, the time-variant controller has only one degree of freedom to control the  https://doi.org/10.1038/s44221-024-00213-wpower consumption of the system, the pump flow rate, which is limited by the maximum operating range of the pump.At most times of day, operating the pump at its maximum flow rate requires much less power than the solar power available, limiting the controller's ability to satisfy the power constraint (equation ( 1) in Methods).
The duration of the drain and fill events relative to desalination can be controlled and potentially optimized to further maximize power use.Reducing the batch volume would decrease the duration of each drain and fill event, although the total number of these events would increase because more batches would be required to achieve the same volume of product water.Another solution to reduce the duration of the drain and fill events is to use larger pumps operating at increased flow rates.Larger pumps would also allow the power consumption of the flexible system to match the available solar power more closely during the EDR process in the middle of the day.However, larger pumps have higher capital costs.A comprehensive techno-economic model of the PV-EDR system is needed to fully weigh these complex trade-offs.
The impact of flexible operation on battery capacity is apparent in the integrated energy flow to the batteries, shown for both flexible and conventional operation in Fig. 3.The flexible system requires an almost negligible amount of energy from the batteries to operate throughout the day (0.11 kWh), corresponding to 3% of the battery capacity required by the conventional system (3.7 kWh).The small amount of energy required by the flexible system is needed to address the brief power overshoots at the start of each batch.These brief power overshoots reflect a limitation of the controller in predicting the current at the very beginning of a batch, as described by He et al. 34 .As the controller underestimates the power demand, it attempts to make full use of the available solar power by increasing the voltage and flow rate, resulting in a spike in power consumption.Despite these spikes, the required battery capacity is minimal compared with the conventional system design.To produce the same volume of water as the flexible system, the conventional system requires significant amounts of stored energy at both the beginning and end of the day.This difference in battery capacity can lead to significant differences in both the capital cost and the periodic replacement costs of PV-EDR systems.
Figure 3 also clearly shows the difference in the total operating time required for the flexible and conventional systems.On the day represented, the flexible system was able to produce as much water as the conventional system in 33% less time, or in a total operating time of about 10.8 h.This measured time saving is substantial and could reduce the labour and overhead costs of operation.

Performance over multiple days
single day analysis was replicated over 6 days of operation, and the results are summarized in Fig. 4. Figure 4a demonstrates the range of solar irradiance profiles tested and the total volume of water produced by the flexible PV-EDR system on each day.During the 6 days, the prototype experienced a wide range of solar conditions, including days with rapid variations due to cloud cover as well as sunny days with minimal variation.On each day, the system was able to deliver the target production volume of ~6 m 3 .This demonstrates the ability of the control strategy to reliably deliver the desired level of performance under various solar conditions.
The solar profiles are further statistically characterized in Fig. 4b, which presents the mean solar power, the standard deviations of the solar power profile and the PV power variability metric, as defined by Hoff and Perez 36 .The PV power variability metric reflects the magnitude of the rate of change in PV power, with a higher variability indicating a more challenging test environment for the controller.Rapid changes in solar irradiance could potentially cause the controller to demand too little or too much power compared with the available power, negatively affecting either the energy use or the battery capacity required to operate.However, Fig. 4c,d shows that the variation in energy use and minimum required battery capacity in the flexible system is relatively small over the 6 test days, despite the relatively high variation in total solar energy (28% of the maximum value) and PV power variability (75% of the maximum value).This suggests that the benefits of flexible operation are robust across both more and less challenging solar conditions.
The average performance of the flexible system for 6 days is compared with the conventional system in three key metrics in Fig. 4c-e.Figure 4c shows that the flexible system is able to directly use 77% of the available solar energy on average compared with only ~40% in the conventional system (a 91% increase).This suggests that a conventional  3.
https://doi.org/10.1038/s44221-024-00213-wsystem would require much more solar panel area to operate directly (that is, without any energy storage), increasing capital costs.Conversely, Fig. 4d presents the average minimum battery capacity required to operate each system using the same solar panel area; in this case, the flexible system requires only 0.27 kWh on average compared with 3.3 kWh for the conventional system (a 92% reduction).This significant difference could translate into a large saving in capital costs due to the relatively high cost of battery storage.The standard deviation of the minimum battery capacity required for the conventional system is also quite large.To ensure reliable operation, the battery capacity would have to be set towards the top of this range to operate under the poorest solar conditions, further adding to the capital cost.Finally, Fig. 4e shows that the flexible system can reach its production volume up to 54% faster than the conventional system.

Cost analysis
Making the desalination load flexible could lead to a significant improvement in the economics of water treatment.By minimizing the required battery capacity, the capital expenditure and maintenance costs (including hardware replacement) of the PV-EDR system can be considerably reduced.The reduction in daily operating time also lowers the operating cost.Therefore, we next examined the impact of shifting from constant to flexible operation on the levelized cost of water (LCOW) using a rural village in India (Chelluru, near Hyderabad) as a case study.
Using a simplified model (Supplementary Information 1.4) to simulate the batch-wise performance of flexible operations, we optimized the system design of flexible-operated EDR systems.We compared the result with the cost of implementing conventional commercial RO on the grid for groundwater desalination in the same context and explain the high potential of flexible EDR technology to improve clean water access in remote areas.
The LCOW in US dollars per cubic metre is a measure of the full cost of building and operating a system over its lifetime, scaled by the total water production.The LCOW or unit product cost of water combines capital and operating expenditures in a single indicator, measuring a system's ability to treat and render usable water 37 .The LCOW is used to investigate the cost-optimal system design for a given technology and application.In this study, the LCOW was calculated over a 10-year period.Details of the cost model are presented in Methods.
Particle swarm optimization 38 was selected to solve the optimization problem to minimize the LCOW of the PV-EDR system.It is a heuristic approach where a population of candidate particles (that is, design variables as shown in Table 2) is expected to evolve in the search space towards the least-cost configuration.Each particle's movement is influenced by both its local best-known position and the best-known position in the search space so far.This algorithm is particularly suited to this non-convex optimization problem where both the objective function (in this study, the LCOW) and the feasible space of the design variables (for example, the PV panel area, the energy capacity of batteries, the volume of water tanks, the area of the electrodes, the number of membrane pairs and the selection of pumps and VFDs) have a complex, implicit dependency on the design variables.
To quantify the improvements enabled by flexible operation, we compared our flexible PV-EDR system with three other reference systems that have been field-tested for village-scale water applications in rural India 34,39 : two conventional PV-EDR systems (systems 1 and 2) in constant operation and a local commercial on-grid RO system (system 3).Below is a detailed description of how each of these systems would be designed to meet Chelluru's daily water demand and the derivation of the corresponding LCOW.To guarantee a fair comparison with flexible operation, the two constant PV-EDR systems used the latest commercial EDR stack on the market 40 , which is the cheapest available EDR stack for small-scale operation.
1.A conventional PV-EDR system as it would be installed in the field today.This system design was derived using the 'rule-of-thumb' design practices described by Bian et al. 26 .2. A state-of-the-art PV-EDR system reflecting the improvements realized by Bian et al. 26 , who optimized the PV-EDR system design for lowest capital cost.3. A commercial on-grid RO system sized for a 600 l h −1 production flow rate in continuous mode.The design parameters and component costs for this system were estimated on the basis of the current products manufactured by a local technology supplier 41 .Over 3,000 of these commercial-scale RO systems have been installed throughout India.We obtained the costs of the products from the local supplier.We estimate that this system produced freshwater at a LCOW of US$1.71 m −3 (Fig. 5c).The capital and operational costs for the EDR variants are normalized to those of the on-grid RO in Fig. 5a,b, respectively.The cost breakdown for the on-grid RO system is not reported to protect the proprietary information of the local supplier.The optimized LCOW achieved by the proposed flexible PV-EDR system is US$1.66 m −3 , which improves the cost by 22% compared with the current state-of-the-art PV-EDR system and by 46% compared with the conventional PV-EDR system.The detailed cost breakdown presented in Fig. 5 shows that these substantial reductions are achieved by using a reduced solar panel area, eliminating almost all battery capacity, and requiring less operator time and labour costs to achieve daily water production.The yearly time series of water production for the state-of-the-art, constant and flexible PV-EDR systems shown in Supplementary Fig. 4 illustrate the capacity of the flexible system to scale water production across the full range of solar power profiles.https://doi.org/10.1038/s44221-024-00213-w The amount of energy captured by the constant system is limited on days of high irradiance by its cost-optimal battery capacity.Despite the additional expense required to implement flexible operation (more powerful pumps and power supply, VFDs), the capital cost of the flexible system remains lower than that of the constant systems due to the reductions in solar panel area and battery capacity.The cost of operating the flexible system is also lower than the cost of constant operation because the water production schedule is synchronized with solar hours and therefore requires the presence of an operator for only 11 hours instead of 14.5 hours in constant operation.
The flexible PV-EDR system achieves a critical milestone for off-grid water treatment systems: our results show that the flexible solar-powered PV-EDR system is cost-competitive with the on-grid RO systems currently commercialized in Indian villages.The capital cost of the PV-EDR system is higher than that of the on-grid RO module as the EDR module itself has a higher cost and the active control requires expensive dedicated hardware.However, the grid electricity required to power the RO system needs an additional US$0.36 m −3 operational cost.This brings the LCOW for on-grid RO to US$1.71 m −3 , 3% above the LCOW of flexible PV-EDR.

Discussion
The demonstrated flexible PV-EDR technology could bring transformative improvements to freshwater supply in remote areas, both in the near and distant future.Regulations are evolving towards stricter brine disposal policies 42 to limit the environmental impact of inland groundwater desalination.This evolution favours PV-EDR, as it produces substantially less waste water and carbon emissions compared with current village-scale desalination solutions.The cost benefits of EDR compared with RO for small-scale systems are even more significant when including the capital cost of installing evaporation ponds to manage brine.PV-EDR can achieve up to 90% recovery and therefore requires evaporation ponds for as little as 20% of the feed water volume, while conventional village-scale RO systems reject 60% of feed water on average 15 .If brine management costs are included, the LCOW of PV-EDR is 37% lower than the LCOW of on-grid RO systems (Supplementary Information 1.7).The high recovery ratio of EDR implies that its cost is relatively insensitive to brine management, ensuring that PV-EDR will have greater economic benefits compared to other solutions.It is very likely remaining an affordable option, whereas the cost of RO increases more rapidly than EDR due to the brine disposal expenses.
If PV-EDR systems become more widespread, their capital costs will probably decrease.This prediction is based on the experience of RO technology, which has rapidly developed in the past several decades 43 .Following its commercialization, RO saw a dramatic 94% reduction in membrane costs between 1975 and 2002 44 , suggesting a similar potential for cost reductions in EDR membrane and electrode materials.This could lead to a lowering of the LCOW to below US$1.45 m −3 .Additionally, advances in automation may further reduce the costs of sensors and controls.A projected 50% CapEx reduction over the next decade could allow PV-EDR systems to produce freshwater at a LCOW of around US$1.3 m −3 , without brine management.
Despite its benefits, flexible PV-EDR technology faces challenges for its widespread adoption in rural communities.PV-EDR systems are expected to cost three to four times more than on-grid RO systems, posing affordability issues for lower-income rural Indian customers.The pay-as-you-go model, successful in commercial on-grid RO systems in rural India, could mitigate this by allowing manufacturers or operators to maintain ownership and spread costs over time, typically 10 years in India 34,45 .This model is financially viable, with system owners benefiting from both equipment production and water service provision.End-users would pay for only the water they use, potentially at rates comparable to or lower than RO-treated water.Public financing with zero or very low interest rates, such as the Government of India's Jal Jeevan Mission with an investment of approximately US$12 billion by 2024, plays a crucial role in establishing rural water infrastructure, including solar-powered solutions 46 .Government support also encourages private investment through innovative financing structures 47 .
Other factors, such as membrane fouling, component degradation and geographic variations, will affect the long-term efficacy of the flexible PV-EDR technology.The current study's limitation lies in its singular focus on a 6-day test with one type of brackish water in a single location.Despite this, the results affirm the system's reduced battery dependence and overall feasibility, showcasing its full operational range.This includes varying levels of operation, from start-up to maximum power.The successful test under diverse weather conditions suggests the system's adaptability to real-world scenarios.Future testing will expand to longer durations, different locations and varied feed salinities to further assess the technology's robustness across diverse operational conditions and potential failure points.
We did not directly compare PV-EDR and PV-RO systems in this study.Previous research 14 suggested that EDR, being more energy efficient at Indian groundwater salinities (1,000-5,000 mg l −1 ), could be more cost-effective than RO for off-grid applications; a PV-EDR system might need a smaller solar panel array than a PV-RO system, potentially halving the power system's capital cost at a salinity of 2,000 mg l −1 .Therefore, our comparisons focused on conventional EDR versus flexible EDR systems.The three systems we compared against the proposed flexible PV-EDR, namely, conventional PV-EDR, state-of-the-art PV-EDR and on-grid RO, have all been field-tested in rural India.There are limited test data for PV-RO systems in these areas, based on literature and field surveys.Studies in the literature focusing on other regions, primarily simulations, indicate that PV-RO costs for brackish water desalination are in the range of US$1.96-9.1 m −3 , above our predicted LCOW for flexible PV-EDR (Fig. 5c).Further research and experimental testing are needed to assess the cost and performance of PV-RO in rural India, which is beyond the scope of this study.
Future PV-EDR research should explore varied conditions, such as changing feed water compositions, salinities and locations, especially in under-served remote areas in developing countries.This study's cost analysis focused mainly on capital and some operational costs, omitting other expenses, such as land costs, provider profit margins and other project fees.Consequently, the actual cost of water to the customer may exceed our estimated LCOW.Nonetheless, our findings suggest that the proposed PV-EDR system could reduce costs, carbon emissions and brine discharge compared with current on-grid RO systems in rural India, enhancing water affordability and minimizing environmental impact.Future research should evaluate the advantages of desalination in various geographical areas, taking into account the diverse salinity levels and compositions of local water sources.This involves tailoring desalination processes to effectively use the region-specific solar energy resources, which vary according to the location.

Ethics statement
All of the collaborators of this study who have fulfilled the criteria for authorship required by Nature Portfolio journals have been included as authors, as their participation was essential for the design and implementation of the research.Roles and responsibilities were agreed among collaborators ahead of the research.This work includes findings that are locally relevant, and were determined in collaboration with local partners.Local and regional research relevant to our study was taken into account in citations.

Time-variant control theory
In conventional static operation, the constant voltage (V) applied to the electrodes of the EDR stack is chosen so that the current density (i) never exceeds a limiting value of the current density (i lim ) at any point in the batch process.Above the threshold i lim , appreciable water https://doi.org/10.1038/s44221-024-00213-wsplitting begins to occur in the ion-depleted boundary layers close to the membranes, reducing the transfer rate of ions and decreasing the overall desalination rate.The threshold i lim is proportional to the concentration of the diluate channel, which decreases over the course of the batch.Thus, as detailed in previous work 32,48 , the constant value of V is constrained throughout the entire batch by the lowest value of i lim , which occurs only at the end of the batch.As a result, for the majority of the batch process, V is lower than it should be to satisfy i(t) ≤ i lim (t), where t is the time.This inefficiency revealed an opportunity to maximize the desalination rate by continuously adjusting V to maintain i close to i lim at each time step 32 , known as variable voltage operation.
Taking the variable voltage theory one step further, we proposed to manipulate i lim by varying the flow rate (Q) at the same time.Manipulation of the limiting current density by controlling the flow rate leads to (1) higher ion-driven currents than the currents of the conventional constant operation, which can increase desalination rates, and (2) a considerably expanded operational range of batch EDR systems, creating flexible EDR systems that can directly use intermittent renewable energy (such as solar energy) over a wide range of power generation.As a consequence, a flexible EDR system can maximize the use of available solar power and reduce the inefficiency of solar energy use in conventional EDR systems.
Therefore, the proposed flexible EDR system needs to control both the voltage and flow rate simultaneously to maximize the desalination rate and the use of the available power.These conditions can be written as functions of the operating variables V τ i and Q τ i at the ith control time step τ i : Here, P ED (W) and P pumps (W) are the energy consumption of the ED stack and the pumps, respectively, P avail (W) is the available power from the solar panel, and P ED,max (W) and P pumps,max (W) are the maximum ED power and pumping power, respectively.An iterative strategy to solve equation (1) for V τ i and Q τ i at intervals of Δt is proposed to maximize the use of solar energy for water production.Using sensors, the controller measures the values of the available instant solar power (P τ i avail ) and the diluate concentration at the outlet of the stack (C τ i d ) as inputs for each time step (τ i ).This control theory has been implemented in a feed-forward controller that includes constraints to address hardware limitations of the power supply and pump (for example, maximum voltage and flow rate).Operating under this feed-forward control strategy is referred to as 'flexible' operation, reflecting that the system operating parameters are adjusted in real time to flexibly accommodate changing environmental conditions.Details of the models can be found in the Supplementary Information 1.7.

Cost modelling
A parametric model was created to predict the LCOW achieved by a given PV-EDR system.It combines an economic model of capital, operational and maintenance costs incurred by the water system operator with an assessment of the long-term reliable water production of the system (equation ( 2)).This model reflects the framework established by Bhojwani et al. 37 , where depreciation is taken as the lifetime of the system without salvage value.
where C capital (US$) is the system capital cost, C maintenance (US$) is the cost of replacing components with a lower lifetime than the system lifetime T life , c operational (US$ m −3 ) is the operational cost and V rel (m 3 ) is the daily volume of freshwater supplied.These costs can be broken up per component i (for example, solar panel).They depend on the unit cost C i (for example, US$98 m −2 for the solar panel) and the corresponding system design Var i (for example, the area of the solar panel used in m 2 ).These design variables include the area of the solar panel (A sol ), the energy capacity of the batteries (C batt ), the volume of the water tank (V tank ), the area of the electrodes used in the ED stack (A stack ), the number of membrane pairs (N CP ), and the selection of pumps, piping, sensors and control electronics.The maintenance cost depends on the number of replacements required (N i ) over the lifetime of the system (T life (h)).For example, solar panels last longer than T life , so in this study, N i = 0. Thus, the maintenance cost is C i × Var i × N i .
For the operation cost, this study considered the labour cost of one operator per system at a unit rate (US$ h −1 ) that was costed with the operating hours for water production, the cost of the feed water (US$ m −3 ) and the cost of consumables, including filters (US$ month −1 ) and acid for brine dosing (US$ m −3 ).
The detailed parameters of this model (Table 2) have been informed by cost data collected in the field in India during a PV-EDR pilot in Chelluru in May 2017 34 .The system is predicted to have a 10-year lifetime, which is a conservative estimate of the lifetime of the EDR membranes 49 .Moreover, this assumption facilitates a direct comparison with the LCOW of existing small-scale RO systems calculated over a 10-year period.The cost of brine management was not taken into account (in the results shown in Fig. 5) owing to the high uncertainty of the cost of an evaporation pond and because surface discharge of brine is typically practised in India.However, a preliminary investigation of the cost sensitivity of the PV-EDR system to brine management costs was developed in comparison with the on-grid RO system

Fig. 1 |
Fig. 1 | Batch photovoltaic EDR systems in constant operation: mismatch between power generated and power consumed.a, Schematic of a batch EDR module (right) and the typical EDR power consumption profile (left) repeated during each batch when a constant voltage and flow rate are applied.The voltage applied to the EDR stack drives ions across the ion exchange membranes from the diluate channels to the concentrate channels.b, Daily PV and EDR power profiles when solar panels are coupled to the EDR module in constant operation (top).The mismatch between the solar power and EDR power profiles requires a 6 kWh battery capacity (for a representative community-scale system) to discharge solar energy (bottom).The corresponding integrated flow into the battery during the day is shown in red.The x axis label in the bottom plot also applies to the top plot.

Fig. 2 |
Fig. 2 | Hardware and software PV-EDR control architecture.The architecture implements in real time the optimal control strategy created to vary the EDR stack voltage and pump flow rate.Details of the hardware components

n = 27 ,Fig. 4 |
Fig. 4 | Experimental performance of the flexible PV-EDR operation compared with constant operation over 6 days.a, Experimental daily water production (blue bars) achieved for six different solar power profiles (green).b, Statistical analysis of daily PV power generation (green bars) and PV power variability (blue triangles).The six experiments represent a wide range of PV energy and PV output variability.The data points in b correspond to the solar power profiles shown in a.The bars represent the mean values and the error bars show the standard deviation (SD).The number of data points (that is, the solar power) measured over 6 days (n) are shown above the bars.c, Fraction of solar energy directly used in both flexible (F) and constant (C) operation over 6 days.Regarding the constant operation during the 6 days, the same daily energy consumption data (measured in the field) were used for all 6 days because the constant EDR operation does not change in the conventional operation.d, Minimum battery capacity needed to achieve the same daily production in flexible and constant operation.Flexible operation requires on average less than 10% of the battery capacity needed for constant operation.e, Daily operation time for flexible and constant operation.In c-e, the bars represent the mean values with the error bars showing the SD.The corresponding data points (n = 6) are shown as black dots.The experiments were run at BGNDRF between 12 and 21 March 2019.The experimental data collected on a daily basis are presented in Supplementary Table3.

Fig. 5 |
Fig. 5 | Comparison of water costs between the proposed flexible PV-EDR and reference technologies.a-c, CapEx (a), operational expense (b) and LCOW (c) for a cost-optimal, flexible PV-EDR system compared with the three reference systems.
the system-level optimization of the flexible PV-EDR system.b A battery capacity is multiplied by two to ensure that the discharge depth does not exceed 50% of the battery capacity and prolong battery lifetime26 .c Cost component.dThe cost was estimated on the basis of the EDR stack COM-P-000000-MQ-01 from Suez Water Technologies.e Database of pumps from CNP, Grundfos, Kirloskar and Lubi.f Only used by/additional functionality required for flexible operation.g See ref. 50.h See ref.42.P VFD,max , maximum VFD power; V max , maximum voltage; I max , maximum current; RR, recovery ratio; T day , daily operating time.

Table 1
. The symbols C, V and Q represent conductivity sensors, voltage sensors and flow rate sensors, respectively.

Single day tests on a full-scale PV-EDR pilot system.
Experimental results from two single day tests on a full-scale PV-EDR pilot system under flexible and constant operation in New Mexico.The flexible and constant operation tests were performed on 17 and 11 March 2019, respectively.Raw solar power data were extrapolated to a complete common full day (see Supplementary Table3for details).The difference between generated and consumed power over time was analysed to derive the integrated power flow into batteries, the minimum battery capacity required by a real installation to produce the desired water demand and the corresponding state of charge (SOC).The power profiles and SOC of batteries in the flexibly operated PV-EDR are shown in the first two figures on the top.The power profiles and SOC of batteries in the constantly operated PV-EDR are shown in the last two figures at the bottom.The x axis applies to all plots.