
Student Support Forum: 'Abs[z] stays complex, z is constraint' topicStudent Support Forum > General > "Abs[z] stays complex, z is constraint"
| 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: , |
|
| | | |
 | |
|