Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Click the aboveLychee Research Societyto follow us

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

πŸ“‹πŸ“‹πŸ“‹The contents of this article are as follows:🎁🎁🎁

Directory

πŸ’₯1 Overview

πŸ“š2 Results

2.0 Monte Carlo Generation of Electric Vehicle Load

2.1 Basic Scenario, No Electric Vehicles

2.2 Scenario 2: No Electric Vehicles, Unordered Charging

2.3 Scenario 3: Ordered Charging of Electric Vehicles

πŸŽ‰3 References

🌈4 MATLAB Code and Data

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

1 Overview

With the popularity of electric vehicles, the impact of electric vehicle charging on the power grid is becoming increasingly significant. To better adapt to multi-period dynamic electricity pricing, optimizing the ordered charging strategies for electric vehicles is crucial. Here are some possible optimization strategies: 1. Consider price fluctuations: Develop charging strategies based on the fluctuations in electricity prices during different periods. Charge during periods of lower prices and avoid peak pricing periods to reduce charging costs. 2. Consider electricity demand: Reasonably schedule the charging periods of electric vehicles based on user electricity demand, avoiding simultaneous use with other high-power household appliances to prevent excessive load. 3. Consider charging speed: Schedule charging duration based on the battery capacity of electric vehicles and the power of charging equipment to maximize the efficiency of the charging devices. 4. Consider grid load balancing: Avoid large numbers of electric vehicles charging simultaneously during peak load periods, adopting time-based and area-based charging strategies to balance the grid load. 5. Consider renewable energy utilization: Schedule electric vehicle charging periods based on renewable energy generation, prioritizing the use of renewable energy for charging to reduce dependence on traditional energy sources. By implementing these optimization strategies, we can better adapt to multi-period dynamic electricity pricing, improve the charging efficiency of electric vehicles, reduce charging costs, and minimize the impact on the power grid, achieving orderly charging of electric vehicles. Currently, there is a significant amount of research on modeling electric vehicle charging loads in the literature, including studies by Wang Shuning et al. who used grid selection methods for orderly regulation of electric vehicle charging in residential areas, and Kong Xiangyu et al. who analyzed user demand response under time-of-use pricing environments. However, static regulation strategies may face limitations in guiding efficiency when dealing with variable load conditions. The increasing penetration of electric vehicles poses a threat to the stable operation of the power grid, but integrating demand response mechanisms into charging load guidance strategies can not only alleviate the burden on the grid but also reduce user costs, achieving a win-win goal. Therefore, the current domestic automotive power batteries mainly use ternary lithium batteries, and their charging process follows a two-stage mode of “constant current – constant voltage”. In the early charging phase, the current remains constant while the voltage continuously increases until it reaches a predetermined value, after which it remains constant, and the charging current gradually decreases to a fixed value. The charging power curve is shown in Figure 1, where the initial and final stages are relatively short, allowing the entire charging process to be considered as a constant power characteristic charging process.

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Time-of-use peak and valley pricing is an effective way for the power grid to regulate user-side demand. Grid operators divide peak and valley pricing based on the local basic load curve, and changes in pricing will affect electricity demand, thereby guiding changes in charging loads, aiming to reduce the peak-to-valley difference in load and achieve peak shaving and valley filling effects. In response to the dual-peak shape of electricity load in China, the typical principle for dividing time-of-use pricing is to classify the afternoon and evening basic electricity peak periods as peak pricing periods, while the nighttime electricity valley period is classified as a valley pricing period, with other times being classified as flat pricing periods.

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

2 Results

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)2.0 Monte Carlo Generation of Electric Vehicle Load

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)2.1 Basic Scenario, No Electric VehiclesOptimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)2.2 Scenario 2: No Electric Vehicles, Unordered ChargingOptimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)2.3 Scenario 3: Ordered Charging of Electric Vehicles

Particle Swarm Algorithm Solution

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Part of the code:

%% Particle Swarm Algorithm Optimization
MaxIt=1500;      % Number of iterations
nPop=650;        % Population size
nVar = sum(sum(Tap));% Number of decision variables
nVar1 = [0; sum(Tap,2)];% Number of decision variables for each electric vehicle (actually the number of dispatchable time slots for each vehicle)
VarMin = zeros(1,nVar);% Lower limit of decision variables
VarMax = EV_features.S_char*ones(1,nVar);% Upper limit of decision variables
% Call the particle swarm algorithm for optimization
[bestPosition, fitValue ,BestCost] = PSOFUN(@objective2,nVar,VarMin,VarMax,MaxIt,nPop);
% Variable restoration (transforming the decision variables from electric vehicle count * dispatch time slots to electric vehicle count * 24h charging power matrix for subsequent calculations)
Load_EV_tran = zeros(car_number,48);
for i=1:car_number
    Load_EV_tran(i,EV_features.Starttime(i):EV_features.Endtime(i)+24)=bestPosition(sum(nVar1(1:i))+1:sum(nVar1(1:i+1)));
end
Load_EV = (Load_EV_tran(:,1:24)+Load_EV_tran(:,25:48));% Calculate the charging demand of electric vehicles at each node
P_L_EV = zeros(33,24);
for i=1:33
   P_L_EV(i,:) = sum(Load_EV((i-1)*car_number/33+1:(i-1)*car_number/33+car_number/33,:))/1000;
end
% Calculate the actual total load
mpc=case33bw;
P_L_act = sum(Power_load.*mpc.bus(:,3))+sum(P_L_EV);% Verify whether the flow constraints are met and calculate the optimal flow
V = zeros(33,24);% Record voltage by hour
P_loss = zeros(1,24);% Record network loss by hour
for t=1:T
    mpc=case33bw;
    mpc.bus(:,3)=Power_load(t).*mpc.bus(:,3);% Current basic load at each node
    mpc.bus(:,3)=mpc.bus(:,3)+P_L_EV(:,t);% Add electric vehicle charging load
    [result,sucess]=runopf(mpc,mpoption('OUT_ALL',0,'VERBOSE',0,'PF_ALG',3));% Matpower calculates the optimal flow
    V(:,t) = result.bus(:,3);% Current voltage magnitude at each node
    P_loss(t) = sum(result.branch(:,14)+result.branch(:,16));% Current system network loss
    if sucess == 1% Check if flow constraints are met
%         disp('Current scenario meets flow constraints!')
    elseif sucess == 0
        disp('Current scenario does not meet flow constraints!')
    end
end
%% Visualization of optimization results
[fun,C_1,C_2] = objective2(bestPosition);
C_1_0 = sqrt((sum((P_L_base*1000-mean(P_L_base)*1000).^2))/24);
C_2_1 = sum(sum(P_EV_0).*csell);
disp('===============================================')
disp('%%            Scenario 3 Results Output               %%')
disp('===============================================')
disp(['Total objective function value:    ',num2str(fun)])
disp(['Standard deviation of basic load fluctuations:  ',num2str(C_1_0)])
disp(['Standard deviation of total load fluctuations:  ',num2str(C_1)])
disp(['Charging costs for electric vehicle users considering dynamic pricing: ',num2str(C_2)])
disp(['Charging costs for electric vehicle users not considering dynamic pricing: ',num2str(C_2_1)])
disp(['Peak value of total load curve:  ',num2str(max(P_L_act*1000))])
disp(['Valley value of total load curve:  ',num2str(min(P_L_act*1000))])

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

3References

Some content in this article is sourced from the internet, and references will be noted. If there are any inaccuracies, please feel free to contact us for removal.

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

[1] Chen Jiade, Xu Haibo, Sun Ruixue, et al. Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing. Northeast Electric Power Technology, 2023, 44(02): 40-46.

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

4 MATLAB Code and Data

Public AccountOptimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)Lychee Research SocietyOptimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Research on Optimization Strategies for Electric Vehicle Charging States Based on Particle Swarm Algorithm

2024-01-10

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Real-time Scheduling Strategies for Electric Vehicles Based on V2G Technology

2023-10-19

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Large-scale Electric Vehicle Spatiotemporal Scheduling Based on Bi-level Optimization

2023-10-10

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Distributed Robust Optimization Scheduling Model for Electric Vehicle Clusters Connected to the Grid

2023-08-28

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Research on Coordinated Scheduling Strategies for Renewable Energy Generation and Electric Vehicles

2023-12-21

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Monte Carlo Simulation Study of Different Types of Electric Vehicle Charging Loads (including Conventional Charging, Fast Charging, Battery Swapping)

2023-12-19

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Bi-level Optimization Scheduling Strategy Considering Large-scale Electric Vehicle Integration into the Grid【IEEE 33 Nodes】

2023-08-28

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Unidirectional/Bidirectional V2G Environment Joint Configuration Method for Distributed Power Sources and Electric Vehicle Charging Stations (MATLAB Code Implementation)

2023-08-27

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Joint Configuration Method for Distributed Power Sources and Electric Vehicle Charging Stations Considering Dispatchable Characteristics of Charging Loads

2023-08-26

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Optimization Configuration Method for Electric Vehicle Charging Stations with Multiple Types of Charging Piles

2023-08-25

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Convex Optimization Algorithm for Electric Vehicle Scheduling Based on Model Predictive Control (MPC)

2023-07-04

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Optimization Configuration Method for Electric Vehicle Charging Stations with Multiple Types of Charging Piles

2023-06-16

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Site Selection and Capacity Determination for Electric Vehicle Battery Swapping Stations

2023-06-15

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Ordered Charging Scheduling Method for Electric Vehicles Considering Different Charging Demands

2023-06-13

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

MATLAB| Bi-level Optimization Scheduling Strategy Considering Large-scale Electric Vehicle Integration into the Grid【IEEE 33 Nodes】

2023-05-11

Optimization of Ordered Charging Strategies for Electric Vehicles Based on Multi-Period Dynamic Electricity Pricing (MATLAB Code Implementation)

Leave a Comment