本文主要是介绍粒子群算法电力系统【原创附代码】,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
以下为我论文的代码。想要的话可以等我发出来再联系我。
请别小看这几行代码。占据了我代码main函数的半壁江山。
figure(1)
tiledlayout(2,2);
nexttile
hold on
plot(lambda_C_s, '-x', 'LineWidth',1.7, 'Color',[254 199 199]/255, 'DisplayName','供电局向区域外销售电价');
plot(lambda_C_p, '-^', 'LineWidth',1.7, 'Color',[254 47 47]/255, 'DisplayName','供电局从区域外购买电价');
plot(The_Optimal_Profit.opt_variable(25:48), '-s','LineWidth',1.7, 'Color',[51 51 248]/255, 'DisplayName','供电局向台区售电电价')
plot(The_Optimal_Profit.opt_variable(1:24), '-d', 'LineWidth',1.7, 'Color',[42 42 252]/255, 'DisplayName','供电局向台区购电电价')
title('系统电价示意图')
legend
hold off
nexttile
hold on
plot(1:T, output1(6,:), "Color",[219, 049, 036]/255, 'DisplayName','购电出力');
plot(1:T, output1(1,:), 'Color',[252, 140, 090]/255, 'DisplayName','传统发电出力');
plot(1:T, output1(2,:) ,'Color',[144, 190, 223]/255, 'DisplayName','绿电(风电)出力');
plot(1:T, output1(3,:),'Color',[15, 10, 223]/255, 'DisplayName','绿电(光伏)出力');
% plot(1:T, Power_didscharging_storage ,'Color',[75, 116, 178]/255, 'DisplayName','储能放电');
title('系统1可动用的全部电力供应')
legend
hold off
nexttile
hold on
plot(1:T, output1(4,:), "Color",[219, 049, 036]/255, 'DisplayName','原始的负荷');
plot(1:T, output1(4,:)-output1(5,:), 'Color',[252, 140, 090]/255, 'DisplayName','需求侧响应以后的负荷');
title('系统1中存在的电力负荷')
legend
hold off
nexttile
bar(output1(8,:),'FaceColor',[15, 10, 223]/255, 'DisplayName','交易的绿证');
title('系统1中交易的绿证')figure(2)
tiledlayout(2,2);
nexttile
hold on
plot(lambda_C_s, '-x', 'LineWidth',1.7, 'Color',[254 199 199]/255, 'DisplayName','供电局向区域外销售电价');
plot(lambda_C_p, '-^', 'LineWidth',1.7, 'Color',[254 47 47]/255, 'DisplayName','供电局从区域外购买电价');
plot(The_Optimal_Profit.opt_variable(25:48), '-s','LineWidth',1.7, 'Color',[51 51 248]/255, 'DisplayName','供电局向台区售电电价')
plot(The_Optimal_Profit.opt_variable(1:24), '-d', 'LineWidth',1.7, 'Color',[42 42 252]/255, 'DisplayName','供电局向台区购电电价')
title('系统电价示意图')
legend
hold off
nexttile
hold on
plot(1:T, output2(6,:), "Color",[219, 049, 036]/255, 'DisplayName','购电出力');
plot(1:T, output2(1,:), 'Color',[252, 140, 090]/255, 'DisplayName','传统发电出力');
plot(1:T, output2(2,:) ,'Color',[144, 190, 223]/255, 'DisplayName','绿电(风电)出力');
plot(1:T, output2(3,:),'Color',[15, 10, 223]/255, 'DisplayName','绿电(光伏)出力');
title('系统2可动用的全部电力供应')
legend
hold off
nexttile
hold on
plot(1:T, output2(4,:), "Color",[219, 049, 036]/255, 'DisplayName','原始的负荷');
plot(1:T, output2(4,:)-output2(5,:), 'Color',[252, 140, 090]/255, 'DisplayName','需求侧响应以后的负荷');
title('系统2中存在的电力负荷')
legend
hold off
nexttile
bar(output2(8,:),'FaceColor',[15, 10, 223]/255, 'DisplayName','交易的绿证');
title('系统2中交易的绿证')figure(3)
tiledlayout(2,2);
nexttile
hold on
plot(lambda_C_s, '-x', 'LineWidth',1.7, 'Color',[254 199 199]/255, 'DisplayName','供电局向区域外销售电价');
plot(lambda_C_p, '-^', 'LineWidth',1.7, 'Color',[254 47 47]/255, 'DisplayName','供电局从区域外购买电价');
plot(The_Optimal_Profit.opt_variable(25:48), '-s','LineWidth',1.7, 'Color',[51 51 248]/255, 'DisplayName','供电局向台区售电电价')
plot(The_Optimal_Profit.opt_variable(1:24), '-d', 'LineWidth',1.7, 'Color',[42 42 252]/255, 'DisplayName','供电局向台区购电电价')
title('系统电价示意图')
legend
hold off
nexttile
hold on
plot(1:T, output3(6,:), "Color",[219, 049, 036]/255, 'DisplayName','购电出力');
plot(1:T, output3(1,:), 'Color',[252, 140, 090]/255, 'DisplayName','传统发电出力');
plot(1:T, output3(2,:) ,'Color',[144, 190, 223]/255, 'DisplayName','绿电(风电)出力');
plot(1:T, output3(3,:),'Color',[15, 10, 223]/255, 'DisplayName','绿电(光伏)出力');
% plot(1:T, Power_didscharging_storage ,'Color',[75, 116, 178]/255, 'DisplayName','储能放电');
title('系统3可动用的全部电力供应')
legend
hold off
nexttile
hold on
plot(1:T, output3(4,:), "Color",[219, 049, 036]/255, 'DisplayName','原始的负荷');
plot(1:T, output3(4,:)-output3(5,:), 'Color',[252, 140, 090]/255, 'DisplayName','需求侧响应以后的负荷');
title('系统3中存在的电力负荷')
legend
hold off
nexttile
bar(output3(8,:),'FaceColor',[15, 10, 223]/255, 'DisplayName','交易的绿证');
title('系统3中交易的绿证')
这篇关于粒子群算法电力系统【原创附代码】的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!