Øng Dông Matlab Gi I M CH ®iön Tuyõn Týnh Ë Chõ ®É X C Lëp
Øng Dông Matlab Gi I M CH ®iön Tuyõn Týnh Ë Chõ ®É X C Lëp
Øng Dông Matlab Gi I M CH ®iön Tuyõn Týnh Ë Chõ ®É X C Lëp
1 0 1
1 1 0
0 1 1
1 0 0
0 1 0
0 0 1
Nhnh; C =
(
(
(
(
(
(
(
(
1 0 0
1 1 0
1 0 1
0 1 0
0 1 1
0 0 1
Nhnh
Ma trn A, C cho bit cu trc ca graph:
Cc phn t trn mt hng ca A cho
bit nhnh ni gia cc im no vi
nhau, v d, hng 2: nhnh 2 ni nt c s
vi nt 2, trong mch in n ch r chiu
dng ca dng in trn nhnh y ng
thi cng cho bit in p trn nhnh bng
hiu s th ca cp nt no (v d u
2
= -
2
).
Cc phn t trn mt ct ca mt nt ch r
ti nt c nhng nhnh no i ra khi
ng dng Matlab gii mch in tuyn tnh ch xc lp
nt (gi tr 1) v nhnh no i vo nt (gi
tr -1).
i vi ma trn C, cc phn t trn mi
hng ch r nhnh c tham gia vo vng
khng, thun chiu hay ngc chiu vng.
Cn cc phn t trn mt ct ch r vng
gm nhng nhnh no, cng chiu hay ngc
chiu vng.
3.2. Biu din cc phng php tnh c bn
bng ma trn
3.2.1. Phng php dng nhnh
H phng trnh dng nhnh l h phng
trnh vit theo nh lut Kichp I v II (
Nguyn Bnh Thnh & cs, 1972):
=
=
k k k
k
E I Z
0 I
& &
&
(3-1a)
k
I
&
, Z
k
,
k
E
&
- Dng in, tng tr, sc
in ng trn cc nhnh.
Nu gi
nh
I
&
- ma trn ct, biu din
dng in trn cc nhnh;
nh
U
&
- ma trn ct, biu din in p trn
cc nhnh;
Z
nh
- ma trn vung kch thc m x m,
cc phn t trn ng cho chnh l tng tr
ring cc nhnh, Z
ij
l tng tr tng h gia
nhnh i v nhnh j;
nut
J
&
- ma trn ct, biu din ngun dng
(ph ti) cc nt (c lp), ly du (+) khi i
vo nt, nguc li ly du (-);
nh
E
&
- ma trn ct cc sc in ng trn
cc nhnh, ly du (+) khi cng chiu cc
dng nhnh, nguc li ly du (-)
Th c th vit h (3-1a) di dng ma
trn:
=
=
nh
E .
T
C
nh
I .
nh
.Z
T
C
nut
J
nh
I
T
A
& &
& &
(3-1b)
Trong : A
T
, C
T
- Cc ma trn chuyn v
ca ma trn A, C.
t: D =
(
(
nh
.Z
T
C
T
A
(3-1c)
G =
(
(
nh
E .
T
C
nut
J
&
&
(3-1d)
Khi :
D.
nh
I
&
= G (3-1e)
Hay:
nh
I
&
= D
-1
.G (3-2)
D
-1
- Ma trn nghch o ca ma trn D.
3.2.2. Phng php dng vng
H phng trnh dng vng tng qut, [2]:
= + + +
= + + +
= + + +
p
k Vp pp 2 V 2 p 1 V 1 p
2
k Vp p 2 2 V 22 1 V 21
1
k Vp p 1 2 V 12 1 V 11
E I . Z .... I . Z I . Z
.........
E I . Z .... I . Z I . Z
E I . Z .... I . Z I . Z
& & & &
& & & &
& & & &
(3-3a)
Dng ma trn:
(
(
(
(
(
=
(
(
(
(
(
(
(
(
(
(
Vp
2 V
1 V
Vp
2 V
1 V
pp 2 p 1 p
p 2 22 21
p 1 12 11
E
...
E
E
I
...
I
I
.
Z ... Z Z
......
Z ... Z Z
Z ... Z Z
&
&
&
&
&
&
(3-3b)
Hay vit gn li:
Z
V
.
V
I
&
=
V
E
&
(3-3c)
Trong :
Nguyn Th Hin, Ng Th Tuyn
Z
V
=
(
(
(
(
(
pp 2 p 1 p
p 2 22 21
p 1 12 11
Z ... Z Z
......
Z ... Z Z
Z ... Z Z
-
ma trn tng tr vng, [2], c th tnh
theo ma trn tng tr nhnh: Z
v
= C
T
.Z
nh
.C
V
I
&
- ma trn ct dng in vng
V
E
&
- ma trn sc in ng vng,
V
E
&
=
C
T nh
E
&
Trng hp c ngun dng
nh
J
&
trong cc
nhnh:
V
E
&
= C
T
. (
nh
E
&
- Z
nh
.
nh
J
&
) (3-3d)
Khi :
V
I
&
= Z
V
-1
.
V
E
&
(3-4)
Dng in nhnh:
nh
I
&
= C.
V
I
&
+
nh
J
&
(3-5)
in p nhnh:
nh
U
&
= Z
nh
.
nh
I
&
-
nh
E
&
(3-6)
3.2.3. Phng php th nt
H phng trnh th nt tng qut, [2]:
+ = +
+ = +
+ =
p
k k
1 n
k 1 n 1 n , 1 n 2 22 n 1 11 n
2
k k
2
k 1 n 1 n 2 2 22 1 21
1
k k
1
k 1 n 1 n 1 2 12 1 11
Y E J . Y .... . Y . Y
.........
Y E J . Y .... . Y . Y
Y E J . Y ... . Y . Y
& &
& & &
& &
& & &
& &
& & &
(3-7a)
Dng ma trn:
(
(
(
(
=
(
(
(
(
(
(
(
(
(
1 n
2 n
1 n
3
2
1
1 n , 1 n 12 n 11 n
1 n 2 22 21
1 n 1 12 11
J
...
J
J
...
.
Y ... Y Y
......
Y ... Z Y
Y ... Y Y
&
&
&
(3-7b)
Hay:
Y
nut
. &=
dnut
J
&
(3-7c)
Trong : Y
nt
- ma trn tng dn nt, c th xc nh theo ma trn tng tr nhnh
Y
nt
= A
T
.Z
nh
-1
.A= A
T
.Y
nh
.A
dnut
J
&
- Ma trn ngun dng ti cc nt
dnut
J
&
=
nut
J
&
- A
T
.Y
nh
.
nh
E
&
(3-7d)
T (3-7c), suy ra: &= Y
nut
-1
.
dnut
J
&
(3-8)
Ma trn dng in nhnh:
nh
I
&
= Y
nh
. (
nh
U
&
+
nh
E
&
) (3-9)
Ma trn in p nhnh:
nh
U
&
= A. & (3-10)
ng dng Matlab gii mch in tuyn tnh ch xc lp
T in p v dng in nhnh, tnh c cng sut nhnh (t c th kim tra iu kin
cn bng cng sut):
S
nh
= U
nh
.conj (I
nh
) (3-11)
Vi: conj (I
nh
) l ma trn lin hp phc ca ma trn dng nhnh.
3.3. Lp trnh gii mch in bng Matlab
Matlab - ch vit tt ca Matrix
Laboratory - th vin ma trn, l mt phn
mm ng dng, dng cho cc tnh ton da
trn c s d liu v ma trn (Nguyn Hoi
Sn & cs, 2000). Vi hng lot cc hm
ton hc c xc nh trc, Matlab cho
php lp chng trnh bng cc lnh n
gin, ngn gn, cu trc gn vi t duy ton
hc. Chng trnh c th lp trnh trn ca
s Command Window hoc lu di dng
cc file trong ca s son tho (m-file) cho
cc ln s dng sau.
a) S thut ton
S khi m t thut ton c cho
Hnh 2.
Phng php th nt
Phng php dng vng Phng php dng nhnh
BEGIN
Nhp s liu bi ton
Nhp cc ma trn cu trc
D=[A;C*Znh]
G=[Jnut;C*Enh]
Inh=D\G
Unh=Znh*Inh-Enh
Snh=Unh.*conj (Inh)
END
Jdnut=Jnut-A'*Ynh*Enh
Ynh=inv (Znh)
Vnut=Ynut\Jdnut
Unh=A*Vnut
Inh=Ynh* (Unh+Enh)
Ynut=A*Ynh*A;
Zv=C*Znh*C;
Ev=C* (Enh-Znh*Jnh)
Iv = Zv\Ev
Inh=C*Iv + Jnh
Nguyn Th Hin, Ng Th Tuyn
Hnh 2. S khi m t thut ton ca bi ton phn tch mch in
b) p dng
Cho s nh hnh 3, bit: R
1
= 10 ; X
1
= 10 ; R
2
= 5 ; X
2
= 5 ; R
3
= 30 ; X
3
=
40 ; h cm gia cc nhnh X
13
= 20; X
23
= 10, sc in ng
1
E
&
= 100 V;
2
E
&
=
100/6 V; J
&
= 2/3 A. Hy tnh dng in
trong cc nhnh bng cc phng php dng
nhnh, dng vng, th nt.
S liu u vo ca bi ton l tng tr,
ngun sc in ng cc nhnh, ngun dng
bm vo cc nt (nu c), trn c s c
th lp cc ma trn tng tr nhnh, sc in
ng nhnh, cc ma trn cu trc... Bi ton
c th gii bng phng php dng nhnh,
phng php dng vng hoc phng php
in th nt.
gii bi ton, ta vit cc lnh sau trn
MATLAB command window hoc trong ca
s son tho (m-file):
1
0
R
2
R
3
R
1
J
E
2
jX
1
jX
2
jX
3
*
*
*
jX
13
jX
23
E
1
Hnh 3. S mch in
Clc
%Nhap so liu bai toan
Z1=10 + j*10;
Z2=5 + j*5;
Z3=30 + j*40;
E1= 100;
E2= 100*exp (j*pi/6);
J= 2*exp (j*pi/3);
%Lap cac ma tran
Enh=[E1;E2;0];
Jnut=[J];
Znh (1,1)=Z1; Znh (2,2)=Z2; Znh (3,3)=Z3;
Znh (1,2)=0; Znh (2,1)=Znh (1,2);
Znh (1,3)=-j*20; Znh (3,1)=Znh (1,3);
Znh (2,3)=-j*10; Znh (3,2)=Znh (2,3);
A = [-1;-1;1];
C=[1 0;0 1;1 1];
+%Giai bai toan bang phuong phap dong
nhanh
disp ('1.Phuong phap dong nhanh');
D=[A';C'*Znh];
G=[Jnut;C'*Enh];
Inh=D\G
Unh=Znh*Inh-Enh
Snh=Unh.*conj (Inh)
%Giai bai toan bang phuong phap dong vong
disp ('2.Phuong phap dong vong');
Jnh=[0;0;J];
Zv=C'*Znh*C;
Ev=C'* (Enh-Znh*Jnh);
Iv = Zv\Ev
Inh=C*Iv + Jnh
Unh=Znh*Inh-Enh
Snh=Unh.*conj (Inh)
% Giai bai toan bang phuong phap the nut
disp ('3.Phuong phap the nut');
Ynh=inv (Znh);
Ynut=A'*Ynh*A;
Jdnut=Jnut-A'*Ynh*Enh;
ng dng Matlab gii mch in tuyn tnh ch xc lp
Vnut=Ynut\Jdnut
Unh=A*Vnut
Inh=Ynh* (Unh+Enh)
Snh=Unh.*conj (Inh)
Trn mn hnh MATLAB command window
s xut hin ln lut:
1. Phuong phap dong nhanh
Inh =
0.9309 - 2.0788i
1.4173 - 0.4097i
3.3482 - 0.7565i
Unh =
-85.0321 -78.4440i
-85.0321 -78.4440i
85.0321 +78.4440i
Snh =
1.0e+002 *
0.8392 - 2.4979i
-0.8838 - 1.4602i
2.2537 + 3.2697i
2.Phuong phap dong vong
Iv =
0.9309 - 2.0788i
1.4173 - 0.4097i
Inh =
0.9309 - 2.0788i
1.4173 - 0.4097i
3.3482 - 0.7565i
Unh =
-85.0321 -78.4440i
-85.0321 -78.4440i
85.0321 +78.4440i
Snh =
1.0e+002 *
0.8392 - 2.4979i
-0.8838 - 1.4602i
2.2537 + 3.2697i
3.Phuong phap the nut
Vnut =
85.0321 +78.4440i
Unh =
-85.0321 -78.4440i
-85.0321 -78.4440i
85.0321 +78.4440i
Inh =
0.9309 - 2.0788i
1.4173 - 0.4097i
3.3482 - 0.7565i
Snh =
1.0e+002 *
0.8392 - 2.4979i
-0.8838 - 1.4602i
2.2537 + 3.2697i
4. KT LUN
Cu trc ca mch in bt k c m
nhnh, n nt u c th c m t bi ma
trn nt - nhnh A v ma trn nhnh - vng C,
nh vy ta c th gii bi ton L thuyt mch
mt cch n gin v d dng bng cch gii
h phng trnh cc ma trn.
Lp trnh bng Matlab c cu trc n
gin, ngn gn, thun tin cho ngi s dng.
Bi ton cho kt qu nhanh, chnh xc, c th
tnh vi s phc mt cch d dng, y l u
im ni bt ca Matlab so vi cc ngn ng
lp trnh khc.
Chng trnh vit khng thin v lp trnh
tin hc, gn gi vi l thuyt ca mn hc,
gip sinh vin cng c kin thc mn hc
ng thi c iu kin kim tra k nng tnh
ton ca bn thn.
Ti liu tham kho
Nguyn Hoi Sn v cng s (2000), ng
dng Matlab trong tnh ton k thut.
NXB i hc quc gia TP H Ch
Minh.
Nguyn Bnh Thnh v cng s (1972), C s
l thuyt mch, quyn 1. NXB i hc
Nguyn Th Hin, Ng Th Tuyn
v Trung hc chuyn nghip, H Ni, tr 25- 30, 99-108.
ng dng Matlab gii mch in tuyn tnh ch xc lp