The rapid integration of high-penetration, volatile renewable energy sources, particularly photovoltaic (PV) generation, presents a significant challenge to the stable operation of modern power systems. The inherent intermittency and stochastic fluctuations of these sources lead to substantial power variations at the point of common coupling (PCC) between a microgrid and the main utility grid, threatening system security and power quality. Integrated Energy Microgrids (IEMs), which synergistically couple multiple energy vectors like electricity, heat, and gas, offer a promising solution by enhancing operational flexibility through complementary energy use and coordinated control of diverse resources.

A particularly potent source of flexibility lies within the burgeoning fleet of electric cars. Each electric car possesses a mobile battery, making it a distributed energy storage unit capable of bidirectional power exchange (Vehicle-to-Grid, V2G). However, harnessing the flexibility of thousands, or even millions, of individual electric cars is computationally prohibitive due to the “curse of dimensionality.” Directly scheduling each unit requires modeling its unique constraints—battery state, charging needs, connection times—leading to an intractable optimization problem for large-scale clusters. To unlock this vast potential, a crucial step is the aggregation of their individual flexibility into a standardized, comprehensible, and schedulable portfolio for the system operator. Simultaneously, the integration of hydrogen energy systems introduces a versatile secondary energy carrier. Hydrogen, produced via electrolysis and reconverted to electricity or heat, or further synthesized into methane, creates multi-energy coupling that significantly enhances the microgrid’s ability to absorb fluctuations and shift energy across time and forms.
In this work, I propose a comprehensive strategy for power fluctuation suppression at the microgrid-grid interface by orchestrating the flexibility of a clustered electric car fleet within an electric-hydrogen IEM framework. My approach follows a streamlined methodology: first, quantifying the adjustable capacity of each heterogeneous electric car using a unified Virtual Battery (VB) model; second, aggregating the power feasible regions of the entire electric car cluster via a relaxed Minkowski summation method for computational efficiency; and third, formulating a stochastic optimization model that accounts for PV uncertainty using Dynamic Time Warping (DTW)-based K-means scenario reduction. The core objective is to minimize the power fluctuation of the microgrid’s tie-line with the main grid.
1. Quantifying and Aggregating Cluster Electric Car Flexibility
1.1 Virtual Battery Model for Individual Electric Car
The adjustable capacity of a single electric car is defined by its power feasible region—the set of permissible charging/discharging power trajectories over a scheduling horizon. This region is constrained by both instantaneous power limits (from the charger) and inter-temporal energy limits (from the battery state and user requirements). Capturing these coupled constraints for diverse electric cars with different plug-in times, departure times, and state-of-charge (SOC) levels is complex. The Virtual Battery model provides an elegant solution by mapping the physical and behavioral constraints of a electric car into a set of standardized, time-varying power and energy boundaries, analogous to a simplified battery model.
For the i-th electric car, the energy boundaries at time interval t are derived by considering the extreme charging/discharging scenarios from its arrival time \( T_{i,o} \) to its departure time \( T_{i,d} \), given its initial energy \( E_{i, T_o} \) and desired departure energy \( E_{i, ex} \). The power boundaries are then constrained by the rate of change between these energy limits and the physical charger limits.
The energy upper and lower limits are calculated as:
$$ E^{EV}_{i, t,\max} = \min\left\{ (E_{i, T_o} + P_{i,\max} (t – T_{i, o}) \tau), E_{i,\max} \right\} $$
$$ E^{EV”}_{i, t,\min} = \max\left\{ (E_{i, ex} – P_{i,\max} (T_{i, d} – t) \tau), E_{i,\min} \right\} $$
$$ E^{EV’}_{i, t,\min} = \max\left\{ (E_{i, T_o} + P_{i,\min} (t – T_{i, o}) \tau), E_{i,\min} \right\} $$
$$ E^{EV}_{i, t,\min} = \max\left( E^{EV’}_{i, t,\min}, E^{EV”}_{i, t,\min} \right) $$
where \( P_{i,\max} \) and \( P_{i,\min} \) are the maximum charging (positive) and discharging (negative) power limits, \( E_{i,\max} \) and \( E_{i,\min} \) are the battery capacity upper and lower limits, and \( \tau \) is the duration of a time interval.
The corresponding power limits for scheduling are:
$$ P^{EV}_{i, t,\max} = \min\left\{ \frac{E^{EV}_{i, t+1,\max} – E^{EV}_{i, t,\min}}{\tau}, P_{i,\max} \right\} $$
$$ P^{EV}_{i, t,\min} = \max\left\{ \frac{E^{EV}_{i, t+1,\min} – E^{EV}_{i, t,\max}}{\tau}, P_{i,\min} \right\} $$
To account for the step changes in energy when an electric car plugs in or out, correction terms \( \Delta E^{EV}_{i,t} \) are introduced into the energy state equation:
$$ E^{EV}_{i, t+1} = E^{EV}_{i, t} + P^{EV}_{i, t} \tau + \Delta E^{EV}_{i, t+1} $$
This VB model provides a unified, privacy-preserving interface for each electric car, hiding user-specific details while exposing its essential flexibility parameters.
| Parameter | Description | Typical Value / Distribution |
|---|---|---|
| \( P_{i,\max} \) | Max charging power | e.g., N(4 kW, 1 kW²) |
| \( P_{i,\min} \) | Max discharging power | e.g., N(-4 kW, 1 kW²) |
| \( E_{i, T_o}/E_{i,\max} \) | Initial SOC upon arrival | e.g., N(0.4, 0.1²) |
| \( E_{i, ex}/E_{i,\max} \) | Desired SOC upon departure | e.g., N(0.8, 0.1²) |
| \( E_{i,\max} \) | Battery capacity | e.g., N(48 kWh, 4 kWh²) |
| \( T_{i, o} \) | Plug-in time | e.g., N(19:00, 2 h²) |
| \( T_{i, d} \) | Departure time | e.g., N(08:00, 1 h²) |
1.2 Aggregating Cluster Electric Car Flexibility via Relaxed Minkowski Sum
The individual power feasible region \( \mathcal{P}_i \) for an electric car modeled by the VB can be represented as a convex polytope defined by linear inequalities:
$$ \mathcal{P}_i = \{ \mathbf{p}_i \mid \mathbf{A}_i \mathbf{p}_i \leq \mathbf{b}_i \} = \left\{ \mathbf{p}_i \ \middle|\ \begin{bmatrix} \mathbf{E} \\ \mathbf{A}^\alpha_i \end{bmatrix} \mathbf{p}_i \leq \begin{bmatrix} \mathbf{b}^P_i \\ \mathbf{b}^E_i \end{bmatrix} \right\} $$
where \( \mathbf{p}_i \) is the power schedule vector, \( \mathbf{E} \) is the identity matrix enforcing power limits \( \mathbf{b}^P_i \), and \( \mathbf{A}^\alpha_i \mathbf{p}_i \leq \mathbf{b}^E_i \) enforces the cumulative energy constraints derived from the VB model.
The aggregate feasible region \( \mathcal{P} \) for a cluster of N electric cars is the Minkowski sum of all individual regions: \( \mathcal{P} = \mathcal{P}_1 \oplus \mathcal{P}_2 \oplus … \oplus \mathcal{P}_N \). Computing the exact Minkowski sum for high-dimensional polytopes is computationally complex. I adopt an efficient and accurate relaxation method. For a cluster where all units share the same efficiency and loss characteristics (\( \mathbf{A}^\alpha_i = \mathbf{A}^\alpha \)), the aggregated region can be obtained by simply summing the individual constraint vectors:
$$ \mathcal{P} = \mathcal{P}_1 \oplus \mathcal{P}_2 = \{ \mathbf{p} \mid \mathbf{A} \mathbf{p} \leq \mathbf{b}_1 + \mathbf{b}_2 \} $$
where \( \mathbf{p} = \sum_{i=1}^N \mathbf{p}_i \) is the aggregate power of the electric car cluster. This relaxed summation provides an exact aggregate for the two-dimensional case and a tight outer approximation for higher dimensions, dramatically reducing computational burden.
Thus, the aggregated constraints for the entire electric car cluster are:
$$ \sum_{i=1}^{N} P^{EV}_{i, t,\min} \leq P^{EV}_t \leq \sum_{i=1}^{N} P^{EV}_{i, t,\max} $$
$$ \sum_{i=1}^{N} E^{EV}_{i, t,\min} \leq E^{EV}_t \leq \sum_{i=1}^{N} E^{EV}_{i, t,\max} $$
$$ E^{EV}_{t+1} = E^{EV}_t + P^{EV}_t \tau + \sum_{i=1}^{N} \Delta E^{EV}_{i, t+1} $$
where \( P^{EV}_t \) and \( E^{EV}_t \) are the aggregate charging/discharging power and energy of the cluster at time t. This aggregation reduces the decision variables from N (one per electric car) to just one for power and one for energy per time step, solving the dimensionality curse.
2. Mathematical Model of the Electric-Hydrogen Energy Microgrid
The microgrid incorporates traditional components like a Gas Boiler (GB) and a Combined Heat and Power (CHP) unit, alongside electric-hydrogen coupling devices: a Proton Exchange Membrane Electrolyzer (PEM), a Hydrogen Fuel Cell (HFC), and a Methane Reactor (MR). This structure enables versatile multi-energy conversion.
2.1 Proton Exchange Membrane Electrolyzer (PEM)
The PEM converts electricity to hydrogen, offering fast response and a wide operating range to absorb renewable fluctuations.
$$ P^{PEM,H_2}_t = \eta_{PEM} P^{PEM,E}_t $$
$$ P^{PEM,E}_{\min} \leq P^{PEM,E}_t \leq P^{PEM,E}_{\max} $$
$$ -\Delta P^{PEM,E}_{\max} \leq P^{PEM,E}_{t+1} – P^{PEM,E}_t \leq \Delta P^{PEM,E}_{\max} $$
where \( P^{PEM,H_2}_t \) is hydrogen production power, \( P^{PEM,E}_t \) is electrical consumption, and \( \eta_{PEM} \) is the conversion efficiency.
2.2 Hydrogen Fuel Cell (HFC)
The HFC converts hydrogen back to electricity and heat with a fixed power-to-heat ratio.
$$ P^{HFC,H}_t + P^{HFC,E}_t = \eta_{HFC} P^{HFC,H_2}_t $$
$$ \frac{P^{HFC,H}_t}{P^{HFC,E}_t} = K_{HFC} $$
$$ P^{HFC,H_2}_{\min} \leq P^{HFC,H_2}_t \leq P^{HFC,H_2}_{\max} $$
$$ -\Delta P^{HFC,H_2}_{\max} \leq P^{HFC,H_2}_{t+1} – P^{HFC,H_2}_t \leq \Delta P^{HFC,H_2}_{\max} $$
2.3 Methane Reactor (MR)
The MR converts hydrogen to synthetic natural gas (SNG), linking the hydrogen and gas networks.
$$ P^{MR,G}_t = \eta_{MR} P^{MR,H_2}_t $$
$$ P^{MR,H_2}_{\min} \leq P^{MR,H_2}_t \leq P^{MR,H_2}_{\max} $$
$$ -\Delta P^{MR,H_2}_{\max} \leq P^{MR,H_2}_{t+1} – P^{MR,H_2}_t \leq \Delta P^{MR,H_2}_{\max} $$
2.4 Gas Boiler (GB) and Combined Heat & Power (CHP)
These conventional units provide heat and power from natural gas.
$$ P^{GB,H}_t = \eta_{GB} P^{GB,G}_t $$
$$ P^{CHP,H}_t + P^{CHP,E}_t = \eta_{CHP} P^{CHP,G}_t $$
$$ \frac{P^{CHP,H}_t}{P^{CHP,E}_t} = K_{CHP} $$
Both have corresponding minimum/maximum power and ramp rate constraints.
| Component | Parameter | Value |
|---|---|---|
| PEM | \( \eta_{PEM} \) | 0.75 |
| \( P^{PEM,E}_{\max} / P^{PEM,E}_{\min} \) | 200 kW / 0 kW | |
| \( \Delta P^{PEM,E}_{\max} \) | 100 kW | |
| HFC | \( \eta_{HFC} \) | 0.85 |
| \( K_{HFC} \) | 0.8 | |
| \( P^{HFC,H_2}_{\max} / P^{HFC,H_2}_{\min} \) | 150 kW / 0 kW | |
| \( \Delta P^{HFC,H_2}_{\max} \) | 75 kW | |
| MR | \( \eta_{MR} \) | 0.65 |
| \( P^{MR,H_2}_{\max} / P^{MR,H_2}_{\min} \) | 100 kW / 0 kW | |
| \( \Delta P^{MR,H_2}_{\max} \) | 50 kW | |
| CHP | \( \eta_{CHP} \) | 0.90 |
| \( K_{CHP} \) | 1.2 | |
| \( P^{CHP,G}_{\max} \) | 300 kW | |
| GB | \( \eta_{GB} \) | 0.92 |
| \( P^{GB,G}_{\max} \) | 250 kW |
3. Stochastic Optimization Model for Power Fluctuation Suppression
3.1 Objective Function and Power Balance
The primary goal is to minimize the absolute power fluctuation of the tie-line between the microgrid and the main grid over the scheduling horizon T. The objective function is:
$$ \min \sum_{t=1}^{T-1} \left| \frac{P^{BUY,E}_{t+1} – P^{BUY,E}_{t}}{P^{BUY,E}_{\max}} \right| $$
where \( P^{BUY,E}_{t} \) is the power purchased from the main grid at time t.
The model must satisfy multi-energy balance constraints at each time step:
$$ P^{EV}_t + P^{L,E}_t + P^{PEM,E}_t = P^{PV}_t + P^{BUY,E}_t + P^{CHP,E}_t + P^{HFC,E}_t $$
$$ P^{MR,H_2}_t + P^{HFC,H_2}_t = P^{PEM,H_2}_t $$
$$ P^{L,H}_t = P^{CHP,H}_t + P^{GB,H}_t + P^{HFC,H}_t $$
$$ P^{L,G}_t + P^{GB,G}_t + P^{CHP,G}_t = P^{MR,G}_t + P^{BUY,G}_t $$
Here, \( P^{L,E}_t \), \( P^{L,H}_t \), \( P^{L,G}_t \) are electrical, thermal, and gas loads, respectively, and \( P^{PV}_t \) is the PV generation output.
3.2 Handling PV Uncertainty with DTW-K-means Scenario Reduction
The volatility of PV output \( P^{PV}_t \) is a key uncertainty. I employ a two-step stochastic optimization approach. First, a large number of PV output scenarios \( \Omega \) are generated using an Auto-Regressive Moving Average (ARMA) model:
$$ X_t = c_t + \sum_{l=1}^{a} \psi_l X_{t-l} – \sum_{j=1}^{b} \theta_j c_{t-j} $$
where \( X_t \) is the PV output, \( \psi_l \) and \( \theta_j \) are coefficients, and \( c_t \) is white noise.
Second, to reduce computational load, these scenarios are clustered into K typical scenarios. Instead of traditional Euclidean distance, I use Dynamic Time Warping (DTW) distance in the K-means algorithm. DTW measures similarity between two temporal sequences by finding the optimal alignment, which is crucial for capturing the shape similarity of PV fluctuation patterns—more relevant for fluctuation suppression than point-wise differences. The DTW distance \( D(A,B) \) between sequences A and B is computed recursively, and the scenarios are clustered to minimize the within-cluster sum of DTW distances. The reduced stochastic optimization model is:
$$ \min \sum_{k=1}^{K} \sum_{t=1}^{T} p_k f(\mathbf{x}_{t,k}) $$
$$ \text{s.t.} \quad h(\mathbf{x}_{t,k}) \leq 0, \quad \forall k $$
where \( p_k \) is the probability of the k-th typical scenario, and \( \mathbf{x}_{t,k} \) represents the decision variables (including the aggregated electric car cluster power \( P^{EV}_t \), device setpoints, etc.) for that scenario.
4. Analysis and Insights from Case Study
4.1 Energy Balancing and the Role of Flexibility
Simulation results demonstrate the coordinated operation of the microgrid. PV output shows significant ramps in the morning and evening. During high PV generation periods, the electrolyzer (PEM) and the electric car cluster actively absorb excess power, with the electric cars shifting to charging mode. When PV generation drops or during peak load hours, the fuel cell (HFC), CHP, and the discharging capability of the electric car cluster work in concert to meet demand and smooth the tie-line power. The hydrogen system acts as a flexible buffer: excess electricity is converted to hydrogen via PEM, which can be stored, used directly in the HFC for quick power generation, or converted to methane via MR for longer-term storage or use in the CHP/GB. The aggregated electric car cluster provides a highly responsive power buffer, with its charging/discharging profile directly counteracting short-term PV and load fluctuations.
4.2 Impact of Cluster Electric Car Fleet Size
The size of the participating electric car cluster has a direct and non-linear impact on fluctuation suppression. As the number of electric cars (N) increases from 20 to 60, the total absolute tie-line power fluctuation decreases significantly, for instance, from 770.47 kW to 581.46 kW in a test case. This is because a larger cluster has a wider aggregated power and energy feasible region, offering greater upward and downward regulation capacity. However, the marginal benefit of adding more electric cars diminishes after a certain point, as the primary fluctuations are of a certain magnitude, and other constraints (like heat demand) become binding.
4.3 Computational Efficiency of the Aggregation Model
The superiority of the VB-based relaxed Minkowski aggregation method is evident in solving speed. Compared to a traditional model that schedules each electric car individually (which quickly becomes intractable), the aggregation model reduces the number of decision variables drastically.
| Number of Electric Cars (N) | Traditional Model Solve Time (s) | Aggregated Model Solve Time (s) | Speed-up Factor | Solution Accuracy* (%) |
|---|---|---|---|---|
| 30 | 1.672 | 0.782 | 2.14 | 99.8 |
| 100 | 3.515 | 0.791 | 4.44 | 99.1 |
| 500 | 14.552 | 0.813 | 17.90 | 98.2 |
*Accuracy relative to the solution of the traditional model (considered optimal).
As shown in Table 3, the solving time for the aggregated model remains stable in the sub-second range even for N=500, while the traditional model’s time grows substantially. The relaxed aggregation provides a very accurate outer approximation, with solution fidelity above 98% even for large clusters. This proves the method’s effectiveness in overcoming the dimensionality challenge of managing a large electric car fleet.
5. Concluding Perspective
This work presents a holistic framework for enhancing grid stability by leveraging the synergistic flexibility of cluster electric cars and electric-hydrogen coupling in a multi-energy microgrid. The Virtual Battery model offers a standardized, privacy-aware method to quantify the heterogeneous flexibility of each individual electric car. The relaxed Minkowski summation technique then enables computationally efficient and accurate aggregation of the entire electric car cluster’s power feasible domain, transforming a dispersed resource into a single, schedulable entity for the system operator. Integrating this with a hydrogen energy system, featuring a PEM electrolyzer, fuel cell, and methane reactor, creates a highly flexible multi-energy buffer that can absorb, convert, and time-shift energy across different forms. Finally, formulating a stochastic optimization model that minimizes tie-line power fluctuations, while accounting for PV uncertainty through DTW-K-means scenario reduction, ensures the strategy is robust against real-world variability. The coordinated dispatch of the aggregated electric car cluster and the electric-hydrogen assets proves highly effective in smoothing the intermittent output from renewables, thereby facilitating higher penetration of clean energy and contributing to a more secure and stable power system.
