tic;
clear;
close all;
clc;
Q_L = table2array(readtable('weizhuangbian_line_at_10_1.csv', 'Range', 'C:C'))/1e3;
T_sample = 5/60;
t = T_sample*(0:1:(length(Q_L) - 1))';
Q_L_rate = [1, -1];
Cap = floor(Q_L_rate*max(Q_L)*1e2)/1e2;
C_bank_proportion = [1, 2, 4, 8];
L_bank_proportion = [1, 2, 4, 8];
Max_switch_times = 24;
Min_switch_timespan = 15/60;
Mode = [1, -1];
C_bank_proportion = sort(C_bank_proportion, 'ascend');
C_bank_Cap = Cap(1)/sum(C_bank_proportion)*C_bank_proportion;
[Q_C_Cap, ~, Q_proportion_plot_Cap, schedule_info_Cap, C_bank_status_info] = C_bank_schedule(T_sample, Q_L, Cap(1), ...
C_bank_proportion, ...
Max_switch_times, Mode(1));
L_bank_proportion = sort(L_bank_proportion, 'ascend');
L_bank_Cap = Cap(2)/sum(L_bank_proportion)*L_bank_proportion;
[Q_C_Rea, ~, Q_proportion_plot_Rea, schedule_info_Rea, L_bank_status_info] = L_bank_schedule(T_sample, Q_L, Cap(2), ...
L_bank_proportion, ...
Max_switch_times, Mode(2));
Q_proportion_plot = [Q_proportion_plot_Cap, Q_proportion_plot_Rea];
Q_C = Q_C_Cap + Q_C_Rea;
delta_Q = Q_L - Q_C;
figure(1);
ax = subplot(1, 1, 1);
stairs(t, Q_L, 'Color', '#0072BD', 'LineStyle', '-', 'LineWidth', 1.2);
hold on;
stairs(t, Q_proportion_plot, 'Color', '#D95319', 'LineStyle', '--', 'LineWidth', 0.5);
hold on;
stairs(t, Q_C, 'Color', '#D95319', 'LineStyle', '-', 'LineWidth', 1.2);
hold on;
stairs(t, delta_Q, 'Color', '#77AC30', 'LineStyle', '-', 'LineWidth', 1.2);
legend_label = cell(1, size(Q_L, 2) + size(Q_proportion_plot, 2) + size(Q_C, 2) + size(delta_Q, 2));
for count = 1:size(legend_label, 2)
if count <= size(Q_L, 2)
legend_label{count} = '{\it{Q_L}}';
elseif count <= size(Q_L, 2) + size(Q_proportion_plot, 2)
legend_label{count} = '';
elseif count <= size(Q_L, 2) + size(Q_proportion_plot, 2) + size(Q_C, 2)
legend_label{count} = '{\it{Q_C}}';
else
legend_label{count} = '{\Delta}{\it{Q}}';
end
end
legend(legend_label, 'Location', 'Southeastoutside');
ax.FontName = 'Times New Roman';
ax.FontSize = 12;
xlabel('{\it{t}} (h)', 'FontName', 'Times New Roman', 'FontSize', 14, 'Color', 'k');
ylabel('{\it{Q}} (Mvar)', 'FontSize', 14, 'Color', 'k');
grid('on');
set(ax, 'XLim', [0, 24], 'XTick', 0:4:24);
for count = 1:size(schedule_info_Cap.real_time_status, 2)
figure(count + 1);
ax = subplot(1, 2, 1);
width = 1;
bar(t, schedule_info_Cap.real_time_status(count).real_time_C_bank_status, width);
ax.FontName = 'Times New Roman';
ax.FontSize = 12;
xlabel('{\it{t}} (h)', 'FontName', 'Times New Roman', 'FontSize', 14, 'Color', 'k');
ylabel('Operation status (1, 0)', 'FontSize', 14, 'Color', 'k');
grid('on');
set(ax, 'XLim', [0, 24], 'XTick', 0:4:24);
set(ax, 'YLim', [0, 1], 'YTick', 0:1:1);
ax = subplot(1, 2, 2);
width = 1;
bar(t, schedule_info_Cap.real_time_status(count).is_C_bank_switched, width);
ax.FontName = 'Times New Roman';
ax.FontSize = 12;
xlabel('{\it{t}} (h)', 'FontName', 'Times New Roman', 'FontSize', 14, 'Color', 'k');
ylabel('Switch status (1, 0, -1)', 'FontSize', 14, 'Color', 'k');
grid('on');
set(ax, 'XLim', [0, 24], 'XTick', 0:4:24);
set(ax, 'YLim', [-1, 1], 'YTick', -1:1:1);
end
for count = 1:size(schedule_info_Rea.real_time_status, 2)
figure(count + 1 + size(schedule_info_Cap.real_time_status, 2));
ax = subplot(1, 2, 1);
width = 1;
bar(t, schedule_info_Rea.real_time_status(count).real_time_L_bank_status, width);
ax.FontName = 'Times New Roman';
ax.FontSize = 12;
xlabel('{\it{t}} (h)', 'FontName', 'Times New Roman', 'FontSize', 14, 'Color', 'k');
ylabel('Operation status (1, 0)', 'FontSize', 14, 'Color', 'k');
grid('on');
set(ax, 'XLim', [0, 24], 'XTick', 0:4:24);
set(ax, 'YLim', [0, 1], 'YTick', 0:1:1);
ax = subplot(1, 2, 2);
width = 1;
bar(t, schedule_info_Rea.real_time_status(count).is_L_bank_switched, width);
ax.FontName = 'Times New Roman';
ax.FontSize = 12;
xlabel('{\it{t}} (h)', 'FontName', 'Times New Roman', 'FontSize', 14, 'Color', 'k');
ylabel('Switch status (1, 0, -1)', 'FontSize', 14, 'Color', 'k');
grid('on');
set(ax, 'XLim', [0, 24], 'XTick', 0:4:24);
set(ax, 'YLim', [-1, 1], 'YTick', -1:1:1);
end
toc;
Academia1998
- 粉丝: 304
- 资源: 18
最新资源
- LABVIEW程序实例-前面板对象数据接收.zip
- LABVIEW程序实例-前面板对象数据接收.zip
- LABVIEW程序实例-求最大值.zip
- LABVIEW程序实例-求最大值.zip
- LABVIEW程序实例-日历控件.zip
- LABVIEW程序实例-日历控件.zip
- LABVIEW程序实例-强度图.zip
- LABVIEW程序实例-强度图.zip
- LABVIEW程序实例-三维曲线.zip
- LABVIEW程序实例-三维曲线.zip
- LABVIEW程序实例-三维表面.zip
- LABVIEW程序实例-三维表面.zip
- LABVIEW程序实例-三维参数表面.zip
- LABVIEW程序实例-三维参数表面.zip
- LABVIEW程序实例-设置颜色.zip
- LABVIEW程序实例-设置颜色.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈