|
马上加入,结交更多好友,共享更多资料,让你轻松玩转电力研学社区!
您需要 登录 才可以下载或查看,没有账号?立即加入
×
各位~~我根据下图的一个系统用MATLAB编写了一段程序,是电流型前推回代法的三相配电系统潮流计算,但是现在结果不是我想要的,不收敛。请各位帮我看一下,提提建议。图片见附件了。还有个问题:已知的线路都是三相对称线路的阻抗值,那么线路的阻抗矩阵中的互阻抗应该如何计算,是什么样的形式,应用怎样的公式?这里我不是很清楚。- %程序名:qiantuihuitui_I_3.m 1 ~( u% b. p f8 G
- %功能:支路电流前推回推法求解潮流
3 B. ?7 ~5 O/ n8 e# ~$ I - clc
s) T. l5 E1 e1 G1 z, y& F - clear all; , G- w- a. X t0 R
- %--------------输入网络参数--------------
6 R/ K9 q( p3 j3 D* Z - %1-支路编号,2-首节点,3-尾节点,4-自阻抗,5-尾节点复功率,6-支路性质(1-馈线段支路,2-变压器支路),7-尾节点是否带负荷
) V$ B& b4 E- E2 N: d - DB=[1 1 2 0.000167+j*0.000208 0.42+j*0.31 1 1
' K6 ]0 Z% s$ G8 c& ? - 2 2 3 0.000151+j*0.000188 6.15 1 0
+ `0 h" U2 I$ h1 r - 3 2 4 0.000066+j*0.000082 0.38+j*0.29 1 1# B" C5 D, H) l7 R+ t' y
- 4 2 5 0.000249+j*0.000310 0 1 02 ^6 F% D3 k% d4 Q9 Z
- 5 2 6 0.000172+j*0.000215 0 1 0) L( `: O" Y0 q! L" k. |+ Y; e
- 6 4 7 0.000156+j*0.000195 6.06 1 0
1 _1 X, i$ t$ s( \! Z1 n - 7 4 8 0.000162+j*0.000202 6.04 1 0
/ e& e2 X/ E k# @8 j. h - 8 4 9 0.000345+j*0.000430 0 1 0
9 t1 n; M* _& j& A - 9 4 10 0.000287+j*0.000358 0 1 0
/ d: n O) s% Z" d( M$ j; s - 10 5 11 0.020563+j*0.321594 0 2 0
0 {( l* U, u) F+ Q C - 11 6 12 0.020563+j*0.321594 0 2 05 w' N$ T! V2 V
- 12 9 13 0.020563+j*0.321594 0 2 0 . \# e; |* k& S6 [+ o$ t
- 13 10 14 0.020563+j*0.321594 0 2 0 / U% j3 X7 h8 i$ z+ p) J, k, N: ]
- 14 11 15 0.000237+j*0.000408 5.72+j*0.12 1 1
& L) g9 s Y$ ^% ` H( p# x - 15 12 16 0.000237+j*0.000408 5.76+j*0.09 1 16 T# I8 h* J! F- T
- 16 13 17 0.000292+j*0.000502 5.86+j*0.11 1 14 s. U/ q d6 g% u8 A
- 17 14 18 0.000274+j*0.000470 5.81+j*0.14 1 1];
x1 x% y) `( q/ S - [n,m]=size(DB); 3 k4 T8 y' P- Q$ T
- B=[1 sin(2*pi/3)+j*cos(2*pi/3) sin(4*pi/3)+j*cos(4*pi/3)];4 b1 T5 @" R" j. d+ Y
- C=[1.02 1 1.02 1 1 1 1.02 1.02 1 1 1 1 1 1 1 1 1 1];! {2 ]5 V) C0 v6 @5 ]
- U(:,1)=B(1,1)*C';+ s1 D l6 D- D' q6 m
- U(:,2)=B(1,2)*C';* g* }5 C2 L- V3 R4 n9 N& b/ N* }
- U(:,3)=B(1,3)*C';
4 Y( J7 U' O/ r9 K/ I - %-------------------求解潮流-----------------
/ T% w2 w1 X2 Q6 {2 G0 ^ ` - for k=1:15
& {2 a9 A+ m k* ?$ V) M" E% E3 l - % I(:,k)=((DB(:,5).')*(diag(1./U(:,k))))';
& C- l& n; {+ U. K0 c - for i=n:-1:1
6 Y8 C0 K+ O+ a& f9 }+ I - %如果尾节点带恒功率负荷,需计算节点上负荷注入的电流 e9 N2 m5 I5 k; N- {
- if DB(i,7)==17 l# f# x" c- j A% V6 v
- c=DB(i,5)/3;
- ^2 E8 d+ b! J5 z, p" h) r. B - d=c/U(i+1,(3*k-2));5 z) r& l# a) t
- IL(i,3*k-2)=conj(d); s) q9 a2 J6 x8 n0 i3 V% f
- d=c/U(i+1,3*k-1);5 _) K3 g c/ g; q6 v& u1 ^1 Y% z
- IL(i,3*k-1)=conj(d);* ^+ N: U7 ^5 j8 ^
- d=c/U(i+1,3*k);2 s, p0 j7 X8 `9 q* U0 }
- IL(i,3*k)=conj(d);
" u0 l7 X& `3 V3 {# | - else9 n; i5 S( L: G& M2 M, f) O
- IL(i,3*k-2)=0;1 y5 T" |' `: b
- IL(i,3*k-1)=0;3 p$ \7 d5 g+ H, E' {) d
- IL(i,3*k)=0;
& M& ~8 c. i- x+ e - end ^1 M/ L8 W& q2 v7 u+ s) e
- %找出所有与尾节点相连的支路,计算进支电流(末端电流),存IKj
4 x- G6 F& Y* J3 P" U$ [2 u - A=(find(DB(:,2)==(i+1)));
* ?+ v+ c5 V$ {# N2 [ - if isempty(A)~=1
/ |3 H, Q+ a3 P - IKj(i,3*k-2)=IL(i,3*k-2)-sum(IKj(A,3*k-2)); w% l# s2 q- ]$ x/ a8 b* _
- IKj(i,3*k-1)=IL(i,3*k-1)-sum(IKj(A,3*k-1));- D# Q, `" ~, J4 R! d$ j4 i
- IKj(i,3*k)=IL(i,3*k)-sum(IKj(A,3*k));
4 l- J0 j% \8 v5 L( v: U2 S0 { - else; F' H( z; N$ O0 x
- IKj(i,3*k-2)=IL(i,3*k-2);
6 R. A4 o" f. [+ d. p - IKj(i,3*k-1)=IL(i,3*k-1);
% L5 V7 y6 ~8 b/ J8 P8 N% y - IKj(i,3*k)=IL(i,3*k); |) I# |5 `. _
- end
8 a3 ]% A) k: G - %计算出支电流(始端电流),存IKi
" E) m( i. S5 S7 k2 w9 i - a=DB(i,2);
9 _. j9 J8 h: T; F - b=DB(i,3);4 ^' E* k' b% Z g0 T7 I$ g2 k$ V
- Yi=1/DB(i,4)*eye(3);
4 r! o6 V( Q% l% u6 }, n- l - if DB(A,6)==1
+ |' k( l! |) A5 l- W, Q - F=0.5*Yi*[(U(a,3*k-2)+U(b,3*k-2)) (U(a,3*k-1)+U(b,3*k-1)) (U(a,3*k)+U(b,3*k))]'+[IKj(i,3*k-2) IKj(i,3*k-1) IKj(i,3*k)]';, |* s) k3 W8 j
- IKi(i,3*k-2)=F(1,1);
* D# L3 L! }+ d - IKi(i,3*k-1)=F(2,1);2 o, g: G0 E) [! [
- IKi(i,3*k)=F(3,1);1 D6 F1 W( A$ S8 }! t9 e# _3 M- a @
- else' {" L j4 F0 w3 H$ G- z! f5 v
- YT=1/real(DB(i,4))+j*(1/imag(DB(i,4)));
, e9 ]2 Z8 x# M% V4 b! ^! t3 j - YI=YT*eye(3);
+ f6 L* u0 O. g; d - YII=YT*eye(3);
: V' E5 A# ?4 m1 C - YIII=-YT*eye(3);7 f3 x* ~, Q: g9 _6 S4 m$ O
- D=inv(YIII)*(-[IKj(i,3*k-2) IKj(i,3*k-1) IKj(i,3*k)]'-YII*([U(b,3*k-2) U(b,3*k-1) U(b,3*k)]'));1 a0 x0 Y1 [4 f+ N5 n4 @
- U(a,3*k+1)=D(1,1);
0 `. z8 {7 \( V/ i9 _ - U(a,3*k+2)=D(2,1);' I# ~2 l" n! x! [6 x. X, A
- U(a,3*k+3)=D(3,1);
& |( u) G" j* }7 m2 z% V9 Y - E=YI*[U(a,3*k+1) U(a,3*k+2) U(a,3*k+3)]'-YIII*[U(b,3*k-2) U(b,3*k-1) U(b,3*k)]';
5 [5 Y4 n- M+ \* ` - IKi(i,3*k-2)=E(1,1);
$ V: y7 `4 L- H: Z+ g - IKi(i,3*k-1)=E(2,1);6 S% d! ^4 U- Q l' f" q8 ]2 C) x, Q
- IKi(i,3*k)=E(3,1);
# w1 \- L) s L* a6 K8 C' n' d - end 6 p. Q6 W5 N/ z
- end
3 g6 d1 V2 O8 e$ X, ?, t ^2 h - %前推电压 . j' t; y4 E, L7 P: p
- for j=2:n8 d4 z8 D9 r% V9 w3 ]
- U(1,3*k-2)=1.02;5 t$ C4 |! s, `" V/ e5 Z: `
- U(1,3*k-1)=1.02*(sin(2*pi/3)+j*cos(2*pi/3));
3 c) S4 i: Y% C( J; G* X! @" F - U(1,3*k)=1.02*(sin(4*pi/3)+j*cos(4*pi/3));
4 ^. k+ e5 @6 l7 R6 {% U - a=DB(j-1,2);
" P H+ s, Z3 Y6 b% L3 @2 S$ s+ @ - if DB(j-1,6)==1
# q; X5 {- Y1 c4 f" x - Yi=1/DB(j-1,4)*eye(3);
+ s4 v7 [2 s+ [0 Z - G1=[IKi(a,3*k-2) IKi(a,3*k-1) IKi(a,3*k)]';6 {& T- U. a. K5 K3 B1 \
- G=[U(a,3*k-2) U(a,3*k-1) U(a,3*k)]'-DB(j-1,4)*eye(3)*(G1-0.5*Yi*[U(a,3*k-2) U(a,3*k-1) U(a,3*k)]');' C5 E- u) H0 ^9 h
- U(j,3*k+1)=G(1,1);
' r3 ~/ G& [. k: C- ~) _ - U(j,3*k+2)=G(2,1);
) C, }. T/ k6 z+ z5 [ - U(j,3*k+3)=G(3,1); 1 q* M( r4 n) `0 G
- else$ j8 F& Q3 U! h& x; l7 d
- YT=1/real(DB(i,4))+j*(1/imag(DB(i,4)));/ T7 @* F! T# F$ K
- YI=YT*eye(3);7 n! s7 L+ h. `# R) S! C
- YII=YT*eye(3);6 P0 X+ }" d" h, p3 F
- YIII=-YT*eye(3);
! \ V! V/ Z* s/ j5 u" ~5 k+ d& q - H=inv(YIII)*([IKi(a,3*k-2) IKi(a,3*k-1) IKi(a,3*k)]'-YI*[U(a,3*k+1) U(a,3*k+2) U(a,3*k+3)]');. ]4 N* w, u% U5 C, V
- U(j,3*k+1)=H(1,1);' q8 m. ?: n6 }" ?4 K# d
- U(j,3*k+2)=H(2,1);* R' m% k- T$ i9 s7 T
- U(j,3*k+3)=H(3,1);, \2 J4 P- J8 Q& X
- end 6 f+ {% B# [8 [9 R; C' O& L/ w% b
- end+ [& T* x' k5 @: t! `; \, k+ J. S
- dU1=U(:,3*k+3)-U(:,3*k); * B! E& X, I6 S- u
- dU2=U(:,3*k+2)-U(:,3*k-1); # N- d7 P1 w7 r& \# t
- dU3=U(:,3*k+1)-U(:,3*k-2);
, b H- h: U* R5 x3 i! | - if (max(abs(dU1))<0.001&&max(abs(dU2))<0.001&&max(abs(dU2))<0.001) + v t8 u9 j$ R1 f. M
- break;
' x7 n% s: X9 H$ P+ t0 J1 O - else ' c+ I7 Z: C; U) }8 d! w; d
- k=k+1; # {" Y. v; v+ \6 B/ }+ L
- end
% G1 x3 s _0 ~+ D - end- l+ W1 Z" G) Q7 Z3 |# ?
- U
1 x" O7 c# e5 ` n' h6 q. h% M2 ] - IL
3 A) P2 b4 k% T* k$ P) L' V# o - IKj
# E& Y$ r% E$ n4 d8 D; B - IKi4 h% y8 e! r! n
- k
4 ~9 w$ Q$ Z ]6 Q
复制代码 |
|