Finding positive-, negative- and zero-sequence components in Matlab

Why the positive and negative sequence values are the same? What is wrong with the fortescue calculation and how to correct it? Up and Un should not be equal.
Code and plot:
f1=50; %Hz
w1 = 2*pi*f1;
hatUa = 25000*sqrt(2)/sqrt(3);
t = linspace(0,1,100000);
a = cos(2*pi/3) + 1i*sin(2*pi/3);
Ua = (hatUa.*(exp(1i.*w1.*t)+exp(-1i.*w1.*t))./2);
Ub = (hatUa.*(exp(1i.*w1.*t + 1i.*2*pi/3)+exp(-1i.*w1.*t - 1i.*2*pi/3))./2);
Uc = (0.5.*hatUa.*(exp(1i.*w1.*t - 1i.*2*pi/3)+exp(-1i.*w1.*t + 1i.*2*pi/3))./2);
Up = real(Ua + (a*Ub) + (a.*a*Uc))./3;
Un = real(Ua + (a.*a.*Ub) + (a.*Uc))./3;
U0 = real(Ua + Ub + Uc)./3;
subplot(2,1,1),plot(t,Ua,'LineWidth',2)
xlim([0 0.1])
xlabel ('Time [s]')
ylim([-hatUa*1.1 hatUa*1.1])
ylabel ('Three-phase Voltage (V)')
hold on
subplot(2,1,1),plot(t,Ub,'LineWidth',2)
hold on
subplot(2,1,1),plot(t,Uc,'LineWidth',2)
legend( 'Ua', 'Ub', 'Uc')
hold on
subplot(2,1,2),plot(t,Up,'LineWidth',2)
xlim([0 0.1])
xlabel ('Time [s]')
ylim([-hatUa*1.1 hatUa*1.1])
ylabel ('P, N and 0 Voltages (V)')
hold on
subplot(2,1,2),plot(t,Un,'LineWidth',2)
hold on
subplot(2,1,2),plot(t,U0,'LineWidth',2)
legend( 'Up', 'Un', 'U0')

5 件のコメント

Image Analyst
Image Analyst 2023 年 9 月 7 日
You need to assign w1, as the error indicates.
Here is a simplified version of the code that retains the essence of the question. (Up and Un are equal at all points, to within floating-point precision, and therefore plot on top of each other.)
I changed and/or removed some constants, e.g. setting hatUa to 1 (effectively and then actually removing it).
I have not debugged further, but I think a logical next step would be to calculate the real and imaginary parts separately. I think this will more directly reveal that Up and Un are equal.
@Ygor Marca, do you have a reference for these equations?
w1=pi;
t = linspace(0,1,100);
a = cos(2*pi/3) + 1i*sin(2*pi/3);
Ua = ((exp(1i.*w1.*t)+exp(-1i.*w1.*t))./2);
Ub = ((exp(1i.*w1.*t + 1i.*2*pi/3)+exp(-1i.*w1.*t - 1i.*2*pi/3))./2);
Uc = (0.5.*(exp(1i.*w1.*t - 1i.*2*pi/3)+exp(-1i.*w1.*t + 1i.*2*pi/3))./2);
Up = real(Ua + (a*Ub) + (a.*a*Uc))./3;
Un = real(Ua + (a.*a.*Ub) + (a.*Uc))./3;
figure
hold on
plot(t,Up,'LineWidth',2)
plot(t,Un,'LineWidth',2)
xlabel ('Time [s]')
ylabel ('P, N and 0 Voltages (V)')
legend( 'Up', 'Un')
dpb
dpb 2023 年 9 月 7 日
w1=pi;
t = linspace(0,1,100)';
a = cos(2*pi/3) + 1i*sin(2*pi/3);
Ua = ((exp(1i.*w1.*t)+exp(-1i.*w1.*t))./2);
Ub = ((exp(1i.*w1.*t + 1i.*2*pi/3)+exp(-1i.*w1.*t - 1i.*2*pi/3))./2);
Uc = (0.5.*(exp(1i.*w1.*t - 1i.*2*pi/3)+exp(-1i.*w1.*t + 1i.*2*pi/3))./2);
Up = real(Ua + (a*Ub) + (a.*a*Uc))./3;
Un = real(Ua + (a.*a.*Ub) + (a.*Uc))./3;
subplot(2,1,1)
plot(t,[real([a*Ub a.*a*Uc]) imag([a*Ub a.*a*Uc])])
legend('R(a.*Ub)','R(a.*a*Uc)','I(a.*Ub)','I(a.*a*Uc)','location','eastoutside')
ylim([-1 1])
subplot(2,1,2)
plot(t,[real([a.*a.*Ub a.*Uc]) imag([a.*a.*Ub a.*Uc])])
ylim([-1 1])
legend('(R(a.*a*Ub)','R(a.*Uc)','(I(a.*a*Ub)','I(a.*Uc)','location','eastoutside')
Shows they're all mirror images of each other...
Ygor Marca
Ygor Marca 2023 年 9 月 11 日
I don't get it, why didn't you plot Up and Un?

サインインしてコメントする。

 採用された回答

David Goodmanson
David Goodmanson 2023 年 9 月 8 日
編集済み: David Goodmanson 2023 年 9 月 10 日

1 投票

Hi Ygor,
I believe the problem is that you are going too soon to real values for Ua,Ub,Uc. In
Ua = ((exp(1i.*w1.*t)+exp(-1i.*w1.*t))./2)
if you ignore the second term (which makes Ua real) and the factor of 1/2 that goes along with it, and also temporarily drop the factor of exp(1i.*w1.*t) in the first term, which is the time dependent part common to all the phases, you are left with Ua = 1. Similarly Ub has a factor of exp(1i.*2*pi/3) = a, and Uc has a factor of a^(-1) = a^2 [which is true since a^3 = 1]. So in terms of column vectors
[Ua; Ub; Uc] = [1; a; a^2/2]
i.e. a complex quanitity.
( I forgot to mention that hatUa has been temporarily dropped. Since it's a common factor, it can be multiplied into all the resulting coefficients U0,U+,U- at the end ).
Now the positive sequence is [1; a^2; a] , the negative sequence is [1; a; a^2] so
[Ua = [1 1 1 [U0
Ub 1 a^2 a * U+
Uc] 1 a a^2] U-]
The matrix is proportional to a unitary matrix so
[U0 = [1 1 1 [Ua
U+ (1/3) * 1 a a^2 * Ub
U-] 1 a^2 a] Uc]
and if you code this up you get
U0plusminus =
0.0833 + 0.1443i % U0
0.0833 - 0.1443i % U+
0.8333 + 0.0000i % U-
A = % amplitudes, same order
0.1667
0.1667
0.8333
theta = % phases, same order
1.0472 % 60 degrees
-1.0472
0.0000
With the final result
U0plusminus = hatUa*U0plusminus
A = hatUa*A

1 件のコメント

Ygor Marca
Ygor Marca 2023 年 9 月 11 日
編集済み: Ygor Marca 2023 年 9 月 11 日
Thank you for the answer. You really helped me.
hatUa=10;
a = cos(2*pi/3) + 1i*sin(2*pi/3);
Ua =hatUa;
Ub = a.*a.*hatUa;
Uc = 1.*a.*hatUa;
Up = abs(Ua + (a.*Ub) + (a.*a*Uc))./3
Up = 10
Un = abs(Ua + (a.*a.*Ub) + (a.*Uc))./3
Un = 2.5121e-15
U0 = abs(Ua + Ub + Uc)./3
U0 = 1.3240e-15

サインインしてコメントする。

その他の回答 (0 件)

コミュニティ

質問済み:

2023 年 9 月 7 日

編集済み:

2023 年 9 月 11 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by