Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Abs[z] stays complex, z is constraint' topicStudent Support Forum > General > "Abs[z] stays complex, z is constraint"

< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic
Author Comment/Response
jf
05/28/12 1:56pm

Mathematica assumes the variables could be complex. A quick way to say all the variables are Real is to wrap the Abs[..] in ComplexExpand[]/

In[1]:= Abs[1/rf + (ri + x)/(lo^2 w^2 + (ri + x)^2) -
I (1/(lm^2 w^2) + (lo^2 w^2)/(lo^2 w^2 + (ri + x)^2))]

Out[1]=
Abs[1/rf + (ri + x)/(lo^2*w^2 + (ri + x)^2) -
I*(1/(lm^2*w^2) + (lo^2*w^2)/(lo^2*w^2 + (ri + x)^2))]

In[2]:= ComplexExpand[
Abs[1/rf + (ri + x)/(lo^2 w^2 + (ri + x)^2) -
I (1/(lm^2 w^2) + (lo^2 w^2)/(lo^2 w^2 + (ri + x)^2))] ]

Out[2]=
Sqrt[(-(1/(lm^2*w^2)) - (lo^2*w^2)/(lo^2*w^2 + (ri + x)^2))^2 +
(1/rf + (ri + x)/(lo^2*w^2 + (ri + x)^2))^2]

In[3]:= $Version

Out[3]= "8.0 for Microsoft Windows (64-bit) (October 7, 2011)"

If you check http://reference.wolfram.com/mathematica/ref/Abs.html, under More Information,
"Abs[z] is left unevaluated if z is not a numeric quantity."



URL: ,

Subject (listing for 'Abs[z] stays complex, z is constraint')
Author Date Posted
Abs[z] stays complex, z is constraint Max 05/27/12 8:59pm
Re: Abs[z] stays complex, z is constraint jf 05/28/12 1:56pm
Re: Re: Abs[z] stays complex, z is constraint Max 05/28/12 2:52pm
< Previous Comment | Next Comment >Help | Reply To Comment | Reply To Topic