0
$\begingroup$

I have a complex $ z $ that I want to write as $ z=|z|e^{i\theta} $ where $ \theta $ is its phase.

I tried using 2 "different" ways and got different results, so I assume one of them is wrong.

This is the number: $ z=\frac{a}{b-ic} $

where $ a,b,c \in \mathbb{R} $ and positive.

Now we can write:

$ z=\frac{a}{b-ic}=\frac{|a|}{\sqrt{b^{2}+c^{2}}}e^{i\left(0-\arctan\left(\frac{-c}{b}\right)\right)} $

But also:

$ z=\frac{-a}{-b+ic}=\frac{|a|}{\sqrt{b^{2}+c^{2}}}e^{i\left(\pi-\arctan\frac{c}{-b}\right)} $

So where is the mistake?

Thanks in advance.

$\endgroup$
13
  • $\begingroup$ Please define your variables properly. $\endgroup$
    – vitamin d
    Feb 20, 2021 at 18:26
  • $\begingroup$ @vitamind Sorry, done. $\endgroup$
    – FreeZe
    Feb 20, 2021 at 18:27
  • $\begingroup$ Don't you think rewriting the expression would make it a lot easier to understand and solve the problem? Your number breaks down to $$\frac{a}{b-ic},\quad a,b,c\in\mathbb{R}.$$ $\endgroup$
    – vitamin d
    Feb 20, 2021 at 18:33
  • $\begingroup$ @vitamind Well, I guess you're right. I'll edit $\endgroup$
    – FreeZe
    Feb 20, 2021 at 18:37
  • $\begingroup$ In any case you need to have a discussion about the sign of $w^2LC-1$, and determine quadrant the phase belongs to, or use $\operatorname{atan2}$ function instead of $\arctan$. $\endgroup$
    – zwim
    Feb 20, 2021 at 18:38

2 Answers 2

1
$\begingroup$

I think this was actually a better question when it still had all the variables $\omega$, $R$, $L$, and $C.$ Eliminating those variables eliminates one of the sources of ambiguity inherent in the original problem, which is that we don't know which of the two quantities $\omega^2 RLC$ or $R$ is greater.


The problem is the in the conversion of $p + iq$ to $\sqrt{p^2+q^2} \, e^{i \arctan(q/p)}.$ That formula is correct only when $p > 0.$ If $p < 0$ a correct formula is $$p + iq = \sqrt{p^2+q^2} \, e^{i (\pi + \arctan(q/p))}.$$

And of course if $p = 0$ neither formula works at all.

So if you have $b - ic,$ where $b$ and $c$ are positive, you have the case $p = b > 0$, so $$b - ic = \sqrt{b^2+c^2} \, e^{i \arctan(-c/b)}.$$

But when you look at $-b + ic,$ you now have the case $p = -b < 0,$ so $$-b + ic = \sqrt{b^2+c^2} \, e^{i (\pi + \arctan(-c/b))}.$$

You applied the wrong formula to the case $-b + ic,$ and that's where the extra $\pi$ comes from.


In your original exercise, you had the expression $\left(R - \omega^{2}RLC\right)+i\omega L$ in one case and $\left(\omega^{2}RLC - R\right)-i\omega L$ in the other. If $R - \omega^{2}RLC > 0,$ then $\omega^{2}RLC - R < 0,$ and vice versa. That is, one of these expressions is the $p > 0$ case and the other is the $p < 0$ case. The plain arc tangent formula only works in one case; the other case needs some modification, such as adding $\pi$ to the arc tangent. (Subtracting $\pi$ works equally well, because that's the same as adding $\pi$ and then subtracting $2\pi$.)

That's why there's a difference of $\pi$ between the angles you found in your results. The correct result is the one where you applied your formula to $p + iq$ where $p > 0.$ In the other case your angle is shifted by $\pi$ radians.

$\endgroup$
3
  • $\begingroup$ I see. So in the last example that I gave it should be $ z=\frac{-a}{-b+ic}=\frac{|a|}{\sqrt{b^{2}+c^{2}}}e^{i\left(\pi-\left(\pi+\arctan\left(\frac{c}{-b}\right)\right)\right)}=\frac{|a|}{\sqrt{b^{2}+c^{2}}}e^{i\left(-\arctan\left(-\frac{c}{b}\right)\right)} $. In your example, as you said, for $ a+ib $ in order to use the formula without $ \pi $ we need $ a $ to be positive. Are there any conditions for $ b $ ? we dont care about the sign of $ b $ ? Thanks. $\endgroup$
    – FreeZe
    Feb 20, 2021 at 19:00
  • 1
    $\begingroup$ Note that I wrote the answer with one set of variables and then edited it to use a different set of variables to avoid names that contradicted the edited question. In the updated notation, converting $p + iq$ to the form $re^{i\theta},$ only the sign of $p$ matters. The value of $q$ can be anything: positive, negative, or zero. The key fact is that $\arctan$ always gives an angle pointing into the right half of the complex plane, but has no difficulty correctly identifying whether it should be above, below, or on the real axis. $\endgroup$
    – David K
    Feb 20, 2021 at 19:07
  • 1
    $\begingroup$ The only problem really is when we need the angle to point along the imaginary axis or into the left half of the plane. Then $\arctan$ gives the wrong direction, but since $(-q)/(-p) = q/p$ it's simply exactly in the opposite direction we want, so adding or subtracting $\pi$ will fix it. $\endgroup$
    – David K
    Feb 20, 2021 at 19:13
0
$\begingroup$

Somewhat off topic:

Since the OP's question was answered by David K's response, I consider it open season to discuss a more straightforward approach.

Without loss of generality, $(b - ic) \neq [0 - i(0)] \implies (b^2 + c^2) \neq 0.$

$$z = \frac{a}{b-ic} \times \frac{b+ic}{b+ic} = \frac{a(b + ic)}{b^2 + c^2}.$$

Since $(b^2 + c^2) \in \mathbb{R^+}$, you can let $s\in\mathbb{R}$ represent $\frac{a}{b^2 + c^2}$, and then let $z_0$ represent $\left(\frac{1}{s} \times z\right).$ Note that since $(a)$ is presumed to be positive, $s$ must be positive.

Therefore, the problem reduces to expressing

$$(b + ic) = z_0 = re^{i\theta}.$$

Once this is done, you will have that $z = (sr)e^{i\theta}.$

Let $r$ denote $\sqrt{b^2 + c^2}$ and
let $\theta$ denote the unique angle, within a modulus of $(2\pi)$
such that $\cos(\theta) = \frac{b}{r}$ and $\sin(\theta) = \frac{c}{r}.$

Then $z_0 = (b + ic) = r[\cos(\theta) + i\sin(\theta)] = re^{i\theta}.$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .