1 简介 在研究电动汽车用户充电需求的前提下,利用蒙特卡洛方法对2种不同充电方式进行模拟并对其进行分析;分析用户响应度对电动汽车有序充电的影响,建立峰谷分时电价对电动汽车负
1 简介
在研究电动汽车用户充电需求的前提下,利用蒙特卡洛方法对2种不同充电方式进行模拟并对其进行分析;分析用户响应度对电动汽车有序充电的影响,建立峰谷分时电价对电动汽车负荷影响的模型,在模拟出电动汽车无序充电负荷的基础上,用实际案例对模型进行验证,利用多目标优化遗传算法进行求解,验证峰谷分时电价对电网负荷优化的有效性.
2 部分代码
function [parent_selected] = tour_selection(pool)%% Description
% 1. 通过基于等级和拥挤距离的二元锦标赛选择从人口池中选择父母以进行繁殖。
% 2. 如果排名低于另一个,或者如果排名低于另一个,则选择一个拥挤距离大于其他
% 3. Input and output are of same size [pop_size, V+M+3].
%% Binary Tournament Selection
[pop_size, distance]=size(pool);
rank=distance-1;
candidate=[randperm(pop_size);randperm(pop_size)]';
for i = 1: pop_size
parent=candidate(i,:); % Two parents indexes are randomly selected
if pool(parent(1),rank)~=pool(parent(2),rank) % For parents with different ranks
if pool(parent(1),rank)<pool(parent(2),rank) % Checking the rank of two individuals
mincandidate=pool(parent(1),:);
elseif pool(parent(1),rank)>pool(parent(2),rank)
mincandidate=pool(parent(2),:);
end
parent_selected(i,:)=mincandidate; % Minimum rank individual is selected finally
else % for parents with same ranks
if pool(parent(1),distance)>pool(parent(2),distance) % Checking the distance of two parents
maxcandidate=pool(parent(1),:);
elseif pool(parent(1),distance)< pool(parent(2),distance)
maxcandidate=pool(parent(2),:);
else
temp=randperm(2);
maxcandidate=pool(parent(temp(1)),:);
end
parent_selected(i,:)=maxcandidate; % Maximum distance individual is selected finally
end
end
3 仿真结果
4 参考文献
[1]欧名勇, 陈仲伟, 谭玉东,等. 基于峰谷分时电价引导下的电动汽车充电负荷优化[J]. 电力科学与技术学报, 2020, 35(5):6.