Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: How to get the Real and Imaginary part of an expression
Posted:
Jan 5, 2013 2:17 AM
|
|
Eduardo,
Two problems:
(1) Mathematica does not know that s is a complex variable.
(2) The functions Re[ ] and Im[ ] work only for numeric arguments.
Try the following:
----- Clear[s, z, w, x, y] (w = 882.)/(s^2 + 2*z*w*s + w^2)
f = % /. s -> x + I y
ComplexExpand[%]
-----------
HTH,
Raul
On Jan 2, 2013, at 6:16 PM, Eduardo M. A. M. Mendes <emammendes@gmail.com> wrote:
> Hello > > I need to extract the real and imaginary part of the following expression > > (w=882)/(s^2+2*z*w*s+w^2) > > where w and z are positive constants. s is a complex variable. > > Applying Re and Im to the expression does not do much. By hand, one can easily find them. > > What am I missing? > > many thanks > > Ed > > >
--Boundary_(ID_rnQ7W0VSrA7Op0O/vuqrsw) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable
<html><head><meta http-equiv="Content-Type" content="text/html = charset=us-ascii"></head><body style="word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; = ">Eduardo,<div><br></div><div>Two problems:</div><div><br></div><div>(1) = Mathematica does not know that s is a complex = variable.</div><div><br></div><div>(2) The functions Re[ ] and Im[ ] = work only for numeric arguments.</div><div><br></div><div>Try the = following:</div><div><br></div><div>-----</div><div><div style="margin: = 0px; font-family: Helvetica; font-size: 16px; ">Clear[s, z, w, x, y]<br> (w = 882.)/(s^2 + 2*z*w*s + w^2)<br> <br> f = % /. s -> x + I y<br> <br> ComplexExpand[%]</div><div style="margin: 0px; font-family: Helvetica; = font-size: 16px; "><br></div><div style="margin: 0px; font-family: = Helvetica; font-size: 16px; ">-----------</div><div style="margin: = 0px; font-family: Helvetica; font-size: 16px; "><br></div><div = style="margin: 0px; font-size: 16px; font-family: Helvetica; = ">HTH,</div><div style="margin: 0px; font-size: 16px; font-family: = Helvetica; "><br></div><div style="margin: 0px; font-size: 16px; = font-family: Helvetica; ">Raul</div><div style="margin: 0px; = font-size: 12px; font-family: Helvetica; "><br></div><div><div>On Jan 2, = 2013, at 6:16 PM, Eduardo M. A. M. Mendes <<a = href="mailto:emammendes@gmail.com">emammendes@gmail.com</a>> = wrote:</div><br class="Apple-interchange-newline"><blockquote = type="cite">Hello<br><br>I need to extract the real and imaginary part = of the following = expression<br><br>(w=882)/(s^2+2*z*w*s+w^2)<br><br>where w and z are = positive constants. s is a complex variable.<br><br>Applying Re = and Im to the expression does not do much. By hand, one can = easily find them. <br><br>What am I missing?<br><br>many = thanks<br><br>Ed<br><br><br><br></blockquote></div><br></div></body></html= >=
--Boundary_(ID_rnQ7W0VSrA7Op0O/vuqrsw)--
|
|
|
|