Finding the tan inverse for different range of values

7 vues (au cours des 30 derniers jours)
A.K
A.K le 6 Mai 2017
Commenté : Star Strider le 9 Mai 2017
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?|

Réponses (2)

David Goodmanson
David Goodmanson le 6 Mai 2017
Modifié(e) : David Goodmanson le 6 Mai 2017
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 le 6 Mai 2017
‘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 commentaires
A.K
A.K le 9 Mai 2017
Modifié(e) : A.K le 9 Mai 2017
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 le 9 Mai 2017
‘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.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Performance and Memory dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by