Optimal Scheduling of Microgrid with Electric Car Charging Based on Improved NSGA2 Algorithm

My research focuses on the optimal dispatching of a microgrid that integrates distributed renewable energy sources and a large number of electric cars. As the penetration of electric cars grows rapidly due to environmental policies and the global push toward carbon neutrality, the stochastic charging behavior of these vehicles adds severe uncertainty to the demand side. Meanwhile, the intermittent output of wind and photovoltaic power further challenges the stability of the microgrid. In this work, I construct a two-layer optimization model that jointly considers the operation economy, pollutant emission, user satisfaction, and net-load fluctuation. I also develop an improved non-dominated sorting genetic algorithm II, namely IMNSGA2, to solve the multi-objective problem efficiently. I verify the proposed method through case studies on both weekdays and rest days, with demand response and ordered charging analysis.

1. Background and Significance

The global energy sector is witnessing a paradigm shift from fossil-fuel-based generation toward clean and distributed energy resources. In China, the “dual carbon” policy strongly stimulates the deployment of renewable energy systems, while the number of electric cars is increasing rapidly. By the end of 2023, annual electric car sales in China exceeded 5.2 million units. Although electric cars can substantially reduce greenhouse gas emissions during operation, their grid integration creates new problems. When many electric cars are plugged into the same distribution network, their charging loads are often synchronized and highly uncertain, leading to enlarged peak-valley differences, voltage deviations, and increased operating costs.

Microgrids provide an effective platform for accommodating distributed generation and electric car charging demand. They can operate in grid-connected mode and actively coordinate various sources such as wind turbines, photovoltaic panels, diesel generators, and battery energy storage systems. A properly scheduled microgrid helps to increase renewable energy utilization, reduce pollutant emissions, and maintain a stable power exchange with the main grid. However, due to the stochastic charging behavior of electric cars and the volatility of renewable generation, the operating condition varies rapidly. Therefore, I need a robust and intelligent optimization tool to obtain a high-quality scheduling scheme.

I notice that most existing research simplifies the interaction between electric cars and microgrids, often neglecting the satisfaction of electric car owners. To fill the gap, I propose a double-layer model. The upper layer applies time-of-use pricing and demand response to shift the charging period of electric cars so as to maximize the users’ comprehensive satisfaction and minimize the grid net-load variance. Then the optimized net-load is passed to the lower layer, where I minimize the operation and maintenance cost, pollutant treatment cost, and Tie-line power fluctuation. The improved IMNSGA2 algorithm is adopted to solve the optimization challenges, which include non-linearity, high dimensionality, and multiple conflicting objectives.

2. Microgrid Structure and Component Models

The microgrid analyzed in this thesis comprises wind power (WT), photovoltaic (PV) generation, a diesel engine, a battery energy storage system, electric cars, and conventional loads. All these units are connected to a low-voltage AC bus. The system can exchange power with the main grid through a point of common coupling. An energy management system (EMS) monitors the real-time power balance and sends dispatch commands to controllable units. The overall structure is described in the following content without referring to the figure.

2.1 Photovoltaic Generation Model

The output power of a PV system depends on the solar irradiation and ambient temperature. My model is given by:

$$P_{PV} = P_{r} \cdot \frac{R}{R_{s}} \cdot \left[ 1 + \theta \left( T_{c} – T_{r} \right) \right]$$

where \(P_{r}\) is the rated power, \(R\) is actual solar radiation, \(R_s\) is standard radiation, \(\theta\) is the power temperature coefficient, \(T_c\) is actual cell temperature and \(T_r\) is reference temperature.

2.2 Wind Power Generation Model

The wind turbine output can be approximated by the piecewise function:

$$P_{WT} = \begin{cases} 0, & v < v_{ci} \text{ or } v > v_{co} \\ a v^{3} + b v^{2} + c v + d, & v_{ci} \le v \le v_{r} \\ P_{r}, & v_{r} < v \le v_{co} \end{cases}$$

In the formula, \(v_{ci}\), \(v_{r}\) and \(v_{co}\) are the cut-in, rated and cut-out wind speeds, and \(a,b,c,d\) are coefficients obtained by curve fitting. The unpredictable nature of wind speed makes this source non-dispatchable, hence I must coordinate other generation units to balance the load.

2.3 Diesel Engine Model

The diesel engine is a controllable distributed generator. I model its operation and maintenance cost as:

$$C_{DE}^{OM}(t) = K_{DE}^{OM} \cdot P_{DE}(t)$$

and the fuel cost as:

$$C_{DE}^{F}(t) = \alpha \cdot P_{DE}^{2}(t) + \beta \cdot P_{DE}(t) + \gamma$$

where \(\alpha,\beta,\gamma\) are fuel cost coefficients. In addition, the environmental cost caused by pollutants from the diesel engine is explicitly included in the lower-level objective function.

2.4 Battery Energy Storage System Model

The state of charge (SOC) of the battery storage system evolves according to:

$$SOC(t+1) = \begin{cases} SOC(t) – \frac{P_{bess}(t)}{\eta^{-}} , & P_{bess}(t) < 0 \\ SOC(t) – \eta^{+} \cdot P_{bess}(t) , & P_{bess}(t) \ge 0 \end{cases}$$

where positive \(P_{bess}(t)\) means discharging, negative value means charging, \(\eta^{-}\) denotes charging efficiency and \(\eta^{+}\) denotes discharging efficiency. In my optimization, the SOC is always kept between a lower bound and an upper bound to elongate battery lifetime.

2.5 Electric Car Charging Models

I categorize the electric cars according to their charging strategies. The random charging behavior reflects that owners plug in their vehicles immediately upon arriving home or reaching their workplace. To simulate daily mileage and home arrival time, I adopt probability distributions that follow normal or uniform patterns.

For the daily mileage of electric cars, the following log-normal distribution is used in my Monte Carlo sampling procedure:

$$f_L(x) = \frac{1}{x \sigma_{x} \sqrt{2\pi}} \exp \left( -\frac{(\ln x – \mu_{x})^{2}}{2\sigma_{x}^{2}} \right)$$

where \(\mu_{x} = 3.2\) and \(\sigma_{x} = 0.88\). The home arrival time is another critical factor. In the random charging model, the probability density of plug-in time is given by:

$$f_a(t) = \begin{cases} \frac{1}{\sigma_a \sqrt{2\pi}} \exp \left( -\frac{(t – \mu_a)^{2}}{2\sigma_a^{2}} \right), & 0 \le t < 12 \\ \frac{1}{\sigma_a \sqrt{2\pi}} \exp \left( -\frac{(t – 24 – \mu_a)^{2}}{2\sigma_a^{2}} \right), & 12 \le t \le 24 \end{cases}$$

For my case, \(\mu_a=17.6\) and \(\sigma_a=3.41\), which means the majority of owners arrive home around 17:00 to 18:00.

When electric cars are charged under an ordered mode, I further divide the owners into two classes. In the first class, the owners do not participate in centralized dispatching, so their charging starts once they arrive home. However, because the charging behavior is constrained by their commuting schedule, I formulate the charging window according to two time points: the morning departure time and the evening arrival time. In the second class, the owners are willing to follow the demand response signals. The dispatching center decides the optimal charging period based on the forecasted net load and electricity price. In exchange, these owners receive a certain subsidy for charging flexibility.

For the feasibility of the demand response, I must ensure that the electric car reaches a minimum required SOC before the owner departs. The allowable discharging capacity is:

$$C_{dischar}(i) = \min\left( SOC_{max} – SOC_{min}, \frac{SOC(i) \cdot C_{ev} – f_r \cdot C_{ev}}{w \cdot s(i)} \right)$$

where \(C_{ev}\) is the battery capacity, \(f_r\) is discharge depth, \(w\) is energy consumption per kilometer and \(s(i)\) is the total daily driving distance. This formula avoids over-discharge and keeps the battery within a safe range.

After I determine the charging/discharging power profile of each electric car, the aggregated charging load is calculated as:

$$P_{EV}(t) = \sum_{i=1}^{N} \left[ P_{c} \cdot a(i,t) + P_{d} \cdot b(i,t) \right]$$

where \(P_{c}\) and \(P_{d}\) denote charging and discharging power, and \(a(i,t)\) and \(b(i,t)\) are binary flags indicating whether the \(i\)-th electric car is charging or discharging at time interval \(t\). Using the Monte Carlo method, I generate random daily driving distances and plug-in times repeatedly. The total charging load is then computed by aggregating the charging profiles across all vehicles.

3. Multi-Objective Optimization and Improved NSGA2 Algorithm

3.1 Multi-objective optimization theory

In many engineering cases, multiple conflicting objectives must be optimized simultaneously. A general multi-objective minimization problem is written as:

$$\min \; F(x) = \min \; \left[ f_{1}(x), f_{2}(x), \ldots, f_{M}(x) \right]^{T}$$

subject to:

$$g_{i}(x) \le 0, \quad i = 1,2,\ldots,p$$
$$h_{j}(x) = 0, \quad j = 1,2,\ldots,q$$

where \(x \in \mathbb{R}^{n}\) is the decision variable vector. Since no single solution can simultaneously minimize all objectives, I seek a set of non-dominated solutions, known as the Pareto optimal set. The concepts of Pareto dominance are essential:

  • A solution \(x\) dominates another solution \(y\) if \(f_i(x) \le f_i(y)\) for all \(i\) and there exists at least one index \(k\) where \(f_k(x) < f_k(y)\).
  • A solution \(x^*\) is Pareto optimal if no solution in its feasible region dominates it.
  • The projection of all Pareto solutions in the objective space is called the Pareto front.

For the microgrid scheduling problem, I have to trade off economic cost, emission cost, and tie-line power smoothness. In particular, the charging behavior of electric cars adds an integer-like dimension to the control variables because each electric car can be either in a charging state or idle. The resulting optimization problem is highly non-linear and non-convex.

3.2 Standard NSGA2 algorithm

NSGA2 is an evolutionary algorithm that extends the genetic algorithm to multi-objective problems. It uses the fast non-dominated sorting procedure to classify individuals into several Pareto fronts. It also uses the crowding distance metric to preserve the diversity of the population. The elite preservation strategy combines the parent population and the offspring population, sorts them again, and selects the best \(N\) individuals to form the next generation.

The major steps of NSGA2 are:

  1. Initialize the parent population \(P_0\) of size \(N\).
  2. Evaluate all objective functions for each individual.
  3. Apply fast non-dominated sorting to assign front ranks.
  4. Calculate the crowding distance for each solution.
  5. Generate offspring \(Q_0\) using binary tournament selection, crossover and mutation.
  6. Combine parent and offspring to obtain a population of size \(2N\).
  7. Sort the combined population according to front rank and crowding distance, and select the best \(N\) individuals.
  8. Repeat steps 5–7 until the maximum iteration number is reached.

Although NSGA2 is widely used, it has several limitations when the solution space is complex. The randomly initialized population may be unevenly distributed. Moreover, original genetic operators may destroy the excellent schemes formed in the early stage, resulting in slow convergence or local optimal traps.

3.3 Improved IMNSGA2 algorithm

To improve the performance of NSGA2 for my microgrid scheduling problem, I introduce two strategies: chaotic initialization and a genetic evolutionary scheme with elite screening. The improved algorithm is called IMNSGA2.

3.3.1 Chaos initialization strategy

I use the Logistic mapping function to generate the initial population with good ergodicity and uniform distribution:

$$x_{k+1} = \mu x_{k} \left( 1 – x_{k} \right)$$

with \(\mu = 3.7\) and \(x_k \in (0,1)\). In the initialization process, I first generate a chaotic sequence in the interval (0,1), and then map it to the boundaries of each decision variable. Since the charging schedules of electric cars have a stochastic nature, a uniformly distributed initial population can explore more possible charging combinations than a pseudo-random one.

3.3.2 Genetic evolution strategy with elite screening

In the standard NSGA2 algorithm, crossover and mutation are random and may eliminate some good individuals. In my improved algorithm, I compute for each non-dominated solution set \(J_1\) the individual-best objective value \(Z_{best}^{k}\) among all objective functions. Then for an individual \(g_i\), I define a difference measure in each objective dimension:

$$\delta_i^k = \left| \frac{Z_{best}^{k} – Z_i^{k}}{Z_{best}^{k}} \right| \times 100\%$$

For each solution, the smallest difference measure is used to select an elite individual \(g_{best}\). Then a candidate offspring \(g_i’\) is generated as:

$$g_i’ = \alpha \cdot g_{best} + (1-\alpha)\cdot g_i$$

In my implementation, I choose \(\alpha=0.7\). The candidate offspring \(g_i’\) is compared with its parent \(g_i\) using Pareto dominance. Only the dominating solution is retained for the next generation. This elitism-oriented genetic evolution enhances the convergence speed and prevents the loss of excellent scheduling patterns obtained during the search.

3.3.3 Procedure of IMNSGA2

  1. Set algorithm parameters: population size \(N\), crossover probability \(P_c\), mutation probability \(P_m\), and maximum iteration \(G\).
  2. Generate the initial population using the chaotic Logistic mapping.
  3. Evaluate objective values for all individuals.
  4. Perform fast non-dominated sorting and calculate crowding distances.
  5. Select parents through binary tournament selection.
  6. Generate offspring through crossover and mutation.
  7. Apply the elite screening strategy to update the offspring with the elite procedure.
  8. Combine parent and offspring populations, sort them by rank and crowding distance, and select the next generation of size \(N\).
  9. If the condition \(g \le G\) is satisfied, go to step 3; otherwise output the Pareto front.

3.4 Performance evaluation using test functions

To verify my improved algorithm, I use three standard multi-objective benchmark functions: ZDT1, ZDT2, and IDTLZ2. The mathematical formulations are given below. For ZDT1:

$$\min f_1(x) = x_1$$
$$\min f_2(x) = g(x)\left[ 1 – \sqrt{\frac{f_1(x)}{g(x)}} \right]$$
$$g(x) = 1 + \frac{9}{m-1} \sum_{i=2}^{m} x_i$$

For ZDT2:

$$\min f_1(x) = x_1$$
$$\min f_2(x) = g(x)\left[ 1 – \left( \frac{f_1(x)}{g(x)} \right)^{2} \right]$$

where the same function \(g(x)\) is used.

For IDTLZ2 with \(M\) objectives:

$$\min f_1(x) = \left( 1 + g(x) \right) \prod_{i=1}^{M-1} \cos\left( \frac{\pi x_i}{2} \right)$$
$$\min f_{k=2,\ldots,M}(x) = \left( 1 + g(x) \right) \left( \prod_{i=1}^{M-k} \cos\left( \frac{\pi x_i}{2} \right) \right) \sin\left( \frac{\pi x_{M-k+1}}{2} \right)$$
$$g(x) = \sum_{i=1}^{n} (x_i – 0.5)^{2}$$

I select four evaluation indicators: generation distance (\(GD\)), uniformity (\(UNI\)), diversity (\(DIV\)), and computation time. \(GD\) measures the average Euclidean distance from the obtained Pareto front to the true Pareto front, so a smaller value is better. \(UNI\) measures the uniform spread of solutions over the front. A larger \(UNI\) indicates a more uniform solution set. \(DIV\) measures the extent of the obtained front; a smaller value indicates a better and more concentrated trade-off. I run both NSGA2 and IMNSGA2 independently 25 times on each benchmark. The common parameters are population size 187, maximum iteration 220, crossover probability 0.872 and mutation probability 0.107.

According to my simulation results, the average \(GD\) values for IMNSGA2 are significantly lower than those of standard NSGA2 on all three benchmarks. For ZDT1, the \(GD\) decreases from 0.00352 to 0.00028. For ZDT2, it decreases from 0.00623 to 0.00017. For IDTLZ2, it decreases from 0.00978 to 0.00562. The \(UNI\) values improve from 0.08347, 0.08864 and 0.11811 to 0.31872, 0.32968 and 0.19522, respectively. At the same time, the computation time is also reduced. These results demonstrate that the chaotic initialization and elite screening mechanism effectively enhance the convergence and distribution performance of the algorithm.

4. Two-Layer Optimal Scheduling Model of Microgrid

4.1 Upper layer: source-load coordination with electric car response

In the upper layer of my model, I optimize the charging behavior of electric cars subject to time-of-use prices and demand response signals. Two objective functions are considered there. The first objective is to maximize the comprehensive satisfaction of electric power users. The satisfaction is the weighted sum of the economy satisfaction and comfort satisfaction:

$$\max \; f_{1} = \omega_{1} C_{com} + \omega_{2} C_{eco}$$

where \(\omega_1\) and \(\omega_2\) are weights, both set to 0.5 in my case study. The comfort satisfaction is defined as:

$$C_{com} = 1 – \frac{\sum_{t=1}^{T} \left| \Delta P_t \right|}{\sum_{t=1}^{T} P_t}$$

where \(P_t\) is the original electricity consumption of the electric car at time \(t\), and \(\Delta P_t\) is the load change after demand response. The economic satisfaction is represented as:

$$C_{eco} = \frac{\sum_{t=1}^{T} price_t \cdot P_t}{\sum_{t=1}^{T} price_t \cdot (P_t + \Delta P_t)}$$

When \(\Delta P_t\) is negative, the owner shifts charging demand away from expensive peak hours, and \(C_{eco}\) becomes greater than 1. In my model, I cap \(C_{eco}\) at a maximum of 1.326 when demand response is adopted, because owners save money by charging during lower price periods.

The second objective of the upper layer is to minimize the net-load variance of the microgrid. The net-load is the remaining demand after the wind and photovoltaic generation is subtracted from the total load:

$$P_{net}(t) = P_{load}(t) + P_{EV}(t) – P_{wt}(t) – P_{pv}(t)$$

The objective function is:

$$\min \; f_{2} = \frac{1}{T}\sum_{t=1}^{T} \left( P_{net}(t) – P_{net}^{avr} \right)^{2}$$

where \(P_{net}^{avr}\) is the average value of net load over the scheduling horizon. A smaller net-load variance means that the residual demand curve seen by the lower layer is smoother.

The upper layer constraints include the permissible SOC range for electric cars:

$$SOC_{min}^{EV} \le SOC(t) \le SOC_{max}^{EV}$$

and minimum comfort requirement:

$$C_{com} \ge C_{com}^{min}$$

as well as minimum economic requirement:

$$C_{eco} \ge C_{eco}^{min}$$

These constraints guarantee that the demand response process does not degrade the electric car user experience too much.

4.2 Simulation of electric car charging load and demand response

In my case study, I simulate 298 electric cars that are connected to a residential microgrid. All cars have a battery capacity of 32 kWh and use a slow charging power of 4.5 kW. I adopt the Monte Carlo sampling method described in Chapter 2 to generate their charging load on weekdays and rest days. The weekday behavior is separated into three groups: group 1 (19% of owners) starts charging around 9:00, group 2 (62%) starts charging around 19:00, and group 3 (19%) has a random charging time. The rest-day behavior is more stochastic, with some owners charging during the daytime, some at night, and others not charging at all.

When electric cars are in the uncontrolled (random) charging state, the aggregated charging load peaks sharply. On weekdays, the maximum charging power reaches 390.1 kW near 20:00, while the minimum is only 31.6 kW near 9:00. The large peak-valley difference is caused by the synchronized charging of group 2. When I apply the demand response mechanism to reshape the load curve, I shift the charging period to the valley hours from 1:00 to 7:00. As a result, the total load profile becomes much smoother. In the weekday case, the total load peak-valley difference is reduced from 902.3 kW to 329.3 kW when electric cars are optimally scheduled. On rest days, the improvement is also visible, as the peak-valley difference drops from 680.8 kW to 462.2 kW.

Considering wind and photovoltaic generation, I obtain the net-load curves. On weekdays, the net-load variance is 102029 kW² without demand response and only 20454 kW² with demand response. On rest days, the reduction is from 54131 kW² to 29758 kW². The demand response also lowers the charging cost for electric car owners. The weekly charging cost decreases from 2191.75 yuan to 1534.70 yuan, a reduction of 29.98%. Although comfort satisfaction declines from 1.000 to 0.8131 due to the shifted charging time, the comprehensive user satisfaction increases from 1.000 to 1.0559 because of the significant economic benefit. Similar results appear on rest days, where the comprehensive satisfaction rises from 1.000 to 1.0993.

4.3 Lower layer: optimised operation of microgrid

After the upper layer optimizes the net-load curve, the lower layer determines the optimal power outputs of the dispatchable units. The lower layer has three objectives:

4.3.1 Daily operation and maintenance cost

$$\min \; f_{1}^{lower} = \sum_{t=1}^{24} \left[ C_{WT}^{OM}(t) + C_{PV}^{OM}(t) + C_{DE}^{OM}(t) + C_{ES}^{OM}(t) + C_{grid}(t) \right]$$

where the storage maintenance cost is:

$$C_{ES}^{OM}(t) = \lambda_{es} \cdot \left| P_{es}(t) \right|$$

and the power exchange cost with the main grid is:

$$C_{grid}(t) = \begin{cases} price_{buy} \cdot P_{buy}(t), & P_{buy}(t)>0 \\ – price_{sell} \cdot P_{sell}(t), & P_{sell}(t)<0 \end{cases}$$

All cost components are summed over the scheduling horizon of one day.

4.3.2 Pollutant treatment cost

$$\min \; f_{2}^{lower} = \sum_{t=1}^{T} \sum_{j=1}^{J} \left( \sigma_{j}^{DE} \cdot P_{DE}(t) + \sigma_{j}^{grid} \cdot P_{buy}(t) \right) \cdot C_{pollute}^{j}$$

where the emission factors for different pollutants from diesel engines and the main grid are listed in the table that follows. This objective ensures that the microgrid not only operates economically but also avoids excessive pollution.

4.3.3 Tie-line power fluctuation

$$\min \; f_{3}^{lower} = \sum_{t=1}^{T-1} \left[ P_{grid}(t+1) – P_{grid}(t) \right]^{2}$$

Minimizing this term can reduce the stress on the main grid connection and improve the operational autonomy of the microgrid.

4.3.4 Constraints in the lower layer

The dispatch result must satisfy the power balance constraint:

$$P_{net}(t) = P_{DE}(t) + P_{grid}(t) + P_{es}(t)$$

where \(P_{net}(t)\) is the optimized net-load from the upper layer. The diesel engine output and ramp limits are:

$$P_{DE}^{min} \leq P_{DE}(t) \leq P_{DE}^{max}$$
$$R_{DE}^{down} \leq P_{DE}(t) – P_{DE}(t-1) \leq R_{DE}^{up}$$

The tie-line power is limited as:

$$P_{grid}^{min} \leq P_{grid}(t) \leq P_{grid}^{max}$$

Similarly, the storage power and SOC limits are:

$$P_{es}^{min} \leq P_{es}(t) \leq P_{es}^{max}$$
$$SOC_{min} \leq SOC(t) \leq SOC_{max}$$

4.4 Scheduling strategy of the microgrid

I design the operating strategy according to the priority of renewable energy utilization. First, electric cars and conventional loads consume the power generated by wind and photovoltaic systems. If the renewable output exceeds the total demand, the surplus energy is stored in the battery until the battery reaches its maximum SOC. Then the remaining surplus is sold to the main grid. When the renewable generation is insufficient, the storage system is discharged first. If the deficit persists, I compare the cost of the diesel generator with the cost of buying electricity from the main grid. The cheaper option is chosen to supply the remaining power. This strategy is dynamic because the electricity price changes hourly. During the valley-price period, the diesel engine is often turned off, while the charging power from the grid is increased. During the peak-price period, the diesel engine and storage system tend to supply the load as much as possible.

4.5 Solution methodology using IMNSGA2

I use the proposed IMNSGA2 algorithm to solve the lower-layer multi-objective model. The decision variables are the hourly output of the diesel engine, the hourly charging/discharging power of the storage system, and the hourly power exchange with the main grid. In real coding, each individual chromosome consists of 24 values for each variable. The upper-layer optimized net-load values are treated as known parameters. During the evolutionary process, I verify the power balance equation after each crossover and mutation operation. Any infeasible individual is penalized in its objective values.

I compare the convergence behavior of the standard NSGA2 and the improved IMNSGA2 in the scheduling model. During the first 20 generations, IMNSGA2 produces a lower initial cost because the chaotic initialization places more individuals in the promising region. At the convergence stage, IMNSGA2 reaches a lower final cost around 100 generations, while standard NSGA2 still lags behind. I can conclude that the elite screening strategy preserves the promising load distribution patterns formed by good solutions and thus helps the algorithm jump out of local optima.

5. Case Study: Simulation Results and Discussion

5.1 Simulation parameters

I carry out the simulation in the MATLAB R2018b environment on a personal computer with the hardware configuration shown in the following table.

Table 1: Hardware configuration
Component Model
CPU Ryzen 7 9700X
GPU Moore Threads MTT S30
RAM 42 GB DDR5
OS Windows 10

The parameters of the IMNSGA2 algorithm and microgrid components are as follows:

Table 2: Simulation parameters for IMNSGA2 and microgrid components
Parameter Value
Population size 220
Crossover probability 0.863
Mutation probability 0.108
Maximum generation 478
Wind maintenance cost (yuan/kW) 0.27
PV maintenance cost (yuan/kW) 0.0074
Diesel max power (kW) 217
Diesel min power (kW) 0
Diesel ramp up/down rate (kW/h) 217/-217
Diesel maintenance cost (yuan/kW) 0.0837
Diesel generation cost (yuan/kWh) 0.404
Battery charging power upper limit (kW) 218
Battery discharging power lower limit (kW) -218
Battery charging efficiency 0.903
Battery discharging efficiency -0.903
Minimum SOC 0.18
Maximum SOC 0.93
Battery maintenance cost (yuan/kW) 0.005
Maximum grid power (kW) 650
Minimum grid power (kW) -650
Grid ramp rate (kW/h) 400

I also consider the emission factors and pollutant treatment cost coefficients shown in the following table:

Table 3: Pollutant emission coefficients and treatment cost
Pollutant SO2 NOX COX
Emission from diesel engine (kg/kWh) 0.00017 0.0112 0.543
Emission from main grid (kg/kWh) 0.00213 0.0017 0.877
Treatment cost (yuan/kg) 14.802 62.842 0.223

5.2 Weekday optimization results

I first analyze the weekday scenario without demand response. During 0:00 to 3:00, the net load is negative, meaning the renewable output exceeds the local consumption. The battery is charged by the surplus renewable energy. At 4:00 to 7:00, the net load is still low. The diesel generator remains off because buying power from the grid is cheaper during the valley period. In the 8:00 to 15:00 interval, the load rises and the net load turns positive. Since the grid price is moderate, the diesel generator and the battery discharge to serve the load. From 16:00 to 22:00, the load reaches the daily peak. The battery is fully utilized and the diesel generator reaches its maximum output, while the main grid is used only for the residual deficit. At 23:00, the load declines and the diesel output drops, while the grid import increases to charge the battery for the next day.

After the demand response is implemented, the charging load of electric cars is shifted to the early morning hours. In this case, the grid import during 0:00 to 7:00 becomes larger because many electric cars are charged at that time. However, the overall plateau of the net-load is avoided. The diesel generator still stays off during the valley period because the grid import price is low. The storage system charges during those low-price hours and discharges during the peak-price period, which further reduces the operation cost.

The objective values of the lower layer for the weekday before and after demand response are listed below:

Table 4: Weekday lower-layer objectives before and after demand response
Scenario Operation cost (yuan) Pollutant cost (yuan) Tie-line power fluctuation (kW²)
Before demand response 3634.19 3368.61 30720.74
After demand response 2902.31 2677.60 16443.26

As shown in Table 4, after demand response the operation cost is reduced by 20.14%, the pollutant treatment cost is reduced by 20.51%, and the tie-line power fluctuation is reduced by 46.48%. These reductions show that shifting the charging of electric cars from the evening peak to the morning valley not only improves the user satisfaction but also significantly lowers the daily operating expense of the microgrid.

The hourly tie-line power exchange on weekdays is illustrated by my simulation data. Before demand response, the peak import reaches 692.3 kW and the average import is 334.6 kW. After demand response, the peak import is only 399.7 kW and the average import drops to 131.6 kW. The variance reduction is about 60%. The plot of the tie-line power profile clearly shows a flatter curve after the demand response, which helps the main grid maintain frequency stability.

When I compare the Pareto fronts generated by NSGA2 and IMNSGA2 for the weekday case, I find that IMNSGA2 consistently yields a lower operation cost for the same pollutant treatment cost. For example, at a pollutant cost of 3000 yuan, IMNSGA2 can find a scheduling scheme with an operation cost nearly 11% lower than the best solution found by standard NSGA2. This indicates that my improved algorithm is able to escape local optima and search more deeply into the feasible scheduling space.

5.3 Rest-day optimization results

On rest days, the car owners’ daily routines are less regular. The total demand curve is smoother than on weekdays. But the demand response is still beneficial. In the rest-day scenario before demand response, the operation cost is 2737.02 yuan, the pollutant treatment cost is 2282.24 yuan, and the tie-line power fluctuation is 20985.87 kW². After demand response, the three values become 2443.80 yuan, 1994.01 yuan and 12934.24 kW², respectively. The corresponding reductions are 10.71%, 12.63% and 38.37%. Because the rest-day charging load is less concentrated, the potential for demand response to reduce the peak is slightly lower than that on weekdays. Nevertheless, the economic and environmental improvements remain significant.

During the rest-day valley period (0:00 to 7:00), the battery is charged by both renewable energy and cheap grid energy. The diesel generator remains off. During 8:00 to 15:00, the net load is positive and the diesel generator operates to reduce the need for high-price grid imports. In the evening period from 16:00 to 22:00, the diesel engine and storage system supply the main load. At 23:00, the diesel output is reduced because the electricity price falls and it becomes cheaper to import power from the main grid.

The Pareto comparison on rest days also confirms the superiority of IMNSGA2. The non-dominated solution set produced by IMNSGA2 is closer to the ideal Pareto front than that produced by NSGA2. Moreover, the distribution of the IMNSGA2 solutions is more uniform, as reflected by the higher uniformity metrics in the benchmark tests.

5.4 Comprehensive analysis

In order to make the comparison clearer, I summarize all objective values in the two scenarios in the following table:

Table 5: Summary of lower-layer objectives in the four examined scenarios
Day type Demand response Operation cost (yuan) Pollutant cost (yuan) Tie-line fluctuation (kW²)
Weekday No 3634.19 3368.61 30720.74
Weekday Yes 2902.31 2677.60 16443.26
Rest day No 2737.02 2282.24 20985.87
Rest day Yes 2443.80 1994.01 12934.24

These results strongly demonstrate that the double-layer model with demand response and ordered charging of electric cars is effective in improving both economic and environmental performance. The IMNSGA2 algorithm has shown better search ability and convergence speed than standard NSGA2, which is critical for a high-dimensional scheduling problem.

6. Conclusion

In this thesis, I researched the optimal scheduling method of a microgrid that contains renewable energy, diesel generation, battery storage and a large number of electric cars. I built mathematical models for wind turbines, photovoltaic panels, diesel engines, battery energy storage and different electric car charging states. From Monte Carlo sampling, I generated realistic electric car charging load profiles for weekdays and rest days. I then formulated a double-layer optimization framework. In the upper layer, time-of-use pricing and demand response shift the charging behavior of electric cars to valley periods, thereby increasing the comprehensive user satisfaction and decreasing the net-load variance. In the lower layer, I minimized the daily operation and maintenance cost, pollutant treatment cost and tie-line power fluctuation. To solve the model, I improved the NSGA2 algorithm by using chaotic initialization and an elite screening mechanism. I verified the algorithm on ZDT1, ZDT2 and IDTLZ2 benchmarks and applied it to the microgrid scheduling case.

My main conclusions include:

  • The improved IMNSGA2 algorithm presents superior convergence accuracy, uniformity and diversity compared with the standard NSGA2 algorithm, as revealed by the benchmark results.
  • Demand response for electric car charging can effectively reduce the charging cost of car owners while maintaining adequate satisfaction. The comprehensive satisfaction increases by 5.59% on weekdays and 9.93% on rest days.
  • The net-load variance of the microgrid is remarkably reduced after demand response. On weekdays, the variance drops by 79.96%, while on rest days the reduction reaches 45.03%.
  • By applying the optimized scheduling strategy from the lower layer, the operation cost, pollutant cost and tie-line fluctuation are all reduced significantly in both weekday and rest-day settings.
  • The improved genetic evolutionary strategy prevents effective scheduling schemes from being lost during the search process, which is very important for handling the uncertain charging demand of electric cars.

I conclude that the two-layer optimized scheduling model based on IMNSGA2 provides a practical and advanced solution for the economic and environmentally friendly operation of a microgrid with electric car charging. In future work, I plan to investigate more complex scenarios, such as vehicle-to-grid services, multi-microgrid interaction, and stochastic forecasting errors for wind and photovoltaic generation. I will also test my method on real microgrid systems in different regions to further validate its robustness. The rapid development of electric cars will continue to challenge the grid, and I believe the proposed approach can contribute to cleaner and more reliable energy systems.

Scroll to Top