Abstract
This study develops an integrated digital twin framework for electrical optimisation and predictive maintenance in hospital wastewater treatment systems. From an industrial engineering perspective, the framework links real-time monitoring, load scheduling, power-quality control, condition assessment, and maintenance planning in a single decision-support architecture. Physical measurements from loT sensors are synchronised with virtual electrical and process models so that facility managers can evaluate operating states, identify energy inefficiencies, and prioritise interventions. Optimisation combines power factor correction, harmonic mitigation, peak demand reduction, and variable-frequency-drive control, supported by machine learning. Predictive maintenance combines electrical, thermal, and vibration indicators to assess equipment condition. Validation on a laboratory-scale pilot system showed sustained power-quality improvements, a 21.7% reduction in energy consumption, and a 22% reduction in peak demand. These gains corresponded to annual savings of 22,107 MAD and a simple payback period of 3.8 years. The results demonstrate the practical value of the proposed framework for energy-intensive systems, while further full-scale validation is required before generalisation to hospital facilities with different layouts and duty cycles.
Abstract
Hierdie studie ontwikkel 'n geïntegreerde digitale tweelingraamwerk vir elektriese optimalisering en voorspellende instandhouding in hospitaalafvalwaterbehandelingstelsels. Vanuit 'n bedryfsingenieurs-perspektief verbind die raamwerk intydse monitering, lasskedulering, kraggehaltebeheer, toestandbeoordeling en instandhoudingsbeplanning binne 'n enkele besluitsteunargitektuur. Fisiese metings vanaf IoT-sensors word met virtuele elektriese en prosesmodelle gesinchroniseer, sodat fasiliteitsbestuurders bedryfstoestande kan evalueer, energie-ondoeltreffendhede kan identifiseer en ingrypings kan prioritiseer. Die optimalisering kombineer arbeidsfaktorkorreksie, die vermindering van harmoniese vervorming, die verlaging van piekvraag en beheer deur veranderlike-frekwensie-aandrywings, met ondersteuning deur masjienleer. Voorspellende instandhouding kombineer elektriese, termiese en vibrasie-aanwysers om die toestand van toerusting te beoordeel. Validering op 'n laboratoriumskaalse loodsstelsel het volgehoue verbeterings in kraggehalte, 'n afname van 21,7% in energieverbruik en 'n afname van 22% in piekvraag getoon. Hierdie verbeterings het ooreengestem met jaarlikse besparings van 22 107 MAD en 'n eenvoudige terugbetalingstydperk van 3,8 jaar. Die resultate toon die praktiese waarde van die voorgestelde raamwerk vir energie-intensiewe stelsels, hoewel verdere volskaalse validering nodig is voordat die bevindinge veralgemeen kan word na hospitaalfasiliteite met verskillende uitlegte en bedryfsiklusse.
1. INTRODUCTION
1.1.
Background and motivationHospitals are among the most energy-intensive facilities, with wastewater treatment representing a significant portion of their total energy demand [1], [2], [3]. Hospital effluents are characterised by substantial temporal variations in flow rate, chemical oxygen demand, and pharmaceutical compounds, which impose strict operational constraints on treatment processes [4], [5], [6]. To comply with these constraints, the conventional systems are generally designed to operate under worst-case conditions [7]. Pumps and aeration units are therefore frequently oversized or are operated at constant speed, resulting in energy losses that can account for 60% to 80% of the electricity consumption of wastewater treatment facilities [8], [9]. In recent years, the development of Industry 4.0 technologies has opened up new perspectives for improving the operation of these systems [10]. The deployment of Internet of Things (IoT) sensor networks in particular has enabled the continuous acquisition of process data, facilitating its integration into digital twin (DT) models to provide a structured framework for data interpretation and decision support [11], [12]. DTs, originally introduced in early work at the University of Michigan in 2002 [13], are commonly defined as virtual representations of physical assets that are constantly updated using real-time measurements and operational feedback [14], [15]. Applied to hospital wastewater treatment, this approach makes it easier to monitor key performance indicators (KPIs) and to anticipate critical process deviations, thereby allowing treatment requirements to be met without systematically resorting to conservative operating margins [16], [17]. This opens the way to more flexible control strategies and reduced electricity consumption while maintaining process reliability [18].
Compared with closely related industrial engineering work, prior DT contributions typically emphasise either energy management or predictive maintenance as separate decision-support threads. This study positions the DT as an integrated decision-support layer that jointly connects electrical KPIs, operational constraints, and maintenance risk, and evaluates these outcomes together on a representative pilot system. This integrated framing supports practical trade-offs that are central to industrial engineering decision-making.
1.2.
Research gap and objectivesWhile recent advances in Industry 4.0 technologies have demonstrated their potential to improve the operation of energy-intensive wastewater treatment systems [19], studies have generally addressed process optimisation and energy management as independent problems [20], [21]. Integrated approaches that are capable of simultaneously supporting predictive maintenance and electrical system optimisation within a unified DT framework remain limited [22]. This gap is particularly evident in the context of hospital wastewater treatment, where strong temporal variability in pollutant loads and stringent treatment requirements impose additional operational constraints.
In this context, the present study develops a comprehensive DT-based framework specifically designed for hospital wastewater treatment systems. Building on real-time data acquisition through an IoT sensor network [23], the proposed approach combines electrical monitoring with data-driven predictive models to support both energy optimisation and maintenance decision-making [24], [25]. By coupling machine learning (ML) techniques with DT-based system representation, the framework enables early detection of equipment degradation while simultaneously identifying opportunities to reduce electrical energy consumption [26], [27]. This integrated perspective contributes to ongoing efforts in electrical engineering to enhance the reliability and efficiency of critical infrastructure through digitalisation.
The specific objectives of this study are as follows:
• To develop a DT of the hospital wastewater treatment system that integrates electrical and process-level representations, enabling the simulation of operating conditions and energy consumption patterns;
• To design and deploy an IoT sensor network for real-time acquisition of electrical and process parameters, and also implement ML models to optimise energy and predict equipment failure;
• To validate the proposed framework under real operating conditions and quantitatively evaluate its impact on system reliability, electrical energy efficiency, and operational costs.
From an industrial engineering perspective, the proposed DT is framed as a decision-support system for industrial engineers and facility managers. It transforms heterogeneous data streams into actionable KPIs and supports operational planning decisions such as load scheduling, intervention prioritisation, and explicit trade-offs between cost, reliability, and process constraints.
2. SYSTEM ARCHITECTURE AND ELECTRICAL CONFIGURATION
2.1. Pilot system design
A laboratory-scale pilot system was developed to reproduce the key operational conditions of hospital wastewater treatment under controlled experimental settings. The system was designed to reflect the main treatment stages while enabling detailed monitoring of both process and electrical variables. Figure 1 shows a photograph of the laboratory-scale pilot system used in this study.
The pilot system consists of the following main components:
• Sedimentation tank equipped with adjustable flow control and turbidity sensors to enable preliminary removal of suspended solids.
• Membrane filtration unit based on ultrafiltration membranes to provide fine particulate and microbial separation.
• UV disinfection chamber with programmable electrical power control and real-time intensity monitoring.
• Hydraulic recirculation system driven by pumps equipped with variable frequency drives (VFDs) which allows flow rate adjustment over an operating range of 10% to 100%.
• Distributed sensor network acquiring electrical parameters at 100 ms sampling intervals as well as water quality indicators and equipment operating states.
• Three-stage automated capacitor bank implemented for dynamic power factor correction and reactive power management.
The pilot system was conceived as a modular and scalable platform to facilitate its extrapolation to full-scale installations. In normal operation it treats about two m3/hour of synthetic hospital wastewater to match the typical discharge rates observed in small healthcare facilities.
2.2. Electrical monitoring and optimisation infrastructure
The electrical monitoring and optimisation infrastructure was designed to provide visibility of energy use, power quality, and equipment condition throughout the pilot system. The improved architecture shown in Figure 2 groups the main components into four functional layers: physical equipment, edge and IoT acquisition, DT analytics, and decision-support applications [28].
A complete inventory of the instrumentation deployed in the system is summarised in Table 1. The instruments are grouped according to their functional role of monitoring, actuation, or control and data management, and are integrated within a unified operational framework that supports the experimental case study presented in the sections that follow.
The monitoring and control strategy links data acquisition, control action, and data management. Electrical, mechanical, and thermal measurements are collected at critical equipment and distribution points [29], [30], [31], [32]. Safety-critical measurements are transmitted directly to the programmable logic controller for interlocking and control [33], while high-resolution data streams are stored through a secure MQTT-based communication network [34], [35]. The time-series database supports visualisation, performance analysis, and long-term archiving [36], [37], [38], [39], [40]. Network time protocol (NTP) synchronisation and a redundant storage architecture are used to ensure data integrity and temporal consistency throughout the monitoring infrastructure.
3. ELECTRICAL OPTIMISATION METHODOLOGY
3.1. Real-time power monitoring and analysis
The electrical optimisation strategy adopted in this study is based on continuous monitoring and analytical evaluation of key power system parameters with the objective of supporting operational decisions grounded in electrical performance indicators rather than in purely process-level criteria. This approach reflects standard practices in industrial power management where optimisation is driven by load behaviour, power quality, and equipment operating conditions [41], [42].
Load profiling is performed through statistical analysis of electrical demand under distinct operating modes of the treatment system. Power consumption data are aggregated using 15-minute averaging intervals, consistent with utility metering and billing practices to establish representative baseline load curves. Under normal operating conditions the average active power demand is about 8.2 kW. Transient process phases such as membrane backwash cycles result in peak demand levels that reach up to 11.0 kW, while maintenance and low-activity periods reduce demand to around 2.5 kW. These differentiated load signatures provide a quantitative basis for identifying demand-driven inefficiencies and assessing the electrical impact of operational scheduling.
Power factor performance is monitored through real-time computation of its constituent components. The displacement power factor is calculated at the fundamental frequency of 50 Hz, reflecting the phase relationship between voltage and current associated with inductive loads such as motors and VFDs. In parallel the distortion power factor is evaluated to account for non-sinusoidal current components introduced by power electronic converters. The true power factor is then derived as the product of these two components, allowing a clear distinction between reactive power effects and harmonic-related degradation [43], [44]. This distinction is essential because corrective actions differ considerably depending on the dominant cause of the power factor reduction.
Harmonic behaviour is continuously assessed through spectral analysis of current waveforms. Total harmonic distortion (THD) and dominant harmonic orders - specifically the 3rd, 5th, 7th, 11th, and 13th harmonics - are evaluated using a 1024-point fast Fourier transform (FFT). These harmonic components are characteristic of rectifier-based loads and VFDs, and are monitored to detect deviations from expected operating conditions. Sudden increases in specific harmonic amplitudes are treated as indicators of abnormal equipment behaviour, improper VFD tuning, or deteriorating power quality at the point of common coupling.
Energy consumption pattern recognition is implemented using sliding-window time-series analysis over four-hour intervals. This temporal resolution enables identification of recurrent peak demand periods, inefficiencies during low-flow or partial-load operation and opportunities for demand-side optimisation. From this perspective, this analysis supports load shifting strategies that are aimed at moving non-critical, energy-intensive operations to off-peak tariff periods to reduce energy costs and pressure on electrical infrastructure without compromising process reliability.
3.2. Optimisation algorithms
Intelligent load scheduling algorithm:
The intelligent load scheduling algorithm is designed to minimise electrical energy costs while ensuring compliance with power capacity limits and uninterrupted operation of critical wastewater treatment processes. The scheduling framework explicitly differentiates between critical loads that must remain continuously energised and non-critical auxiliary loads, whose operation can be temporally shifted within predefined operational constraints. The algorithm operates over a rolling 24-hour horizon discretised into 10-minute intervals corresponding to 144-time steps. This temporal resolution is consistent with both process dynamics and standard utility billing practices. Anticipative scheduling decisions are enabled through short-term demand forecasts generated by long short-term memory (LSTM) neural networks allowing load management actions to be taken before capacity limits are reached [45], [46].
The scheduling problem is formulated as a mixed-integer optimisation problem that minimises electricity cost while penalising peak demand excursions:
where teT denotes the discrete time index over the scheduling horizon, D(t) is the total active power demand (kW), and C(t) represents the time-varying electricity price reflecting peak and off-peak tariff periods. The parameter τ penalises violations of the maximum allowable power threshold Pmax= 9.5 kW. The constant term Dc aggregates the demand of critical loads, while denotes the set of non-critical loads characterised by rated power wj and binary operating state xj(t). The constraint T¡min enforces minimum operation durations to preserve functional requirements.
Priority-based scheduling logic:
Each non-critical load j ϵ J is assigned a priority level pjϵ {1,2,3,4,5}, with lower values indicating higher priority. Scheduling decisions are based on forecasted demand D (t) and follow three operating rules.
During peak tariff periods Tpeak (06:00-22:00), non-critical loads are deferred when forecasted demand approaches the capacity limit:
where δ=0.1Pmax provides a safety margin to accommodate forecast uncertainty.
During off-peak periods Toff-peak (22:00-06:00), loads are scheduled when sufficient capacity is available:
When available capacity is limited, load activation follows a priority-based allocation:
with
representing the remaining capacity after higher-priority loads have been allocated.
Power factor correction algorithm:
Reactive power compensation is implemented to reduce unnecessary current circulation and maintain efficient use of the electrical infrastructure. The required compensation is computed as:
where P is the measured active power and PFtarget=0.95.
The capacitor bank is composed of a finite set of discrete compensation stages, denoted by the index ie I where I = {1, 2...., Nc} and Nc is the total number of available capacitor stages. Each stage I provides a fixed reactive power rating Qstage,i. The remaining uncompensated reactive power after partial correction is denoted by Qremaining. Stage activation is governed by the following condition:
This criterion avoids frequent switching of marginal stages and ensures stable compensation behaviour under fluctuating load conditions.
Voltage transients are monitored following each switching action:
All switching events are synchronised with voltage zero crossings. Fine adjustment is performed when:
Harmonic mitigation strategy:
Harmonic mitigation is achieved through active filtering when distortion exceeds acceptable limits:
Dominant harmonic components are identified as:
Priority compensation targets characteristic harmonics:
3.3. Machine learning for energy optimisation
ML techniques are used as decision-support tools within the proposed electrical optimisation framework. Their role is to enhance anticipation and adaptability of control actions while all decisions remain constrained by electrical capacity limits, power quality requirements, and treatment process specifications. The learning models do not operate autonomously, but are embedded in a supervisory architecture that ensures consistency with operational and electrical constraints.
LSTM networks for consumption forecasting:
LSTM networks are used to forecast short-term electrical energy consumption. The model processes 48 hours of historical consumption data at 10-minute resolution, augmented with cyclic temporal features such as hour of day, day of week, and weekend indicator, and produces a 24-hour-ahead demand forecast. The forecasted profile is used as an anticipative input for load scheduling and control optimisation. The network architecture and data flow are illustrated in Figure 3, which shows the input sequence, preprocessing stage, LSTM layers, and forecast output.
Reinforcement learning for VFD optimisation:
A deep Q-network (DQN) agent is developed to optimise VFD speed settings in real time [47], [48], [49]. The agent state includes process variables and electrical indicators such as energy consumption, power factor, and total harmonic distortion rate to ensure the compatibility of control actions with power quality and operational constraints. The DQN architecture and interaction with the treatment system are shown in Figure 4.
Training over 10,000 episodes results in an additional 8% reduction in energy consumption compared with rule-based control while maintaining treatment performance limits.
Anomaly detection:
Anomaly detection is implemented using isolation forest algorithms to identify abnormal energy-consumption patterns associated with equipment inefficiencies or incipient faults. Detected anomalies are classified by severity to enable prioritised maintenance actions. During the evaluation period, 12 anomalies were detected, of which 10 were confirmed as equipment-related issues, corresponding to a precision of 83%.
4. DIGITAL TWIN DEVELOPMENT FOR ELECTRICAL SYSTEMS
4.1. Digital twin architecture
The DT framework is structured around three interdependent layers operating in continuous synchronisation to ensure consistency between the physical system and its virtual representation.
The physical layer corresponds to the laboratory-scale wastewater treatment system shown in Figure 1. It includes all electromechanical equipment, electrical distribution components, and processing units that are instrumented by a complete sensor network. Real-time measurements are acquired at predefined sampling intervals with electrical variables captured at high temporal resolution and process variables monitored according to their dynamic characteristics.
The virtual layer consists of computational models that represent the electrical distribution network, hydraulic circuits, and treatment processes. The electrical model reproduces the network layout, load connectivity, and equipment characteristics; and it allows the calculation of voltages, currents, power flows, and power quality indicators under various operating conditions. These models are parameterised using real-time measurements to ensure continuous alignment with the physical system state.
The connectivity layer provides bidirectional data exchange between the physical and virtual layers, enabling real-time state synchronisation. This layer is designed to support sub-second latency for time-critical monitoring and control functions, and incorporates the following components:
• a data streaming pipeline based on Apache Kafka, supporting sustained throughput of about 5,000 messages per second with message persistence [50];
• timestamp-based synchronisation protocols relying on NTP-synchronised clocks to ensure temporal consistency between distributed data sources;
• a state update mechanism whereby physical measurements update the virtual model at defined intervals of 100 ms for electrical variables and 1 s for process variables.
4.2. Real-time synchronisation mechanisms
Real-time synchronisation between the physical system and its DT is achieved through time-stamped sensor measurements transmitted using an MQTT-based publish-subscribe architecture. Incoming data streams undergo a structured preprocessing stage that includes range validation, rate-of-change constraints, and cross-sensor consistency checks prior to assimilation into the virtual model.
Measurements identified as invalid or inconsistent are flagged and replaced by estimated values generated through Kalman filtering techniques. State estimation is performed using extended Kalman Filter algorithms that fuse multiple sensor inputs to estimate electrical states, including voltages, currents, and power flows. This approach reduces measurement noise by about 60% compared with raw sensor data, and improves the robustness of the virtual model under transient operating conditions.
The resulting synchronised data set supports both short-term operational monitoring and longer-term trend analysis. Over the three-month evaluation period, this structured data management enabled continuous tracking of system performance and progressive equipment degradation, forming the basis for subsequent optimisation and maintenance functions.
4.3.
What-if analysis capabilitiesThe DT platform incorporates simulation capabilities that allow prospective evaluation of operational and infrastructural changes prior to physical implementation. Load scenario analysis is used to assess system behaviour under hypothetical operating conditions, including peak load scenarios up to 150% of nominal demand to evaluate voltage regulation margins and thermal constraints, long-term load growth scenarios to examine infrastructure adequacy, and emergency operating modes to determine minimum viable processing conditions.
The platform also supports capacitor switching impact analysis to assess transient overvoltage levels and potential harmonic resonance associated with reactive power compensation. Electromagnetic transient simulations predict voltage peaks in the range of 1.12 to 1.18 p.u., enabling identification of resonance conditions near the 7th harmonic that may require detuning measures. Inrush current estimates are also generated to guide appropriate protection device selection.
Energy-saving measures are evaluated in the same simulation environment. Speed reduction scenarios for VFDs are analysed using power-speed relationships while accounting for their impact on treatment capacity. Equipment replacement options, nighttime operation strategies, and participation in demand management schemes are assessed to quantify their potential contributions to reduced costs and improved energy efficiency.
4.4.
Predictive maintenance integrationThe system integrates electrical and mechanical monitoring data to provide an equipment condition assessment for intervention planning [51]. Rotating equipment degradation is monitored through vibration signatures and frequency components indicative of failure [52]. A health index combines RMS vibration, temperature rise, power factor, and efficiency according to their operational significance [53]. Remaining useful life is estimated by extrapolating degradation trends towards predefined insulation and vibration thresholds [54].
These indicators support condition-based maintenance planning and reduce reliance on fixed-interval interventions [55].
5. RESULTS AND PERFORMANCE ANALYSIS
5.1. Electrical optimisation performance
The experimental campaign conducted over a three-month period demonstrated measurable improvements in multiple electrical and operational performance indicators. All measurements were performed in Morocco, with economic evaluations expressed in Moroccan dirhams (MAD) using local electricity tariffs. To ensure comparability, all results were obtained under equivalent process conditions, with an average flow rate of 1.85 m3-h"1, influent turbidity of 45 NTU, and ambient temperature of 24 °C.
Power quality improvements:
Power factor correction was a primary outcome of the electrical optimisation strategy. Baseline measurements collected during the initial two-week period (around 336 operating hours) showed an average power factor of 0.83, with values ranging between 0.82 and 0.85 depending on load conditions. This limitation was primarily associated with inductive behaviour of pumps and motor-driven equipment.
Following implementation of the automated capacitor bank control algorithm, the average power factor increased to 0.94, with values ranging between 0.92 and 0.96, as shown in Figure 5. The improvement showed strong temporal consistency, with the power factor maintained above 0.90 for 96% of operating hours compared with only 12.7% under baseline conditions. This improvement eliminated reactive power penalties that are applied when the monthly average power factor falls below 0.90. Given a penalty rate of 8% applied to energy charges, this resulted in monthly savings of about 640 MAD.
Total harmonic distortion (THD) was also significantly reduced. Baseline current THD averaged 15.2%, while optimised operation reduced this value to an average of 4.8%, corresponding to a 68.4% reduction. This improvement was primarily attributed to the operation of the active harmonic filter targeting dominant harmonic orders. The detailed harmonic spectrum analysis in Figure 6 showed reductions of:
• 72% for the 5th harmonic (from 8.2% to 2.3% of the fundamental),
• 66% for the 7th harmonic (from 5.8% to 2.0%),
• 59% for the 11th harmonic (from 3.4% to 1.4%), and
• 57% for the 13th harmonic (from 2.1% to 0.9%).
As a result, the installation complied with IEEE 519-2014 limits for voltage THD (<8%) and current THD at the point of common coupling (<15%).
Voltage quality also improved. Voltage fluctuation amplitude, defined as - (Vmax)/Vmnominal over 10-minute intervals, decreased by 68%, from a baseline average of 4.2% to 1.3% under optimised operation. Voltage unbalance, defined according to IEC 61000-2-2 as the ratio of negative-sequence to positive-sequence voltage, improved from 1.8% to 0.6%, reducing motor derating requirements and associated thermal stress.
Energy consumption optimisation:
Energy consumption was evaluated by comparing baseline operation during the first 15 days (360 operating hours) with optimised operation over the subsequent 75 days (1,800 operating hours). Representative 24-hour consumption profiles before and after optimisation are shown in Figure 7.
Total energy consumption decreased by 21.7%, from 8,706.45 kWh under baseline conditions to 6,818.71 kWh over equivalent operating periods. This reduction resulted from the combined effect of multiple optimisation mechanisms:
• intelligent load scheduling contributed about 8.5% through shifting non-critical loads to off-peak periods;
• VFD speed optimisation via reinforcement learning contributed 7.8%;
• power factor correction contributed 3.2%;
• predictive maintenance contributed 2.2% by maintaining equipment efficiency through timely interventions.
Peak demand was reduced by 22.0%, from 11.00 kW to 8.58 kW, primarily through strategic load shifting. Given a demand charge of about 120 MAD-kW~1-month~1, this reduction yielded monthly savings of 290 MAD. Load duration curves further showed a 35% reduction in hourly demand variability, with the standard deviation decreasing from 2.34 kW to 1.52 kW.
Reactive power consumption decreased by 35%, from 4,580 kVARh to 2,977 kVARh, over the evaluation period. This reduction lowered reactive current levels from an average of 6.2 A to 4.0 A at 400 V, thereby reducing I2R losses in distribution cables and transformer windings.
Economic benefits:
The electrical optimisation framework produced tangible economic benefits over the three-month evaluation period. Electricity expenditure decreased by 15%, from 10,883 MAD to 9,250 MAD, corresponding to estimated annual savings of 6,532 MAD. The cost reduction exceeded the proportional energy reduction owing to preferential savings during high-tariff periods.
Reactive power penalties averaging 870 MAD per month plus an 8% surcharge on monthly energy costs were fully eliminated, resulting in annual savings of around 10,440 MAD.
Improved operating conditions extended motor service life by an estimated 20% through reduced voltage unbalance, harmonic distortion, and thermal cycling. This extension, corresponding to a deferral of replacement over a 10-12-year horizon, yielded net present value savings of about 640 MAD.
Predictive maintenance reduced annual maintenance costs by 31%, from 14,500 MAD to 10,005 MAD. This reduction resulted from fewer planned interventions, elimination of unnecessary component replacement, and a 35% reduction in unplanned downtime.
Aggregated annual savings amounted to about 22,107 MAD. Given an implementation cost of 85,000 MAD for instrumentation, networking, edge computing hardware, and software licences, the resulting simple payback period was 3.8 years.
5.2.
Electrical system monitoring resultsContinuous electrical monitoring provided early detection of performance degradation and incipient faults. Motor current signature analysis identified developing faults 7 to 14 days prior to failure. Insulation resistance monitoring revealed progressive degradation trends, while temperature monitoring prevented three potential overheating incidents.
At the distribution level, unbalanced loading conditions were detected and corrected, deteriorating electrical connections were identified through thermal trending, and transformer loading was optimised to improve efficiency.
5.3.
Digital twin dashboardThe integrated DT dashboard in Figure 8 provided real-time visualisation of electrical system performance, predictive maintenance alerts, and energy optimisation outcomes through a web-based interface accessible from desktop and mobile devices. By consolidating heterogeneous electrical, process, and maintenance data streams into a unified operational view, the dashboard significantly reduced the effort required for daily system supervision.
The interface displayed key electrical indicators, including power factor, total harmonic distortion, voltage and current phasor diagrams, power flows, and available electrical capacity. Equipment condition was represented by health indices and remaining useful life estimates, enabling early identification of degradation trends. Energy and cost performance metrics such as real-time energy savings and peak demand tracking supported continuous assessment of optimisation effectiveness. Scenario-based what-if analysis modules allowed operators to evaluate the impact of load profile modifications, capacitor bank switching, and operational scheduling on both electrical performance and operating costs.
Routine use of the dashboard by operations personnel reduced the time required for daily system inspection from about 45 minutes to 12 minutes. User feedback indicated high usability, with an average system usability scale score of 82.5 out of 100.
6. DISCUSSION
The results obtained over the three-month experimental campaign confirm the effectiveness of the proposed DT-based electrical optimisation framework when applied to a laboratory-scale hospital wastewater treatment system. This discussion focuses on the consistency between observed improvements, the underlying mechanisms, and their implications for industrial engineering decision-making.
The improvement in power factor from 0.83 to 0.94 is a central outcome, as it directly influenced both energy efficiency and economic performance. This improvement resulted in a substantial reduction in reactive power consumption and associated current levels, which in turn reduced distribution losses and eliminated reactive power penalties. The sustained maintenance of a power factor above 0.90 for the majority of operating hours demonstrates that the adopted control strategy achieved stable compensation rather than short-term corrective action.
Harmonic mitigation contributed significantly to overall power quality improvement. The observed reduction in total harmonic distortion, particularly for dominant low-order harmonics, is consistent with the characteristics of VFD-dominated loads. Compliance with IEEE 519-2014 limits was achieved without excessive filtering, indicating that selective harmonic compensation was sufficient to address distortion while avoiding unnecessary over-dimensioning. Improvements in voltage fluctuation and unbalance further indicate a more stable electrical environment, which is reflected in reduced thermal stress on rotating equipment.
Energy consumption reduction of 21.7% is attributable to the combined action of multiple complementary mechanisms rather than a single dominant factor. Load scheduling primarily reduced consumption during high-tariff periods, while speed optimisation through VFDs addressed hydraulic losses during partial-load operation. Power factor correction and harmonic mitigation reduced non-productive current components, and predictive maintenance contributed indirectly by maintaining equipment efficiency over time. The proportional contribution of each mechanism aligns with its respective physical impact on system operation, and supports the internal consistency of the results.
Peak demand reduction and load profile smoothing further demonstrate improved electrical system use. The reduction in demand variability indicates a shift toward more predictable operating conditions, which benefits both electrical infrastructure loading and cost control. These effects are particularly relevant in systems that are subject to demand-based tariffs, where peak reduction yields disproportionate economic benefits.
From an economic perspective, the calculated savings and resulting payback period are consistent with the scale and complexity of the implemented solution. The elimination of reactive power penalties and the reduction in demand charges contribute significantly to overall savings, while maintenance cost reductions and asset life extension provide longer-term benefits. The payback period of 3.8 years reflects a balance between upfront instrumentation and software costs and recurring operational savings, making the solution economically viable without relying on optimistic assumptions.
The DT dashboard played a key role in translating technical improvements into operational value. By consolidating electrical, process, and maintenance information in a unified interface, it reduced monitoring effort and supported timely decision-making. User feedback and reduced inspection time indicate that the system was not only technically effective, but also usable as a practical decision-support tool for facility managers.
From an implementation perspective, industrial engineers and facility managers could adopt the framework progressively. The first stage consists of instrumenting critical electrical loads and building a reliable baseline. The second stage deploys the dashboard and power-quality monitoring. The third stage introduces load scheduling, power factor correction, and VFD optimisation under operational constraints. The final stage integrates predictive maintenance indicators into work-order planning. This staged adoption path reduces implementation risk, and makes the method transferable to other energy-intensive industrial utilities.
Overall, the results demonstrate that integrating real-time electrical monitoring, optimisation algorithms, and predictive analytics in a DT framework can deliver measurable improvements in energy efficiency, power quality, and operational reliability for hospital wastewater treatment systems.
The main limitation of the study is that validation was performed on a laboratory-scale pilot system rather than on a full-scale hospital installation. The reported gains should therefore be interpreted as controlled proof-of-concept results. Full-scale deployment may be affected by larger flow variability, heterogeneous equipment, existing control policies, utility tariff structures, and operator routines. Future work should include multi-site field validation, longer monitoring periods, and sensitivity analysis under different treatment capacities.
7. CONCLUSION
This study presented an integrated DT-based framework for applying electrical optimisation and predictive maintenance to a hospital wastewater treatment system. By combining real-time electrical monitoring, data-driven optimisation algorithms, and condition-based maintenance strategies, the proposed approach achieved significant improvements in power quality, energy efficiency, and operational reliability while supporting practical facility-level decisions.
The experimental results demonstrated consistent enhancement of power factor, substantial harmonic distortion reduction, improved voltage stability, and a 21.7% decrease in total energy consumption. These technical improvements translated into tangible economic benefits, including reduced electricity costs, elimination of reactive power penalties, and lower maintenance expenditures.
Beyond performance gains, the proposed solution enabled anticipative decision-making through real-time synchronisation, scenario analysis, and predictive maintenance integration. The unified dashboard facilitated efficient system supervision, reduced operational workload, and provided a structured basis for maintenance and energy-management decisions.
The findings indicate that DT technologies, when grounded in detailed electrical monitoring and aligned with operational constraints, represent an effective pathway for improving the sustainability and resilience of energy-intensive treatment systems. The results should be interpreted in the light of the laboratory-scale validation. Future work will focus on full-scale deployment, multi-site validation, and extension to other critical infrastructure domains.
REFERENCES
-
[1] M. Magni, E. R. Jones, M. F. P. Bierkens, and M. T. H. van Vliet, 'Global energy consumption of water treatment technologies', Water Research, vol. 277, 123245, Jun. 2025. doi: 10.1016/j.watres.2025.123245
» https://doi.org/10.1016/j.watres.2025.123245 -
[2] P. Yapicioğlu, 'Energy cost assessment of an industrial wastewater treatment plant: Effect of design flow', Academic Perspective Procedia, vol. 2, no. 3, pp. 532-537, Nov. 2019. doi: 10.33793/acperpro.02.03.45
» https://doi.org/10.33793/acperpro.02.03.45 - [3] M. Abu-Orf, G. Tchobanoglous, H. D. Stensel, R. Tsuchihashi, F. Burton, and B. Pfrang, Wastewater engineering: Treatment and resource recovery, 5th ed. McGraw-Hill, 2013.
- [4] D. C. Joshi, S. Prasad, A. Sharma, and N. Joshi, 'Pathological contaminants in wastewater from hospital waste: Implications and mitigation strategies', in H. Gupta, S. Madhav, S. Dhiman, and R. Mishra, Emerging contaminants in water and wastewater: Sources and substances. Environmental Science and Engineering Series, Springer, 2025, ch. 3, pp. 43-85. doi: 10.1007/978-3-031-82579-8_3
-
[5] H. Dion, M. Evans, and P. Farrell, 'Hospitals management transformative initiatives; towards energy efficiency and environmental sustainability in healthcare facilities', Journal of Engineering, Design and Technology, vol. 21, no. 2, pp. 552-584, Aug. 2022. doi: 10.1108/JEDT-04-2022-0200
» https://doi.org/10.1108/JEDT-04-2022-0200 -
[6] E. Carraro, Si. Bonetta, C. Bertino, E. Lorenzi, Sa. Bonetta, and G. Gilli, 'Hospital effluents management: Chemical, physical, microbiological risks and legislation in different countries', Journal of Environmental Management, vol. 168, pp. 185-199, Mar. 2016. doi: 10.1016/j.jenvman.2015.11.021
» https://doi.org/10.1016/j.jenvman.2015.11.021 -
[7] G. Bhandari et al., 'A review on hospital wastewater treatment technologies: Current management practices and future prospects', Journal of Water Process Engineering, vol. 56, 104516, Dec. 2023. doi: 10.1016/j.jwpe.2023.104516
» https://doi.org/10.1016/j.jwpe.2023.104516 -
[8] P. Yapicioğlu and M. İ. Yeşilnacar, 'Investigating energy costs for a wastewater treatment plant in a meat processing industry regarding water-energy nexus', Environmental Science and Pollution Research, vol. 29, no. 1, pp. 1301-1313, Jan. 2022. doi: 10.1007/s11356-021-15757-7
» https://doi.org/10.1007/s11356-021-15757-7 -
[9] S. Longo, A. Hospido, and M. Mauricio-Iglesias, 'Energy efficiency in wastewater treatment plants: A framework for benchmarking method selection and application', Journal of Environmental Management, vol. 344, 118624, Oct. 2023. doi: 10.1016/j.jenvman.2023.118624
» https://doi.org/10.1016/j.jenvman.2023.118624 -
[10] M. Javaid, S. Khan, A. Haleem, and S. Rab, 'Adoption of modern technologies for implementing Industry 4.0: An integrated MCDM approach', Benchmarking: An International Journal, vol. 30, no. 10, pp. 3753-3790, Nov. 2022. doi: 10.1108/BIJ-01-2021-0017
» https://doi.org/10.1108/BIJ-01-2021-0017 -
[11] C. M. Coman, A. Florescu, C. D. Oancea, 'Assessment of energy use based on an implementation of loT, cloud systems, and artificial intelligence', Energies, vol. 14, no. 11, 3202, May 2021. doi: 10.3390/en14113202
» https://doi.org/10.3390/en14113202 -
[12] R. Anderl, S. Haag, K. Schützer, and E. Zancul, 'Digital twin technology: An approach for Industrie 4.0 vertical and horizontal lifecycle integration', it - Information Technology, vol. 60, no. 3, pp. 125-132, Jun. 2018. doi: 10.1515/itit-2017-0038
» https://doi.org/10.1515/itit-2017-0038 - [13] M. Grieves and J. Vickers, 'Digital twin: Mitigating unpredictable, undesirable emergent behavior in complex systems', in F.-J. Kahlen, S. Flumerfelt, and A. Alves, eds, Transdisciplinary perspectives on complex systems: New findings and approaches, Cham: Springer, 2017, pp. 85-113. doi: 10.1007/978-3-319-38756-7_4
-
[14] M. Abdelrahman, E. Macatulad, B. Lei, M. Quintana, C. Miller, and F. Biljecki, 'What is a digital twin anyway? Deriving the definition for the built environment from over 15,000 scientific publications', Building and Environment, vol. 274, 112748, Apr. 2025. doi: 10.1016/j.buildenv.2025.112748
» https://doi.org/10.1016/j.buildenv.2025.112748 -
[15] Abhinav Parashar A. Singh and Neepakumari Gameti, 'Digital twins in manufacturing: A survey of current practices and future trends', International Journal of Science and Research Archive, vol. 13, no. 1, pp. 1240-1250, Sep. 2024. doi: 10.30574/ijsra.2024.13.1.1705
» https://doi.org/10.30574/ijsra.2024.13.1.1705 -
[16] J. Leng, H. Zhang, D. Yan, Q. Liu, X. Chen, and D. Zhang, 'Digital twin-driven manufacturing cyber-physical system for parallel controlling of smart workshop', Journal of Ambient Intelligence and Humanized Computing, vol. 10, no. 3, pp. 1155-1166, Mar. 2019. doi: 10.1007/s12652-018-0881-5
» https://doi.org/10.1007/s12652-018-0881-5 -
[17] S. C. Pandey, N. Virmani, D. Bhandari, and S. Jagtap, 'A sustainability-oriented KPI framework for digital twin adoption in the sugar industry: ISM-MICMAC approach', Journal of Agribusiness in Developing and Emerging Economies, Vol. ahead-of-print, No. ahead-of-print, Nov. 2025. doi: 10.1108/JADEE-08-2025-0392
» https://doi.org/10.1108/JADEE-08-2025-0392 -
[18] P. Burger, J. Vosloo, and J. van Laar, 'Future mines' compressed air planning using digital twin simulations', The South African Journal of Industrial Engineering, vol. 35, no. 3, pp. 96-112, Nov. 2024. doi: 10.7166/35-3-3094
» https://doi.org/10.7166/35-3-3094 -
[19] R. Sala-Garrido, M. Mocholi-Arce, A. Maziotis, and M. Molinos-Senante, 'Energy efficiency evaluation of wastewater treatment plants: A methodological proposal for its benchmarking', Environmental Science & Policy, vol. 162, 103915, Dec. 2024. doi: 10.1016/j.envsci.2024.103915
» https://doi.org/10.1016/j.envsci.2024.103915 -
[20] J. Zhang, S. Liu, W. Xue, P. Hou, G. Zhang, and J. Liang, 'Prediction and optimization of in-situ excess sludge reduction in wastewater treatment process by machine learning', Bioresource Technology, vol. 437, 133183, Dec. 2025. doi: 10.1016/j.biortech.2025.133183
» https://doi.org/10.1016/j.biortech.2025.133183 -
[21] F. Lin, X. Lin, J. Li, J. Zeng, W. Lin, and J. Wang, 'High efficiency and sustainability of PVDF membrane in wastewater treatment and reuse', Green Technologies and Sustainability, vol. 4, no. 2, 100317, Apr. 2026. doi: 10.1016/j.grets.2025.100317
» https://doi.org/10.1016/j.grets.2025.100317 -
[22] N. Hvala, D. Vrecko, P. Cerar, G. Zefran, M. Levstek, and D. Vrancic, 'Energy cost optimisation in a wastewater treatment plant by balancing on-site electricity generation with plant demand', Water, vol. 17, no. 8, Apr. 2025. doi: 10.3390/w17081170
» https://doi.org/10.3390/w17081170 -
[23] A. Choudhary, 'Internet of Things: A comprehensive overview, architectures, applications, simulation tools, challenges and future directions', Discover Internet of Things, vol. 4, no. 1, 31, Dec. 2024. doi: 10.1007/s43926-024-00084-3
» https://doi.org/10.1007/s43926-024-00084-3 -
[24] P. Aivaliotis, K. Georgoulias, and G. Chryssolouris, 'The use of digital twin for predictive maintenance in manufacturing', International Journal of Computer Integrated Manufacturing, vol. 32, no. 11, pp. 1067-1080, Nov. 2019, doi: 10.1080/0951192X.2019.1686173.
» https://doi.org/10.1080/0951192X.2019.1686173 -
[25] I. Kavasidis, E. Lallas, V. C. Gerogiannis, T. Charitou, and A. Karageorgos, 'Predictive maintenance in pharmaceutical manufacturing lines using deep transformers', Procedia Computer Science, vol. 220, pp. 576-583, Jan. 2023. doi: 10.1016/j.procs.2023.03.073
» https://doi.org/10.1016/j.procs.2023.03.073 -
[26] S. Ayvaz and K. Alpay, 'Predictive maintenance system for production lines in manufacturing: A machine learning approach using loT data in real-time', Expert Systems with Applications, vol. 173, 114598, Jul. 2021. doi: 10.1016/j.eswa.2021.114598
» https://doi.org/10.1016/j.eswa.2021.114598 -
[27] B. Xu et al., 'A case study of digital-twin-modelling analysis on power-plant-performance optimizations', Clean Energy, vol. 3, no. 3, pp. 227-234, Nov. 2019. doi: 10.1093/ce/zkz025
» https://doi.org/10.1093/ce/zkz025 -
[28] T. Domínguez-Bolaño, O. Campos, V. Barral, C. J. Escudero, and J. A. García-Naya, 'An overview of IoT architectures, technologies, and existing open-source projects', Internet of Things, vol. 20, 100626, Nov. 2022. doi: 10.1016/j.iot.2022.100626
» https://doi.org/10.1016/j.iot.2022.100626 -
[29] A. Madhan, A. Shunmugalatha, and A. S. Vigneshwar, 'Real-time installation of a smart energy meters using the long-range network', Journal of Electrical Engineering & Technology, vol. 19, no. 1, pp. 223-236, Jan. 2024. doi: 10.1007/s42835-023-01578-w
» https://doi.org/10.1007/s42835-023-01578-w -
[30] J. Kaur and S. K. Bath, 'Harmonic distortion in power systems due to electronic control and renewable energy integration: A comprehensive review', Discover Electronics, vol. 2, no. 1, 67, Aug. 2025. doi: 10.1007/s44291-025-00111-9
» https://doi.org/10.1007/s44291-025-00111-9 -
[31] Y. Han et al., 'The use of model-based voltage and current analysis for torque oscillation detection and improved condition monitoring of centrifugal pumps', Mechanical Systems and Signal Processing, vol. 222, 111781, Jan. 2025. doi: 10.1016/j.ymssp.2024.111781
» https://doi.org/10.1016/j.ymssp.2024.111781 -
[32] I. Lopez and A. Garcia, 'Analysis of three methodologies for characterization of triaxial accelerometers type MEMS', Measurement: Sensors, vol. 38, 101757, May 2025. doi: 10.1016/j.measen.2024.101757
» https://doi.org/10.1016/j.measen.2024.101757 -
[33] Q. Bai, B. Jin, D. Wang, Y. Wang, and X. Liu, 'Compact Modbus TCP/IP protocol for data acquisition systems based on limited hardware resources', Journal of Instrumentation, vol. 13, no. 04, T04004, Apr. 2018. doi: 10.1088/1748-0221/13/04/T04004
» https://doi.org/10.1088/1748-0221/13/04/T04004 - [34] G. C. Hillar, MQTT essentials - A lightweight loT protocol: The preferred loT publish-subscribe lightweight messaging protocol. Birmingham: Packt Publishing, 2017.
- [35] T. Prantl, L. Iffländer, S. Herrnleben, S. Engel, S. Kounev, and C. Krupitzer, 'Performance impact analysis of securing MQTT using TLS', in ICPE '21, Proceedings of the ACM/SPEC International Conference on Performance Engineering, Apr. 2021, pp. 241-248. doi: 10.1145/3427921.3450253
-
[36] S. Pratap Singh, N. Kumar, G. Kumar, B. Balusamy, A. K. Bashir, and M. M. A. Dabel, 'Enhancing quality of service in IoT-WSN through edge-enabled multi-objective optimization', IEEE Transactions on Consumer Electronics, vol. 71, no. 2, pp. 4110-4119, May 2025. doi: 10.1109/TCE.2025.3526992
» https://doi.org/10.1109/TCE.2025.3526992 -
[37] P. Huber, U. Göhner, M. Trapp, J. Zender, and R. Lichtenberg, 'Comprehensive analysis of neural network inference on embedded systems: Response time, calibration, and model optimisation', Sensors, vol. 25, no. 15, Aug. 2025. doi: 10.3390/s25154769
» https://doi.org/10.3390/s25154769 -
[38] H. Chang, Z. Wu, H. Hu, X. Wang, and F. Liu, 'The development of gyrotron data management system for ECRH system based on InfluxDB', Nuclear Engineering and Technology, vol. 57, no. 7, 103489, Jul. 2025. doi: 10.1016/j.net.2025.103489
» https://doi.org/10.1016/j.net.2025.103489 -
[39] K. Naveed et al., 'Machine learning assisted predictive urban digital twin for intelligent monitoring of air quality index for smart city environment', Environmental Modelling & Software, vol. 192, 106559, Aug. 2025. doi: 10.1016/j.envsoft.2025.106559
» https://doi.org/10.1016/j.envsoft.2025.106559 - [40] R. Zhang, Z. Hu, J. Li, F. Fan, and F. Wen, 'Network time protocol (NTP) implementation for laser inter-satellite networks', in Proceedings SPIE, Advanced Fiber Laser Conference (AFL2023), Mar. 2024, pp. 1707-1712. doi: 10.1117/12.3023868
- [41] A. Baggini, Handbook of power quality. John Wiley & Sons, 2008.
- [42] R. C. Dugan, S. Santoso, M. F. McGranaghan, and H. W. Beaty, Electrical power systems quality. McGraw-Hill Professional, 2002.
- [43] J. Arrillaga and N. R. Watson, Power system harmonics. John Wiley & Sons, 2003.
-
[44] G. L. Xavier et al., 'An update on the performance of reactive energy meters under non-sinusoidal conditions', Electrical Engineering, vol. 102, no. 4, pp. 1881-1891, Dec. 2020. doi: 10.1007/s00202-020-00970-3
» https://doi.org/10.1007/s00202-020-00970-3 - [45] W.-C. Hong, M.-W. Li, and G.-F. Fan, eds, Short-term load forecasting by artificial intelligent technologies. MDPI, 2019.
- [46] X. Zhang, B. Meng, and L. Yu, eds, Advanced models of energy forecasting. Lausanne, Switzerland: Frontiers Media SA, 2022.
- [47] M. Sewak, 'Deep Q network (DQN), Double DQN, and Dueling DQN', in Deep Reinforcement Learning: Frontiers of Artificial Intelligence, M. Sewak, ed., Singapore: Springer, 2019, pp. 95-108. doi: 10.1007/978-981 -13-8285-7_8
- [48] T. Liu, Reinforcement learning-enabled intelligent energy management for hybrid electric vehicles. Springer Nature, 2022.
- [49] F. Li and Y. Du, Deep learning for power system applications: Case studies linking artificial intelligence and power systems. Springer Nature, 2023.
- [50] A. Zelenin and A. Kropp, Apache Kafka in action: From basics to production. Simon and Schuster, 2025.
-
[51] H. N. Teixeira, I. Lopes, and A. C. Braga, 'Condition-based maintenance implementation: A literature review', Procedia Manufacturing, vol. 51, pp. 228-235, Jan. 2020. doi: 10.1016/j.promfg.2020.10.033
» https://doi.org/10.1016/j.promfg.2020.10.033 - [52] R. B. Randall, Vibration-based condition monitoring: Industrial, automotive and aerospace applications. John Wiley & Sons, 2021.
- [53] K. Mobley, L. Higgins, and D. Wikoff, Maintenance engineering handbook. McGraw-Hill, 2008.
- [54] T. S. Sudarshan, K. M. Pandey, R. D. Misra, P. K. Patowari, and S. Bhaumik, Recent advancements in mechanical engineering: Select proceedings of ICRAME 2021. Springer Nature, 2022.
- [55] V. Pandian, W. Gerhard-Wilhelm, and D. Ngoc Vo, Handbook of research on modern optimization algorithms and applications in engineering and economics. IGI Global, 2016.
Accepted for publication 22 Jun 2026
Available online 31 Aug 2026
ORCID® identifiers
S. Embarki https://orcid.org/0000-0002-4365-1562
Y. El Kihel https://orcid.org/0009-0000-9600-3908
B. El Kihel https://orcid.org/0000-0001-8628-0397









