Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1996
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1996

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: declaring variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4761] Re: declaring variables
  • From: vvs124 at rsphy1.anu.edu.au (Victoria Steblina)
  • Date: Fri, 13 Sep 1996 13:54:47 -0400
  • Organization: Australian National University
  • Sender: owner-wri-mathgroup at wolfram.com

dh61 at rs3.hrz.th-darmstadt.de (Burkhardt Goedde) wrote:

>Dear math users,
>just a simple problem, but I got no answer from thew book.
>Re[x + I y] gives
>Re[x + I y]
>whereas 
>Re[2 + 3 I]
>gives 2
>How could I tell Mathematica that x and y are real numbers?

There is a package <<Algebra`ReIm` that lets you specify that given 
variables are purely real. Try the following:

In[5]:= Needs["Algebra`ReIm`"]

        Im[x]^=0;  

        Im[y]^=0;

        Re[x + I y]

        Im[x + I y]

Out[8]= x
Out[9]= y

The up definitions make the assignment associated with x and y rather
than
with Im...

Hope this helps
Vicki

________________________________________________________________________

 Victoria Steblina                      Email: vvs124 at rsphy1.anu.edu.au
 Optical Sciences Centre                Tel:   61 6 249 5129
 Australian National University         Fax:   61 6 249 5184


==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: declaring variables
  • Next by Date: Re: Questions about labels
  • Previous by thread: Re: declaring variables
  • Next by thread: Re: declaring variables