Message Boards Message Boards

0
|
3659 Views
|
6 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Get absolute value of a complex number?

Posted 6 years ago

Hi!

I'll start right away. I have a question about Complex Numbers.

I have a complex number, or a bunch of complex numbers, like you can see below. Here I need to know the absolute value of the number B squared, but in the result there is still the imaginery unit in it. I said that all the variables are real numbers greater than zero, so it should be possible to give me a correct term for the absolute value of B.

Or what is my mistake here? How do I use complex numbers with variables in it? How do I make sure that the variables are part of the reals numbers an grater than zero?

Input

\[Alpha] \[Element] Reals; \[Lambda] \[Element] Reals; L \[Element] Reals; \[Alpha] > 0; \[Lambda] > 0; L > 0;

\[CapitalOmega] = (\[Alpha] - I*\[Lambda])/(\[Alpha] + I*\[Lambda])*Exp[\[Alpha]*L];
c = (2*I*\[Lambda])/(I*\[Lambda] + \[Alpha])*Exp[(\[Alpha] - I*\[Lambda])*L/2]/(1 + \[CapitalOmega]^2);
d = c*\[CapitalOmega];

B = c*Exp[(-\[Alpha] + I*\[Lambda])*L/2] + d*Exp[(\[Alpha] + I*\[Lambda])*L/2] - 1;
Abs[B]^2

Output

Abs[-1 + (
  2 I E^(L \[Alpha] + 1/2 L (\[Alpha] - I \[Lambda]) + 
    1/2 L (\[Alpha] + I \[Lambda])) (\[Alpha] - 
     I \[Lambda]) \[Lambda])/((1 + (
     E^(2 L \[Alpha]) (\[Alpha] - I \[Lambda])^2)/(\[Alpha] + 
       I \[Lambda])^2) (\[Alpha] + I \[Lambda])^2) + (
  2 I E^(1/2 L (\[Alpha] - I \[Lambda]) + 
    1/2 L (-\[Alpha] + I \[Lambda])) \[Lambda])/((1 + (
     E^(2 L \[Alpha]) (\[Alpha] - I \[Lambda])^2)/(\[Alpha] + 
       I \[Lambda])^2) (\[Alpha] + I \[Lambda]))]^2

In[7]:= Simplify[
 Abs[-1 + (
   C E^(L \[Alpha] + 
     1/2 L (\[Alpha] + I \[Lambda])) (\[Alpha] - 
      I \[Lambda]))/(\[Alpha] + I \[Lambda]) + (
   2 I E^(1/2 L (\[Alpha] - I \[Lambda]) + 
     1/2 L (-\[Alpha] + I \[Lambda])) \[Lambda])/((1 + (
      E^(2 L \[Alpha]) (\[Alpha] - I \[Lambda])^2)/(\[Alpha] + 
        I \[Lambda])^2) (\[Alpha] + I \[Lambda]))]^2]

Out[7]= Abs[-1 + (
  C E^(1/2 L (3 \[Alpha] + I \[Lambda])) (\[Alpha] - 
     I \[Lambda]))/(\[Alpha] + I \[Lambda]) + (
  2 I \[Lambda])/((1 + (
     E^(2 L \[Alpha]) (\[Alpha] - I \[Lambda])^2)/(\[Alpha] + 
       I \[Lambda])^2) (\[Alpha] + I \[Lambda]))]^2

I hope you can help me. Thanks in advance! :)

Best regards, Thomas

POSTED BY: Thomas Vergeiner
6 Replies
Anonymous User
Anonymous User
Posted 6 years ago
POSTED BY: Anonymous User

Or perhaps with your B from above

B
Bstar = B /. Complex[u_, v_] -> Complex[u, -v]

and then (giving Abs[ B ]^2 )

B *Bstar // FullSimplify
POSTED BY: Hans Dolhaine
POSTED BY: Gianluca Gorni

So I have another question: Why doesn't that work for Abs[], Im[] or Re[]?

When i type

FullSimplify[Abs[B], myAssumptions]

I just get

Abs[((\[Alpha] - I \[Lambda]) ((\[Alpha] - I \[Lambda]) Cosh[L \[Alpha]] - 2 I \[Lambda] Sinh[ L \[Alpha]]))/((\[Alpha] - \[Lambda]) (\[Alpha] + \[Lambda]) * Cosh[L \[Alpha]] - 2 I \[Alpha] \[Lambda] Sinh[L \[Alpha]])]

as result. Same for Re and Im.

POSTED BY: Thomas Vergeiner
POSTED BY: Thomas Vergeiner

The mechanism for assumptions is different:

myAssumptions = {\[Alpha] \[Element] Reals, \[Lambda] \[Element] 
    Reals, L \[Element] Reals, \[Alpha] > 0, \[Lambda] > 0, L > 0};
FullSimplify[Abs[B]^2, myAssumptions]

If you need global assumptions, look up $Assumptions.

POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract