-1

I have an equation

(0.125-(1j*(mu1)*0.125))/(0.125 - cmath.sqrt((0.125**2)-(0.125**2)-((mu1**2)*(0.125**2))))

This is suppose to be 1 for any value of mu1 but it seems I am getting 1 only if mu1 is real... what am I missing?

For mu1 = 1, the above expression calculates 1 (see 3rd line)
(0.125-(1j*(mu1)*0.125))/(0.125 - cmath.sqrt((0.125**2)-(0.125**2)-((mu1**2)*(0.125**2))))
(1+0j)
For mu1 = 2, the above expression calculates 1 (see 3rd line)
(0.125-(1j*(mu1)*0.125))/(0.125 - cmath.sqrt((0.125**2)-(0.125**2)-((mu1**2)*(0.125**2))))
(1-0j)  ANSWER I AM LOOKING FOR
For mu1 = 2+2j, the above expression calculates
(0.125-(1j*(mu1)*0.125))/(0.125 - cmath.sqrt((0.125**2)-(0.125**2)-((mu1**2)*(0.125**2))))
(-1.4-0.8j) I WAS EXPECTING 1 because NUMERATOR and DENOMINATOR are same

For the last one, the bottom half evaluates to

1                     1
-- - sqrt(j^2 (2+2j)^2 ---^2 )
8                     8

1              1
-- - j (2+2j) ---
8              8

1 -2j -2j^2
-----------
8

3 - 2j
------
8
8
  • The (0.125**2)-(0.125**2) part of your equation cancels out to zero - I suspect you've miscopied some part of it. Commented Oct 13, 2022 at 2:03
  • No its ok.. They are suppose to cancel out and the sqrt should give j*mu1*0.125 Commented Oct 13, 2022 at 2:05
  • In the original eq, both 0.125 is replaced by variables a and b.. I gave a easier expression to make my point Commented Oct 13, 2022 at 2:06
  • After cancelling out everything, the result will only be 1 when 1j*mu1*0.125 == cmath.sqrt(-(mu1**2 * 0.125**2)) Commented Oct 13, 2022 at 2:19
  • Yes... that's what my question... I am getting 1 only if mu1 is real and not if mu1 is complex.... I thought they are essentially same expression...cmath.sqrt(-1) == 1j Commented Oct 13, 2022 at 2:26

3 Answers 3

0

After cancelling out the common terms, the result will only be 1 when

1j*mu1*0.125 == cmath.sqrt(-(mu1**2 * 0.125**2))

I haven't analyzed it carefully, but it seems to be true only the real part of mu1 is positive or zero and the imaginary part is negative or zero. I.e. it's true in the lower-right quadrant of the complex plane.

So I think you may have been misinformed about the equation, or you copied it wrong.

Sign up to request clarification or add additional context in comments.

11 Comments

LHS == RHS regardless of mu1 being real or complex...
@user3873617 Evidently not.
@kaya3 why is that???
Why is it evident? Because you can see for yourself that the left hand side is not equal to the right hand side in some cases.
@user3873617 It seems like Mathematics might be a better place for you to ask about this formula.
|
0

The answer lies in using appropriate branch cuts of sqrt function.

Comments

-1

In your case of 2+2j the top half of the fraction resolves to:

 1       j(2 + 2j)
---  -  -----------
 8           8

 1    -   (2j + (2j)^2)
---------------------
          8

 1    -   (2j + 2*-1)
---------------------
          8

 1    -   2j + 2
---------------------
          8

     3    -   2j 
---------------------
          8

Which only happens with the complex input due to j^2 = -1

The bottom half is:

(-0.125+0.25j)

# or
 
 -1 + 2j
--------
   8

# Because:

 1        sqrt(0 -      (2+2j)^2      )
---   -       -------------------
 8                 8^2


 1         sqrt(   -       8j
---  -                  -------     )
 8                         8^2

 1       2      2j
---  - (--- - -----)
 8       8      8

 1       2      2j
---  -  --- +  -----
 8       8      8

 -1 + 2j
--------
   8

It's worth noting this difference:

>>> cmath.sqrt(8j/64)
(0.25+0.25j)
>>> cmath.sqrt(-8j/64)
(0.25-0.25j)

5 Comments

The bottom also evaluates to (3-2j)/8
I added the bottom half calc that I see... How are you getting (2-2j)/8
Sorry, that's not correct, I'll update my answer
I agree with other posters, this probably would be easier resolved on Mathematics StackExchange if you're still not satisfied. Fun times revisiting complex number theory! Also - they probably have proper formatting tools - trying to write formulae on here is not easy.
Your 3rd line is incorrect... I have added the bottom calc in my orig...

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.