0
$\begingroup$

Let $z_1 = r_1 \exp(i \theta_1) $ and $z_2 = r_2\exp(i \theta_2) $ be complex numbers in exponential form and $z = z_1 + z_2 $, then I know using the complex plane vector representation that $z$ can be written in the exponential form too, $z = r \exp(i \theta) $, where $$ r = \sqrt{r_1^2 + r_2^2 + 2 r_1 r_2 \cos( \theta_1 - \theta_2)} $$ $$ \theta = \arctan\left(\frac{r_1 sin\theta_1 + r_2 sin\theta_2} {r_1 cos\theta_1 + r_2 cos\theta_2}\right) $$

Problem: when I plotted-in Mathematica- the real part of $z$, it did not match with the plot of the real part of $z_1 + z_2$ but rather it matched the plot of the real part of its absolute value $|{z_1 + z_2}|$. I tried two different numbers for $z_1, z_2$, both have the problem.

Question: 1) Why is that, what is wrong with the formula?, 2) How to fix it so both $Re[z_1 + z_2]$ and $Re[z]$ give the same plot?

$\endgroup$
1
  • 1
    $\begingroup$ I don't know if this will solve your problem, but try this: the arctangent formula for the angle only works when the angle of the resulting complex number is between $-\pi/2$ and $\pi/2$. Try adjusting the whole thing by an angle of $\pi$. $\endgroup$
    – Josh B.
    Jul 20, 2020 at 19:09

1 Answer 1

1
$\begingroup$

$z = z_1+z_2 = r_1\cos\theta_1 + r_2\cos\theta_2 + ir_1\sin\theta_1+ir_2\sin\theta_2$.

$\mod(z) = \sqrt{(Re(z))^2 + (Im(z))^2} = \sqrt{r_1^2(\cos^2\theta_1 + \sin^2\theta_1) + r_2^2(\cos^2\theta_2 + \sin^2\theta_2) + 2r_1r_2(\cos\theta_1\cos\theta_2 + \sin\theta_1\sin\theta_2)} = \sqrt{r_1^2+r_2^2+2r_1r_2\cos(\theta_1-\theta_2)}$.

$\arg(z) = \arctan(Im(z)/Re(z)) = \arctan(\frac{r_1\sin\theta_1 + r_2\sin\theta_2}{r_1\cos\theta_1 + r_2\cos\theta_2})$.

Looks correct to me. Maybe you are plugging into Mathematica incorrectly? Or possibly the arctan function in Mathematica is defined differently?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.