Finding the tan inverse for different range of values

조회 수: 4 (최근 30일)
A.K
A.K 2017년 5월 6일
댓글: Star Strider 2017년 5월 9일
I have two quantities phi1 and phi2 that are obtained from the phase of complex quantities. Being phase their values lies from -pi to +pi. I define the following quantities:
alpha=phi1-phi2;
S1=cos(alpha);
S2=sin(alpha);
K=atan2(S2,S1);
I need K to be same as alpha. But since atan2 returns values from -pi to pi, there is a difference of 2pi in some of the elements. Subtracting phi1 and phi2 to get alpha has changed its range to 2pi to -2pi.
I want exact alpha value, because there is another equation giving
beta=phi1+phi2.
And my main aim is to evaluate phi1 by deriving alpha from S1 and S2 and the beta equation (i.e two simultaneous equations). Can anyone please help me evaluate the original values of alpha?|

답변 (2개)

David Goodmanson
David Goodmanson 2017년 5월 6일
편집: David Goodmanson 2017년 5월 6일
Hello AK, consider the following two situations, where all phi obey -pi<angle<pi :
case x
phi1x = pi - pi/20
phi2x = -pi + pi/20
alphax = 2pi - pi/10
case y
phi1y = - pi/20
phi2y = + pi/20
alphay = - pi/10
Now sin(alphax)=sin(alphay), cos(alphax)=cos(alphay) and taking trig functions removes the 2pi difference between alphax and alphay. You need that 2pi-or-not information to find phi1 and phi2, and there is no way to get it back. And beta = 0 in both cases. So it does not look good for this method.

Star Strider
Star Strider 2017년 5월 6일
‘Subtracting phi1 and phi2 to get alpha has changed its range to 2pi to -2pi.’
Exactly.
Is there a particular reason for calculating ‘K’? (In phasor notation, subtract the phase values to divide one phasor by another, and add them to multiply.) Calculating ‘K’ puts them in the correct quadrant on the interval (-pi,pi). Taking the cos and sin of ‘K’ reproduces ‘S1’ and ‘S2’.
‘I need K to be same as alpha.’
The only way you are going to achieve that is:
K = alpha;
  댓글 수: 2
A.K
A.K 2017년 5월 9일
편집: A.K 2017년 5월 9일
What if the problem at hand is as follows: We have a matrix consisting of complex numbers, whose phases lie between 2pi to-2pi. Can there be any method to evaluate the phase in this (-2pi,2pi) range instead of reducing them to pi to -pi range.
Ex=exp(1i*phi1)+exp(1i*phi2);
beta=angle(Ex);
In the above code phi1 and phi2 are angles in the range of -pi to pi.
Mathematically, beta should be equal to (phi1+phi2)/2,
because exp(i*phi1)+exp(i*phi2)=exp(i(phi1+phi2)/2)cos((phi1+phi2)/2)
This means values of beta will lie in range of 2pi to -2pi.
Is there any method to evaluate the angle in their original (-2pi,2pi) range?
Star Strider
Star Strider 2017년 5월 9일
‘Can there be any method to evaluate the phase in this (-2pi,2pi) range instead of reducing them to pi to -pi range.’
Not to my knowledge.
You can convert them to the interval (0,2*pi) with this utility function:
Angles2pi = @(a) rem(2*pi+a, 2*pi); % For ‘atan2’
The ‘a’ argument is the angle in radians on the interval (-pi,pi). That is likely the best you can do.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Performance and Memory에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by