0
$\begingroup$

I have this equation and I wanted to find the absolute square of this term in Mathematica

$$ H_1 = \left | 1 + j\; \left(\frac{ 2 \pi}{1-e^\lambda}\right) \right|^2 $$

I did this in mathematica

H1 = Abs[1 + 1*i*((2*Pi)/ (1 - e^(-\[Lambda])))]^2

which does not yield any result.

then I did this enter image description here

Can anyone help? As the absolute square is just square of real-term and imaginary term which should be simple. Solving this on paper is quite simple

$$ H_1 = \left | 1 + j\; \left(\frac{ 2 \pi}{1-e^\lambda}\right) \right|^2 $$

$$ H_2 = \left | 1 + \; \left(\frac{ j2 \pi}{e^{(-j2\pi)}-e^{(-j2\pi\lambda)}}\right) \right|^2 $$


Thank you very much, I made an edit in the question. Now I have H_2 as well, can you please look into H_2 at the end of the question and tell me how to calculate it's absolute square. My code for H_2 in Mathematica is

(ComplexExpand[#1, TargetFunctions -> {Re, Im}] & )[ Abs[1 + (I*2*Pi)/ ((2*Pi)/E^I - E^I*2*Pi* [Lambda])]^2] – 
$\endgroup$
2
  • $\begingroup$ You seem to be implicitly assuming that $\lambda$ is real... $\endgroup$ Jan 26, 2021 at 8:16
  • $\begingroup$ @J.M. YES, $\lambda$ is real. $\endgroup$ Jan 26, 2021 at 10:18

1 Answer 1

4
$\begingroup$

Imaginary unit is I , not i, exponential constant is E , not e and use option for ComplexExpand

Abs[1 + (2 I π)/(1 - E^-λ)]^2 // 
   ComplexExpand[#, TargetFunctions -> {Re, Im}] &

(*   1 + (4 π^2)/(1 - E^-λ)^2   *)
$\endgroup$
3
  • $\begingroup$ Thank you very much, I made an edit in the question. Now I have H_2 as well, can you please look into H_2 at the end of the question and tell me how to calculate it's absolute square. My code for H_2 in Mathematica is (ComplexExpand[#1, TargetFunctions -> {Re, Im}] & )[ Abs[1 + (I*2*Pi)/ ((2*Pi)/E^I - E^I*2*Pi* [Lambda])]^2] $\endgroup$ Jan 26, 2021 at 10:06
  • 1
    $\begingroup$ @good_omen92 - The code for H2 should be (ComplexExpand[#1, TargetFunctions -> {Re, Im}] &)[Abs[1 + (I*2*Pi)/(E^(I*2*Pi) - E^(I*2*Pi*\[Lambda]))]^2] // FullSimplify $\endgroup$
    – Bob Hanlon
    Jan 26, 2021 at 16:30
  • $\begingroup$ Did you miss negative signs in exponential power? Isn't that? (ComplexExpand[#1, TargetFunctions -> {Re, Im}] &)[Abs[1 + (I*2*Pi)/(E^(-I*2*Pi) - E^(-I*2*Pi*[Lambda]))]^2] // FullSimplify $\endgroup$ Jan 28, 2021 at 11:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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