Under the patronage of:

Journal Metrics


Impact factor (2025): 2.1


CiteScore best quartile: Q1

More about CiteScore


Source Normalized Impact per Paper (SNIP): 0.701


SCImago Journal & Country Rank

 
 

Comparison of Energy Management Strategies between Fuzzy Logic and Mixed-Integer Linear Programming for a Hybrid Photovoltaic–Wind Powered Reverse Osmosis Desalination System

Original scientific paper

Journal of Sustainable Development of Energy, Water and Environment Systems
Volume 14, Issue 2, June 2026, 1140680
DOI: https://doi.org/10.13044/j.sdewes.d14.0680
Amine Ben Rhouma1 , Abir Zgalmi2, Xavier Roboam3, Jamel Belhadj4, Bruno Sareni3
1 ENSIT, Tunis, Tunisia
2 ENIT, Tunis, Tunisia
3 ENSEEIHT, Toulouse, France
4 HIDE, Tunis, Tunisia

Abstract

Enhancing energy efficiency in water distribution systems is crucial for developing sustainable water infrastructures. Applying renewable energy sources for this purpose is a key step toward cleaner energy production. For this reason, the energy/water unit discussed in this paper includes a hybrid system, combining solar photovoltaic and wind generation, with a water treatment process composed of three motor pumps and storage tanks for water pumping and desalination. Such multi-energy multi-pumps system can be operated more efficiently by optimizing the energy management systems according to environmental (solar and wind) conditions and fulfilling operation constraints. Therefore, this paper presents a comparative analysis between the results obtained using a Fuzzy Logic Energy Management System, an optimized Genetic Algorithm for the tuning of a Fuzzy Logic Energy Management System and a Mixed-Integer Linear Programming optimization approach that converges close to the global optimum in terms of energy management trajectories. It is worth noting that the Fuzzy Logic energy management system can be implemented at real time while the Mixed-Integer Linear Programming is based on the knowledge of the full (past and future) power production trajectories. This comparative analysis is a novel opportunity to assess the level of optimality achieved by fuzzy logic.

Keywords: Energy management system, Fuzzy logic, Genetic Algorithm, Mixed-Integer Linear Programming, Reverse Osmosis desalination system

Creative Commons License
Views (in 2026): 899 | Downloads (in 2026): 256
Total views: 899 | Total downloads: 256
Introduction

The rapid demographic growth is continually increasing the demand for water and energy resources, while also straining both economic and environmental sustainability [1]. By 2035, the global energy demand is projected to be 40% higher than it was in 2010 [2]. In comparison, global human water consumption was estimated at approximately 2,000 km3/yr in 2010 and projections indicate that total consumption could increase by up to 40% by the end of the 21st century [3]. Thus, it is imperative to explore interlinks between energy and water so that both resources are managed and conserved sustainably [4]. Moreover, applying renewable energy sources is essential for achieving cleaner energy production within these systems.

Among desalination technologies, Reverse Osmosis (RO) dominates, representing approximately 69% of the installed global capacity, while thermal methods such as Multi-Stage Flash (MSF) and Multi-Effect Distillation (MED) account for much smaller shares. Most new desalination contracts also prefer membrane-based systems. This preference is driven by technical, economic and environmental advantages: compared to MED and MSF, RO is the most energy-efficient, reducing electrical consumption by over 31%. It is up to 53% more cost-effective and exhibits the lowest carbon footprint among desalination technologies [5].

In the same context, several studies have demonstrated that coupling reverse osmosis (RO) desalination with renewable energy sources such as solar photovoltaic (PV) and wind can reduce energy costs, lower environmental impacts and enhance system sustainability and resilience. For instance, [6] review the state of the art of wind and PV-powered RO systems and discuss the technical challenges of direct renewable energy sources (RES) integration in large-scale plants. Furthermore, studies emphasize the role of renewable integration in cutting carbon emissions and improving long-term viability of RO desalination [7].

RO desalination systems coupled with RES such as photovoltaic (PV) panels or/and wind turbines to ensure water and energy sustainability, is a promising and efficient direction that may be considered as a water-energy microgrid (WEMG). The integration of such systems enables a beneficial coordinated energy and water management by leveraging renewable generation to drive desalination processes. This synergy improves overall resource efficiency and enables optimal scheduling of energy and water demands within a multi-vector energy system [8].

The inherent randomness and intermittency of RES on the one hand and the specific features of the desalination system on the other, present significant challenges to optimizing the dispatch of energy flows that guarantee a water supply, given its consumption. To mitigate these issues within a WEMG, the deployment of efficient energy management systems becomes essential. Furthermore, various studies have been conducted to address these challenges, with special attention given to optimization techniques that enable the efficient scheduling of alternative energy resources and energy storage systems. In [9], the authors proposed a data-driven, machine learning-based economic dispatch method for grid-connected water-energy microgrids. The approach focuses on the cost-efficient operation of distributed energy resources under variable renewable generation. In [10], the authors developed a deep reinforcement learning-based operational strategy for islanded energy-water microgrids, enabling adaptive scheduling by leveraging the water system as a virtual battery. In [11], the authors developed an optimal sizing framework for a grid-connected DC microgrid supplying agricultural loads. The proposed optimal sizing method incorporates a water-energy management system integrating battery cycle-life degradation.

This approach of optimization technique ensures system stability and facilitates the optimal dispatch of generated power, thereby enhancing overall economic performance.

Among the various EMS approaches, two representative methods are presented: an offline method that performs global optimization but requires a prior information database and an online method that operates in real-time based on system conditions.

Mathematical programming techniques, being an offline approach, such as linear programming (LP) or mixed-integer linear programming (MILP), are widely employed to address the global optimum of the energy management in microgrids [12]. Similarly, dynamic programming (DP) and nonlinear programming (NLP), which are also typically formulated as offline optimization problems, also offer deterministic solutions under well-defined system models and constraints.

A well-established method is the optimization-based MILP formulation, which can be applied to complex systems especially with a huge number of decision variables [13]. In [14], the study employs the roulette wheel mechanism and probability distribution functions to generate uncertainty scenarios for renewable generation, demand and market prices. The MILP optimisation approach is validated through simulations on both a single household and a microgrid, demonstrating the effectiveness of the proposed stochastic model.

MILP is widely used in system analysis and optimization due to its flexibility and robustness in handling large-scale, complex problems, such as those encountered in the water-energy nexus. In [15], a mathematical model for a centralized EMS for microgrids, functioning in both grid-connected and stand-alone modes, is proposed. The problem is formulated as a unit commitment problem, incorporating the distribution network and its associated operational constraints, which initially results in a Mixed-Integer Nonlinear Programming (MINLP) model. To reduce the computational complexity, the distribution power flow equations and nonlinear constraints are simplified via linearization techniques, transforming the MINLP into a MILP formulation. In [16], the integration of energy management systems into microgrids is examined through a multi-objective function that accounts for both total cost and greenhouse gas emissions. The system is precisely modelled to apply a novel MILP optimization algorithm. In [17], an energy renovation model is proposed to address an optimization problem in residential urban areas using the MILP approach. The model integrates energy supply systems and building envelope design, with a focus on assessing economic feasibility and the availability of roof space. In [18], the authors present two EMS approaches: a heuristic method and a Mixed-Integer Linear Programming (MILP) algorithm, applied to a smart power plant consisting of wind turbines and a lithium-ion storage battery to meet a power production commitment to the utility grid. A comparative study is conducted to improve the predefined heuristic using the optimal reference provided by the global MILP optimizer.

In [19], a year-long comparative analysis of two distinct architectures of water station involving single and multi-pump system both powered by the same PV generator is conducted. For the multi-pump architecture, a MILP model is developed to maximize water production. Consequently, the multi-pump water station demonstrates a significant enhancement in hydraulic efficiency compared to the single-pump station. Additionally, the annual water production volume for both architectures is assessed.

Other techniques have also been investigated, like metaheuristic algorithms including Genetic Algorithms (GA), Particle Swarm Optimization (PSO) and Grey Wolf Optimizer (GWO), which provide flexibility in handling complex non-linear and multi-objective optimization [20].

Recently, hybrid metaheuristic approaches have gained increasing attention, with studies proposing methods such as the Dual Predator Optimization (DPO) algorithm [21], which combines Grey Wolf Optimization (GWO) and Whale Optimization Algorithm (WOA) to address their respective shortcomings. The DPO has been applied to optimize renewable energy utilization in a hybrid microgrid. Reported results are promising, showing a reduction of approximately 15-20% in the Cost of Electricity (COE) and an average 7.5% reduction in the Loss of Power Supply Probability (LPSP).

On the other hand, the online EMS has emerged as an attractive approach and has been the subject of numerous studies because of its key advantage of operating in real-time without requiring any prior knowledge of future events. Recently, the adoption of artificial intelligence (AI) techniques as an online method particularly reinforcement learning has gained attraction [22] . Fuzzy logic is also considered as a robust and intelligent methodology for energy management which provides a suitable framework for addressing such problems. Parameters tuning of conventional rule-based fuzzy logic systems are manually designed by human experts, relying on heuristic knowledge and intuition about the system's behavior. Nevertheless, this kind of method exhibits the inability to handle accurately nonlinearities and uncertainties. To overcome the lack of adaptability and scalability, AI-optimized fuzzy logic control leverages artificial intelligence techniques, such as genetic algorithms, neural networks, or reinforcement learning, to automatically generate or fine-tune fuzzy rules and membership functions, thereby improving control accuracy and adaptability.

In this context, [23] presents a comparative evaluation of two simplified and reduced fuzzy logic processes applied for EMS to achieve cost savings in a grid-connected hybrid solar PV and battery storage system. The paper [24] proposes an adaptive and optimal fuzzy logic-based EMS that generates day-ahead fuzzy rules for real-time energy dispatch under operational uncertainties. An offline meta-heuristic algorithm, based on the artificial sheep algorithm, is used to optimize the fuzzy inference system, membership functions and rule sets. The objective is to minimize power fluctuations and operational costs. Simulation results show that the proposed solution outperforms conventional online rule-based and offline meta-heuristic scheduling methods.

The authors in [25] applied a real-time neural network to solve the EMS problem for a test bench desalination system. By considering that all motor-pumps are power controlled in the internal control loop, an improved Power Field oriented control was proposed in [26].

Therefore, in this paper, two classes of strategy approaches, assessing online (suboptimal) fuzzy logic and offline (global optimum) MILP optimization, are developed to maximize the produced freshwater of a reverse osmosis micro-grid system. As implied by its name, MILP is constrained to linear relations between continuous model mixing real and integer variables. To account for nonlinear characteristics, these must sometimes be approximated using piecewise-linear functions. These approximations are incorporated into the MILP formulation through the introduction of auxiliary binary variables which are used to distinguish between the segments of the piecewise-linear function. The main contribution of this paper is to assess the “level of optimality” of online fuzzy logic-based EMS for renewable energy supplied water treatment process, these EMS approaches being considered as performing and robust for this class of systems.

The remaining sections are outlined as follows. Section 2 presents the architecture and the model of the desalination process coupled with a hybrid PV/Wind system, followed by the optimized fuzzy logic EMS. Section 3 presents the MILP-based EMS. Section 4 presents the comparative analysis of both (fuzzy logic and MILP) EMS applied to the pumping/desalination water station, both strategies aiming to maximize freshwater volume. Finally, the conclusions are presented in Section 5.

Structure and Modelling of the Reverse Osmosis Desalination Hybrid System

The Reverse Osmosis desalination hybrid system involves coupling a hybrid (wind and solar) source powering a water pumping/desalination unit. The power hybrid source and the water treatment system, which is composed of three motor pumps with desalination and storage devices, are interconnected to a DC bus via power converters. The interconnection to a reverse osmosis pumping/desalination system is structured as presented in Figure 1. One of the key characteristics of the case study is the use of hydraulic storage, which is preferred over electrochemical storage to lower both economic and environmental costs. In this regard, three water storage tanks are associated with the water pumping and desalination system.

A submersible motor pump 1 is used to pump brackish water from a well into the water tank 1 (pumping mode), needed as the source of feedwater for the RO module. Subsequently, a multi-stage high-pressure motor pump 2 is used to ensure freshwater production (permeate) through the RO module from water tank 1 (desalination mode). The produced freshwater is then stored in the water tank 2. Finally, a centrifugal motor pump 3 transfers the low-pressure permeate into an elevated storage tank (water tank 3 consisting of a water tower) for distribution (storage mode).

Depending on the available generated hybrid PV-wind power (Phyb), the water levels in the three tanks and the consumption profile, eight operating modes are possible. An optimal management of the energy produced by this system is therefore essential to maximize permeate production and meet water demand. The principle and more details have been presented in previous work [27].

Structure of the hybrid power desalination system

Solar PV Model

The power output of solar panels is directly influenced by their dimensions, but also by solar irradiance levels and operating temperatures, as outlined below [28] :

P PV = η gpv ×[1β×( T cell T NOCT )]× A PV × I r

The PV cell temperature is estimated using the following expression:

T cell =30+0.0175×( I r 300)+1.14×( T a 25)

where ƞgpv include the reference efficiency of the photovoltaic module and the power conditioning components (boost converter, wiring, etc.), AΡν denotes the panel's area [m2], Ir represents the solar irradiation [W/m2], β refers to the power temperature coefficient,TNOCT is the nominal operating cell temperature, Tcell is the photovoltaic cell temperature and Ta [°C] is the ambient temperature.

Wind Turbine Model

Wind turbine power modeling is essential for predicting energy production and optimizing system performance. Several models exist, each with varying levels of complexity and accuracy. These models can be classified into three main categories: energetic, empirical and dynamic. In this paper, the author proposes to use an energetic model based on fundamental aerodynamic principles. The output power of a wind turbine, denoted as PWT [W], is expressed as follows:

P WT = 1 2 × η gWT × C p opt ×ρ× A WT × V wind 3

where c p opt is the optimum power coefficient, ρ is the air mass density [kg/m3], AWT is the wind turbine swept area [m2], Vwind is the wind speed [m/s] and ƞgWT include the global static converter and generator efficiency.

Water Desalination System Model

The first motor pump, a submerged type, is used to extract brackish water from the well to the water tank 1. The following equation expresses the variation of the water flow rate as a function of power for a given discharge head:

Q 1 =0.0022× P 1 1.16 +6.8

where Q1 [m3 /h] and P1 are respectively the flow rate and the electric power of the motor-pump P1.

A high-pressure vertical multi-stage centrifugal pump is used to feed the Reverse Osmosis (RO) module and to ensure freshwater production [27]. The evolution of the flow rate Q2 at RO module input with respect to the desalination motor-pump power and the membrane capacity MC is given by:

Q 2 =0.0122× P e2 0.534 ×M C 0.552

Given an MC, the recovery rate R is evaluated using the following equation:

R = 0.162 × Q 2 0.452 × M C 0.353

The produced permeate freshwater flow Q2p and the concentrate flow Q2r are deduced respectively from eq. (7) and eq. (8):

Q 2p =R× Q 2 Q 2 r = Q 2 Q 2 p

The produced freshwater at very low pressure is stored in Water Tank 2. A third motor pump is employed for a gravity store at an elevated height (Water tank 3), ensuring useful water to supply consumers and reducing the dependence on the availability of electrical power. The energetic model of the third motor pump 3 can be expressed by [29] :

Q 3 = 2.18 × 10 7 × P 3 2.15 + 3.44

where Q3 [m3 /h] and P3 are respectively the flow rate and the electric power of the motor-pump P3.

Environment (wind, solar, temperature) and water load profile data

Figure 2 illustrates the environmental input variables over both a one-year and a representative one-week period. The one-week period (the first week of July) was selected as a representative operating window from the annual dataset to illustrate short-term system dynamics while maintaining the readability of the results. This specific week corresponds to a period of high freshwater demand combined with pronounced renewable energy variability, making it particularly suitable for comparing energy management strategies within a concise and interpretable time frame. Seasonal and inter-daily variations in wind speed and solar irradiance are clearly visible in the annual profiles, highlighting the significant fluctuations encountered throughout the year. It is important to note that the energy management system design is based on a one-year horizon.

Hourly meteorological data for the entire year, including wind speed, ambient temperature and solar irradiance, were used for a site in Djerba, southern Tunisia. The freshwater consumption profile was generated by extrapolating measured demand data obtained over one month to a full year using seasonal correction factors derived from historical consumption patterns.

Optimized Fuzzy Logic Energy Management System

In this study, the authors have selected the Mamdani-type Fuzzy Logic Controller (FLC) [30], [31], which operates through three fundamental stages. First, the fuzzification process transforms the crisp input values into linguistic variables by applying predefined membership functions. Next, the inference mechanism applies a set of fuzzy rules within the rule base for Energy Management System (EMS) to simulate human decision-making using fuzzy operators such as AND/OR, typically implemented through the MIN/MAX operators. The inference system generates a fuzzy output based on the degree of activation of the fuzzy rules and the input variable magnitudes. Finally, this fuzzy output undergoes defuzzification to convert it into a crisp output value suitable for “real-world” application. Among the various defuzzification techniques, the Center of Gravity (COG) method is employed in this work, as it is widely recognized for its computational efficiency and reliable performance. The COG technique calculates the centroid of the aggregated output membership function, thereby providing a balanced and representative crisp value.

The input variables of the system consist of the hybrid photovoltaic/wind power (Phyb) and the water levels of the three tanks (H1, H2 and H3). The outputs correspond to the power sharing factors (α1, α2) which determine the distribution of the generated powers within the hydraulic process. The third coefficient α3 is deduced from eq. (10):

i=1 3 α i =1 P i = α i × P h y b

The proposed fuzzy manager parameters

MF type

Number of subsets

Number of parameters

Inputs

Phyb

Triangular / Trapezoidal

12

38

H1

Triangular

3

9

H2

Triangular

3

9

H3

Triangular

3

9

Outputs

α1

Triangular

9

27

α2

Triangular

11

33

The design of the Fuzzy Logic EMS (FLEMS) largely relies on determining a set of tuning parameters, such as membership functions (type, number and placement parameters), the fuzzy rule base and the defuzzification method. In this study, the FL system consists of 324 rules based on the membership functions of both the input and output variables. The proposed fuzzy manager parameters for the different inputs and outputs is presented in Table 1.

The number of degrees of freedom (DoF) that can be used for the application of a Genetic algorithm (GA) to optimize the fuzzy system refers to the number of tuning parameters that GA can manage. This last defines the solution space within which the GA operates and directly influences the flexibility and complexity of the optimization process. Typically, the GA can optimize key components of fuzzy logic systems, particularly the structure and parameters of the membership functions (MFs), which include selecting the type of MF (e.g., Gaussian, triangular, trapezoidal) as well as tuning the parameters that define their shape and position. GA can also optimize the fuzzy rule base by selecting which rules are active (rule pruning) or adjusting the associated rule weights [32].

Furthermore, the optimization process may extend to other components of the fuzzy inference system, including the defuzzification strategy and/or inference mechanism. In some cases, GAs can also fine-tune the rule weights of scaling factors.

In this paper, the proposed GA is used to optimize the fuzzy energy manager that aims to parameterize the fuzzy parameters to maximize the freshwater production as follows:

F fitness = 0 N Q 2p (t)dt

where Ffitness is the objective function corresponding with the freshwater volume to be maximized and where N is the total number of time steps.

In this context, the defuzzification method, the set of inference rules and the number and type of the previously selected membership functions are kept fixed. The optimization focuses on the shape and position parameters of the membership functions for both inputs and outputs. To reduce the complexity of the proposed optimization technique, only one point of the triangular membership function is adjusted. The proposed optimization technique is depicted in Figure 3. In the end, the set of decision parameters shrank to a 31-gene chromosome structure, which was used by the genetic algorithm. Specifically, the first input variable (Phyb) is represented by 9 genes, while the three inputs related to the tank level variables (H1, H2 and H3) are represented by 6 genes. The first output variable is encoded by 7 genes and the remaining 9 genes are allocated to the characterization of the second output variable. Thanks to this structured encoding, the GA can focus on different solutions in an organized manner without losing the compactness of the fuzzy system. The optimal set of Fuzzy Inference Systems (FIS) will be selected by varying these parameters.

The proposed optimized Fuzzy logic energy management system

The hybrid power produced for one week, with the dispatched powers of the three motor pumps for the GA optimized FLEMS (GA_FLEMS) are presented in Figure 4.

Power flows of the hybrid source shared by the three motor pumps over one typical week using GA_FLEMS

Figure 5 and Figure 6 show, respectively, the different water flows and water level evolutions of the three pumps with the GA_FLEMS.

The three pumps' flow rate and the permeate flow rate over one week

The three tanks’ levels over one week

The consumed energy Ec, the non-consumed energy Enc (wasted energy) and the produced freshwater volume for FLEMS and optimized GA_FLEMS are compared in Table 2.

Applying the optimization strategy, the freshwater production shows a performance improvement of 2.96% over one week, increasing until 8.06% over a year. Additionally, the energy generated by the hybrid source is used more efficiently. Specifically, the system's overall energy efficiency is enhanced by 2.06%, while the amount of unused power drops by 5.77%.

Comparative performance of FLEMS and GA_FLEMS

Comparative simulation results of the FLEMS and GA_FLEMS for a year

Ec (kWh)

Enc (kWh)

Freshwater (m3)

FLEMS

3× 104

1.073 × 104

2245

GA-FLEMS

3.06 x 104

1.011X 104

2426

Gain (%)

2.06

5.77

8.06

This table demonstrates the effectiveness of GA-FLEMS in managing energy flows and meeting operational objectives. However, the degree of optimality cannot currently be assessed, as that kind of EMS is necessarily suboptimal. Therefore, this paper aims to employ an optimization algorithm capable of determining the optimal trajectory a priori, given the trajectories of the power flows produced by solar and wind generators. To achieve this within reduced computation time, the mixed-integer linear programming (MILP) technique is selected.

Contrary to the FLEMS, the MILP strategy is not applicable in real-time since it requires the knowledge of environment profiles. Thus, an analytical evaluation setting the gap with respect to the reference optimal approach (here, the MILP formulation) is essential to determine how close the real-time EMS (in our case, the FLEMS) operates to an optimal or near-optimal performance level. The optimality level of the FLEMS will be assessed in the following section.

Energy Management System Based on A Milp Algorithm

Linear programming offers several advantages for solving complex optimization problems with a huge number of decision variables, enabling the attainment of an optimal solution in a fast and efficient manner. In this study, the GUROBI solver is used, which relies on the Branch-and-Bound algorithm to efficiently solve the MILP optimization problem. The first step in the modeling process involves linearizing the desalination system to ensure its compatibility with linear programming techniques. The second step focuses on defining the objective function and system constraints, thereby ensuring a rigorous formulation of the MILP problem.

Piecewise Linearization of the Desalination Motor Pump Constraints

The water flow rate, as a function of electric power at motor pump input, along with the rejection rate of the desalination motor pump, are described by their respective nonlinear equations in [27], [29] . To formulate the MILP problem, a piecewise-linear approximation is applied [19] . This method involves dividing each nonlinear function (flow rate and rejection rate) into “n” breakpoints and approximating each segment linearly as illustrated in Figure 7 for a case of two segments. Typically, the selection of the number of breakpoints is based on balancing the trade-off between the process complexity (number of segments and subsequent variables) and the approximation error between the actual nonlinear and the linearized models. In this study, different cases were performed with varying numbers of breakpoints to obtain the optimal models presented in Table 3.

Modeling a piecewise linear function

For any given desalination power, e.g., Ρi−1 ≤ P2i ≤ Pi, the flow rate function value (Q2i = f(P2i)) can be approximated by linear equation with coefficients ai, bi for each piecewise i, which is expressed as:

Q 2i = a i × P 2i (t)+ b i

The same manner is used for the recovery rate Ri = f (Q2i) with coefficients ci, di for each piecewise i, such that:

R i = c i × Q 2 i ( t ) + d i

The selection of the best linear model (i.e. best number of segments) is based on the calculated error between the actual nonlinear model and the linearized representation. Moreover, the error in our analysis can be quantified using various metrics, such as Mean Absolute Error (MAE), Mean Squared Error (MSE), or Root Mean Squared Error (RMSE). In this study, RMSE is selected as the primary error evaluation metric, as given by eq. (15) and eq. (16):

RMSE( Q 2 )= ( i=1 N ( Q 2real ( P 2i ) Q 2 ( P 2i )) 2 ) N R M S E ( R ) = ( i = 1 N ( R r e a l ( Q 2 r e a l i ) R ( Q 2 i ) ) 2 ) N

where, P2min, P2max, Q2min and Q2max are respectively the maximum and the minimum desalination electric motor pump power and flow rate, Q2real and Q2 are the consistent real and linearized flow rates and Rreal and R are the corresponding real and linearized recovery rates.

In this paper, three case studies regarding the number of breakpoints (piecewise) are developed. An optimization problem is formulated using the Fmincon algorithm to determine the optimal piecewise linear approximation of the water flow and rejection rate curves. The objective is to minimize the root mean squared error (RMSE) between the original curve and its piecewise linear approximations for the three cases:

min{ RMSE( Q 2 ) RMSE(R)

An inequality constraint is implemented to ensure that the linear approximation solution lies below the actual curve, preventing the overestimation of water production in the MILP formulation:

Q 2 Q 2real

Table 3 presents the error values calculated between the actual nonlinear model and its linearized approximation for the three numbers (n) of breakpoints (piecewise).

For a single piecewise approximation, the error was huge, measured at approximately 0.55 for the flow rate and 0.17 for the recovery rate. In the second case study (n=2), the error decreased slightly to 0.29 and 0.09 for the flow and recovery rates, respectively. Finally, with three piecewise segments (2 breakpoints), the linearized approximation closely matched the actual nonlinear model, yielding an RMSE of 0.06 for the flow rate and 0.03 for the recovery rate. These results demonstrate the small error and validate the effectiveness and accuracy of the linear models used in the MILP formulation for the case of 3 breakpoints.

Error between the actual nonlinear model and its linearized approximation for the three cases

RMSE n=1

RMSE n=2

RMSE n=3

Flow rate Q2

0.553

0.296

0.066

Recovery rate R

0.175

0.094

0.032

MILP Problem Formulation

The MILP objective function is calculated using eq. (19) aiming to maximize the water storage volume in the output water tank 3, which represents the freshwater quantity available for users:

Max( V 3 = 0 T Q 3 (t)×dt t=0 T Q 3 (t)×Δt)

Different system constraints related to the power balance and parameter boundaries are presented in the following sections.

System Power Balance Constraint

To maintain the energy balance in the pumping/desalination plant, the total energy consumed by the plant and generated by the PV/Wind system should be equal. Hence, the equation constraint (20) must be fulfilled:

P h y b ( t ) = P 1 ( t ) + P 2 ( t ) + P 3 ( t ) + P c u r ( t )

where, P1(t) ≥ 0, P2(t) ≥ 0 and P3(t) ≥ 0 are respectively the three motor pumps power and Pcur(t) is the curtailment power from both hybrid sources.

Water Tank Constraints

As the hydraulic storage has finite capacity, the energy management strategy has to manage water levels between the maximum capacity denoted Hmax and a minimum level denoted Hmin>=0 to avoid excessive discharging. Accordingly, the state of the storage system at any time must satisfy the following constraints:

0 H 1 (t) H 1max , 0 H 2 (t) H 2max , 0 H 3 (t) H 3max ,

where H1 (t), H2(t) and H3(t) are respectively the instantaneous brackish water, permeate water and freshwater tank levels.

Desalination, Pumping and Storage Motor Pumps Constraints

The two pumping and storage motor pumps (P1 and P3) operating at fixed power have two possible operating states. For this reason, two binary variables D 1 t and K 1 t are added to represent the startup and shutdown (on/off) operation of P1 and P3, respectively, which are expressed in eq. (24) and eq. (25):

P 1 (t)= D 1 t × P 1max P 3 (t)= K 1 t × P 3max

where P1max and P3max are respectively the pumping and storage maximum power.

The two variables P2i and Tri are associated with the appropriate pair of consecutive breakpoints. Each breakpoint and corresponding segment are linked to a binary variable s i t ·. Thus, for n−1 breakpoints and n segments, n binary variables are introduced. The piecewise linear approximation of the flow rate function and the conversion rate are represented through the following constraints:

s i t × P i1 P 2i (t) s i t × P i ,i1 i=0 n s i t =1 P 2 (t)= i=1 n P 2i (t)

The water flow and the conversion rate can be deduced from eq. (29) and eq. (30):

Q 2 = i=1 n Q 2i = i=1 n a i × P 2i (t)+ i=1 n s i t × b i R= i=1 n R i = i=1 n c i × Q 2i ( P 2i )+ i=1 n s i t × d i

It should be noted that s 0 t = 1 corresponds to the case where the motor pump 2 is inactive, since for any i > 1, s i t =0 would also implies P2i (t) = 0 due to constraints eq. (26).

Optimality Assessment of the Flems for the Water Station

This section presents the simulation results of the pumping/desalination water station comparing the FLEMS, GA-FLEMS and MILP performance, the final objective being to assess the level of optimality of FL based EMS that may be actually implemented at real time. The input weather conditions (temperature, wind speed and solar irradiation) and water consumption profile are sampled every hour.

Figure 8, presents the results of the MILP-based EMS. The first curve shows the power generated by the photovoltaic and wind systems (Phyb) over one typical week. The second curve illustrates the power consumed for water pumping (motor pump 1), where the pumping unit operates at a constant power level. Similarly, the water storage unit (motor pump 3) operates with fixed power consumption. The third curve displays the power used by the desalination unit, which operates with a variable power range between a minimum P2min and a maximum P2max, as depicted in Figure 8. The flow rate curve in terms of time, represented by Figure 9, looks the same as the aspect of the absorbed power of the three motor pumps (Q1, Q2 and Q3) as well as the permeate water flow (Qp). Then, Figure 10 exposes the water tanks' levels evolution for the same period. Simulation results in Figure 11 show that the maximum water volume using this MILP configuration is equal to 94.5 m3 after one week.

Hybrid power shared by the three motor pumps power over one week (MILP-based EMS)

The three pumps' flow rate and the permeate flow rate over one week (MILP-based EMS)

The three tanks’ levels over one week (MILP-based EMS)

Freshwater volume produced with MILP-based EMS

The MILP optimization relies on a linear model based on the piecewise approximation described in the previous section, with the number of segments optimized to minimize deviations. Due to that process, a slight underestimation of the pump outlet flow is involved in the linearized model compared to the nonlinear representation. To provide a more rigorous comparative assessment between both management approaches, the output references sent by the MILP-based EMS are therefore applied to the nonlinear model.

Figure 12, Figure 13 and Figure 14 illustrate the evolution of the water levels in the reservoirs under the EMS-based MILP strategy applied to both the linear and nonlinear models over one week. The results show a tiny deviation. To better assess this deviation, particular attention is given to the freshwater volume, as shown in Figure 15.

Freshwater tank level for linear and nonlinear models from the MILP EMS

Permeate water tank level for linear and nonlinear models from the MILP EMS

Brackish water tank level for linear and nonlinear models from the MILP EMS

As illustrated in Figure 15, the outcome of the linear model shows no significant deviation from that of the nonlinear model, with a relative error evaluated at 0.37%.

Freshwater volume for linear and nonlinear models from the MILP EMS

The MILP-based approach involves the maximum producible freshwater volume over the year, compared to FL-EMS and GA-FLEMS strategies, as illustrated in Figure 16.

Freshwater volume for different EMS strategies over 1 year

Table 4 allows for the assessment of the optimality degree of the fuzzy logic controller optimized by a genetic algorithm (GA-FLEMS) at annual, monthly and weekly time scales using two complementary indices. The optimality degree is defined as a performance index relative to the MILP benchmark:

Optimality degree (%)= V GAFL V MILP ×100

where VGA-FL and VMILP represent the freshwater production achieved by GA-FLEMS and MILP, respectively. Similarly, the deviation in non-consumed energy is defined as:

D e v i a t i o n ( % ) = E n c G A F L E n c M I L P E n c M I L P × 100

where Enc GA-FLand Enc MILP represent the non-consumed energy under each strategy.

Over the annual trajectory, MILP achieves the highest freshwater production (2701 m3) and the lowest non-consumed energy (7.35 × 103 kWh), confirming its role as the global optimal benchmark. GA-FLEMS produces 2426 m3 of freshwater, corresponding to an optimality degree of approximately 90% with respect to the MILP reference. The higher curtailment observed under GA-FLEMS (+37.5%), as captured by the deviation metric, indicates an underutilization of the available renewable resources and reflects the trade-off associated with real-time implementation and limited future knowledge.

At the monthly scale, GA-FLEMS produces 72.8% of the MILP reference freshwater, while exhibiting a significantly higher level of non-consumed renewable energy (+481.7%) compared to MILP.

At the weekly scale, GA-FLEMS closely tracks the optimal MILP trajectory that may be operated at real time in “real life” in terms of freshwater production (95% of the MILP reference), while showing a large deviation in non-consumed energy (+157.6%).

These deviations, which are not constant across the three simulation periods, are due both to the intrinsic differences between the two energy management methods and to the variability of meteorological data, water demand and seasonal effects. However, the long term (annual) vision gives an “integral vision” of the management process efficiency and the optimality degree of the fuzzy logic controller with optimization of its control parameters (GA-FLEMS) remains really high (close to 90%) for an EMS process that may be implemented at real time, without perfect production and water demand foresight.

Comparative performance of GA_FLEMS and MILP at annual, monthly and weekly time scales

Comparative simulation results of the GA-FLEMS and MILP for a year

Ec (kWh)

Enc (kWh)

Freshwater (m3)

GA-FLEMS

3.06 × 104

1.011 × 104

2426

MILP

3.336 × 104

7.352 × 103

2701

Comparative simulation results of the GA-FLEMS and MILP for a month

Ec (kWh)

Enc (kWh)

Freshwater (m3)

GA-FLEMS

1.16 × 103

14.96× 102

400

MILP

2.4 × 103

2.57× 102

549

Comparative simulation results of the GA-FLEMS and MILP for a week

Ec (kWh)

Enc (kWh)

Freshwater (m3)

GA-FLEMS

702.44

168.5

90

MILP

805.54

65.4

94.5

This paper primarily addresses the problem of energy management over a one-year time horizon. In that paper, the focus was put on evaluating online fuzzy-based management performance with respect to deterministic optimization approaches (MILP) with fixed system sizing. The results are certainly relevant in terms of qualitative efficiency performance of EMS but there are rigorously only valid for the considered system sizing. Thus, in future work, it would be advisable to integrate both sizing and operation inside a “co-design process” optimization. In such integrated process, uncertainties effects related to data, degradation models and extended time horizons should be assessed. For example, in [33] the authors investigated the design of a microgrid under uncertainty. The results indicate that temporal representation is a dominant factor: reducing the data to a single year with respect to the project lifecycle strongly distorts both the key performance indicators (KPIs - namely system cost and self-sufficiency level) and the sizing results, whereas extending the horizon to several years substantially reduces errors by better capturing long-term efficiency.

Conclusion

In this study, two energy management strategies are proposed and comparatively analyzed. The first strategy is based on a fuzzy logic energy management system optimized using a genetic algorithm (GA-FLEMS), while the second relies on a Mixed-Integer Linear Programming (MILP) formulation. The GA-FLEMS approach is grounded in causal knowledge of the system environment and is therefore suitable for real-time implementation. In contrast, the MILP-based strategy assumes a priori knowledge of the complete set of system inputs, including climatic conditions and water consumption profiles, over the entire optimization horizon.

The primary objective of both energy management strategies is to optimally distribute power flows among the motor pumps in a rational and efficient manner, thereby maximizing pure water production while ensuring optimal system performance. The MILP-based approach is particularly relevant as it provides a global optimum for the energy management problem and can serve as a reference benchmark. Moreover, due to its non-causal nature, the MILP formulation is well-suited for system sizing and optimal co-design studies.

To enable the MILP formulation, the system model is piecewise linearized. This step reformulates the original nonlinear problem into a tractable linear optimization problem while preserving the essential system dynamics. Using the MILP solution as a reference benchmark, a comparative analysis is conducted to evaluate the performance and optimality of the GA-FLEMS approach, specifically designed for real-time operation.

Simulation results demonstrate that the GA-FLEMS strategy achieves approximately 90% of the optimal performance obtained with the MILP benchmark in terms of annual pure water production. These results confirm the effectiveness of the proposed fuzzy-logic-based energy management strategy while highlighting the inherent trade-off between real-time causal control and globally optimal, non-causal optimization methods.

It is important to highlight that, in the present study, the system component sizing is assumed to be fixed. Future work will focus on developing a comprehensive co-optimization framework that simultaneously optimizes motor pump setpoint trajectories and component sizing, thereby enabling integrated design and operational optimization of the overall system.

Acknowledgment
Acknowledgment

This work was supported by the Tunisian Ministry of Higher Education and Research under Grant LSE-ENIT-LR 11 ES15 and the PHC-Utique project "23G1124".

REFERENCES
  1. Dzhumashev R., Kazakevitch G., , Environ Resour Econ (Dordr), Vol. 8811 , :2791-28142025, https://doi.org/10.1007/s10640-025-00956-4., Production, Environment and Population Growth
  2. , , 2023www.iea.org/reports/world-energy-outlook-2023, International Energy Agency, World Energy Outlook
  3. Wada Y., Bierkens M., Sustainability of global water use: past reconstruction and future projections, Environmental Research Letters, Vol. 9 (10), 2014, https://doi.org/10.1088/1748-9326/9/10/104003., pp 104003
  4. Abidi M., Ben Rhouma A., Belhadj J., Water-Energy system toward the meeting of an improved Low Voltage Ride Through Capability of Grid-Connected photovoltaic generator: power-sharing and control issues, Energy Sources, Part A: Recovery, Utilization and Environmental Effects, Vol. 47 (1), :2613-26402025, https://doi.org/10.1080/15567036.2020.1841857.
  5. El YouNossi C., El Fadar A., Elaouzy Y., Comprehensive investigation of desalination technologies considering numerous plants worldwide, Appl Therm Eng, Vol. 278 , 2025, https://doi.org/10.1016/j.applthermaleng.2025.127216., p. 127216
  6. Mito M., Ma X., Albuflasa H., Davies P., Reverse osmosis (RO) membrane desalination driven by wind and solar photovoltaic (PV) energy: State of the art and challenges for large-scale implementation, Renewable and Sustainable Energy Reviews, Vol. 112 , :669-6852019, https://doi.org/10.1016/j.rser.2019.06.008.
  7. Nurjanah I., Chang T., You S., Huang C., Sean W., Reverse osmosis integrated with renewable energy as sustainable technology: A review, Desalination, Vol. 581 , 2024, https://doi.org/10.1016/j.desal.2024.117590., p. 117590
  8. Baleta J., Mikulčić H., Klemes J., Urbaniec K., Duić N., Integration of energy, water and environmental systems for a sustainable development, J Clean Prod, Vol. 215 , :1424-14362019, https://doi.org/10.1016/J.JCLEPRO.2019.01.035.
  9. Iwakin O., Moazeni F., Khazaei J., Data-driven economic dispatch towards operational management of distributed energy resources for grid-connected water-energy microgrids, Energy, Vol. 335 , 2025, https://doi.org/10.1016/j.energy.2025.137668., pp 137668
  10. Ghasemi R., Doko G., Petrik M., Wosnik M., Lu Z., Foster D., Mo W., Deep reinforcement learning-based optimization of an island energy-water microgrid system, Resour Conserv Recycl, Vol. 222 , 2025, https://doi.org/10.1016/j.resconrec.2025.108440., pp 108440
  11. Mokhtare M., Keysan O., Optimal sizing of a grid-connected DC microgrid for agricultural applications with water-energy management system considering battery cycle life, Energy Nexus, Vol. 18 , 2025, https://doi.org/10.1016/j.nexus.2025.100445., pp 100445
  12. Thirunavukkarasu G., Seyedmahmoudian M., Jamei E., Horan B., Mekhilef S., Stojcevski A., Role of optimization techniques in microgrid energy management systems—A review, Vol. Energy Strategy Reviews43 , 2022, https://doi.org/10.1016/j.esr.2022.100899., pp 100899
  13. Alvarez G., Marcovecchio M., Aguirre P., Unit Commitment Scheduling Including Transmission Constraints: a MILP Formulation, Vol. Comput. Aided Chem. Eng38 , :2157-21622016, https://doi.org/10.1016/B978-0-444-63428-3.50364-7.
  14. Farrokhifar M., Aghdam F., Alahyari A., Monavari A., Safari A., Optimal energy management and sizing of renewable energy and battery systems in residential sectors via a stochastic MILP model, Electric Power Systems Research, Vol. 187 , 2020, https://doi.org/10.1016/j.epsr.2020.106483., pp 106483
  15. Zaree N., Vahidinasab V., An MILP formulation for centralized energy management strategy of microgrids, 2016 Smart Grids Conference (SGC), 1-82016, https://doi.org/10.1109/sgc.2016.7883464.
  16. Nicolosi F., Alberizzi J., Caligiuri C., Renzi M., Unit commitment optimization of a micro-grid with a MILP algorithm: Role of the emissions, bio-fuels and power generation technology, Energy Reports, Vol. 7 , :8639-86512021, https://doi.org/10.1016/j.egyr.2021.04.020.
  17. Iturriaga E., Campos-Celador A., Terés-Zubiaga J., Aldasoro U., Alvarez-Sanz M., A MILP optimization method for energy reNovation of residential urban areas: Towards Zero Energy Districts, Sustain Cities Soc, Vol. 68 , 2021, https://doi.org/10.1016/j.scs.2021.102787., pp 102787
  18. Bourbon R., Ngueveu S., Roboam X., Sareni B., Turpin C., Hernandez-Torres D., Energy management optimization of a smart wind power plant comparing heuristic and linear programming methods, Math Comput Simul, Vol. 158 , :418-4312019, https://doi.org/10.1016/j.matcom.2018.09.022.
  19. Abidi M., Ben Rhouma A., Belhadj J., Optimal coordinated planning of water-energy system-based MILP algorithm of a multi-pump PV water station by deeming power commitment, Electric Power Systems Research, Vol. 220 , 2023, https://doi.org/10.1016/j.epsr.2023.109343., pp 109343
  20. Soleimanzade M., Sadrzadeh M., Deep learning-based energy management of a hybrid photovoltaic -reverse osmosis-pressure retarded osmosis system, Vol. Appl Energy293 , 2021, https://doi.org/10.1016/J.APENERGY.2021.116959., pp 116959
  21. Hasan M., Rahman M., Ishraque M., Ahmad K., Shezan S., Ahmed M., Ahmad N., Ahmad F., An Improved Energy Management Strategy for Hybrid Power Systems using Dual Predator OptimizationJournal of Sustainable Development of Energy, Water and Environment Systems, Vol. 13 (3), :1-202025, https://doi.org/10.13044/j.sdewes.d13.0586.
  22. Cai W., Kordabad A., Gros S., Energy management in residential microgrid using model predictive control-based reinforcement learning and Shapley value, Eng Appl Artif Intell, Vol. 119 , 2023, https://doi.org/10.1016/j.engappai.2022.105793., pp 105793
  23. Ibrahim O., Bakare M., Owonikoko W., Alao R., Amosa T., Tijani M., Comparative Evaluation of Different Fuzzy Tuning Rules on Energy Management Systems Cost Savings, Results in Engineering, Vol. 26 , 2025, https://doi.org/10.1016/j.rineng.2025.105107., pp 105107
  24. Dong W., Yang Q., Fang X., Ruan W., Adaptive optimal fuzzy logic based energy management in multi-energy microgrid considering operational uncertainties, Appl Soft Comput, Vol. 98 , 2021, https://doi.org/10.1016/j.asoc.2020.106882., pp 106882
  25. Zgalmi A., Ben Rhouma A., Belhadj J., Artificial Neural Network-Based Real-Time Power Management for a Hybrid Renewable Source Applied for a Water Desalination System, Electronics (Basel), Vol. 13 (13), 2024, https://doi.org/10.3390/electronics13132503., pp 2503
  26. Ben Rhouma A., Roboam X., Belhadj J., Sareni B., Improved Control Strategy for Water Pumping System Fed by Intermittent Renewable Source, Energies (Basel), Vol. 16 (22), 2023, https://doi.org/10.3390/en16227593., pp 7593
  27. Zgalmi A., Ben Rhouma A., Cherif H., Belhadj J., Energy management based fuzzy-logic of a reverse osmosis desalination powered with hybrid system, in 2021 IEEE 2nd International Conference on Signal, Control and Communication (SCC), 132-1372021, https://doi.org/10.1109/SCC53769.2021.9768374.
  28. Abbes D., Martinez A., Champenois G., Eco-design optimisation of an autoNomous hybrid wind-photovoltaic system with battery storage, IET Renewable Power Generation, Vol. 6 (5), :358-3712012, https://doi.org/10.1049/iet-rpg.2011.0204.
  29. Zgalmi A., Cherif H., Belhadj J., Design of water-energy management based on neural networks for an autonomous solar and wind renewable energy system coupled with brackish water desalination, Environ Prog Sustain Energy, Vol. 41 (6), 2022, https://doi.org/10.1002/ep.13929.
  30. Ishaque M., Khan M., Afzal M., Wadood A., Oh S., Talha M., Rhee S., Fuzzy Logic-Based Duty Cycle Controller for the Energy Management System of Hybrid Electric Vehicles with Hybrid Energy Storage System, Applied Sciences, Vol. 11 (7), 2021, https://doi.org/10.3390/app11073192., pp 3192
  31. Xu L., Wang Z., Liu Y., Xing L., Energy allocation strategy based on fuzzy control considering optimal decision boundaries of standalone hybrid energy systems, J Clean Prod, Vol. 279 , 2021, https://doi.org/10.1016/j.jclepro.2020.123810., pp 123810
  32. Rodriguez-Fdez I., Mucientes M., Bugarin A., FRULER: Fuzzy Rule Learning through EVolution for Regression, Inf Sci (N Y), Vol. 354 , :1-182016, https://doi.org/10.1016/j.ins.2016.03.012.
  33. Boennec C., Sareni B., Ngueveu S., Robust design of microgrids under uncertainties: Comparative impact of modeling choices on sizing decisions, Energy Conversion and Management: X, Vol. 28 , 2025, https://doi.org/10.1016/j.ecmx.2025.101330., pp 101330

DBG