help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: please help me


From: shoo
Subject: Re: please help me
Date: Wed, 5 Feb 2014 05:36:13 -0800 (PST)

I made something in Octave. but i think it is wrong. could you find 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;             % iteration start value.
pwracur = 0.0001;   % accuracy or in other word, the permited mismatch
limit.
DC = 10;            % the maximum power residual to a high value.
while max(abs(DC)) > pwracur
iter = iter +1
% In this section I just simply define the formulas for those parameters
% which are given. 
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
% In this section I defined my rest variables:
P1= V(1)^2*Y(1,1)*cos(t(1,1))+V(1)*V(2)*Y(1,2)*cos(t(1,2)-d(1)+d(2))+...
    V(1)*V(3)*Y(1,3)*cos(t(1,3)-d(1)+d(3))
Q1=-V(1)^2*Y(1,1)*sin(t(1,1))-V(1)*V(2)*Y(1,2)*sin(t(1,2)-d(1)+d(2))-...
    V(1)*V(3)*Y(1,3)*sin(t(1,3)-d(1)+d(3))
Q2=-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))-V(2)^2*Y(2,2)*sin(t(2,2))


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

% Fast Decoupled Method:
V1= 1.02; V2 = 1.0; V3 = 1.0;
d1 = 0; d2 = 0; d3=0;
Ps2= 0.5;  Ps3 = -1.2;
Qs3= -0.5;
% My own calculated Y-Matrix:
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);
B = [-13.3333   10.0000
      10.0000  -20.0000];
Binv = inv(B)
iter=0;
pwracur = 0.0001;    % Power accuracy
DC = 10;              % Power mismatch limit
while max(abs(DC)) > pwracur
iter = iter +1;
P2= V2*V1*Y(2,1)*cos(t(2,1)-d2+d1)+V2^2*Y(2,2)*cos(t(2,2))+ ...
    V2*V3*Y(2,3)*cos(t(2,3)-d2+d3);
P3= V3*V1*Y(3,1)*cos(t(3,1)-d3+d1)+V3^2*Y(3,3)*cos(t(3,3))+ ...
    V3*V2*Y(3,2)*cos(t(3,2)-d3+d2);
Q3=-V3*V1*Y(3,1)*sin(t(3,1)-d3+d1)-V3^2*Y(3,3)*sin(t(3,3))- ...
    V3*V2*Y(3,2)*sin(t(3,2)-d3+d2);
DP2 = Ps2 - P2; DP2V = DP2/V2;
DP3 = Ps3 - P3; DP3V = DP3/V3;
DQ3 = Qs3 - Q3; DQ3V = DQ3/V3;
DC =[DP2; DP3; DQ3];
Dd = -Binv*[DP2V;DP3V];
DV = -1/B(1,1)*DQ3V;
d2 =d2+Dd(1);
d3 =d3+Dd(2);
V3= V3+DV;
angle2 =180/pi*d2;
angle3 =180/pi*d3;
R = [iter  d2  d3  V2  DP2  DP3 DQ3];
disp(R)
end
Q2=-V2*V1*Y(2,1)*sin(t(2,1)-d2+d1)-V2^2*Y(2,2)*sin(t(2,2))- ...
    V2*V3*Y(2,3)*sin(t(2,3)-d2+d3);
P1= V1^2*Y(1,1)*cos(t(1,1))+V1*V2*Y(1,2)*cos(t(1,2)-d1+d2)+ ...
    V1*V3*Y(1,3)*cos(t(1,3)-d1+d3);
Q1=-V1^2*Y(1,1)*sin(t(1,1))-V1*V2*Y(1,2)*sin(t(1,2)-d1+d2)- ...
    V1*V3*Y(1,3)*sin(t(1,3)-d1+d3);
S1=P1+j*Q1
Q2



--
View this message in context: 
http://octave.1599824.n4.nabble.com/please-help-me-tp4661658p4661664.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]