function show_results(feeder,res)
%|---------------------------------------------|
%| Power flow in power distribution networks |
%| Plot the feeder and show results |
%| By: Alejandro Garces |
%| alejandro.garces@utp.edu.co |
%| sites.google.com/utp.edu.co/alejandro/home |
%|---------------------------------------------|
num_n = feeder.num_n;
hold off
plot(feeder.xy(1,1),feeder.xy(1,2),'r.','MarkerSize',12);
hold on
for k = 2:num_n
plot(feeder.xy(k,1),feeder.xy(k,2),'b.','MarkerSize',12);
end
for k = 1:feeder.num_l
n1 = feeder.graph(k,1);
n2 = feeder.graph(k,2);
plot([feeder.xy(n1,1),feeder.xy(n2,1)],[feeder.xy(n1,2),feeder.xy(n2,2)],'b')
end
hold off
axis off
node = (1:num_n)';
v_pu = abs(res.v_node);
v_a = v_pu(1:num_n);
v_b = v_pu((num_n+1):2*num_n);
v_c = v_pu((2*num_n+1):3*num_n);
angle_deg = angle(res.v_node)*180/pi;
ang_a = angle_deg(1:num_n);
ang_b = angle_deg((num_n+1):2*num_n);
ang_c = angle_deg((2*num_n+1):3*num_n);
sbase = feeder.p_base*1000;
p = round(real(res.s_node)*sbase,4);
p_a = p(1:num_n);
p_b = p((num_n+1):2*num_n);
p_c = p((2*num_n+1):3*num_n);
q = round(imag(res.s_node)*sbase,4);
q_a = q(1:num_n);
q_b = q((num_n+1):2*num_n);
q_c = q((2*num_n+1):3*num_n);
disp('-----------------------------------------------------------------------------');
disp(' Table 1: Nodal Voltages (v in pu, ang in deg)');
disp('-----------------------------------------------------------------------------');
disp(table(node,v_a,ang_a,v_b,ang_b,v_c,ang_c));
disp('-----------------------------------------------------------------------------');
disp(' Table 2: Nodal Power (p in kW, q in kVAr)');
disp('-----------------------------------------------------------------------------');
disp(table(node,p_a,q_a,p_b,q_b,p_c,q_c));
disp('-----------------------------------------------------------------------------');
disp(' Table 3: General data');
disp('-----------------------------------------------------------------------------');
psubA=round(res.s_node(1)*sbase,3);
psubB=round(res.s_node(feeder.num_n+1)*sbase,3);
psubC=round(res.s_node(2*feeder.num_n+1)*sbase,3);
psubT=psubA+psubB+psubC;
vminA = min(v_a);
vminB = min(v_b);
vminC = min(v_c);
vmaxA = max(v_a(2:end));
vmaxB = max(v_b(2:end));
vmaxC = max(v_c(2:end));
vbase = feeder.v_base*1000;
t = res.scenario/feeder.num_e;
h = floor(t*24);
m = (t*24-floor(t*24))*60;
disp(strcat(' Number of nodes :',num2str(num_n)));
disp(strcat(' Number of lines :',num2str(feeder.num_l)));
disp(strcat(' Number of loads :',num2str(feeder.num_d)));
disp(strcat(' Scenario :',num2str(res.scenario)));
disp(strcat(' Time :',num2str(h),'h-',num2str(m),'min'));
disp(strcat(' Iterations :',num2str(res.iter)));
disp(' Minimum voltages');
disp(strcat(' Phase A :',num2str(round(vminA,4)),'(',num2str(round(vminA*vbase,2)),'V)'));
disp(strcat(' Phase B :',num2str(round(vminB,4)),'(',num2str(round(vminB*vbase,2)),'V)'));
disp(strcat(' Phase C :',num2str(round(vminC,4)),'(',num2str(round(vminC*vbase,2)),'V)'));
disp(' Maximum voltages');
disp(strcat(' Phase A :',num2str(round(vmaxA,4)),'(',num2str(round(vmaxA*vbase,2)),'V)'));
disp(strcat(' Phase B :',num2str(round(vmaxB,4)),'(',num2str(round(vmaxB*vbase,2)),'V)'));
disp(strcat(' Phase C :',num2str(round(vmaxC,4)),'(',num2str(round(vmaxC*vbase,2)),'V)'));
disp(' Power at substation ');
disp(strcat(' Phase A :',num2str(real(psubA)),' kW + ',num2str(imag(psubA)),' kVAr'));
disp(strcat(' Phase B :',num2str(real(psubB)),' kW + ',num2str(imag(psubB)),' kVAr'));
disp(strcat(' Phase C :',num2str(real(psubC)),' kW + ',num2str(imag(psubC)),' kVAr'));
disp(strcat(' Total :',num2str(real(psubT)),' kW + ',num2str(imag(psubT)),' kVAr'));
disp(strcat(' Total power loss :',num2str(res.p_loss*sbase),' kW'));
disp('-----------------------------------------------------------------------------');
end
- 1
- 2
前往页