[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Newton Raphson Power Flow Solution using Octave
From: |
shoo |
Subject: |
Re: Newton Raphson Power Flow Solution using Octave |
Date: |
Wed, 5 Feb 2014 02:34:39 -0800 (PST) |
I made Octave code, could you see it and say what is its problem?
% Newton Raphson Method:
V = [1.02; 1.0; 1.0];
d = [0; 0; 0];
Ps= [0.5; -1.2];
Qs= -0.5;
YB = [1.2113 - j*13.094 -0.2212 + j*3.3186 -0.9901 + j*9.9010
-0.3309 + j*3.3096 1.2113 - j*13.0946 -0.9901 + j*9.9010
-0.9901 + j*9.9010 -0.9901 + j*9.9010 1.9802 - j*19.7019];
Y= abs(YB); t = angle(YB);
iter=0;
pwracur = 0.0001;
DC = 10;
while max(abs(DC)) > pwracur
iter = iter +1
P=[V(2)*V(1)*Y(2,1)*cos(t(2,1)-d(2)+d(1))+V(2)^2*Y(2,2)*cos(t(2,2))+ ...
V(2)*V(3)*Y(2,3)*cos(t(2,3)-d(2)+d(3));
V(3)*V(1)*Y(3,1)*cos(t(3,1)-d(3)+d(1))+V(3)^2*Y(3,3)*cos(t(3,3))+ ...
V(3)*V(2)*Y(3,2)*cos(t(3,2)-d(3)+d(2))];
Q= -V(3)*V(1)*Y(3,1)*sin(t(3,1)-d(3)+d(1))-V(3)^2*Y(3,3)*sin(t(3,3))- ...
V(3)*V(2)*Y(3,2)*sin(t(3,2)-d(3)+d(2));
J(1,1)=V(2)*V(1)*Y(2,1)*sin(t(2,1)-d(2)+d(1))+...
V(2)*V(3)*Y(2,3)*sin(t(2,3)-d(2)+d(3));
J(1,2)=-V(2)*V(3)*Y(2,3)*sin(t(2,3)-d(2)+d(3));
J(1,3)=V(2)*Y(2,3)*cos(t(2,3)-d(2)+d(3));
J(2,1)=-V(3)*V(2)*Y(3,2)*sin(t(3,2)-d(3)+d(2));
J(2,2)=V(3)*V(1)*Y(3,1)*sin(t(3,1)-d(3)+d(1))+...
V(3)*V(2)*Y(3,2)*sin(t(3,2)-d(3)+d(2));
J(2,3)=V(1)*Y(3,1)*cos(t(3,1)-d(3)+d(1))+2*V(3)*Y(3,3)*cos(t(3,3))+...
V(3)*Y(3,2)*cos(t(3,2)-d(3)+d(2));
J(3,1)=-V(3)*V(2)*Y(3,2)*cos(t(3,2)-d(3)+d(2));
J(3,2)=-V(3)*V(1)*Y(3,1)*cos(t(3,1)-d(3)+d(1))-2*V(3)*Y(3,3)*sin(t(3,3))-...
V(3)*V(2)*Y(3,2)*cos(t(3,2)-d(3)+d(2));
J(3,3)=-V(1)*Y(3,1)*sin(t(3,1)-d(3)+d(1))-2*V(3)*Y(3,3)*sin(t(3,3))-...
V(2)*Y(3,2)*sin(t(3,2)-d(3)+d(2));
DP = Ps - P;
DQ = Qs - Q;
DC = [DP; DQ]
J
DX = J\DC
d(2) =d(2)+DX(1);
d(3)=d(3) +DX(2);
V(3)= V(3)+DX(3);
V, d, delta =180/pi*d;
end
--
View this message in context:
http://octave.1599824.n4.nabble.com/Newton-Raphson-Power-Flow-Solution-using-Octave-tp4661585p4661644.html
Sent from the Octave - General mailing list archive at Nabble.com.