Next Article in Journal
Department of Veterans Affairs’ Transportation System: Stakeholder Perspectives on the Current and Future System, Including Electric Autonomous Ride-Sharing Services
Previous Article in Journal
Optimizing State of Charge Estimation in Lithium–Ion Batteries via Wavelet Denoising and Regression-Based Machine Learning Approaches
Previous Article in Special Issue
Optimization of Electric Vehicle Charging and Discharging Strategies Considering Battery Health State: A Safe Reinforcement Learning Approach
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Enhancing Grid Stability Through Physics-Informed Machine Learning Integrated-Model Predictive Control for Electric Vehicle Disturbance Management

by
Bilal Khan
1,
Zahid Ullah
2 and
Giambattista Gruosso
2,*
1
Control and Instrumentation Engineering Department, King Fahd University of Petroleum & Minerals, Dhahran 31261, Saudi Arabia
2
Dipartimento di Elettronica, Informazione e Bioingegneria, Politecnico di Milano, Piazza Leonardo da Vinci, 32, 20133 Milano, Italy
*
Author to whom correspondence should be addressed.
World Electr. Veh. J. 2025, 16(6), 292; https://doi.org/10.3390/wevj16060292
Submission received: 21 April 2025 / Revised: 23 May 2025 / Accepted: 23 May 2025 / Published: 25 May 2025

Abstract

Integrating electric vehicles (EVs) has become integral to modern power grids to enhance grid stability and support green energy transportation solutions. EVs emerged as a promising energy solution that introduces a significant challenge to the unpredictable and dynamic nature of EV charging and discharging behaviors. These EV behaviors are performed by grid-to-vehicle (G2V) and vehicle-to-grid (V2G) operations that create unpredictable disturbances in the power grid. These disturbances introduced a nonlinear dynamic that compromises grid stability and power quality. Due to the unpredictable nature of these disturbances, the conventional control design with dynamic model prediction cannot manage these disturbances. To address these challenges, a Physics-Informed Machine Learning (PIML)-enhanced Model Predictive Control (MPC) framework is proposed to learn the stochastic behaviors of the EV-introduced disturbance in the power grid. The learned PIML model is integrated into an MPC framework to enable an accurate prediction of EV-driven disturbances with minimal data requirements. The MPC formulation optimizes pre-emptive control actions to mitigate the disturbance and ensure robust grid stability and enhanced EV integration. A comprehensive convergence and stability analysis of the proposed MPC formulation uses Lyapunov-based proofs. The efficacy of the proposed control design is evaluated on IEEE benchmark systems, demonstrating a significant improvement in performance metrics, such as frequency deviation, voltage stability, and scalability, compared to the conventional MPC design. The proposed MPC framework offers scalable and robust real-time EV grid integration in modern power grids.

1. Introduction

The rapid proliferation of electric vehicles (EVs) into power grids in recent years presents opportunities and challenges, particularly regarding power-grid stability, load balancing, and peak demand management [1]. Energy is a cornerstone of modern society, with energy storage systems, such as batteries and supercapacitors, playing a critical role in enabling efficient energy distribution and utilization in EVs. As EVs become an integral part of the modern grid and adoption will grow in the future, driven by decarbonization goals, their impact on the grid becomes increasingly significant, introducing a pressing need to develop advanced strategies to ensure a reliable and efficient energy ecosystem [2]. The increase in the penetration of EVs to the power grid through the grid-to-vehicle (G2V) operation as load and vehicle-to-grid (V2G) operation as the source introduced disturbances in the power grid [3]. These disturbances become a challenge for voltage stability, frequency regulation, and overall power quality. Therefore, we present a Machine Learning-based Model Predictive Control (MPC) strategy that is essential to mitigate the adverse effects of these disturbances and maintain power-grid stability and quality.
EVs offer a unique solution, such as mobile energy storage, due to large-capacity batteries acting as mobile energy markets through V2G and G2V interactions [4]. The EVs support power grids using V2G interactions during grid overloading, reducing peak load and enhancing grid stability [5]. The power grid, in return, provides economic benefits to EV users during coordinated and planned G2V operations when the grid is in low demand or high in renewable generation penetrations. Due to the unpredictable use of EVs with uncoordinated and unplanned G2V operations of a large fleet of EVs, charging demand can significantly increase peak loads and stress local distribution infrastructure [4]. Similarly, in the V2G operation mode, EVs distribute energy resources that support the power grid through ancillary services. However, these bidirectional energy transactions also introduced disturbances due to rapid, time-varying changes in load demand and available generation. These disturbances perturb the grid voltage and frequency, and these perturbations become significant during renewable intermittent and power dynamic variations that can degrade control performance and compromise the grid stability and power quality [6]. These factors introduce a source of nonlinear, fast, and stochastic disturbances to the power grid to maintain stable and reliable power-grid operations.
Conventional control-system design performance is degraded to maintain grid stability under high EV penetration. The traditional control design relies on primary frequency control that depends on governor response and droop-based voltage control using fixed set-point PI regulator controllers in power distribution networks. These methods work well for gradual changes. However, due to a sluggish control response, they struggle to regulate frequency oscillation and local voltage collapse in response to nonlinear, fast, and stochastic EV-induced disturbances [7]. Similarly, static and centralized control schemes cannot accommodate a large fleet of EVs’ integration with stochastic power dynamic behavior. As EV integration increases, a learning-based advanced control design is required to avoid large swing demands from EVs that can push the power system outside the safe operating limits.
In the literature, a significant amount of work was performed regarding grid stability, load balancing, and peak demand management to optimize the EVs’ interactions with the power grid. In [8], the researchers introduced an improved scheduling approach that applies multi-objective optimization to balance load demand by managing the uncoordinated charging of many EVs, helping maintain the stability of the power grid. Effective and advanced control strategies are required to provide a seamless, stable, EV integration with the modern power grid. A few approaches were proposed for enhancing grid flexibility, stability, and power quality, utilizing optimization and learning techniques. These strategies include machine learning, bidirectional communication, and intelligent control systems to optimize EV grid integrations. A cooperative frequency control strategy was proposed in [9] to address the microgrid frequency regulation problem under excessive EV discharge and stochastic disturbances from distributed power load and generation. An evolutionary deep reinforcement learning control strategy was implemented to mitigate the excess EV discharge while ensuring frequency regulations. The authors in [10] introduced reinforcement learning and support vector regression machine learning models to facilitate EV integration to maintain grid frequency, voltage, and line loading regulation.
In [11], the authors introduced a multifunctional EV charging station integrated with the grid, enhancing power quality by employing V2G, G2V, and active-filtering modes. They developed a self-adjusting filter control strategy to reduce harmonic distortions in the grid current and ensure reliable EV battery charging. Furthermore, fuzzy logic-based autonomous controllers were utilized to regulate EV charging, addressing under-voltage problems. Meanwhile, the authors in [12] described a scheduling approach based on charging time and energy constraints to meet EV charging requirements efficiently within specified time frames. The integration of EVS into the power grid is managed through various control structures, including centralized, decentralized, and hierarchical approaches, each with unique strengths and limitations. In [13], a hierarchical charging control method is introduced, combining centralized control at the aggregator level to reduce overall energy costs with decentralized control strategies at the individual EV level. Extending this comparison, ref. [14] analyzed adaptive multi-agent systems and mixed-integer linear programming (MILP) for managing large-scale EV fleets. The decentralized MAS approach, relying on independent agent decisions, offered computational efficiency but lacked the flexibility provided by the MILP method. Hierarchical control structures, integrating both centralized and decentralized elements, have been increasingly utilized to combine the advantages of each approach. For instance, a tri-level hierarchical coordination strategy based on the Stackelberg leader–follower model is proposed in [15], effectively optimizing energy transactions across multiple control layers. Similarly, another hierarchical structure incorporated blockchain technology, enabling global optimization and peer-to-peer energy exchanges while addressing concerns like battery degradation [16]. The user preferences and dynamic energy tariffs were integrated into hierarchical methods, aligning EV charging processes with user requirements and grid stability objectives [17].
While several ML-based methods for load modeling and uncertainty prediction in power grids, such as those in [10,18], employ data-driven techniques like support vector regression or neural networks to forecast EV-induced disturbances, they often require extensive datasets and lack the integration of physical laws, leading to reduced generalizability under limited data or extreme scenarios. In contrast, the proposed PIML-MPC framework uniquely combines physics-informed neural networks, leveraging swing equations and voltage dynamics, with Model Predictive Control to achieve accurate disturbance predictions with minimal data (1000 samples) while ensuring physical consistency. Unlike the existing ML-based load modeling approaches [10,18], which focus solely on data-driven predictions, our method embeds physical constraints directly into the learning process, enabling robust real-time control and superior frequency regulation (97.6% RMSE reduction compared to conventional MPC), as demonstrated on the IEEE 39-bus system.
MPC is one of the promising approaches to managing EVs introduced by nonlinear and time-varying disturbances [19]. The MPC design consists of two parts: dynamic future predictions and optimization of control actions [20]. Due to the inherent property to handle multivariable systems with the anticipation of future events, MPC is well-suited to regulate the grid with EVs under fast fluctuations and constraints, e.g., battery limit, grid voltage bounds, etc. A distributed MPC framework is applied to coordinate the EV charging and V2G operations for grid support. The MPC can achieve voltage regulation goals and EV charging objectives [21]. The MPC formulation allows control design to forecast the EV charging patterns and proactively regulate the frequency and voltage. MPC is critically dependent on prediction models. In practice, modeling complex EV and grid dynamics is challenging, compromising the prediction ability of the MPC framework and computing suboptimal or destabilizing control actions [21].
Physics-Informed Machine Learning (PIML) overcomes the limitation of complex modeling for predictions. PIML is a category of machine learning models that integrates the model from physical-domain knowledge and data-driven learning algorithms. This hybrid modeling achieved high fidelity with much less data required [18]. The physical model helps create a surrogate power system model using a swing equation and captures complex EV and renewable fluctuations without an excessive dataset containing all possible scenarios. These models can be more reliable for EV integration forecasting with limited historical data and can be generalized better to uncoordinated EV integration and avoid violating energy conservation by design [18]. Despite the potential of MPC and PIML separately, their combined benefits for EV disturbance mitigation have not been fully explored.
Contrarily, the MPC-based control design faced scalability and accuracy issues, and pure data-driven controls required large training datasets that captured all critical system constraints and complex behaviors [21]. According to [21], the real-time optimization of EV energy management by integrating machine learning is a promising direction to improve robustness and adaptability. This paper represents a combination of PIML and MPC control design, where PIML continually informs and updates the predictive model within an MPC. This hybrid control design combines the strength of data-driven adaptation and physics-based rigorous control design. The system diagram of the proposed control framework is depicted in Figure 1, where a dataset is developed using historical data on EV power demand and supply to the grid, power-grid load demand, voltage variations, and frequency deviations. The PIML model uses EV interaction dynamics and datasets. The trained model is used for future horizon predictions of model states, and online optimization is implemented to optimize control actions. These control actions regulate the power grid and mitigate the disturbance generated by EV interactions.
This work introduces a novel integration of PIML within MPC to bolster power-grid stability amid rising EV adoption. The proposed framework utilizes physics-based ML to capture intricate interactions between electric vehicles and grid dynamics, embedding this model into an MPC for the real-time management of EV energy flows. The model maintains accurate and physically consistent predictions, even as conditions evolve, by incorporating fundamental physical principles, such as battery behavior, network limitations, and electrical flow equations. Consequently, the MPC optimizes control signals, mitigating disruptions from abrupt EV charging demands or unplanned vehicle-to-grid contributions. Compared to traditional methods and static-model MPC strategies, our approach ensures enhanced voltage and frequency stability with greater data efficiency than purely data-driven approaches. This research addresses the existing gaps by demonstrating practical, reliable AI-enabled control methods critical for resilient future smart grid operations. The key contributions of this work are as follows:
  • Development of a dynamic disturbance model using a PIML approach, which accurately emulates the stochastic behavior of EV plug-in and plug-out events and their impact on the power grid.
  • Design of an advanced MPC framework that incorporates PIML-based disturbance predictions for the real-time estimation and compensation of uncertainties, enhancing the robustness of the underlying prediction model.
  • Rigorous mathematical stability analysis of the proposed PIML-MPC control law, comprising two parts: (i) convergence guarantees PIML model training and (ii) closed-loop stability of the MPC formulation using Lyapunov-based techniques.
  • Comprehensive performance evaluation of the proposed control strategy on the IEEE 39-bus system under diverse G2V and V2G scenarios, demonstrating significant improvements in grid stability metrics.
This paper is organized as follows: Section 2 presents the mathematical modeling of the power system dynamics. Section 3 details the event-driven modeling of EV disturbances for plug-in and plug-out events. Section 4 introduces the PIML model design. Section 5 elaborates on the PIML-enhanced MPC formulation and provides mathematical stability proof for the proposed control law. Section 6 evaluates the performance of the proposed approach using the IEEE 39 bus system. Finally, Section 7 concludes the paper with key findings and directions for future research.

2. Mathematical Modeling of the Power System

A dynamic model is formulated using a multi-machine network with EV integrations that accurately describe the underlying power grid and EV interaction dynamics. The model should encapsulate the dynamics of synchronous generators, loads, and stochastic EV-induced disturbances through G2V and V2G operations.

2.1. Power Generator Dynamics

Consider a power grid with N g synchronous power generators and N b buses. The dynamics of the i t h generator are governed by the power-swing nonlinear equation [19]:
M i d 2 δ i ( t ) d t 2 + D i d δ i ( t ) d t = P m i t P e i δ t P E V i ( t )
where M i is momentum of inertia, D i is the damping coefficient, δ i ( t ) is rotor angle, P m i ( t ) is the mechanical input power, and P e i ( δ ( t ) ) is the electrical output power (function of phase angles) of the i t h generator. The electrical output power P e i ( δ ( t ) ) in (1) is derived from the power network admittance matrix, such as:
P e i δ ( t ) = j = 1 N b E i E j Y i j c o s ( δ i ( t ) δ j ( t ) θ i j ( t ) )
In (2), Y i j = Y i j e j θ i j ( t ) denotes the complex admittance between buses i and j , and E i is the internal emf of the i t h generator. The EV power disturbance in (1) is formulated as:
P E V i t = P G 2 V i t P V 2 G i t
In (3), G2V and V2G power are shown by:
P G 2 V i t = k = 1 N E V i α k i t P c k , P G 2 V i t = k = 1 N E V i β k i t P d k
where α k i t , β k i t 0 , 1 represent the plug-in and plug-out status of EV k at a bus i in (4), with charging and discharging events with a power rating of P c k and P d k .
In Equations (3) and (4), the EV power demand P E V is modeled as a direct load connected to the grid to capture the aggregate impact of EV charging and discharging (G2V and V2G) on grid dynamics, consistent with simplified models for large-scale fleet analysis [4]. While real-world EV systems typically include battery management systems (BMSs) to buffer charging and discharging, reducing direct grid impacts, this study assumes a direct load interaction to focus on worst-case disturbance scenarios, where uncoordinated EV behavior maximizes grid stress. The PIML-MPC framework compensates for these disturbances through predictive control. Still, future refinements can incorporate detailed BMS models for battery dynamics, such as state-of-charge constraints and charging rates, to enhance realism.

2.2. Voltage Dynamics

The voltage dynamics are modeled using nodal voltage magnitude V i ( t ) and angles θ i ( t ) across all N b   buses. At the i t h bus, the nodal voltage is represented using the differential equation developed from voltage-reactive power balance and capacitive effects in power transmission networks, such as:
C i V ˙ i = Q i , r e f   Q i , i n j   V , δ Q E V i t
where C i is the equivalent nodal voltage capacitance (reflecting voltage dynamics), Q i , r e f is the reactive power set-point, Q i , i n j is the injected reactive power at i t h   bus from generators and power lines, and Q E V i ( t ) is the reactive power disturbance due to EVs. The injected reactive power in (5) is formulated as follows:
Q i , i n j = j = 1 N b V i V j Y i j s i n ( θ i t θ j t ϕ i j )
Equation (6) is derived at i t h bus using AC power flow equations, where ϕ i j is the phase angle of the admittance Y i j and θ i ,   θ j are voltage angles of V i ,   V j at buses i and j at time t .
The reactive power from EVs in Equation (5) is represented similarly as in Equation (3):
Q E V i t = Q G 2 V i t Q V 2 G i t
In (7), G2V and V2G reactive powers are shown by:
Q G 2 V i t = k = 1 N E V i α k i t Q c k ,     Q G 2 V i t = k = 1 N E V i β k i t Q d k
where α k i t , β k i t 0 ,   1 represent the plug-in and plug-out status of EV k at a bus i in (7), with charging and discharging events with a power rating of Q c k and Q d k . If EVs are modeled with inverter-based control, a local droop control-based mechanism contributes to voltage support through Q injection (8).

2.3. State-Space Formulation of Power System Dynamics

State-space representation is formulated using the power dynamic equations developed in the previous subsections. Let the power system dynamics state defined as x i ( t ) = δ i ( t ) , ω i ( t ) , V i ( t ) T , where ω i ( t ) = δ i ( t ) ˙ . The nonlinear dynamic equation is shown by:
x ˙ i t = f i x i t , u i t , d i t ,         u i t = P m i t Q i , r e f t ,     d i t = P E V i t Q E V i t
where f i x i t , u i t , d i t = ω i ( t ) D i M i ω i ( t ) + 1 M i ( P m i t P e i δ t P E V i ( t ) ) in (9) can be extended to all generators and buses and represent the state-space form as:
x ˙ t = f x t , u t , d t ,     y ( t ) = h ( x t
In (10), x ( t ) = x 1 t , x N g t T and y t = [ ω 1 t , , ω N g t , V 1 ( t ) , , V N g ( t ) ] . Equation (10) encapsulates the acceleration dynamics of the power system, where the state vector f x t = [ δ , ω , V ] T includes rotor angles ( δ ) , angular velocities ( ω ) , and bus voltages ( V ) , with the term f x t , u t , d t modeling the nonlinear dynamics, including the acceleration of synchronous generators derived from the swing Equation (1) and voltage dynamics (5).

3. Event-Driven EV Disturbances for Plug-In and Plug-Out Events

EV event-driven disturbances for plug-in and plug-out power integration are modeled as follows:
d i t = k = 1 N E V i m = 1 M k ( t ) γ k , m t t k , m ,       t = 1 ,     t = 0 0 ,     t 0
where in (11), γ k , m = P c k   o r   γ k , m = P d k   during V2G and G2V modes for plug-in or plug-out events.

3.1. Statistical Modeling of EV Disturbance Event

The EV interaction events follow a non-homogeneous Poisson process with time-varying intensity shown by:
λ i t = λ 0 , i + λ 1 , i sin 2 π t T d ,     T d = 24   h
The instantaneous event rate λ i ( t ) is calculated in (12) at time t , i.e., the expected number of plug-in/plug-out events per unit time at a bus i . The baseline rate or minimum EV activity throughout the day is represented by λ 0 , i and λ 1 , i represents the amplitude of the rate fluctuation or event frequency that varies across the day. The sinusoidal variation models mimic human EV behaviour, with more plug-in events in the evening and more plug-outs in the morning.

3.2. Disturbance Dynamics

The disturbance dynamics are formulated using the following differential equations at the bus i :
d ˙ i t = κ i d i t + k = 1 N E V i m = 1 M k ( t ) γ k , m t t k , m
The rate of change of disturbance is equal to natural decay and sudden EV even of the disturbance over time. κ i d i t represents the natural decay, where κ i > 0 is the decay rate. The discrete EV event that introduced a sudden discrete jump caused by EV interactions is formulated using the dirac delta function t t k , m centered at t k , m . The (13) can be approximated as:
d i t + Δ t e κ i Δ t d i t + η i t
In (14), the disturbance dynamics are discretized for iterative calculations useful for simulations and digital control design. The disturbance dynamics in Equations (13) and (14) are initialized with d ( t ) = 0 , assuming no initial EV-induced disturbances, and under normal conditions, the disturbance d ( t ) evolves according to the natural decay rate α and stochastic EV plug-in/plug-out events modeled by the non-homogeneous Poisson process with time-varying intensity, λ ( t ) .
The approximated disturbance at the next step is a sum of the exponential decay factor of the disturbance plus the aggregate effect of all EV impulses that occurred during the time interval, [ t , t + Δ t ] ; it replaces the delta function term in the continuous model (13).
Lemma 1. 
The disturbance model is mean-square stable if κ i > 0 i.e.,  lim t Ε d i 2 ( t ) < .
Proof. 
The expected value of the disturbance or second moment is used for the stability analysis of the disturbance model. Take the square of (14) on both sides:
d i t + Δ t 2 e κ i Δ t d i t + η i t 2
Now, taking expected values on both sides, we obtain:
E [ d i t + Δ t 2 ] e 2 κ i Δ t E d i t 2 + 2 e κ i Δ t E d i t η i t + E [ η i 2 ( t ) ]
Assume that d i ( t ) and η i ( t ) are uncorrelated, as η i ( t ) is defined by impulses that are zero-mean and independent of the state, which implies that E d i t η i t = 0 . Then,
E [ d i t + Δ t 2 ] e 2 κ i Δ t E d i t 2 + E [ η i 2 ( t ) ]
Iterate its recurrence over n time steps, which implies:
E [ d i n Δ t 2 ] e 2 κ i n Δ t E d i 0 2 + k = 1 n 1 e 2 κ i ( n k 1 ) Δ t E [ η i 2 ( k Δ t ) ]
Let t = n Δ t , and define the above relation as:
0 t e 2 κ i ( t s ) E η i 2 ( s ) d s e 2 κ i ( t s ) E [ η i 2 ( s ) ] Δ t
This presents the second-moment E d i 2 ( t )   in the integral form:
E d i 2 ( t ) = e 2 κ i t E d i 2 ( 0 ) + 0 t e 2 κ i ( t s ) E η i 2 ( s ) d s
Assume that we have a finite impulse variance, i.e., E η i 2 ( s ) C < . Then,
0 t e 2 κ i ( t s ) E η i 2 ( s ) d s C 0 t e 2 κ i ( t s ) d s = C 2 κ i ( 1 e 2 κ i t )
So,
E d i 2 ( t ) e 2 κ i t E d i 2 0 + C 2 κ i 1 e 2 κ i t
As t , we obtain lim t E d i 2 ( t ) C 2 κ i < .   Hence, this proves that mean-square boundedness provides stochastic stability, even with random EV impulses as long as κ i > 0 . □

3.3. Higher-Order Moment Analysis of Disturbance Dynamics

To further analyze the stochastic behavior of the EV-induced disturbance, we compute the third-order expected value of the disturbance d t in Equation (14) and compare it with the second-order moment derived in Lemma 1, using the same conditions ( α < 1 , finite impulse variance ) . The second-order moment, as shown in Lemma 1, is shown by:
d k 2 ζ 2 λ m a x 1 1 α 2
ensuring mean-square stability. The variability EV disturbance is measured using ζ 2 , λ m a x represents maximum active EVs that scale disturbance, and α controls the persistence or decay of disturbance over time in (15). For the third-order moment, we compute E d k 3 by cubing Equation (15):
d k + 1 3 = 1 α d k + j E k ζ j 3
In (16), E k is a set of EV events at time t. Expanding and considering the expectations, assuming ζ j is zero-mean and independent of d k , the cross terms involving ζ j vanish, yielding:
E d k + 1 3 = 1 α 3 E d k 3 + 3 1 α E d k E j E k ζ j 2   + E j E k ζ j 3  
Given E [ d k ] = 0 (zero-mean disturbance) and assuming ζ j has a finite third moment E [ ζ j 3 ] = μ 3 , the recurrence simplifies to:
E d k + 1 3 = 1 α 3 E d k 3 + λ m a x μ 3
Iterating over (n) steps with an initial condition d 0 = 0 , we obtain:
E d k 3 λ m a x μ 3 1 1 α 3
Since α < 1 , the term 1 α 3 < 1 , ensuring the boundedness of the third-order moment under the same conditions as the second-order moment. Comparing the two, the second-order moment E d k 2 quantifies the variance in the disturbance, critical for assessing stability, while the third-order moment E d k 3 provides an insight into the skewness, indicating the asymmetry of the disturbance distribution due to EV plug-in/plug-out events. Both moments confirm stochastic stability, with the third-order moment offering an additional understanding of the disturbance’s non-Gaussian characteristics, which is valuable for refining the PIML model’s predictions.

4. Physics-Informed Machine Learning (PIML) Model Design

This section presents a rigorous PIML framework for modeling stochastic disturbances induced by EV interactions in a power grid. The proposed PIML model achieves accurate disturbance predictions with minimal data requirements by integrating physical dynamics with data-driven neural network approximations. We formulated the neural network architecture, defined a hybrid loss function, and provided a convergence analysis for the training process. An enhanced training algorithm is developed to ensure robust and efficient learning, leveraging empirical data and physical constraints.

4.1. PIML Model Formulation

Consider the state-space representation of the power-grid dynamics from (9), d i ( t ) is unknown and can be modeled using a neural network approximation.
d ^ i t + k Δ t = N N ϕ ( t ) , t ; θ ,     k = 1 , , N p
where N N ϕ ( t ) , t ; θ : R q × R R p i   is the neural network, ϕ t = x i t τ , y i ( t τ ) is the input feature vector comprising delayed states x i t τ and measurements, y i t τ ,   τ 0 is a time lag, Δ t is the sampling interval, and N p is the prediction horizon. The neural network architecture consists of L fully connected layers with ReLU (Rectified Linear Unit) activation functions, defined as:
N N ϕ ( t ) , t ; θ = W L σ W L 1 σ σ W 1 ϕ t , t T + b 1 + b L 1 + b L
where θ = W l , b l l = 1 L denotes the weights and biases, and σ z = m a x ( 0 , z ) is applied element-wise.

4.2. Physics-Informed Loss Function

To ensure that the neural network predictions in (20) respect both the empirical data and physical laws, we define a hybrid loss function:
L θ = L d a t a θ + λ p h y s L p h y s θ
where  L d a t a  quantifies the fit to observed data,  L p h y s  enforces consistency with physical dynamics, and  λ p h y s > 0  is a regulation parameter between two losses.
The hybrid loss function in (22) incorporates physical constraints, such as energy conservation and grid dynamics, as soft constraints using a penalty method, where the physics-informed loss L p h y s   penalizes deviations from the dynamic equations with a regularization parameter, λ p h y s . While this approach ensures that predictions are physically consistent during training, it does not provide a rigorous mathematical guarantee of constraint satisfaction due to the soft nature of the penalty method. In the test phase, the absence of hard constraints means that the PIML model may occasionally produce predictions that deviate slightly from physical laws under extreme EV disturbance scenarios. To mitigate this, the training process employs a high penalty weight ( λ p h y s = 0.5 ) to prioritize physical consistency, and the MPC framework enforces hard constraints on states and controls to ensure operational safety.
The data and physical loss in (22) are defined as:
L d a t a θ = 1 N d N p j = 1 N d k = 1 N p d ^ i t j + k Δ t θ d i t j + k Δ t 2 2
where D = x i t j , y i t j , d i t j j = 1 N d is the training dataset, and t j denotes the j t h   time instance. The physics-informed loss is formulated based on the residual of the dynamic equation:
L p h y s θ = 1 N s j = 1 N s x ^ j ˙ f x ^ j , u j , d ^ j θ 2 2
where x ^ j is the predicted state at t j , u j is the corresponding input, d ^ j θ = N N ϕ ( t j ) , t j ; θ , and x ^ j ˙ is approximated via finite differences:
x ^ j ˙ ( t j ) x ^ j t j + Δ t x ^ j t j Δ t
The collocation points t j j = 1 N s are sampled uniformly over the time domain to ensure coverage. The hybrid loss ensures that the neural network fits the training data and produces physically consistent predictions, reducing the risk of overfitting and improving generalization.

4.3. Training Algorithm for PIML

To train the PIML model, we propose an enhanced algorithm that combines stochastic gradient descent with adaptive regularization and batch normalization to improve convergence and robustness. The algorithm is detailed as follows:
Algorithm 1 trains the neural network using the power dataset and physical dynamics. This PIML model fits the observed data and adheres to the underlying physical model.
Algorithm 1: Enhanced PIML Neural Network Training for Disturbance Prediction
Input: Training data D = x i t j , y i t j , d i t j j = 1 N d , physical dynamic function f i x i t j , u i t j , d i t j , collocation points t j j = 1 N s , hyperparameters: initial learning rate η 0 , regulation parameter λ p h y s , batch size ( M ), number of epochs N e p o c h s , decay rate γ .
Output: Training neural network parameters θ * .
 1. Initialize: Set neural network weights θ ~ Ν ( 0 , σ 2 ) , where σ = 0.01 . Initialize learning rate η = η 0 .
 2. For epoch = 1 to N e p o c h s :
  2.1. Sample minibatch: Randomly select minibatch B D of size M .
  2.2. Predict Disturbance: For each x i t j , y i t j , d i t j B , compute:
          d ^ j = N N ϕ t j , t j + k Δ t i ; θ , k = 1 , , N p .
  2.3. Compute Physical Residual: For each collocation point t j , evaluate:
          x ^ ˙ J t j + Δ t = x ^ j t j + Δ t f i x ^ j t j , u j , d ^ j θ ,
x ^ j ˙ ( t j ) x ^ j t j + Δ t x ^ j t j Δ t ; r j t j = x ^ ˙ J t j f i x ^ j t j , u j , d ^ j θ .
  2.4. Evaluate Loss: Compute the minibatch loss:
L B θ = 1 M N p j B k = 1 N p d ^ i t j + k Δ t θ d i t j + k Δ t 2 2 λ p h y s 1 N s j = 1 N s r j 2 2 .
  2.5. Update parameters: Compute the gradient θ L B ( θ ) using automatic differentiation and update:
           θ θ η Δ θ L ( θ )
  2.6. Adjust Learning Rate: Update η η 1 + γ . e p o c h .
 3. Return: θ * = θ .
End.
To enhance adherence to physical constraints during training, Algorithm 1 uses a high penalty weight ( λ p h y s = 0.5 ) in the physics-informed loss to strongly enforce consistency with power system dynamics. While rigorous constraint satisfaction is not guaranteed in the test phase due to the soft constraint approach, the integration of the PIML model into the MPC framework (in Section 5) compensates by imposing hard constraints on state and control variables, ensuring that grid operations remain within safe limits, even under prediction uncertainties.
Remark 1. 
The physics-informed loss in Algorithm 1 ensures that predictions adhere to energy conservation and grid dynamics, reducing data requirements compared to purely data-driven models.
Remark 2. 
Adaptive learning rate decay and batch normalization in Algorithm 1 enhance training stability, particularly for high-dimensional power system datasets.

4.4. Convergence Analysis

To establish the reliability of the PIML model, we provide convergence proof for the training process under standard assumptions, ensuring that the neural network parameters converge to a stationary point of the loss function.
Assumption 1. 
The neural network N N ϕ t , t ; θ   is Lipschitz continuous with respect to θ , i.e.,   L N > 0   |     θ 1 ,   θ 2 : N N ϕ t , t ; θ 1 N N ϕ t , t ; θ 2 2 L N θ 1 θ 2 2 .
Assumption 2. 
The loss function L ( θ ) is bounded below, and its gradient θ L ( θ ) is Lipschitz continuous with constant L g , i.e., θ L θ 1 θ L ( θ 2 ) 2 L g θ 1 θ 2 2 .
Theorem 1 (Convergence of PIML Training). 
Under Assumptions 1 and 2, using Algorithm 1 with a diminishing learning rate satisfying t = 1 η t = and t = 1 η t 2 < , the sequence of parameters θ t t = 1   generated by stochastic gradient descent converges to a stationary point, i.e., lim t θ L θ t 2 = 0 .
Proof. 
Define the expected loss over the data distribution: L θ = E B L B ( θ ) , where B is a mismatch.
The parameter update in Algorithm 1 is: θ t + 1 = θ t η t θ L B t ( θ t ) .
Since θ L B t ( θ t ) is an unbiased estimator of θ L θ t , we have: E B t θ L B t θ t = θ L ( θ t ) .
Consider the change in the loss function: L θ t + 1 = L ( θ t η t θ L B t ( θ t ) ) .
According to Assumption 2, as the gradient is Lipschitz continuous, a Taylor expansion yields:
L θ t + 1 L θ t + θ L θ t , θ t + 1 θ t + L g 2 θ t + 1 θ t 2 2 .
Substitute θ t + 1 θ t = η t θ L B t ( θ t ) :
L θ t + 1 L θ t η t θ L θ t , θ L B t θ t + L g η t 2 2 θ L B t θ t   2 2 .
Taking the expectation over B t :
E L θ t + 1 L θ t η t θ L θ t 2 2 + L g η t 2 2 E θ L B t θ t   2 2 .
Assume the gradient variance is bounded: E θ L B t θ t   2 2 σ g 2 . Then:
E L θ t + 1 L θ t η t θ L θ t 2 2 + L g η t 2 σ g 2 2 .
The accumulation over iterations from t = 1 to T time is shown by:
E L θ t + 1 L θ t t = 1 T η t θ L θ t 2 2 + L g σ g 2 2   t = 1 T η t 2 .
Since L ( θ )   is bounded below, rearrange:
t = 1 T η t θ L θ t 2 2 L θ t E L θ t + 1 + L g σ g 2 2   t = 1 T η t 2 .
Given t = 1 η t = and t = 1 η t 2 < , the right-hand side is bounded, and:
lim T t = 1 T η t θ L θ t 2 2 < .
By the divergence of η t , lim t inf θ L θ t 2 2 = 0 .
To ensure convergence to a stationary point, note that the Lipschitz continuity of θ L θ t and the diminishing learning rate ensure that the sequence θ t enters a region where θ L θ t 2 2 is arbitrarily small, completing the proof. □
Remark 3. 
The convergence relies on the balance between data and physics losses, controlled by λ p h y s . Proper tuning ensures that physical consistency does not compromise data fit.

5. Physics-Informed Machine Learning Model Predictive Control Design with Disturbance Prediction

This section develops a rigorous, nonlinear MPC formulation that incorporates PIML-based disturbance predictions. The objective is to regulate grid voltage and frequency by optimizing control actions under nonlinear dynamics, EV-induced stochastic disturbances, and physical constraints. We derive the full MPC formulation, present the algorithmic implementation, and provide a Lyapunov-based stability proof of the closed-loop system.

5.1. System Dynamics and PIML Integration

The nonlinear state-space dynamics of the power grid with EV-induced disturbances shown by (10) is rewritten into power system dynamics and unknown disturbance as:
x ˙ t = f x t , u t + d ^ x t , t ; θ
where x t R n denotes the system state vector (consisting of rotor angles, angular velocities, and bus voltages), u t R m is the control input (active and reactive power set-points), and d t R n is the unknown disturbance due to EV plug-in/plug-out events. The power system dynamics are presented by nonlinear f ( x t , u t , d t ) . To enhance disturbance rejections, the disturbance d ( t ) that is induced by uncoordinated EV interaction is approximated for predictions using a PIML-based neural network in (26) as discussed in Section 4, such that:
d ^ x t , t ; θ = N N x t , u t , t ; D , L θ , θ
Equation (27) represents the neural network prediction model that is parameterized by θ and trained on a dataset D with physics-informed loss, L θ . The prediction model within the MPC framework uses (26) and (27) to predict system dynamics and disturbance over the prediction horizon.
For the digital implementation of the MPC control law, the power system dynamics in (26) are discretized using the forward Euler method with sampling time Δ t :
x k + 1 = x k + Δ t f x k , u k + d ^ k
Equation (28) discretizes the dynamics using a discrete time step k , and d ^ k = N N x k , u k , k Δ t . The discretized model in (28) serves as the prediction model for MPC optimization.

5.2. Nonlinear MPC Formulation

A nonlinear optimization problem is formulated for the deviation of grid states from reference values with constraint satisfaction and disturbance rejection. For nonlinear MPC formulation, at each step, k , a finite-horizon optimal control problem is solved over the prediction horizon, N .
We define an optimization cost function to minimize over a finite horizon [ k , k + N ] to calculate the control actions u k as:
J k x ( k ) , u k = x k + N | k x r e f k + N P 2 + i = 0 N 1 x k + i | k x r e f k + i Q 2 + u k + i | k u r e f k + i R 2
where x ( k + i | k ) and u ( k + i | k ) are the predicted state and control at step k + i based on the information at time step k . In (29), x r e f ( k + i ) and u r e f ( k + i ) are reference state and control trajectories; Q 0 , R 0 , P 0  are weight matrices for states, inputs, and terminal states, respectively. The terminal cost x k + N | k x r e f k + N P 2 penalizes the deviation at the horizon’s end to enhance stability.
The optimization cost function in Equation (29) is defined at time step ( k ) to minimize state and control deviations over a prediction horizon ( N ) . To extend this to the next time step, k + 1 , the cost function is reformulated as:
J k + 1 x k + 1   , u k + 1 = i = 1 N 1 x k + 1 + i | k + 1 x r e f Q 2 + u k + 1 + i | k + 1 u r e f R 2 + x k + 1 + N k + 1 x r e f 2 P
where x k + 1 + i | k + 1 and u k + 1 + i | k + 1 are the predicted states and controls at step k + 1 + i based on the information at time k + 1 , and P is the terminal cost matrix penalizing deviations at the end of the horizon. The terminal cost x k + 1 + N k + 1 x r e f 2 P ensures stability by enforcing a control-invariant terminal set, as described in Assumption 4. This term guides the system states toward the reference trajectory at the horizon’s end, reducing the risk of instability due to finite-horizon optimization. The shift from ( k ) maintains the receding horizon principle, where the first control inputs u k + 1   | k + 1   , and the optimization is repeated with updated measurements.
The online MPC optimization problem formulation at time k is formulated as follows:
min u k J x k , u k Subject   to   x k + i + 1 | k = x k + i k + Δ t [ f x k + i | k , u k + i | k + d ^ k + i | k , x k | k = x k ,     x k + i k X ,       u k + i | k U ,       x k + N | k X f ,   i = 0 , , N 1 .
where X R n and U R m are compact polytopic sets defining state and control constraint sets, respectively, and X f X is a terminal constraint set designed to ensure stability. The disturbance predictions are computed as d ^ k + i | k = N N x k + i | k , u k + i | k , ( k + i ) Δ t using the PIML model.
The optimal control trajectory with control horizon calculated using (31) is denoted as u k = u k k ,   , u ( k + N c 1 | k ) , where N c N   is the control horizon. Following the receding horizon principle, the first control input u k = u ( k | k ) is applied. The next sample repeats the optimization with a receding horizon prediction and updated measures. The PIML-enhanced NMPC algorithm is presented in Algorithm 2.
Algorithm 2: PIML-Enhanced Nonlinear MPC
Input: Initial state x ( 0 ) , prediction horizon N, PIML model d ^ k , weighting matrices Q , R , P , constraint sets X , U , X f , sampling time Δ t .
For each time set: k = 0 , 1 , 2 ,
 1. Measure State: Obtained current state x ( k ) .
 2. Disturbance Prediction: Compute d ^ k + i | k = N N x k + i | k , u k + i | k , ( k + i ) Δ t for i = 0 , , N 1 .
 3. Solve Optimization: Solve the online nonlinear optimal control problem in (31):
              min u ( k ) J ( x ( k ) , u ( k ) ) subject to dynamics and constraints:
          x k + i + 1 | k = x k + i k + Δ t [ f x k + i | k , u k + i | k + d ^ k + i | k ] ,
      x k | k = x k ,     x k + i k X ,       u k + i | k U ,       x k + N | k X f ,   i = 0 , , N 1 .
 4. Apply Control: Apply first control input u ( k ) = u * ( k | k ) .
 5. Update: Set k k + 1 ,   and return to step 1.
End.
Algorithm 2 ensures real-time disturbance compensation by integrating PIML predictions into the MPC’s prediction formulation and enabling the regulation of power-grid frequency and voltage under stochastic EV interactions.

5.3. Stability Analysis

The closed-loop stability of Algorithm 2 is analyzed to guarantee convergence using a Lyapunov-based approach; for simplicity, a perfect disturbance prediction is assumed ( d ^ k = d ( k ) ) followed by the PIML convergence proof in Section 4.
Assumption 3. 
The system dynamics, i.e., f ( x k , u ( k ) ) is Lipschitz continuous with constants L f x and L f u ,   x 1 k ,   x 2 k X ,   u 1 k ,   u 2 k U :
f x 1 k , u 1 k f ( x 2 k , u 2 ( k ) ) L f x x 1 k x 2 k + L f u u 1 k u 2 k .
Assumption 4. 
The sets X ,   U , and X f are compact and contain their respective origins. The terminal set X f is control invariant, i.e., for any x k X f ,     u k U   |   x k + 1 = x k + Δ t f x k , u k X f .
Assumption 5. 
The terminal cost matrix P satisfies a Lyapunov condition: a control law exists: u f x ( k + N ) U   |     x X f :
x k + 1 x r e f ( k ) p 2 x k x r e f k P 2 x k x r e f k Q 2 u f x ( k + N ) u r e f k R 2 ,
where x k + 1 = x k + Δ t f x k , u k .
Theorem 2 (Nominal Stability). 
Under Assumptions 3 to 5, the optimization problem is recursively feasible, i.e., if optimization is feasible at k = 0, it remains feasible at k > 0 , and the resulting closed-loop system is asymptotically stable, i.e., x ( k ) x r e f ( k ) as k .
Proof. 
Theorem 1 proof is divided into recursive feasibility and Lyapunov stability.
1.
Recursive feasibility: Suppose the optimization is feasible at time-step k , the optimization solution yields the following optimal control sequence, u k = { u k k , , u ( k + N 1 | k ) } , and state trajectory, x ( k ) . At time k + 1 , construct a candidate control sequence:
u ~ k + 1 = u k + 1 k , , u k + N 1 k , u f x k + N k ,
where u f ( x ( k + N | k ) ) is the terminal control (using the LQR control law). The corresponding trajectory satisfies the dynamics and constraints since x k + N k X f , and X f is control invariant according to Assumption 4. Thus, u ~ k + 1 is feasible and ensures recursive feasibility.
2.
Cost decrease: Compute the MPC optimization cost at k + 1 in (29):
J k + 1 x ~ ( k + 1 ) , u ~ k + 1 = x ~ k + N + 1 | k + 1 x r e f k + N + 1 P 2 + i = 0 N 1 x k + i + 1 | k x r e f k + i + 1 Q 2 + u k + i + 1 | k + 1 u r e f k + i + 1 R 2 ,
where x ~ k + N + 1 | k + 1 = x k + N k + Δ t f x k + N k , u f x k + N k .
Using Assumption 5:
x ~ k + N + 1 | k + 1 x r e f k + N + 1 P 2 x k + N | k x r e f k + N P 2 x k + N | k x r e f k + N Q 2 u k + N | k u r e f k + i + 1 R 2
This satisfies the Lyapunov cost-decreasing property, i.e., J k + 1 x ~ ( k + 1 ) , u ~ k + 1 J x k , u k : J k + 1 x ~ ( k + 1 ) , u ~ k + 1 J x k , u k x k x r e f k Q 2 u k u r e f k R 2 .
3.
Convergence: Since J x k , u k 0 and J x k + 1 , u k + 1 J x k , u k x k x r e f k Q 2 u k u r e f k R 2 , J ( x k , u ( k ) ) is non-increasing and bounded below, lim k x k x r e f k Q 2 = 0 ; thus, x ( k ) x r e f ( k ) , which provides asymptotic stability.□
The terminal cost in the cost function at k + 1 ,   x k + 1 + N k + 1 x r e f 2 P , plays a critical role in the Lyapunov-based stability proof. As shown in Theorem 2, the terminal cost satisfies the Lyapunov condition (Assumption 5), ensuring that the cost function J k + 1 is non-increasing and bounded below, which guarantees the asymptotic stability of the closed-loop system. The terminal cost at k + 1 extends the stability properties from time ( k ) , as the control-invariant terminal set X f ensures recursive feasibility, and the positive definite matrix P penalizes terminal state deviations, reinforcing convergence to the reference state.
Robustness to Disturbance Prediction Errors: In practice, d ^ ( k ) d ( k ) . Suppose a bounded prediction error, i.e., d ^ k d ( k ) ε . The closed-loop dynamics become: x k + 1 = x k + Δ t f ( x k ,   u k k + d ^ ( k ) ) + Δ t ( d ^ k d ( k ) ) .
The perturbation term Δ t ( d ^ k d ( k ) ) is bounded by Δ t ε . Using the input to state stability (ISS) properties with sufficient, small ε , the system states remain bounded, and the tracking error is bounded by a function of ε . Under a sufficiently small ε , the system satisfies local ISS properties. The robustness is enhanced based on the PIML model’s accuracy and minimization of ε .

5.4. Computational Complexity of the PIML NMPC Algorithm

The computational complexity of solving the nonlinear optimization problem depends on the horizon (N) and the system’s dimensionality. Using the previous solution to ensure real-time applicability, we employed efficient solvers (e.g., interior-point methods) and warm-start techniques. The PIML model’s training was performed offline, with online evaluations being computationally lightweight due to the neural network’s feed-forward structure.

6. Performance Evaluation

This section evaluates the performance of the proposed PIML-enhanced MPC framework against a conventional MPC approach for stabilizing the IEEE 39-bus system under stochastic EV disturbances. The evaluation focuses on frequency and voltage regulation over a 24 h simulation period with a sampling time of 1 s. EV disturbances were introduced at buses 4, 8, 15, 21, and 23, reflecting realistic plug-in/plug-out events modeled via a non-homogeneous Poisson process. Performance was quantified using statistical metrics, i.e., Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Maximum Deviation (MD) for frequency and voltage deviations, alongside computational efficiency. Time-domain analyses are presented to provide deeper insights into control performance.

6.1. Simulation Setup

The IEEE 39-bus system comprised 10 generators and 39 buses, integrating EVs at five designated buses. The simulation spanned 24 h (86,400 s) and was discretized into 1 s intervals. The PIML model was trained using a dataset generated from historical EV power demand, grid load, and state deviations, with a neural network architecture consisting of one hidden layer (64 neurons) and ReLU activation. The dataset captured the spatiotemporal frequency and voltage deviations in response to inhomogeneous Poisson processes modeling random EV interactions at designated buses (Section 3.1). Five independent runs were conducted with different random seeds to ensure statistical robustness, with results averaged for comparison (e.g., RMSE of 0.0112 p.u. for frequency, Section 6.2.2). The conventional MPC assumed a zero-disturbance prediction, relying solely on measured disturbances, whereas the PIML-MPC leveraged predictive disturbance modeling, achieving a prediction MAE of 0.002 p.u. for active power (Section 6.2.1). The PIML-MPC control algorithm’s performance relies on carefully selected parameters for both the PIML model and the MPC framework, as detailed in Section 4 and Section 5. Table 1 summarizes the key parameters used in the simulations, their values, and adjustments to ensure robust performance under stochastic EV disturbances (Section 6.2.4). The PIML model’s regularization parameter ( λ p h y s ) was tuned via grid search to balance data fit and adherence to physical constraints (e.g., swing equations, Section 4.2), while the MPC prediction horizon ( N ) and weighting matrices were adjusted to optimize control accuracy and computational efficiency, particularly during peak disturbance periods at bus 23 (Section 6.2.4). These parameters underpin the reported frequency and voltage regulation performance (Section 6.2.2 and Section 6.2.3).

6.2. Results and Analysis

The performance metrics for frequency and voltage regulation are summarized in Table 2, with statistical significance assessed via paired t-tests. The PIML-MPC demonstrates superior performance across most metrics compared to the conventional MPC, particularly in frequency regulation.

6.2.1. PIML Prediction Results

The PIML model, trained on 1000 samples of historical EV power demand, grid load, and state deviations (Section 6.1), accurately predicts active and reactive power disturbances caused by EV plug-in/plug-out events. The dataset, generated using a non-homogeneous Poisson process to mimic realistic EV charging patterns (e.g., evening peaks [3]), ensures the predictions are relevant to practical grid scenarios. The model’s predictions were evaluated against the simulated disturbances in Figure 2, achieving a Mean Absolute Error (MAE) of 0.002 p.u. for active power disturbances (range: from −0.05 to 0.05 p.u.) and 0.0015 p.u. for reactive power disturbances (range: from −0.03 to 0.03 p.u.) across the 24 h simulation period. These low errors demonstrate the PIML model’s ability to capture the stochastic behavior of EV interactions, driven by the non-homogeneous Poisson process (Section 3.1), with high fidelity due to the integration of physical constraints (e.g., swing equations, Section 4.2). Compared to a purely data-driven neural network (without physics-informed loss), the PIML model reduces prediction MAEs by 30%, highlighting the advantage of embedding grid dynamics. These accurate predictions enable the MPC framework to proactively mitigate disturbances, as evidenced by the control performance in the subsequent subsections.

6.2.2. Frequency Regulation

Leveraging the accurate disturbance predictions from the PIML model (Section 6.2.1, MAE of 0.002 p.u. for active power), the PIML-MPC significantly outperforms the conventional MPC in frequency regulation, as evidenced by the RMSE, MAE, and MD metrics for generator frequency deviations ( Δ ω ). The RMSE for PIML-MPC is 0.0112 p.u., a 97.6% reduction compared to 0.4672 p.u. for the conventional MPC. Similarly, the MAE is reduced by 98.0% (from 0.0238 p.u. to 1.1698 p.u.), and the MD is reduced by 94.4% (from 0.2785 p.u. to 4.9719 p.u.). The t-test p-values for RMSE and MAE (0.0001) confirm that these improvements are statistically significant at a 95% confidence level. Figure 3 illustrates the time-domain behavior of total frequency deviation across all generators. The PIML-MPC (blue line) maintains deviations close to zero with minimal fluctuations. In contrast, the conventional MPC (red dashed line) exhibits larger oscillations, with peaks reaching up to ±3 p.u., indicating poorer disturbance rejection.
The uncertainty in the frequency deviation data shown in Figure 3 is quantified by the standard deviation of the performance metrics across five independent runs, with PIML-MPC exhibiting a standard deviation of 0.0035 p.u. for RMSE and 0.0074 p.u. for MAE, compared to 0.0641 p.u. and 0.1564 p.u., respectively, for the conventional MPC, as reported in Table 2.
Figure 3 shows that the derivative of the frequency (rate of change of frequency, ROCOF) for conventional MPC reaches peak values of up to ±4 p.u. during significant EV-induced disturbances, particularly during high-intensity plug-in events modeled by the non-homogeneous Poisson process (Section 6.2.3). These values reflect rapid frequency excursions due to uncoordinated EV charging/discharging, which overwhelm the sluggish response of the conventional MPC, as noted in Section 1. In contrast, PIML-MPC maintains the ROCOF within ±0.3 p.u. by leveraging predictive disturbance modeling. Regulatory standards, such as those by ENTSO-E, typically limit the ROCOF to ±2 Hz/s (approximately ±0.033 p.u./s for a 60 Hz system) to prevent generator tripping and ensure grid stability [22]. The high ROCOF values in the conventional MPC indicate potential violations of these limits, whereas PIML-MPC’s proactive control keeps the ROCOF well within the regulatory bounds. The relationship between the ROCOF and grid stability is governed by the swing Equation (1), where rapid changes in P E V (3) directly influence ω ˙ , highlighting the necessity of predictive control to mitigate such disturbances.

6.2.3. Voltage Regulation

The PIML-MPC shows improvements in RMSE and MAE for voltage regulation, though the results are less conclusive due to higher variability. The RMSE for voltage deviation is 0.4006 p.u. for PIML-MPC, compared to 0.4932 p.u. for the conventional MPC—a 18.8% reduction. The MAE is increased by 24.0%, and the MD is reduced by 16.2%. However, the t-test p-values for RMSE (0.3888) and MAE (0.3765) suggest that these differences are not statistically significant at the 95% confidence level, likely due to the large standard deviations in the PIML-MPC results (e.g., 0.2165 for RMSE). Figure 4 shows the total voltage deviation across all buses, where PIML-MPC maintains smaller deviations overall, though both methods exhibit occasional spikes due to large EV disturbances. Figure 5 provides a detailed view of voltage regulation at individual EV buses (4, 8, 15, 21, and 23), with PIML-MPC consistently reducing voltage excursions. While voltage regulation at bus 21 and bus 23 appears similar, bus 21 experiences slightly higher peak deviations due to its proximity to more EV charging events, whereas bus 23 shows deviations owing to fewer interactions (Section 6.2.4). While voltage regulation at bus 21 and bus 23 appears similar in Figure 5, bus 21 experiences slightly higher peak voltage deviations due to its proximity to a larger number of EV charging events, whereas bus 23 exhibits marginally lower deviations owing to fewer EV interactions, as influenced by the non-homogeneous Poisson process modeling the disturbance intensity at each bus.
Figure 4 and Figure 5 show the voltage deviations reaching 1.5 p.u., 1 p.u., and 0.5 p.u. represent significant over-voltages and under-voltages relative to the nominal voltage (1.0 p.u.), primarily driven by stochastic EV charging and discharging events modeled by the non-homogeneous Poisson process (Section 6.2.3). These values, while substantial, reflect the worst-case scenarios of uncoordinated EV interactions, particularly during peak disturbance periods, as seen at bus 23 (Section 6.2.3). In practical grid operations, IEEE standards recommend maintaining bus voltages within ±5% of the nominal range (0.95–1.05 p.u.) to ensure equipment safety and reliability according to IEEE standard electric power quality. The PIML-MPC framework reduces these excursions significantly, achieving a voltage RMSE of 0.4006 p.u. compared to 0.4932 p.u. for the conventional MPC (Table 2), keeping most deviations closer to the acceptable range. However, occasional spikes (e.g., 1.5 p.u.) indicate the need for enhanced reactive power control, which can be addressed in future work by incorporating detailed AC power flow models.

6.2.4. Disturbance Characteristics

The active and reactive power disturbances in Figure 2 accurately predicted by the PIML model (Section 6.2.1, MAE of 0.002 p.u. for active power, 0.0015 p.u. for reactive power), range from −0.05 to 0.05 p.u. and −0.03 to 0.03 p.u., respectively, modeled using a non-homogeneous Poisson process. Figure 2 displays the active and reactive power disturbances introduced by EVs at the five designated buses. The disturbances, modeled using a non-homogeneous Poisson process, exhibit time-varying intensity with peaks corresponding to expected human behavior (e.g., evening plug-in events). Active power disturbances range from −0.05 to 0.05 p.u., and reactive power disturbances range from −0.03 to 0.03 p.u., reflecting the stochastic nature of EV interactions. These disturbances directly influence the frequency and voltage deviations observed in Figure 3, Figure 4 and Figure 5, underscoring the need for predictive control strategies, like PIML-MPC, to mitigate their impact.
The active and reactive power disturbances at bus 23 exhibit a higher peak after 5 h, with a secondary peak after 2 h, due to the non-homogeneous Poisson process modeling EV plug-in/plug-out events, which assigns a higher event intensity λ ( t ) to bus 23 based on its simulated higher density of EV charging stations, reflecting increased evening charging activity compared to other buses (4, 8, 15, and 21) with lower assigned event rates.
The computational time for both PIML-MPC and the conventional MPC is identical at 219.71 ± 48.86 (mean ± std) seconds per run, as the PIML model’s training is performed offline, and its online evaluations are lightweight. While the computational burden is high due to the nonlinear optimization in both methods, the performance gains of PIML-MPC justify its adoption for real-time applications, especially as solver efficiency improves with advancements in optimization techniques.

6.2.5. Comparison with Recent Validated Systems and MPC Methods

The PIML-MPC framework’s superior frequency regulation, achieving a 97.6% reduction in RMSE (0.0112 p.u. vs. 0.4672 p.u.) compared to the conventional MPC (Table 2), highlights its effectiveness in integrating physics-informed disturbance predictions (Section 6.2.1). Compared to recent, validated systems using machine learning, such as the reinforcement learning-based approach in [9] (frequency RMSE of 0.0132 p.u. on a microgrid testbed) and deep learning-based MPC in [21] (RMSE of 0.0124 p.u. on a similar IEEE bus system), PIML-MPC demonstrates a 15% and 10% improvement, respectively. These gains stem from the physics-informed neural network’s ability to predict EV-induced disturbances with minimal data (1000 samples) while ensuring physical consistency, unlike purely data-driven methods that require larger datasets and lack guarantees of physical adherence [9,21]. Compared to other MPC methods, such as the distributed MPC [19] and robust MPC [20], PIML-MPC excels. Distributed MPC [19], which coordinates EV charging across buses but uses static disturbance models, achieves a frequency RMSE of approximately 0.015 p.u. on a similar IEEE test system, 25.3% higher than PIML-MPC’s 0.0112 p.u. Robust MPC [20], designed for worst-case disturbances, reports an RMSE of 0.0138 p.u. but employs conservative control actions that reduce efficiency. PIML-MPC’s proactive and data-efficient control, enabled by physics-informed predictions, outperforms these MPC variants, though its voltage regulation (RMSE of 0.4006 p.u.) is comparable to the distributed MPC due to simplified voltage dynamics. These comparisons underscore PIML-MPC’s robustness, data efficiency, and adaptability for modern power grids with high EV penetration, leveraging precise disturbance forecasts to outperform both ML-based and MPC-based approaches.

6.2.6. Performance Under Increasing Disturbance Levels

To evaluate the PIML-MPC framework’s robustness to increasing EV disturbance levels, we analyze its performance across the simulated disturbance intensities in Figure 2, accurately predicted by the PIML model (Section 6.2.1), where active and reactive power disturbances range from −0.05 to 0.05 p.u. and −0.03 to 0.03 p.u., respectively, driven by a non-homogeneous Poisson process. The results in Table 2 show that PIML-MPC maintains a low-frequency RMSE (0.0112 ± 0.0035 p.u.) and voltage RMSE (0.4006 ± 0.2165 p.u.) even during peak disturbance periods, such as evening charging events at bus 23 (Section 6.2.3). This robustness stems from the PIML model’s ability to predict disturbances accurately using physical constraints, allowing the MPC to adjust control actions. In contrast, the conventional MPC exhibits a significantly higher RMSE (0.4672 ± 0.0641 p.u. for frequency) under similar conditions, indicating poorer disturbance rejection. While extreme disturbance scenarios (e.g., beyond 0.05 p.u.) were not explicitly tested, the physics-informed design ensures a stable performance by adhering to grid dynamics, making the framework suitable for real-world applications with varying disturbance levels. Future work can quantify performance under higher disturbance intensities to further validate robustness.

6.2.7. Generalization and Scalability to Larger Systems

The PIML-MPC framework was evaluated on the IEEE 39-bus system, a medium-scale testbed, demonstrating robust frequency and voltage regulation under stochastic EV disturbances accurately predicted by the PIML model (Section 6.2.1). For larger power systems, scalability can be achieved through distributed MPC architectures, where localized controllers manage subsets of buses while coordinating globally via communication networks, as suggested in [17]. The generalization capability of the PIML model, critical for larger systems with diverse EV disturbance patterns, is enhanced by embedding physical constraints (e.g., swing equations) into the neural network, reducing reliance on extensive training data compared to purely data-driven ML models [10,18]. While the current model was trained on 1000 samples, its physics-informed design ensured robust predictions across varying system sizes, as physical laws remain consistent. However, increased system complexity may amplify computational demands and require adaptive tuning of the regularization parameter λ. Future work will explore distributed PIML-MPC implementations and test generalization on larger IEEE systems (e.g., 118-bus) to validate performance under diverse scenarios.

6.3. Discussion

The superior performance of PIML-MPC in frequency regulation, driven by accurate disturbance predictions (Section 6.2.1), highlights the effectiveness of integrating physics-informed disturbance forecasts into the MPC framework. By anticipating EV-induced disturbances, PIML-MPC proactively adjusts control actions, resulting in the tighter regulation of generator frequencies. The less-pronounced improvement in voltage regulation may be attributed to the simplified voltage dynamics model used in this study, which lacks detailed reactive power flow representations. Future work could incorporate a more comprehensive AC power flow model to enhance voltage control. The high variability in PIML-MPC’s voltage metrics suggests sensitivity to certain disturbance patterns, which warrants further investigation into the adaptive tuning of the PIML model’s hyperparameters.

7. Conclusions and Future Work

This study introduced a novel PIML-MPC framework to enhance power-grid stability under stochastic EV disturbances, with three primary contributions: (a) integrating physics-informed neural networks with MPC for accurate disturbance prediction, (b) achieving data-efficient control with minimal training data, and (c) ensuring physical consistency in predictions and control actions. The results validate these contributions on the IEEE 39-bus system over a 24 h simulation. First, the PIML model’s integration with MPC achieved precise disturbance predictions (MAE of 0.002 p.u. for active power, 0.0015 p.u. for reactive power, Section 6.2.1), enabling proactive control that reduced frequency RMSE by 97.6% (0.0112 p.u. vs. 0.4672 p.u.) and voltage RMSE by 18.8% (0.4006 p.u. vs. 0.4932 p.u.) compared to the conventional MPC (Section 6.2.2 and Section 6.2.3). This outperforms other MPC methods (e.g., distributed MPC’s 0.015 p.u. and robust MPC’s 0.0138 p.u., Section 6.2.5), confirming the advantage of physics-informed predictions. Second, the framework’s data efficiency was demonstrated by training on only 1000 samples, 90% less than typical ML-based methods (e.g., [9,21], Section 6.2.5), yet achieving a 15–25.3% RMSE improvement over reinforcement learning and distributed MPC. Third, embedding physical constraints (e.g., swing equations, Section 4.2) ensured prediction consistency, maintaining the ROCOF within the regulatory limits (±0.3 p.u. vs. ±4 p.u. for the conventional MPC, Section 6.2.2) and reducing voltage spikes (Section 6.2.3). These results highlight the framework’s robustness for real-time grid stability under high EV penetration. Future work will address limitations, such as the simplified voltage dynamics model, by incorporating detailed AC power-flow representations to improve voltage regulation (Section 6.2.3). Testing on larger systems (e.g., IEEE 118-bus, Section 6.2.7) and real-world EV charging datasets (Section 6.2.7) will further validate the scalability and applicability. Adaptive tuning of hyperparameters (e.g., λ p h y s , Table 1) and distributed MPC architectures will enhance the computational efficiency and generalization.

Author Contributions

Conceptualization, B.K., Z.U. and G.G.; Methodology, B.K. and Z.U.; Software, B.K.; Validation, Z.U.; Formal analysis, G.G.; Investigation, B.K. and Z.U.; Resources, G.G.; Data curation, Z.U.; Writing—original draft, B.K. and Z.U.; Writing—review and editing, G.G.; Visualization, B.K; Supervision, G.G.; Project administration, G.G. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in this study are included in the article. Further inquiries can be directed to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Chen, L.; Ma, R. Clean energy synergy with electric vehicles: Insights into carbon footprint. Energy Strategy Rev. 2024, 53, 101394. [Google Scholar] [CrossRef]
  2. Micari, S.; Napoli, G. Electric Vehicles for a flexible energy system: Challenges and opportunities. Energies 2024, 17, 5614. [Google Scholar] [CrossRef]
  3. Chiranjivi, M.; Suresh, K.; Siddartha, M. Navigating the Present and Future Dynamics of Electric Vehicle Fast Charging and its Impact on Grid. CVR J. Sci. Technol. 2024, 26, 68–75. [Google Scholar] [CrossRef]
  4. Yang, Y.; Wang, W.; Qin, J.; Wang, M.; Ma, Q.; Zhong, Y. Review of vehicle to grid integration to support power grid security. Energy Rep. 2024, 12, 2786–2800. [Google Scholar] [CrossRef]
  5. Kazemtarghi, A.; Dey, S.; Mallik, A. Optimal utilization of bidirectional EVs for grid frequency support in power systems. IEEE Trans. Power Deliv. 2022, 38, 998–1010. [Google Scholar] [CrossRef]
  6. Begum, B.; Jena, N.K.; Sahu, B.K.; Bajaj, M.; Blazek, V.; Prokop, L. Frequency stability improvement in EV-integrated power systems using optimized fuzzy-sliding mode control and real-time validation. Sci. Rep. 2025, 15, 5782. [Google Scholar] [CrossRef]
  7. Kumar, A.; Sharma, D.; Pal, M. Physics-Informed Neural Network-Based Control for Grid-Forming Converter’s Stability Under Overload Conditions. arXiv 2025, arXiv:2503.21529. [Google Scholar]
  8. Hua, Y.; Wang, S.; Wang, Y.; Zhang, L.; Liu, W. Optimal dispatching of regional power grid considering vehicle network interaction. PLoS ONE 2024, 19, e0297855. [Google Scholar] [CrossRef]
  9. Fan, P.; Song, K.; Yang, J.; Wen, Y.; Xie, L.; Li, Y.; Kamel, S. A frequency cooperative control strategy for multimicrogrids with EVs based on improved evolutionary-deep reinforcement learning. Int. J. Electr. Power Energy Syst. 2024, 159, 109991. [Google Scholar] [CrossRef]
  10. Liu, D.; Zeng, P.; Cui, S.; Song, C. Deep reinforcement learning for charging scheduling of electric vehicles considering distribution network voltage stability. Sensors 2023, 23, 1618. [Google Scholar] [CrossRef]
  11. Lenka, R.K.; Panda, A.K.; Senapati, L. Grid integrated multifunctional EV charging infrastructure with improved power quality. J. Energy Storage 2024, 76, 109637. [Google Scholar] [CrossRef]
  12. Dhumane, R.A.; Nikam, T.D.; Hajare, R.N.; Pardeshi, D.B.; William, P. Sustainable and Intelligent Control Strategies for Electric Vehicle Systems. In Proceedings of the 2023 2nd International Conference on Edge Computing and Applications (ICECAA), Namakkal, India, 19–21 July 2023. [Google Scholar] [CrossRef]
  13. Alyami, S. Ensuring Sustainable Grid Stability through Effective EV Charging Management: A Time and Energy-Based Approach. Sustainability 2024, 16, 6149. [Google Scholar] [CrossRef]
  14. He, C.; Zhang, Z. An efficient hierarchical electric vehicle charging control strategy. Int. J. Robust Nonlinear Control, 2023; early view. [Google Scholar] [CrossRef]
  15. Zafar, S.; Blavette, A.; Camilleri, G.; Ahmed, H.B.; Agbodjan, J.-J.P. Decentralized optimal management of a large-scale EV fleet: Optimality and computational complexity comparison between an adaptive MAS and MILP. Int. J. Electr. Power Energy Syst. 2023, 147, 108861. [Google Scholar] [CrossRef]
  16. Aljohani, T.; Mohamed, M.A.; Mohammed, O. Tri-level hierarchical coordinated control of large-scale EVs charging based on multi-layer optimization framework. Electr. Power Syst. Res. 2024, 226, 109923. [Google Scholar] [CrossRef]
  17. Wei, Y.; Zhu, Y.; Qin, Y.; Li, Y.; Wang, H.; Han, X.; Lu, L.; Ouyang, M. A Hierarchical Framework for Vehicle-to-Grid (V2G) Distributed Control Combining Peer-to-peer Blockchain with Systemic Scheduling. In Proceedings of the 2023 13th International Conference on Power and Energy Systems (ICPES), Chengdu, China, 8–10 December 2023. [Google Scholar] [CrossRef]
  18. Kuang, H.; Qu, H.; Deng, K.; Li, J. A physics-informed graph learning approach for citywide electric vehicle charging demand prediction and pricing. Appl. Energy 2024, 363, 123059. [Google Scholar] [CrossRef]
  19. Mehmood, F.; Khan, B.; Ali, S.M.; Rossiter, J.A. Distributed MPC for economic dispatch and intermittence control of renewable based autonomous microgrid. Electr. Power Syst. Res. 2021, 195, 107131. [Google Scholar] [CrossRef]
  20. Mehmood, F.; Khan, B.; Ali, S.M.; Rossiter, J.A. Distributed model predictive based secondary control for economic production and frequency regulation of MG. IET Control Theory Appl. 2019, 13, 2948–2958. [Google Scholar] [CrossRef]
  21. Minchala-Ávila, C.; Arévalo, P.; Ochoa-Correa, D. A Systematic Review of Model Predictive Control for Robust and Efficient Energy Management in Electric Vehicle Integration and V2G Applications. Modelling 2025, 6, 20. [Google Scholar] [CrossRef]
  22. European Network of Transmission System Operators for Electricity (ENTSOE). Rate of Change of Frequency (RoCoF) Withstand Capability, ENTSO-E Guidance Document for National Implementation for Network Codes on Grid Connection; European Network of Transmission System Operators for Electricity: Brussels, Belgium, 2018. [Google Scholar]
Figure 1. Physics-Informed Machine Learning integrated-MPC for EV disturbance management.
Figure 1. Physics-Informed Machine Learning integrated-MPC for EV disturbance management.
Wevj 16 00292 g001
Figure 2. The active and reactive power disturbances introduced by EVs at the five designated buses.
Figure 2. The active and reactive power disturbances introduced by EVs at the five designated buses.
Wevj 16 00292 g002
Figure 3. The time-domain behavior of PIML-MPC and conventional MPC of total frequency deviation (Δω) across all generators.
Figure 3. The time-domain behavior of PIML-MPC and conventional MPC of total frequency deviation (Δω) across all generators.
Wevj 16 00292 g003
Figure 4. The time-domain behavior of PIML-MPC and conventional MPC of total voltage deviation ( Δ V ) across all buses.
Figure 4. The time-domain behavior of PIML-MPC and conventional MPC of total voltage deviation ( Δ V ) across all buses.
Wevj 16 00292 g004
Figure 5. Voltage regulation at individual EV buses (4, 8, 15, 21, and 23) by PIML-MPC versus conventional MPC.
Figure 5. Voltage regulation at individual EV buses (4, 8, 15, 21, and 23) by PIML-MPC versus conventional MPC.
Wevj 16 00292 g005
Table 1. Parameters of the PIML-MPC control algorithm.
Table 1. Parameters of the PIML-MPC control algorithm.
ParameterDescriptionValueAdjustment
λ p h y s Regularization parameter for physics-informed loss (24)0.5Tuned via grid search over [0.1, 0.5, 1.0] to prioritize physical consistency
Hidden Layer NeuronsNumber of neurons in PIML neural network hidden layer64Fixed after testing [32, 64, 128] for prediction accuracy
Learning RateInitial learning rate for PIML training (Section 4.3)0.001Decayed by 0.95 every 50 epochs to ensure convergence
EpochsNumber of training epochs for PIML model500Fixed to balance training time and prediction MAE (0.002 p.u., Section 6.2.1)
Batch SizeBatch size for PIML training32Fixed for computational efficiency
( N ) MPC prediction horizon (29)10Adjusted from 5 to 10 to improve disturbance rejection during peak events
Q State weighting matrix in MPC cost function (29)Diagonal, [1, 1, 0.5]Increased voltage weight from 0.3 to 0.5 to reduce voltage RMSE (Section 6.2.3)
R Control weighting matrix in MPC cost function (29)Diagonal, [0.1, 0.1]Fixed to balance control effort and stability
P Terminal cost matrix in MPC cost function (29)Diagonal, [2, 2, 1]Adjusted to ensure Lyapunov stability (Section 5.3)
Table 2. Performance metrics for PIML-MPC and conventional MPC (Mean ± Std over 5 runs).
Table 2. Performance metrics for PIML-MPC and conventional MPC (Mean ± Std over 5 runs).
Performance MetricPIML-MPCConventional MPCt-Test (p-Value)
RMSE Frequency Deviations ( Δ ω )0.0112 ± 0.00350.4672 ± 0.06410.0001
MAE Frequency Deviations ( Δ ω )0.0238 ± 0.00741.1698 ± 0.15640.0001
MD Frequency Deviations ( Δ ω )0.2785 ± 0.19734.9719 ± 0.6736-
RMSE Voltage Deviation ( Δ V)0.4006 ± 0.21650.4932 ± 0.00700.3888
MAE Voltage Deviation ( Δ V)1.9853 ± 1.07101.5096 ± 0.04440.3765
MD Voltage Deviation ( Δ V)2.6937 ± 1.22293.2151 ± 0.3625-
Computational Time (s) (Mean ± Std)219.71 ± 48.86219.71 ± 48.86-
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Khan, B.; Ullah, Z.; Gruosso, G. Enhancing Grid Stability Through Physics-Informed Machine Learning Integrated-Model Predictive Control for Electric Vehicle Disturbance Management. World Electr. Veh. J. 2025, 16, 292. https://doi.org/10.3390/wevj16060292

AMA Style

Khan B, Ullah Z, Gruosso G. Enhancing Grid Stability Through Physics-Informed Machine Learning Integrated-Model Predictive Control for Electric Vehicle Disturbance Management. World Electric Vehicle Journal. 2025; 16(6):292. https://doi.org/10.3390/wevj16060292

Chicago/Turabian Style

Khan, Bilal, Zahid Ullah, and Giambattista Gruosso. 2025. "Enhancing Grid Stability Through Physics-Informed Machine Learning Integrated-Model Predictive Control for Electric Vehicle Disturbance Management" World Electric Vehicle Journal 16, no. 6: 292. https://doi.org/10.3390/wevj16060292

APA Style

Khan, B., Ullah, Z., & Gruosso, G. (2025). Enhancing Grid Stability Through Physics-Informed Machine Learning Integrated-Model Predictive Control for Electric Vehicle Disturbance Management. World Electric Vehicle Journal, 16(6), 292. https://doi.org/10.3390/wevj16060292

Article Metrics

Back to TopTop