Re: Forcing Re[]'s to be Real
- To: mathgroup at smc.vnet.net
- Subject: [mg18268] Re: [mg18223] Forcing Re[]'s to be Real
- From: Haiduke Sarafian <has2 at psu.edu>
- Date: Thu, 24 Jun 1999 14:24:53 -0400
- References: <199906231218.IAA34852@f04n07.cac.psu.edu>
- Sender: owner-wri-mathgroup at wolfram.com
At 03:15 PM 6/23/99 -0700, Anthony Foglia wrote:
>On Wed, 23 Jun 1999, Haiduke Sarafian wrote:
>
>> Anthony; the source of the problem is the argument of k[w] function - It
>> should read k[w_]:=...
>
> Actually I have that correct in my code, but mistyped when I wrote
>the message.
>
>> As you suggested, to extract the Re and Im components of k[w] apply
>> Re[ComplexExpand[k[w]] and Im[ComplexExpand[k[w]] - then you can graph the
>> outputs. Cheers
>
> Nope, still can't. Still getting "...not a machine-sized real"
>errors.
>
>--Anthony
Anthony; I am surprised with our "Nope" answer!! If you define the k[w]
correctly then you can generate two numerical tables one for
Re[ComplexExpand[k[w]]] and the other one for Im[...] for a range of w
before graph them - this will ensure the graph process.
define:
r1:=Re[ComplexExpand[[k[w]]]
tr1:=N[Table[r1,{w,0,10}] (* this will produce a set of real values *)
Plor1=Plot[r1,{w,0,10}]; (* this will plot the r1 function which behaves
linearly *)
You can try the same procedure for the Im part of the k[w]. I graphed the
Re and Im pieces of the k[w] and naturally they worked!!
>