In the context of global climate governance and energy structural transformation, renewable energy integrated into power systems has become a key pathway for achieving sustainable development. I have observed that the accelerated deployment of wind and photovoltaic generation introduces significant operational challenges for the grid, while the widespread adoption of electric vehicles has imposed additional uncertainty and peak demand pressures on distribution networks. To systematically coordinate these intertwined factors, I developed a coordinated dispatch framework for a microgrid that integrates renewable generation, battery energy storage, and electric vehicles. Three major pillars support this framework: the construction of a battery degradation model with enhanced prediction capabilities, the development of an adaptive mixed-variable metaheuristic capable of optimizing continuous and discrete generation decisions simultaneously, and the formulation of a dynamic tariff mechanism that incentivizes electric vehicle users to participate in orderly charging and vehicle-to-grid discharging. Throughout the study, I employed comprehensive mathematical models that account for the stochastic mobility characteristics of electric vehicle users, the economic behavior of electricity retailers, and the degradation phenomena of energy storage batteries. The experimental results verified the effectiveness of the proposed methods in reducing microgrid operational costs, flattening the net load profile, extending battery longevity, and increasing the economic benefits of electric vehicle owners.
Background and motivation
Energy is an essential foundation for socioeconomic development. However, the extensive consumption of fossil fuels has led to severe environmental pollution and greenhouse gas emissions, forcing a global transition toward clean and low-carbon energy systems. Solar energy and wind energy, as the most widely available renewable resources, have been increasingly integrated into power networks. Meanwhile, the electrification of transportation has been accelerated worldwide, particularly in China, where the production and sales of new energy vehicles continue to grow sharply.

The rapid growth of electric vehicle adoption brings both opportunities and challenges. On the one hand, electric vehicles can act as distributed flexible resources when connected to the grid; on the other hand, uncoordinated charging loads may exacerbate peak loads, increase the peak-to-valley difference, and threaten the secure operation of transformers and feeders. In this regard, vehicle-to-grid technology has emerged as a promising solution, enabling bidirectional power exchange between electric vehicles and the microgrid. In addition to electric vehicles, battery energy storage systems are indispensable components of microgrids, smoothing renewable energy fluctuations and providing backup capacity. Nevertheless, the economic viability of storage is strongly affected by battery aging. Frequent charging and discharging actions accelerate capacity fade and shorten the remaining useful life. Therefore, in microgrid dispatch optimization, it is critical to embed a precise battery degradation cost model and to design algorithms that can solve the resulting coupled economic dispatch problem.
Methodology overview
The overall research framework follows a hierarchical optimization pathway. First, I established the microgrid architecture that includes distributed generation units, battery storage, loads, and electric vehicles. Each distributed energy resource is described by an appropriate mathematical formulation. For solar generation, the output power is affected by solar irradiance and ambient temperature; wind generation is modeled through a piecewise function dependent on wind speed; the micro gas turbine is represented by a quadratic fuel cost function with start-up costs. I then developed a data-driven battery remaining useful life prediction model named HSK-GPR. This model relies on the Gaussian process regression framework and automatically combines multiple kernel functions according to Bayesian information criterion. The predicted remaining capacity, serving as a measure of storage health, is transformed into a normalized objective in the scheduling model. For the optimization problem, I proposed an adaptive mixed-variable particle swarm optimizer that employs logistic chaotic initialization, time-varying inertia weight and acceleration coefficients, and transfer functions to handle binary decisions. The optimizer can solve unit commitment and economic dispatch concurrently. Finally, I constructed an electric vehicle load model that considers the stochastic travel patterns of private vehicles, including daily driving mileage, departure time, and arrival time. Based on the load model, I compared uncoordinated charging scenarios with orderly charging and discharging scenarios. In the orderly framework, dynamic pricing is generated by the real-time balance between net load and generation costs. I established a multi-objective model that minimizes total microgrid operating costs, battery degradation, and electric vehicle user expenses. All experiments were performed on a typical daily scheduling basis with one-hour resolution.
Mathematical model of the microgrid
The microgrid in this study is structured as follows: renewable generating units, dispatchable generating units, a centralized battery storage unit, electric vehicle clusters, and local load. The system can exchange power with the upstream distribution network through a tie-line, so it can operate either grid-connected or islanded. The load and renewable production time series are assumed to be available from forecasts, with possible uncertainty ranges analyzed later.
Photovoltaic generation units
Photovoltaic cells are nonlinear direct current sources whose output depends on solar irradiance and temperature. I used the single-diode equivalent circuit, in which the output current satisfies:
$$
I = I_{ph} – I_d – I_{sh}
$$
where \(I_{ph}\) is the photo-generated current, \(I_d\) is the diode current, and \(I_{sh}\) denotes the shunt leakage current. The diode current is modeled as:
$$
I_d = I_0 \left\{ \exp\left[\frac{q(U + I R_s)}{\alpha k T}\right] – 1 \right\}
$$
with the shunt current:
$$
I_{sh} = \frac{U + I R_s}{R_{sh}}
$$
where \(R_s\) represents the equivalent series resistance, \(R_{sh}\) designates the shunt resistance, \(q\) is the electronic charge, \(k\) denotes Boltzmann’s constant, \(\alpha\) expresses the diode ideality factor, and \(T\) denotes the cell temperature. Through simulation, I verified that higher irradiance enhances the short-circuit current and open-circuit voltage, whereas a higher temperature slightly increases the short-circuit current but reduces the output power. The operating power of the photovoltaic system at time interval \(t\) can be expressed using the following calibrated equation:
$$
P_{PV}^{t}=P_{PV,max}^{t} \cdot \frac{W_{now}}{W_{max}}\cdot \left[1 + \alpha_{PV}\left(T_{now}-T_{stc}\right)\right]
$$
where \(W_{now}\) is the actual irradiance, \(W_{max}\) is the rated irradiance, \(T_{now}\) is the ambient temperature, \(T_{stc}\) is the standard test temperature, and \(\alpha_{PV}\) is the temperature coefficient with a negative value typically between \(-0.2\%\) and \(-0.5\%\) per degree celsius.
Wind power generation units
Wind power generation depends on the stochastic wind speed. Let \(v\) denote the current wind speed; the wind turbine starts generating when \(v\) exceeds the cut-in speed \(v_{cis}\), and it is shut down for protection when the wind speed exceeds the cut-out speed \(v_{cos}\). The actual output power is given by:
$$
P_{WT} = \begin{cases}
0 & v < v_{cis} \text{ or } v > v_{cos}\\[2mm]
P_{WT}^{r} \cdot \dfrac{v-v_{cis}}{v_r-v_{cis}} & v_{cis} \le v < v_r\\[2mm]
P_{WT}^{r} & v_r \le v \le v_{cos}
\end{cases}
$$
where \(v_r\) denotes the rated wind speed and \(P_{WT}^{r}\) denotes the rated wind power. The daily wind generation cost can be evaluated by discounted investment and annual operation-maintenance expenditure:
$$
C_{WT}=\frac{\sum_{i=1}^{T_c}\frac{C_i}{(1+r)^{i}}}{\sum_{i=1}^{Y_{WT}}\frac{1}{(1+r)^{i}}}
$$
where \(C_i\) is the equivalent annualized cost of wind turbines, \(Y_{WT}\) denotes the plant lifetime, and \(r\) denotes the discount rate.
Micro gas turbine units
Micro gas turbine units are dispatchable generation sources. I modeled their operational fuel cost by a quadratic function:
$$
C_{MT,i}(P_{i,t}) = a_i + b_i P_{i,t} + c_i P_{i,t}^{2}
$$
where \(a_i\), \(b_i\), and \(c_i\) are the cost coefficients of unit \(i\), and \(P_{i,t}\) is the power output at time interval \(t\). In addition to the running cost, start-up costs should be included. I differentiate between hot and cold start-up costs depending on the shut-down duration:
$$
S_{i,t}= \begin{cases}
S_{i}^{hot} & T_{i,min}^{off} \le T_i^{off} \le T_i^{cold}\\
S_{i}^{cold} & T_i^{off} > T_i^{cold}
\end{cases}
$$
where \(S_{i}^{hot}\) and \(S_{i}^{cold}\) denote the hot and cold start-up costs, \(T_i^{off}\) is the continuous off time, and \(T_i^{cold}\) is the cold-start threshold.
Battery storage dynamics
The battery state-of-charge represents the available energy relative to the nameplate capacity:
$$
SOC(t) = \frac{E(t)}{E_{rate}}
$$
The discrete-time SOC dynamics are:
$$
SOC(t+1) = SOC(t)\cdot\left(1-\sigma_{sd}\Delta t\right) + \frac{\delta \eta P_{BESS}(t)\Delta t}{E_{rate}}
$$
where \(E_{rate}\) is the rated capacity, \(P_{BESS}(t)\) is the charging or discharging power, \(\sigma_{sd}\) is the self-discharge coefficient, and \(\eta\) represents the charging/discharging efficiency. The binary coefficient \(\delta\) is \(+1\) for charging, \(-1\) for discharging, and \(0\) when the storage is idle. To ensure a safe operating range, the following limits are imposed:
$$
SOC_{min} \le SOC(t) \le SOC_{max}
$$
At the beginning and end of a daily scheduling cycle, the SOC should be maintained reasonably near its initial value to ensure continuity.
Battery remaining useful life prediction with HSK-GPR
It is generally accepted that lithium-ion battery capacity decreases gradually with cycling. Several endogenous mechanisms induce capacity fade: loss of active cathode material, loss of anode active material, loss of cyclable lithium, and increase of internal resistance. Since these mechanisms are mutually coupled and difficult to measure directly, I selected a data-driven modeling strategy for the remaining useful life estimation. Among the available machine learning methods, Gaussian process regression is a non-parametric Bayesian approach that provides not only a predicted capacity value but also an associated confidence interval.
Let the battery capacity be modeled as:
$$
f(x) \sim \mathcal{GP}\left(m(x),\, k(x,x’)\right)
$$
where \(m(x)\) is the mean function and \(k(x,x’)\) is a covariance kernel function. Without loss of generality, the mean function is often assumed to be zero after data centering. The choice of the kernel function is the most crucial part because it encodes the assumptions about the latent degradation pattern. Common kernel functions used in this work are listed below.
| Kernel Name | Expression |
|---|---|
| Radial Basis Function | \(k_{RBF}(x,x’) = \sigma_{f}^{2}\exp\left(-\dfrac{(x-x’)^{2}}{2l^{2}}\right)\) |
| Linear Kernel | \(k_{Lin}(x,x’) = \sigma^2 (x-c)(x’-c)\) |
| Polynomial Kernel | \(k_{PL}(x,x’) = \sigma^2 \left(a x x’ + c\right)^{d}\) |
| Rational Quadratic | \(k_{RQ}(x,x’) = \sigma^2 \left(1+\dfrac{(x-x’)^{2}}{2\alpha l^{2}}\right)^{-\alpha}\) |
| Laplacian Kernel | \(k_{Lap}(x,x’) = \sigma^2\exp\left(-\dfrac{|x-x’|}{l}\right)\) |
| Matérn Kernel | \(k_{M}(x,x’) = \sigma^2 \dfrac{2^{1-\nu}}{\Gamma(\nu)}\left(\dfrac{\sqrt{2\nu}|x-x’|}{l}\right)^{\nu} K_{\nu}\left(\dfrac{\sqrt{2\nu}|x-x’|}{l}\right)\) |
A single kernel is often insufficient to represent the complex nonlinearity of battery degradation curves. I therefore constructed a pool of composite kernels by adding or multiplying pairs of basic kernels. To avoid the subjectivity of manual kernel selection, I used the Bayesian information criterion as the evaluation metric:
$$
BIC = -2\ln(L) + k\ln(n)
$$
where \(L\) denotes the maximized value of the likelihood function, \(k\) is the number of model hyperparameters, and \(n\) is the number of training samples. The full iterative procedure of the HSK-GPR model is described as follows:
- Create the initial kernel set \(K=\{K_1,K_2,…,K_n\}\). Generate pairwise combinations to build a combination space \(C=\{K_i+K_j, K_i \times K_j\;|\;i \neq j \}\).
- Optimize hyperparameters using the training subset and compute the BIC for every composite kernel.
- Select the composite kernel \(K_{new}\) with the lowest BIC value and add it to the basic kernel set.
- Regenerate a new combination space by combining \(K_{new}\) with the current basic kernels.
- Repeat steps 2 to 4. If the best BIC has not improved for five consecutive iterations, stop and output the global best composite kernel.
With the optimized composite kernel, the prediction of the battery capacity at future degradation cycles can be obtained. For a testing input set, the posterior mean and variance are calculated from Gaussian process inference.
I trained and validated the model using the Oxford battery degradation data set containing eight lithium-ion pouch cells aged under controlled tests. Three representative cells, Cell 1, Cell 7, and Cell 8, were selected to test the model generalizing capability. The first 70% of each capacity curve was used for training and the rest for validation. The evaluation metrics were the mean absolute error and the mean squared error. The composite kernels selected automatically for the three cells are shown in the table below.
| Data set | Optimal composite kernel | BIC | MAE | MSE |
|---|---|---|---|---|
| Cell 1 | (RBF + Quadratic) × Poly + Matérn | -446.27 | 0.005545 | 0.0001 |
| Cell 7 | Poly × Quadratic | -419.32 | 0.005700 | 0.0001 |
| Cell 8 | Laplacian + Quadratic | -396.48 | 0.006300 | 0.0001 |
Compared with the standard single-kernel Gaussian process models, the proposed HSK-GPR model reduced the mean absolute error by more than 94% and achieved notably better long-term prediction stability. The 95% confidence intervals successfully covered the actual capacity measurements at both early and late prediction stages. These results confirm that the automatic kernel composition method extracts characteristic features from aging data across different cells and is highly suitable for online scheduling-oriented storage life predictions.
Optimization model for microgrid economic dispatch considering battery lifespan
In the base economic dispatch stage, the microgrid operates on a typical day without electric vehicle integration. The objective is to minimize the sum of the fuel costs of the dispatchable units, the start-up costs, the electricity purchase cost from the external network, and the revenue from electricity sales to the external network. The mathematical formulation can be written as:
$$
\min F_{op} = \sum_{t=1}^{T}\sum_{i=1}^{N} u_{i,t}C_{i,t}(P_{i,t}) + \sum_{t=1}^{T}\sum_{i=1}^{N} S_{i,t}\cdot\max\{u_{i,t}-u_{i,t-1},0\} + \sum_{t=1}^{T} \rho_t P_{line,t}
$$
where \(u_{i,t}\) denotes the commitment state of unit \(i\) at time \(t\), \(\rho_t\) denotes the market clearing price, and \(P_{line,t}\) is the power imported or exported through the tie-line.
When the battery remaining useful life is incorporated as an extra objective, I normalized two conflicting goals into a weighted sum:
$$
\min f = \omega_1 \frac{F_{op}}{F_{op}^{base}} + \omega_2 \frac{F_{RUL}}{F_{RUL}^{base}}
$$
where \(F_{RUL}\) is the capacity value predicted by HSK-GPR model and \(\omega_1\) and \(\omega_2\) are weighting coefficients reflecting the priority of cost efficiency and lifespan preservation. In this study, I set \(\omega_1 = 0.8\) and \(\omega_2 = 0.2\). The normalized formulation is necessary because the operating cost and the remaining capacity have different units and numerical ranges.
Several operational constraints are considered in the model. The power balance constraint is:
$$
\sum_{i=1}^{N}P_{i,t} + P_{PV,t} + P_{WT,t} + \delta P_{BESS,t} + P_{line,t} = P_{load,t}
$$
where \(\delta=+1\) denotes charging and \(\delta=-1\) discharging. The generator power limits are given by:
$$
P_{i}^{min} \le P_{i,t} \le P_{i}^{max}
$$
and ramp rate limits are imposed by:
$$
P_{i,t} – P_{i,t-1} \le R_{u,i}, \quad P_{i,t-1} – P_{i,t} \le R_{d,i}
$$
Minimum up and down time constraints are included:
$$
T_{i,t}^{on} \ge T_{i,min}^{on},\quad T_{i,t}^{off} \ge T_{i,min}^{off}
$$
In addition, the tie-line power capacity is bounded by:
$$
P_{Line}^{min} \le P_{line,t} \le P_{Line}^{max}
$$
Development of the adaptive mixed-variable particle swarm optimizer
The economic dispatch problem in a microgrid is essentially a mixed-integer nonlinear optimization problem because the decision variables include commitment statuses (binary), output powers (continuous), and target states of the storage unit. Traditional mathematical programming approaches may be trapped by non-convexity and large dimensionality. Particle swarm optimization is a population-based stochastic search method, but it suffers from premature convergence and limited diversity when solving multimodal landscapes. To overcome these limitations, I developed an adaptive mixed-variable particle swarm optimizer named AMPSO. The conventional velocity-position update formulas are:
$$
v_{ij}^{k+1} = \omega v_{ij}^{k} + c_1 r_1 \left(P_{ij}^{k} – x_{ij}^{k}\right) + c_2 r_2 \left(P_{gj}^{k} – x_{ij}^{k}\right)
$$
$$
x_{ij}^{k+1} = x_{ij}^{k} + v_{ij}^{k+1}
$$
where \(\omega\) denotes the inertia weight, \(c_1\) and \(c_2\) denote the cognitive and social acceleration factors, and \(r_1, r_2\) are random numbers uniformly distributed in \([0,1]\). In the AMPSO algorithm, the inertia weight is exponentially decreased according to the iteration counter:
$$
\omega(t) = \omega_{min} + \left(\omega_{max} – \omega_{min}\right) \cdot \exp\left(-\frac{d_1 t}{T + d_2}\right)
$$
where \(\omega_{max}=0.95\), \(\omega_{min}=0.4\), \(d_1 = 0.2\), and \(d_2 = 7\). This setting preserves diversity over the early iterations and gradually improves the local search precision during later iterations. The individual learning factor and the social learning factor are designed as complementary functions:
$$
c_1(t) = c_{min} + \left(c_{max}-c_{min}\right)\exp\left(-\frac{4t^2}{T^2}\right)
$$
$$
c_2(t) = c_{max} – \left(c_{max}-c_{min}\right)\exp\left(-\frac{4t^2}{T^2}\right)
$$
where \(c_{max}=2.2\) and \(c_{min}=0.5\). Thus, the particle mainly explores in the early phase and gradually turns its attention toward the global best position in the late phase.
Because conventional pseudo-random initialization easily causes non-uniform particle distributions, I employed logistic chaotic mapping to initialize the swarm:
$$
x_{i+1} = \mu x_i\left(1-x_i\right),\quad \mu=3.8
$$
where \(x_i\) denotes the chaotic sequence. Chaotic initialization guarantees deterministic coverage of the whole solution space and remarkably improves the population diversity, as demonstrated in the comparative simulation.
To apply AMPSO to the binary variables represented by unit state and charging/discharging actions, the continuous particle velocities are mapped into the binary decision space through transfer functions. Three categories of transfer functions were evaluated in this work.
| Category | Function Name | Formula |
|---|---|---|
| S-shaped | \(S_1\) | \(S(x)=\dfrac{1}{1+e^{-x}}\) |
| S-shaped | \(S_2\) | \(S(x)=\dfrac{1}{1+e^{-x/2}}\) |
| V-shaped | \(V_1\) | \(V(x)=|\tanh(x)|\) |
| V-shaped | \(V_2\) | \(V(x)=|x/\sqrt{1+x^2}|\) |
| V-shaped | \(V_3\) | \(V(x)=|\sqrt{\dfrac{2}{\pi}}\int_{0}^{x}e^{-t^2/2}dt|\) |
| V-shaped | \(V_4\) | \(V(x)=|\dfrac{2}{\pi}\arctan(\dfrac{\pi}{2}x)|\) |
| Q-shaped | \(Q_1\) | \(Q(x)=\begin{cases}\dfrac{x}{x_{max}} & |x|<x_{max}\\ &="" 0.5="" td="" x_{max}\end{cases}\) |
| Q-shaped | \(Q_2\) | \(Q(x)=\begin{cases}\left(\dfrac{x}{x_{max}}\right)^{3} & |x|<x_{max}\\ &="" 0.5="" td="" x_{max}\end{cases}\) |
For particles containing continuous and integer variables, the real-valued parts are still updated using the standard arithmetic operations, while the integer parts are rounded to the nearest integer:
$$
x_{i}^{int}(t+1) = \mathrm{round}\left(x_{i}^{int}(t) + v_{i}(t+1)\right)
$$
For the binary variables, the probability of switching each bit is computed from the relevant transfer function. In the S-shaped and Q-shaped families, the new binary position is determined stochastically:
$$
x_{i}^{bin}(t+1) =
\begin{cases}
1 & \mathrm{rand} \ge S(v_{i}(t+1))\\
0 & \mathrm{otherwise}
\end{cases}
$$
while V-shaped transfer functions operate complementarily:
$$
x_{i}^{bin}(t+1) =
\begin{cases}
\widetilde{x}_{i}^{bin}(t) & \mathrm{rand} \le V(v_{i}(t+1))\\
x_{i}^{bin}(t) & \mathrm{otherwise}
\end{cases}
$$
The AMPSO algorithm repeats particle evaluation, personal best and global best updates, and parameter adaptation until the stopping criterion is satisfied.
Simulation results for the base microgrid scheduling
I used a representative test microgrid consisting of six dispatchable generating units, one solar farm, one wind farm, one centralized storage unit, and resident loads. The relevant parameter tables are listed below. Six thermal-like units have different quadratic fuel cost coefficients, ramp rates, minimum up/down times, and start-up costs. The storage capacity is 10 MWh and the charge/discharge power limits are fixed at 1.5 MW. The scheduling horizon is one day with 24 hourly intervals.
| Unit | \(P_{max}\) (MW) | \(P_{min}\) (MW) | Ramp (MW/h) | \(T_{on}\) (h) | \(T_{off}\) (h) | \(S_{cold}\) ($) | \(S_{hot}\) ($) | a ($) | b ($/MWh) | c ($/MW\(^2\)h) |
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 455 | 150 | 130 | 8 | 8 | 100 | 50 | 100 | 16.19 | 0.00048 |
| 2 | 130 | 20 | 60 | 5 | 5 | 80 | 40 | 70 | 17.26 | 0.00200 |
| 3 | 162 | 25 | 90 | 6 | 6 | 80 | 40 | 45 | 19.70 | 0.00390 |
| 4 | 85 | 25 | 40 | 3 | 3 | 30 | 10 | 37 | 27.74 | 0.00079 |
| 5 | 80 | 20 | 40 | 3 | 3 | 30 | 10 | 48 | 22.26 | 0.00712 |
| 6 | 55 | 10 | 40 | 1 | 1 | 20 | 5 | 66 | 25.92 | 0.00220 |
| Parameter | Value |
|---|---|
| Initial state of charge | 0.70 |
| SOC lower limit | 0.20 |
| SOC upper limit | 0.90 |
| Maximum energy capacity | 10 MWh |
| Charging efficiency | 0.95 |
| Discharging efficiency | 0.90 |
| Maximum charging/discharging power | 1.5 MW |
In the deterministic simulation, the actual renewable generation and load are assumed to follow the forecasted curves. The experiments revealed essential behavior: during low electricity price periods, the microgrid purchases power from the external grid to charge the storage unit; during high price intervals, the dispatchable units are committed in ascending order of marginal cost and the storage unit is discharged whenever the price difference exceeds the operating cost threshold. When the battery remaining useful life factor is ignored, the storage SOC fluctuates drastically. By contrast, when the battery life degradation is included in the objective, the dispatch strategy restricts deep and frequent charging/discharging cycles. The SOC variation becomes much smoother, which effectively fulfills the shallow-charge and shallow-discharge principle.
To comprehensively examine different transfer functions, I conducted thirty independent runs for each of the eight transfer function configurations. The average operating costs are compared in the following table.
| Transfer Function | Optimal Cost ($) | Worst Cost ($) | Average Cost ($) |
|---|---|---|---|
| \(S_1\) | 239774.2 | 253446.7 | 246010.5 |
| \(S_2\) | 239774.2 | 241710.3 | 242278.6 |
| \(V_1\) | 121714.5 | 142213.6 | 123959.7 |
| \(V_2\) | 114699.2 | 130163.8 | 116714.2 |
| \(V_3\) | 195109.4 | 212583.7 | 208595.7 |
| \(V_4\) | 107191.1 | 137220.6 | 125073.1 |
| \(Q_1\) | 82839.2 | 125700.0 | 92621.3 |
| \(Q_2\) | 116492.1 | 176992.1 | 125700.2 |
The results clearly indicate that the Q-shaped family yields the lowest average operating cost. Compared with the \(S_1\) function, \(Q_1\) offered a cost reduction of up to 62.35%, representing an absolute saving of around $153,389.2. Meanwhile, I observed that the S-shaped transfer functions are remarkably stable, while the V-shaped family sometimes converges fast but may suffer premature convergence in specific runs. The Q-type transfer function balances the exploration and exploitation phases more effectively and is therefore the most appropriate choice for this particular scheduling task.
When I introduced uncertainty in load and renewable forecasts, the load error was set to 5%, while the wind and solar forecast errors were 3%. The AMPSO algorithm still achieved a robust scheduling result. Under the \(S_1\) function, the worst operating cost was $250,274 and the remaining battery capacity was 81.85%; under the \(Q_2\) function, the best operating cost was $228,406 and the remaining battery capacity was 82.34%. The relative cost reduction was 8.74%, corresponding to an absolute saving of $21,868. These findings verify the robustness of the AMPSO algorithm in handling practical uncertainties of renewable energy and load.
Electric vehicle load modeling and charging behavior
When electric vehicles are connected to the microgrid, their charging demand adds a new load to the daily load curve. To investigate the impact of electric vehicle integration, I first established a stochastic load model representing the travel and charging behavior of individual electric vehicle users. The driving mileage per day can be statistically described by the log-normal distribution:
$$
f_S(s) = \frac{1}{s\,\sigma_s\sqrt{2\pi}}\exp\left[-\frac{\left(\ln s – \mu_s\right)^2}{2\sigma_s^2}\right]
$$
with the statistical parameters \(\mu_s=3.2\) and \(\sigma_s=0.88\). Most users in the distribution drive less than 60 kilometers daily. Departure time in the morning is normally distributed around 7:36 a.m.:
$$
f_{T_1}(t_1) = \frac{1}{\sigma_1\sqrt{2\pi}}\exp\left[-\frac{(t_1-\mu_1)^2}{2\sigma_1^2}\right]
$$
where \(\mu_1 = 7.62\) and \(\sigma_1=2.14\). The arrival time in the evening also follows a normal distribution:
$$
f_{T_2}(t_2) = \frac{1}{\sigma_2\sqrt{2\pi}}\exp\left[-\frac{(t_2-\mu_2)^2}{2\sigma_2^2}\right]
$$
where \(\mu_2=18.5\) and \(\sigma_2=1.25\). The initial state-of-charge before departure is represented by a truncated normal distribution given by:
$$
f_{SOC}^{EV}(x) = \frac{1}{\sigma_{es}\sqrt{2\pi}}\exp\left[-\frac{(x-\mu_{es})^2}{2\sigma_{es}^2}\right]
$$
where \(\mu_{es}=0.6\), \(\sigma_{es}=0.1\).
Accordingly, the daily energy consumption of one electric vehicle follows from the driving distance:
$$
W_{EV}=s\cdot w_{EV}
$$
where \(w_{EV}\) is the energy consumption per kilometer. The charging duration is calculated by:
$$
T_{ch}^{EV} = \frac{W_{EV}}{\eta_{ch}^{EV}\,P_{ch}^{EV}}
$$
where \(\eta_{ch}^{EV}\) is the charging efficiency and \(P_{ch}^{EV}\) is the charging power. The aggregate charging load at each interval is:
$$
P_{EV}(t) = \sum_{n=1}^{N_{EV}} P_{n}^{EV}(t)
$$
where \(N_{EV}\) represents the connected number of electric vehicles. Monte Carlo simulation is adopted to generate many independent sample sets of the random variables, allowing the stochastic charging load curve to be evaluated.
The distribution of the electric vehicle battery capacities is assumed to be a Gamma distribution with shape parameter \(\alpha=4.5\), scale parameter \(\beta=6.7\), truncated between 10 kWh and 72 kWh. The main battery capacity classes used in the simulations are listed in the following table.
| Capacity (kWh) | [15,30] | [30,45] | [45,60] | [60,75] | [75,90] |
|---|---|---|---|---|---|
| Probability | 0.155 | 0.241 | 0.380 | 0.121 | 0.103 |
| Consumption (kWh/km) | 0.1141 | 0.1273 | 0.1321 | 0.1470 | 0.1649 |
Uncoordinated charging load model
In the uncoordinated charging mode, electric vehicle owners start to charge immediately after arriving home. This charging behavior is not restricted by price signals and leads to a simultaneous activation of a large number of charging load in the evening. I implemented the Monte Carlo load flow for 200, 400, and 600 electric vehicles, respectively. The resulting daily curve indicates that the charging peak occurs around 20:00, precisely coincident with the late-evening residential peak. Consequently, the uncoordinated charging pattern significantly increases the peak load and the peak-to-valley difference of the microgrid.
Orderly charging and vehicle-to-grid model
To encourage the participation of electric vehicle users, users are classified into three groups according to their willingness to participate in demand-side management. Type A users do not respond to the dispatch signal at all, and therefore their vehicles are always charged in the uncoordinated mode. Type B users are willing to shift their charging periods but do not allow discharging. Type C users, referred to as the vehicle-to-grid participants, permit the microgrid operator to control both charging and discharging actions, provided that their daily mobility needs are satisfied. Empirical survey data suggest that Type A accounts for about 5.3%, Type B accounts for 21.9%, and Type C accounts for 72.8% of all users.
For a vehicle participating in the orderly dispatch, the state-of-charge evolution is:
$$
SOC_{EV}(t+1) = SOC_{EV}(t) + \frac{\left(\eta_{ch}^{EV}P_{ch}^{EV}(t)-\frac{1}{\eta_{dis}^{EV}}P_{dis}^{EV}(t)\right)\Delta t}{E_{EV}^{rated}}
$$
where \(P_{ch}^{EV}(t)\) and \(P_{dis}^{EV}(t)\) denote the charging and discharging rate, while \(\eta_{ch}^{EV}\) and \(\eta_{dis}^{EV}\) represent the corresponding efficiencies. At the time of departure, the battery state of charge must meet the travelling requirement:
$$
SOC_{EV}(t_{dep}) \ge SOC_{req}
$$
where \(SOC_{req}\) is set to 0.6. In addition, the operational constraints for the electric vehicle battery include:
$$
SOC_{min}^{EV} \le SOC_{EV}(t) \le SOC_{max}^{EV}
$$
where \(SOC_{min}^{EV}=0.4\) and \(SOC_{max}^{EV}=0.9\). The charging and discharging powers cannot be positive simultaneously:
$$
X_{EV}(t)\cdot Y_{EV}(t) = 0
$$
where \(X_{EV}(t)\) is the charging state binary variable and \(Y_{EV}(t)\) is the discharging state binary variable.
Dynamic pricing mechanism for guiding electric vehicles
Price-based demand response is a natural way to coordinate the load behavior of electric vehicles. Unlike the fixed time-of-use tariff, a dynamic tariff should reflect the real-time balance between the net load and the marginal generation cost. I define the net load as the remaining demand after subtracting renewable generation:
$$
P_{N}(t) = P_{load}(t)-P_{PV}(t)-P_{WT}(t)
$$
When the net load is less than or equal to zero, renewable energy is sufficient to cover all loads, and the charging price can be set at the valley price \(C_V\). When the net load is positive, the electricity price is dynamically determined by adding an adjustment term to the base purchase price:
$$
C_{EV}(t) =
\begin{cases}
C_V & P_{N}(t) \le 0 \\
C_n + \mu_t \left(C_p – C_n\right) & P_{N}(t) > 0
\end{cases}
$$
where \(C_V=0.48\) $/kWh, \(C_n=1.3\) $/kWh, and \(C_p=2.1\) $/kWh. The adjustment factor \(\mu_t\) is derived from the current net load magnitude and the generator operation cost offset such that:
$$
\mu_t = \frac{P_{N,t}}{P_{N,max}}
$$
with a gradient-descent update to make sure the charging price is not higher than the cost of purchasing from external network:
$$
\mu_t \leftarrow \max\left\{\mu_t – \frac{\Delta C}{C_0-C_{EV}}, 0\right\}
$$
By applying this dynamic tariff, the charging load of Types B and C is naturally shifted toward the valley period, and the discharging load of Type C is promoted during peak hours. I simulated orderly charging/discharging load profiles for 200, 400, and 600 electric vehicles. When the electric vehicle number increases, the valley-filling effect is much stronger, while the peak charging power is significantly reduced.
Multi-objective optimization with electric vehicles
The economic objective for microgrid operation should incorporate the revenues and costs related to electric vehicles. Let the total electric vehicle user expense be defined as:
$$
C_{EV}^{user} = C_{buy}^{EV} – R_{sell}^{EV} – R_{comp}^{EV}
$$
where \(C_{buy}^{EV}\) is the charging payment made by users, \(R_{sell}^{EV}\) denotes the vehicle-to-grid discharging revenue paid to the electric vehicle owners, and \(R_{comp}^{EV}\) denotes the additional compensation for depreciation due to discharging. Positive \(C_{EV}^{user}\) indicates that the users pay for electricity, while negative values indicate that the electric vehicle users receive a net profit from participating in demand response. From the perspective of the microgrid operator, the net operational cost replacing the original cost is:
$$
F_{op}^{EV}=F_{op} – C_{EV}^{user}
$$
where electricity sold to electric vehicle users increases the income and therefore reduces the operating cost. The multi-objective optimization model is normalized:
$$
\min F_{final} = \omega_1 \frac{F_{op}^{EV}}{F_{op,base}^{EV}} + \omega_2 \frac{F_{RUL}}{F_{RUL}^{base}}
$$
In this model, the cost minimization covers the conventional unit outputs, storage charging/discharging set-points, power exchange with the main grid, and the charging/discharging schedules of multiple electric vehicle groups. The dispatch constraints include the original unit constraints plus the electric vehicle energy constraints and the maximum charging/discharging power limits for each vehicle group. The resulting optimization problem has a high-dimensional mixed-variable solution and is therefore solved by the same AMPSO algorithm developed in the previous stage.
Comparison of orderly and uncoordinated scheduling results
I separately tested the proposed dynamic pricing based orderly scheduling strategy and the uncoordinated scheduling strategy under three scales of electric vehicle penetration. The metrics employed for the evaluation are: the cumulative electric vehicle user expense, the microgrid operating cost, the final SOC of the centralized storage battery, and the peak-to-valley difference of the load curve. The following table summarizes the orderly scheduling results for the S-shaped transfer functions.
| Transfer function | Number of EVs | EV user cost ($) | MG operation cost ($) | Battery RUL |
|---|---|---|---|---|
| \(S_1\) | 200 | -822.57 | 226499.0 | 82.47% |
| \(S_1\) | 400 | -2022.24 | 220517.0 | 82.50% |
| \(S_1\) | 600 | -2839.31 | 220479.0 | 82.51% |
| \(S_2\) | 200 | -822.57 | 228635.0 | 82.47% |
| \(S_2\) | 400 | -2022.24 | 220892.0 | 82.50% |
| \(S_2\) | 600 | -2839.31 | 217955.0 | 82.51% |
It is apparent that the electric vehicle user expense is negative, meaning that electric vehicle owners receive a net benefit. As the penetration grows from 200 to 600 vehicles, the user benefit increases significantly. The maximum user-side benefit enhancement observed in the orderly mode is 245.2%, whereas the microgrid operating cost is reduced by up to 4.67% in the S-shaped function group and by an average of 3.66%. This result confirms the financial viability of vehicle-to-grid programs for the end users.
| Transfer function | Number of EVs | EV user cost ($) | MG operation cost ($) | Battery RUL |
|---|---|---|---|---|
| \(V_1\) | 200 | -822.57 | 206510.0 | 82.51% |
| \(V_1\) | 400 | -2022.24 | 197536.0 | 82.51% |
| \(V_1\) | 600 | -2839.31 | 193832.0 | 82.51% |
| \(V_3\) | 200 | -822.57 | 229768.0 | 82.49% |
| \(V_3\) | 400 | -2022.24 | 194856.0 | 82.51% |
| \(V_3\) | 600 | -2839.31 | 192677.0 | 82.51% |
| \(V_4\) | 200 | -822.57 | 217436.0 | 82.49% |
| \(V_4\) | 400 | -2022.24 | 197941.0 | 82.51% |
| \(V_4\) | 600 | -2839.31 | 194350.0 | 82.51% |
Results for the V-shaped functions also show a noticeable improvement: the average microgrid operating cost reduction is 9.76%, and the maximum reduction reaches 16.14%. The Q-shaped transfer functions likewise exhibit outstanding performance in microgrid operational cost saving. In particular, the best combination of \(Q_2\) with 600 electric vehicles reduces the microgrid operating cost to $182,683, which is lower than all the other configurations considered.
| Transfer function | Number of EVs | EV user cost ($) | MG operation cost ($) | Battery RUL |
|---|---|---|---|---|
| \(Q_1\) | 200 | -822.57 | 209488.0 | 82.47% |
| \(Q_1\) | 400 | -2022.24 | 201548.0 | 82.51% |
| \(Q_1\) | 600 | -2839.31 | 198274.0 | 82.51% |
| \(Q_2\) | 200 | -822.57 | 209335.0 | 82.51% |
| \(Q_2\) | 400 | -2022.24 | 198750.0 | 82.51% |
| \(Q_2\) | 600 | -2839.31 | 182683.0 | 82.51% |
By contrast, when the electric vehicles are charged in an uncoordinated mode, the microgrid operating cost and the electric vehicle user cost both increase significantly as the number of electric vehicles grows. The following tables report the performance metrics under uncoordinated charging.
| Transfer function | Number of EVs | EV user cost ($) | MG operation cost ($) | Battery RUL |
|---|---|---|---|---|
| \(S_1\) | 200 | 23080.3 | 245749.0 | 82.47% |
| \(S_1\) | 400 | 46859.5 | 246615.0 | 82.47% |
| \(S_1\) | 600 | 71648.1 | 265633.0 | 82.47% |
| \(S_2\) | 400 | 46859.5 | 244033.0 | 82.47% |
| \(S_2\) | 600 | 71648.1 | 266039.0 | 82.47% |
| Transfer function | Number of EVs | EV user cost ($) | MG operation cost ($) | Battery RUL |
|---|---|---|---|---|
| \(V_1\) | 200 | 23080.3 | 212417.0 | 82.50% |
| \(V_1\) | 400 | 46859.5 | 235380.0 | 82.49% |
| \(V_1\) | 600 | 71648.1 | 237272.0 | 82.49% |
| \(V_4\) | 200 | 23080.3 | 223217.0 | 82.49% |
| \(V_4\) | 600 | 71648.1 | 255114.0 | 82.49% |
| Transfer function | Number of EVs | EV user cost ($) | MG operation cost ($) | Battery RUL |
|---|---|---|---|---|
| \(Q_1\) | 200 | 23080.3 | 235900.0 | 82.51% |
| \(Q_1\) | 400 | 46859.5 | 236810.0 | 82.51% |
| \(Q_1\) | 600 | 71648.1 | 242288.0 | 82.51% |
| \(Q_2\) | 400 | 46859.5 | 236002.0 | 82.51% |
| \(Q_2\) | 600 | 71648.1 | 236088.0 | 82.50% |
A clear conclusion can be drawn: the uncoordinated charging mode worsens the microgrid load factor by concentrating the charging load at peak hours. The increase in operating cost is most severe when using the Q-shaped transfer function, with an average increment of 18.83%. In contrast, the orderly scheduling strategy realizes multi-party benefits: the user electricity bills decrease, the operating cost decreases, and the load peak-to-valley difference is reduced by at least 85.45%. Furthermore, with the increase in the number of electric vehicles, the peak-to-valley difference continues to decrease, which means the grid operates more stably. The reason is that the dynamic pricing strategy shifts 62.4% of electric vehicle charging load to the period of abundant renewable generation. In the best case, the microgrid operating cost after orderly scheduling is 27% lower than that after uncoordinated charging, corresponding to an amount of $67,591. The remaining battery capacity remains around 82.5%, demonstrating that the strategy does not sacrifice battery health.
Further analysis of the battery SOC under coordinated scheduling
Another important observation is that the battery SOC trajectory in the coordinated scheduling mode is considerably flattened compared with that in the uncoordinated mode. In the optimal daily scheduling scheme, the storage system charges during deep night and discharges during peak daytime hours. Because the degradation cost is embedded in the objective function, the storage dispatch is executed only when the arbitrage revenue outweighs the loss of battery life. I introduce the following logical rule as a heuristic interpretation:
$$
\text{discharge admissible} \iff \pi_{sell}(t) – \pi_{buy}(t) \ge 2 \cdot C_{deg}
$$
where \(C_{deg}\) is the marginal degradation cost per MWh. This rule prevents unnecessary micro-cycles and protects the battery from accelerated aging. In the conventional model without lifespan awareness, the battery may be repeatedly charged and discharged merely because of small price gaps, leading to rapid capacity fade. In the proposed dispatch framework, the SOC trajectory exhibits a total daily swing that is much smaller than the swing obtained by the cost-only strategy, i.e., a shallow charging and discharging pattern is automatically learned by the optimizer.
Interpretation of the role of dynamic pricing in load shaping
Let \(L(t) = P_{base}(t) + P_{EV}^{ch}(t) – P_{EV}^{dis}(t)\) denote the final load curve including electric vehicles. Peak shaving and valley filling can be quantified by:
$$
\Delta_{PV} = L_{max} – L_{min}
$$
Under the dynamic pricing mechanism, the peak period price is high enough for Type C electric vehicles to have an economic incentive to discharge, while the valley period price is low enough to encourage charging. Simultaneously, the microgrid avoids the fuel consumption of high-cost generators at the margin. In the simulation, the peak-valley difference with 600 electric vehicles under the dynamic pricing design is reduced by more than 85.45% relative to the uncoordinated charging case. The net load standard deviation is also significantly decreased. The operation of the six dispatchable generators becomes increasingly smooth, avoiding frequent start-stop cycles and high ramping costs. Furthermore, the renewable energy consumption rate is improved because the charging behavior of electric vehicles is deliberately shifted toward the high renewable output interval. This synergy demonstrates the effectiveness of the price-based demand response in sustainable microgrid operation.
Concluding remarks and future perspectives
In this work, I systematically addressed the coordinated dispatch problem of a renewable-based microgrid with integrated electric vehicles. A first contribution concerns the prediction framework for storage battery aging: I proposed the HSK-GPR model with self-selected composite kernels. The model was validated on three different lithium-ion battery data sets, and it consistently outperformed single-kernel Gaussian process models in mean absolute error and long-term capacity tracking. This prediction model can be embedded in online scheduling systems. A second contribution is the AMPSO algorithm with logistic chaotic initialization, time-varying control parameters, and flexible binary transfer functions. Simulation results on a six-generator microgrid benchmark demonstrated that the Q-shaped transfer function yields the best economic outcome, reducing the deterministic dispatch cost by 62.35% compared with the worst S-shaped configuration. The algorithm also produced stable solutions when forecast errors were included. A third contribution is the dynamic tariff plus vehicle-to-grid dispatch strategy. Based on the Monte Carlo simulation of the stochastic travel behavior of electric vehicle owners, I established both uncoordinated and orderly charging load models. The results reveal that orderly charging/discharging can convert electric vehicles from a simple load burden into flexible distributed resources. In the dynamic electricity price environment, the load peak-to-valley difference decreases by up to 85.45%, the microgrid operating cost is reduced on average by 7.48% under the three transfer function classes, and the total benefits of electric vehicle users are increased by 245.2% when the number of connected vehicles grows from 200 to 600. Meanwhile, the centralized storage battery works in a shallow-cycling regime, and its predicted remaining useful life remains as high as 82.5% over the typical daily simulation. The multi-objective scheduling framework proposed in this study therefore succeeds in reconciling economic efficiency, operational stability, renewable energy accommodation, and electric vehicle user satisfaction.
Future research directions could be extended in several promising aspects. First, the accuracy of the day-ahead optimal schedule could be further improved by combining the HSK-GPR remaining life prediction model with online battery state-of-health estimation based on real-time sensor data. Second, the stochastic traveling behavior of electric vehicles could be modeled at a higher temporal resolution such as 15-minute intervals, with correlated spatial travel chains in a distribution network. Third, a hierarchical scheduling framework could be developed where the upper layer coordinates multiple microgrids and the lower layer manages each microgrid with detailed electric vehicle information. Finally, the dynamic tariff mechanism could be integrated with deep reinforcement learning so that the price-making process can adapt to evolving consumer behavior and renewable generation patterns. These improvements would create an even more practical and scalable framework for future low-carbon power grids with high penetration of renewable energy and electric vehicles.
