马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!
您需要 登录 才可以下载或查看,没有账号?立即加入
×
现在用matpower工具算潮流,发现一个问题。执行runpf('case××')算得某一个PV节点的无功出力是24.3,然后我修改generator data数据中的Qmax和Qmin,把Qmax改成了24,然后重新用runpf函数来算,可是得到最后的结果,这个PV节点的无功出力还是24.3。) B" s ~% Y8 | A; w/ H
我查看runpf.m文件,发现里面有关于无功限制的语句,就是当无功越界时,将PV节点转为PQ节点。那么为什么执行不了呢?求教各位朋友~~谢谢~~
! c3 @2 w0 T2 K8 a; K这是runpf.m文件中关于无功越界处理的语句,从234行开始:( k8 J2 C7 k% ~! Y
%% find gens with violated Q constraints0 a$ T4 [) I" s u% J7 I! l
mx = find( gen(:, GEN_STATUS) > 0 & gen(:, QG) > gen(:, QMAX) );
' X0 d' r' j3 Z! B mn = find( gen(:, GEN_STATUS) > 0 & gen(:, QG) < gen(:, QMIN) );
% y5 a0 W" Y, zif ~isempty(mx) || ~isempty(mn) %% we have some Q limit violations$ e- {; [9 R O( z0 I
if isempty(pv)( g2 s& r9 r T) l! X
if verbose9 ^3 I, Z4 x/ m; U# e9 \& p% M2 Q
if ~isempty(mx) % u9 T, {2 j- b, b( f4 s& m
fprintf('Gen %d (only one left) exceeds upper Q limit : INFEASIBLE PROBLEM\n', mx);4 l/ A- E+ @& @$ o& i- ]
else' [+ u. ~$ M; a' _1 K: o d \
fprintf('Gen %d (only one left) exceeds lower Q limit : INFEASIBLE PROBLEM\n', mn);9 u$ s! D* g3 S' K# t, d+ E# {
end
: l' t2 m& S" M# q6 L end+ h% |1 T' b" H; D, _+ E4 S; |
success = 0;6 `) b; F+ g) M* B
break;
; O! f- @9 B0 a, W end$ c% k& w5 a' [' b
$ U" G2 i! L+ M0 S }" ^ x
%% one at a time? T9 }4 s" F# b
if qlim == 2 %% fix largest violation, ignore the rest0 o- z+ f" R2 {( S+ w. ]6 h L" g
[junk, k] = max([gen(mx, QG) - gen(mx, QMAX);9 v- D2 L- E3 S, ?9 y7 b5 }+ P, l
gen(mn, QMIN) - gen(mn, QG)]);
: T5 w* Z7 e* J if k > length(mx)5 q6 ? k7 y% r w6 |2 F8 f' @0 p
mn = mn(k-length(mx));* o$ r- e) Y3 ?6 n, d. t
mx = [];
+ r, o( V! C& f! \) S, c" h7 _ else
5 w4 m6 j+ d5 s9 c `$ x% z2 a% \ mx = mx(k);5 E% x; G- H# P3 F; {7 d/ J
mn = [];
+ X; Y+ D& ?$ a! G0 B' [6 b$ v# T end
3 ~) x+ K# e/ h+ X end
" W+ ~* U# E+ |+ S- z2 {
B; q# x7 Y4 d/ b/ s' y if verbose && ~isempty(mx)
O) @. M1 |7 n* x, W5 E fprintf('Gen %d at upper Q limit, converting to PQ bus\n', mx);2 z- ?2 x' c) b, q& H* w* _9 i. e
end
9 g& S2 L3 M+ C. a7 l4 A" o if verbose && ~isempty(mn)
! @ c$ F' e! C4 {. V- ~) A/ S fprintf('Gen %d at lower Q limit, converting to PQ bus\n', mn);: z N Y! P+ ^) n! N2 H
end! n" U+ r4 ?- r0 A. Z0 E7 O
8 u0 y8 H+ w* R, z3 i% I
%% save corresponding limit values4 X2 A1 l/ e+ f2 k$ d
fixedQg(mx) = gen(mx, QMAX);
6 U: B1 ^6 S" N# A fixedQg(mn) = gen(mn, QMIN);' H; M. c: B/ |" C
mx = [mx;mn];
1 G. O& e& G* M: U% i
5 Z+ J4 n4 s" m) w ?$ h8 ~ %% convert to PQ bus8 f* w: f% S6 [1 i6 R/ _6 S
gen(mx, QG) = fixedQg(mx); %% set Qg to binding limit
! f" Y& v; J; k; D2 S! l9 Y2 p/ I gen(mx, GEN_STATUS) = 0; %% temporarily turn off gen,
( G3 d7 v' v$ j/ `0 u for i = 1:length(mx) %% (one at a time, since* Q! n- x3 g$ a2 v& ~6 M0 N* \
bi = gen(mx(i), GEN_BUS); %% they may be at same bus)
8 U5 X5 z) ^3 q2 f9 o: Q0 c bus(bi, [PD,QD]) = ... %% adjust load accordingly, P* y. i1 D) x
bus(bi, [PD,QD]) - gen(mx(i), [PG,QG]);
8 y, z- }5 l0 e' b end' Q3 ^7 D( u. c$ v8 }# c
if length(ref) > 1 && any(bus(gen(mx, GEN_BUS), BUS_TYPE) == REF)# I# z0 y6 r" d3 E- q/ W9 \, `
error('Sorry, MATPOWER cannot enforce Q limits for slack buses in systems with multiple slacks.');
; ^0 F8 c3 x7 j! ~: m: } end5 u: R5 T1 X$ R0 ?! T
bus(gen(mx, GEN_BUS), BUS_TYPE) = PQ; %% & set bus type to PQ |