重新制作了生成直方图的函数。
Signed-off-by: dugg@lab-desk <dugg@lab-desk>
This commit is contained in:
parent
8f5fe67a6a
commit
3231d81b99
|
|
@ -0,0 +1,83 @@
|
||||||
|
function createfigure(xvector1, yvector1, xvector2, yvector2, xvector3, yvector3)
|
||||||
|
%CREATEFIGURE(XVECTOR1,YVECTOR1,XVECTOR2,YVECTOR2,XVECTOR3,YVECTOR3)
|
||||||
|
% XVECTOR1: bar xvector
|
||||||
|
% YVECTOR1: bar yvector
|
||||||
|
% XVECTOR2: bar xvector
|
||||||
|
% YVECTOR2: bar yvector
|
||||||
|
% XVECTOR3: bar xvector
|
||||||
|
% YVECTOR3: bar yvector
|
||||||
|
|
||||||
|
% Auto-generated by MATLAB on 11-Feb-2015 17:24:27
|
||||||
|
|
||||||
|
% Create figure
|
||||||
|
figure1 = figure('Name','相角直方图','Color',[1 1 1]);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes1 = axes('Parent',figure1,'XTick',[-0.0002 -0.0001 0 0.0001 0.0002],...
|
||||||
|
'Position',[0.0920853080568723 0.470619469026549 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
xlim(axes1,[-0.0003 0.0003]);
|
||||||
|
% Uncomment the following line to preserve the Y-limits of the axes
|
||||||
|
ylim(axes1,[0 11]);
|
||||||
|
box(axes1,'on');
|
||||||
|
hold(axes1,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector1,yvector1,'FaceColor',[0 0 0],'Parent',axes1);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('误差/弧度','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形A','FontSize',13);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes2 = axes('Parent',figure1,'XTick',[-0.002 -0.001 0 0.001 0.002],...
|
||||||
|
'Position',[0.350370561164917 0.466814159292035 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
xlim(axes2,[-0.002 0.002]);
|
||||||
|
% Uncomment the following line to preserve the Y-limits of the axes
|
||||||
|
ylim(axes2,[0 7]);
|
||||||
|
box(axes2,'on');
|
||||||
|
hold(axes2,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector2,yvector2,'FaceColor',[0 0 0],'Parent',axes2);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('误差/弧度','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形B','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes3 = axes('Parent',figure1,'XTick',[-0.002 -0.001 0 0.001 0.002],...
|
||||||
|
'Position',[0.606286146026517 0.463982300884956 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
xlim(axes3,[-0.002 0.002]);
|
||||||
|
% Uncomment the following line to preserve the Y-limits of the axes
|
||||||
|
ylim(axes3,[0 10]);
|
||||||
|
box(axes3,'on');
|
||||||
|
hold(axes3,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector3,yvector3,'FaceColor',[0 0 0],'Parent',axes3);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('误差/弧度','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形C','FontSize',13);
|
||||||
|
|
||||||
|
|
@ -0,0 +1,115 @@
|
||||||
|
function createfigure(X1, YMatrix1, YMatrix2, YMatrix3, YMatrix4)
|
||||||
|
%CREATEFIGURE(X1,YMATRIX1,YMATRIX2,YMATRIX3,YMATRIX4)
|
||||||
|
% X1: vector of x data
|
||||||
|
% YMATRIX1: matrix of y data
|
||||||
|
% YMATRIX2: matrix of y data
|
||||||
|
% YMATRIX3: matrix of y data
|
||||||
|
% YMATRIX4: matrix of y data
|
||||||
|
|
||||||
|
% Auto-generated by MATLAB on 11-Feb-2015 16:31:59
|
||||||
|
|
||||||
|
% Create figure
|
||||||
|
figure1 = figure('Color',[1 1 1]);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes1 = axes('Parent',figure1,'XTick',[1 4 7 10 13 16 19 22 25 28 31 33],...
|
||||||
|
'Position',[0.140663507109006 0.572508000217951 0.537061611374407 0.365998852384935],...
|
||||||
|
'FontName','Times New Roman');
|
||||||
|
hold(axes1,'all');
|
||||||
|
|
||||||
|
% Create multiple lines using matrix input to plot
|
||||||
|
plot1 = plot(X1,YMatrix1,'Parent',axes1,'LineStyle',':','Color',[0 0 0]);
|
||||||
|
set(plot1(1),'Marker','diamond','DisplayName','情形A');
|
||||||
|
set(plot1(2),'Marker','square','DisplayName','情形B');
|
||||||
|
set(plot1(3),'Marker','o','DisplayName','情形C');
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('节点号','FontName','黑体');
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('偏差/p.u','FontName','Times New Roman');
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes2 = axes('Parent',figure1,'XTick',[2 5 8 11 14 17 20 23 26 29 32],...
|
||||||
|
'Position',[0.143033175355449 0.120301205914361 0.537914691943128 0.365998852384935],...
|
||||||
|
'FontName','Times New Roman');
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
% xlim(axes2,[2 33]);
|
||||||
|
hold(axes2,'all');
|
||||||
|
|
||||||
|
% Create multiple lines using matrix input to plot
|
||||||
|
plot2 = plot(X1,YMatrix3,'Parent',axes2,'LineStyle',':','Color',[0 0 0]);
|
||||||
|
set(plot2(1),'Marker','diamond','DisplayName','算例A');
|
||||||
|
set(plot2(2),'Marker','square','DisplayName','算例B');
|
||||||
|
set(plot2(3),'Marker','o','DisplayName','算例C');
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('节点号','FontName','Times New Roman');
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('相对偏差%','FontName','Times New Roman');
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('有功');
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes3 = axes('Parent',figure1,...
|
||||||
|
'XTickLabel',{'1','4','7','10','13','16','19','22','25','28','31','33'},...
|
||||||
|
'XTick',[1 4 7 10 13 16 19 22 25 28 31 33],...
|
||||||
|
'Position',[0.440758293838865 0.574607379571982 0.537914691943128 0.365998852384935]);
|
||||||
|
hold(axes3,'all');
|
||||||
|
|
||||||
|
% Create multiple lines using matrix input to plot
|
||||||
|
plot3 = plot(X1,YMatrix2,'Parent',axes3,'LineStyle',':','Color',[0 0 0]);
|
||||||
|
set(plot3(1),'Marker','diamond','DisplayName','情形A');
|
||||||
|
set(plot3(2),'Marker','square','DisplayName','情形B');
|
||||||
|
set(plot3(3),'Marker','o','DisplayName','情形C');
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('节点号');
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('偏差/弧度');
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes4 = axes('Parent',figure1,'XTick',[2 5 8 11 14 17 20 23 26 29 32],...
|
||||||
|
'Position',[-0.490853080568712 -0.0598281717337482 0.537914691943128 0.365998852384935]);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
% xlim(axes4,[2 33]);
|
||||||
|
hold(axes4,'all');
|
||||||
|
|
||||||
|
% Create multiple lines using matrix input to plot
|
||||||
|
plot4 = plot(X1,YMatrix4,'Parent',axes4,'LineStyle',':','Color',[0 0 0]);
|
||||||
|
set(plot4(1),'Marker','diamond','DisplayName','算例A');
|
||||||
|
set(plot4(2),'Marker','square','DisplayName','算例B');
|
||||||
|
set(plot4(3),'Marker','o','DisplayName','算例C');
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('节点号');
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('相对偏差%');
|
||||||
|
|
||||||
|
% Create legend
|
||||||
|
legend1 = legend(axes1,'show');
|
||||||
|
set(legend1,...
|
||||||
|
'Position',[0.155301294649576 0.633902089695378 0.112559241706161 0.12206572769953],...
|
||||||
|
'FontName','黑体');
|
||||||
|
|
||||||
|
% Create legend
|
||||||
|
legend2 = legend(axes2,'show');
|
||||||
|
set(legend2,...
|
||||||
|
'Position',[0.533220206544619 0.178635859349444 0.112559241706161 0.12206572769953],...
|
||||||
|
'FontName','黑体');
|
||||||
|
|
||||||
|
% Create legend
|
||||||
|
legend3 = legend(axes3,'show');
|
||||||
|
set(legend3,...
|
||||||
|
'Position',[0.450281817919025 0.807479462339755 0.117298578199052 0.12206572769953],...
|
||||||
|
'FontName','黑体');
|
||||||
|
|
||||||
|
% Create legend
|
||||||
|
legend4 = legend(axes4,'show');
|
||||||
|
set(legend4,...
|
||||||
|
'Position',[-0.098296381133102 -0.0539564029130473 0.117298578199052 0.122065727699531]);
|
||||||
|
|
||||||
37
OPF.m
37
OPF.m
|
|
@ -143,13 +143,13 @@ plot(1:length(CaseBREA),(CaseBREA),'b:','Marker','square');
|
||||||
subplot(4,1,3);
|
subplot(4,1,3);
|
||||||
hold on;
|
hold on;
|
||||||
% CaseBREP=(PD-RealPD)./(RealPD+0.00001)*100;%Relative Error of PD in Case B
|
% CaseBREP=(PD-RealPD)./(RealPD+0.00001)*100;%Relative Error of PD in Case B
|
||||||
CaseBREP=(PD-RealPD)./RealPD;%Relative Error of PD in Case B
|
CaseBREP=(PD-RealPD)./RealPD*100;%Relative Error of PD in Case B
|
||||||
RealPD(1)=0;
|
RealPD(1)=0;
|
||||||
plot(1:length(CaseBREP),(CaseBREP),'b:','Marker','square');
|
plot(1:length(CaseBREP),(CaseBREP),'b:','Marker','square');
|
||||||
subplot(4,1,4);
|
subplot(4,1,4);
|
||||||
hold on;
|
hold on;
|
||||||
% CaseBREQ=(QD-RealQD)./(RealQD+0.00001)*100;%Relative Error of QD in Case B
|
% CaseBREQ=(QD-RealQD)./(RealQD+0.00001)*100;%Relative Error of QD in Case B
|
||||||
CaseBREQ=(QD-RealQD)./RealQD;%Relative Error of QD in Case B
|
CaseBREQ=(QD-RealQD)./RealQD*100;%Relative Error of QD in Case B
|
||||||
CaseBREQ(1)=0;
|
CaseBREQ(1)=0;
|
||||||
plot(1:length(CaseBREQ),(CaseBREQ),'b:','Marker','square');
|
plot(1:length(CaseBREQ),(CaseBREQ),'b:','Marker','square');
|
||||||
CaseBE=sqrt((sum(CaseBREV.^2)+sum(CaseBREA.^2)+sum(CaseBREP.^2)+sum(CaseBREQ.^2))/132);
|
CaseBE=sqrt((sum(CaseBREV.^2)+sum(CaseBREA.^2)+sum(CaseBREP.^2)+sum(CaseBREQ.^2))/132);
|
||||||
|
|
@ -233,6 +233,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
voltBarCaseAX=x;
|
||||||
|
voltBarCaseAY=yy;
|
||||||
xlabel('Error');
|
xlabel('Error');
|
||||||
ylabel('Number of buses');
|
ylabel('Number of buses');
|
||||||
title('算例A');
|
title('算例A');
|
||||||
|
|
@ -246,9 +248,11 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
voltBarCaseBX=x;
|
||||||
|
voltBarCaseBY=yy;
|
||||||
xlabel('Error');
|
xlabel('Error');
|
||||||
ylabel('Number of buses');
|
ylabel('Number of buses');
|
||||||
title('ËãÀýD');
|
title('ËăŔýB');
|
||||||
% ylim([0 4])
|
% ylim([0 4])
|
||||||
%Case C
|
%Case C
|
||||||
subplot(1,3,3)
|
subplot(1,3,3)
|
||||||
|
|
@ -259,6 +263,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
voltBarCaseCX=x;
|
||||||
|
voltBarCaseCY=yy;
|
||||||
xlabel('Error');
|
xlabel('Error');
|
||||||
ylabel('Number of buses');
|
ylabel('Number of buses');
|
||||||
title('算例C');
|
title('算例C');
|
||||||
|
|
@ -275,6 +281,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
angelBarCaseAX=x;
|
||||||
|
angelBarCaseAY=yy;
|
||||||
% ylim([0 4])
|
% ylim([0 4])
|
||||||
%Case B
|
%Case B
|
||||||
subplot(2,2,2)
|
subplot(2,2,2)
|
||||||
|
|
@ -285,6 +293,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
angelBarCaseBX=x;
|
||||||
|
angelBarCaseBY=yy;
|
||||||
% ylim([0 4])
|
% ylim([0 4])
|
||||||
%Case C
|
%Case C
|
||||||
subplot(2,2,3)
|
subplot(2,2,3)
|
||||||
|
|
@ -293,6 +303,8 @@ ymin=min(y);
|
||||||
ymax=max(y);
|
ymax=max(y);
|
||||||
x=linspace(ymin,ymax,split_number); %将最大最小区间分成split_number个等分点(19等分),然后分别计算各个区间的个数
|
x=linspace(ymin,ymax,split_number); %将最大最小区间分成split_number个等分点(19等分),然后分别计算各个区间的个数
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
|
angelBarCaseCX=x;
|
||||||
|
angelBarCaseCY=yy;
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
%PD
|
%PD
|
||||||
|
|
@ -307,6 +319,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
PDBarCaseAX=x;
|
||||||
|
PDBarCaseAY=yy;
|
||||||
% ylim([0 4])
|
% ylim([0 4])
|
||||||
%Case B
|
%Case B
|
||||||
subplot(2,2,2)
|
subplot(2,2,2)
|
||||||
|
|
@ -317,6 +331,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
PDBarCaseBX=x;
|
||||||
|
PDBarCaseBY=yy;
|
||||||
% ylim([0 4])
|
% ylim([0 4])
|
||||||
%Case C
|
%Case C
|
||||||
subplot(2,2,3)
|
subplot(2,2,3)
|
||||||
|
|
@ -327,6 +343,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
PDBarCaseCX=x;
|
||||||
|
PDBarCaseCY=yy;
|
||||||
%QD
|
%QD
|
||||||
figure('Name','无功直方图')
|
figure('Name','无功直方图')
|
||||||
split_number=20;
|
split_number=20;
|
||||||
|
|
@ -339,6 +357,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
QDBarCaseAX=x;
|
||||||
|
QDBarCaseAY=yy;
|
||||||
% ylim([0 4])
|
% ylim([0 4])
|
||||||
%Case B
|
%Case B
|
||||||
subplot(2,2,2)
|
subplot(2,2,2)
|
||||||
|
|
@ -349,6 +369,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
QDBarCaseBX=x;
|
||||||
|
QDBarCaseBY=yy;
|
||||||
% ylim([0 4])
|
% ylim([0 4])
|
||||||
%Case C
|
%Case C
|
||||||
subplot(2,2,3)
|
subplot(2,2,3)
|
||||||
|
|
@ -359,6 +381,8 @@ x=linspace(ymin,ymax,split_number); %
|
||||||
yy=hist(y,x); %计算各个区间的个数
|
yy=hist(y,x); %计算各个区间的个数
|
||||||
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
% yy=yy/(sum(yy)*(ymax-ymin)/split_number); %计算各个区间的个数,除以总面积,总面积计算的方式为:所有小分割的面积的和即:
|
||||||
bar(x,yy) %画出概率密度分布图
|
bar(x,yy) %画出概率密度分布图
|
||||||
|
QDBarCaseCX=x;
|
||||||
|
QDBarCaseCY=yy;
|
||||||
%画收敛曲线
|
%画收敛曲线
|
||||||
fz=find(abs(plotGapA)==0);
|
fz=find(abs(plotGapA)==0);
|
||||||
% fz=fz(1);
|
% fz=fz(1);
|
||||||
|
|
@ -371,3 +395,10 @@ figure('Name','
|
||||||
%% 计算时间
|
%% 计算时间
|
||||||
calTime=[87 61; 211 87; 108 59;];
|
calTime=[87 61; 211 87; 108 59;];
|
||||||
bar(calTime,'stacked');
|
bar(calTime,'stacked');
|
||||||
|
% figure();
|
||||||
|
% DeviationFigure(1:33,[CaseAREV;CaseBREV;CaseCREV],[CaseAREA;CaseBREA;CaseCREA],[CaseAREP,CaseBREP,CaseCREP],[CaseAREQ,CaseBREQ,CaseCREQ]);%,[CaseAREA;CaseBREA;CaseCREA],[CaseAREV;CaseBREV;CaseCREV],[CaseAREV;CaseBREV;CaseCREV]);
|
||||||
|
% VoltBar(voltBarCaseAX,voltBarCaseAY,voltBarCaseBX,voltBarCaseBY,voltBarCaseCX,voltBarCaseCY);
|
||||||
|
% AngelBar(angelBarCaseAX,angelBarCaseBY,angelBarCaseCX,angelBarCaseAY,angelBarCaseBX,angelBarCaseCY);
|
||||||
|
% AngelBar(PDBarCaseAX,PDBarCaseAY,PDBarCaseBX,PDBarCaseBY,PDBarCaseCX,PDBarCaseCY);
|
||||||
|
QDBar(QDBarCaseAX,QDBarCaseAY,QDBarCaseBX,QDBarCaseBY,QDBarCaseCX,QDBarCaseCY);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,83 @@
|
||||||
|
function createfigure(xvector1, yvector1, xvector2, yvector2, xvector3, yvector3)
|
||||||
|
%CREATEFIGURE(XVECTOR1,YVECTOR1,XVECTOR2,YVECTOR2,XVECTOR3,YVECTOR3)
|
||||||
|
% XVECTOR1: bar xvector
|
||||||
|
% YVECTOR1: bar yvector
|
||||||
|
% XVECTOR2: bar xvector
|
||||||
|
% YVECTOR2: bar yvector
|
||||||
|
% XVECTOR3: bar xvector
|
||||||
|
% YVECTOR3: bar yvector
|
||||||
|
|
||||||
|
% Auto-generated by MATLAB on 11-Feb-2015 17:32:07
|
||||||
|
|
||||||
|
% Create figure
|
||||||
|
figure1 = figure('Name','相角直方图','Color',[1 1 1]);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes1 = axes('Parent',figure1,...
|
||||||
|
'Position',[0.0920853080568723 0.470619469026549 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
% xlim(axes1,[-4 4]);
|
||||||
|
% Uncomment the following line to preserve the Y-limits of the axes
|
||||||
|
% ylim(axes1,[0 6]);
|
||||||
|
box(axes1,'on');
|
||||||
|
hold(axes1,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector1,yvector1,'FaceColor',[0 0 0],'Parent',axes1);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('相对误差%','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形A','FontSize',13);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes2 = axes('Parent',figure1,'XTick',[-12 -6 0 6 12],...
|
||||||
|
'Position',[0.350370561164917 0.466814159292035 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
% xlim(axes2,[-12 12]);
|
||||||
|
% Uncomment the following line to preserve the Y-limits of the axes
|
||||||
|
% ylim(axes2,[0 8]);
|
||||||
|
box(axes2,'on');
|
||||||
|
hold(axes2,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector2,yvector2,'FaceColor',[0 0 0],'Parent',axes2);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('相对误差%','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形B','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes3 = axes('Parent',figure1,'XTick',[-12 -6 0 6 12],...
|
||||||
|
'Position',[0.606286146026517 0.463982300884956 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
% xlim(axes3,[-12 12]);
|
||||||
|
% Uncomment the following line to preserve the Y-limits of the axes
|
||||||
|
% ylim(axes3,[0 5]);
|
||||||
|
box(axes3,'on');
|
||||||
|
hold(axes3,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector3,yvector3,'FaceColor',[0 0 0],'Parent',axes3);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('相对误差%','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形C','FontSize',13);
|
||||||
|
|
||||||
|
|
@ -0,0 +1,77 @@
|
||||||
|
function createfigure(xvector1, yvector1, xvector2, yvector2, xvector3, yvector3)
|
||||||
|
%CREATEFIGURE(XVECTOR1,YVECTOR1,XVECTOR2,YVECTOR2,XVECTOR3,YVECTOR3)
|
||||||
|
% XVECTOR1: bar xvector
|
||||||
|
% YVECTOR1: bar yvector
|
||||||
|
% XVECTOR2: bar xvector
|
||||||
|
% YVECTOR2: bar yvector
|
||||||
|
% XVECTOR3: bar xvector
|
||||||
|
% YVECTOR3: bar yvector
|
||||||
|
|
||||||
|
% Auto-generated by MATLAB on 11-Feb-2015 17:36:00
|
||||||
|
|
||||||
|
% Create figure
|
||||||
|
figure1 = figure('Name','相角直方图','Color',[1 1 1]);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes1 = axes('Parent',figure1,...
|
||||||
|
'Position',[0.0920853080568723 0.470619469026549 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
xlim(axes1,[-3 3]);
|
||||||
|
box(axes1,'on');
|
||||||
|
hold(axes1,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector1,yvector1,'FaceColor',[0 0 0],'Parent',axes1);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('相对误差%','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形A','FontSize',13);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes2 = axes('Parent',figure1,'XTick',[-12 -6 0 6 12],...
|
||||||
|
'Position',[0.350370561164917 0.466814159292035 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
xlim(axes2,[-8 8]);
|
||||||
|
box(axes2,'on');
|
||||||
|
hold(axes2,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector2,yvector2,'FaceColor',[0 0 0],'Parent',axes2);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('相对误差%','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形B','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes3 = axes('Parent',figure1,'XTick',[-12 -6 0 6 12],...
|
||||||
|
'Position',[0.606286146026517 0.463982300884956 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
xlim(axes3,[-9 9]);
|
||||||
|
box(axes3,'on');
|
||||||
|
hold(axes3,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector3,yvector3,'FaceColor',[0 0 0],'Parent',axes3);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('相对误差%','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形C','FontSize',13);
|
||||||
|
|
||||||
|
|
@ -0,0 +1,79 @@
|
||||||
|
function createfigure(xvector1, yvector1, xvector2, yvector2, xvector3, yvector3)
|
||||||
|
%CREATEFIGURE(XVECTOR1,YVECTOR1,XVECTOR2,YVECTOR2,XVECTOR3,YVECTOR3)
|
||||||
|
% XVECTOR1: bar xvector
|
||||||
|
% YVECTOR1: bar yvector
|
||||||
|
% XVECTOR2: bar xvector
|
||||||
|
% YVECTOR2: bar yvector
|
||||||
|
% XVECTOR3: bar xvector
|
||||||
|
% YVECTOR3: bar yvector
|
||||||
|
|
||||||
|
% Auto-generated by MATLAB on 11-Feb-2015 17:21:34
|
||||||
|
|
||||||
|
% Create figure
|
||||||
|
figure1 = figure('Name','电压直方图','Color',[1 1 1]);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes1 = axes('Parent',figure1,'XTick',[-0.0002 -0.0001 0 0.0001 0.0002],...
|
||||||
|
'Position',[0.0920853080568723 0.470619469026549 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the Y-limits of the axes
|
||||||
|
ylim(axes1,[0 7]);
|
||||||
|
box(axes1,'on');
|
||||||
|
hold(axes1,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector1,yvector1,'FaceColor',[0 0 0],'Parent',axes1);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('误差/p.u','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形A','FontSize',13);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes2 = axes('Parent',figure1,...
|
||||||
|
'Position',[0.350370561164917 0.466814159292035 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
xlim(axes2,[-0.004 0.004]);
|
||||||
|
box(axes2,'on');
|
||||||
|
hold(axes2,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector2,yvector2,'FaceColor',[0 0 0],'Parent',axes2);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('误差/p.u','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形B','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create axes
|
||||||
|
axes3 = axes('Parent',figure1,...
|
||||||
|
'Position',[0.606286146026517 0.463982300884956 0.20649289099526 0.372300884955752],...
|
||||||
|
'FontSize',13);
|
||||||
|
% Uncomment the following line to preserve the X-limits of the axes
|
||||||
|
xlim(axes3,[-0.004 0.004]);
|
||||||
|
% Uncomment the following line to preserve the Y-limits of the axes
|
||||||
|
ylim(axes3,[0 7]);
|
||||||
|
box(axes3,'on');
|
||||||
|
hold(axes3,'all');
|
||||||
|
|
||||||
|
% Create bar
|
||||||
|
bar(xvector3,yvector3,'FaceColor',[0 0 0],'Parent',axes3);
|
||||||
|
|
||||||
|
% Create xlabel
|
||||||
|
xlabel('误差/p.u','FontSize',13);
|
||||||
|
|
||||||
|
% Create ylabel
|
||||||
|
ylabel('数量','FontSize',13);
|
||||||
|
|
||||||
|
% Create title
|
||||||
|
title('情形C','FontSize',13);
|
||||||
|
|
||||||
Loading…
Reference in New Issue