Re: global real variables

*To*: mathgroup at smc.vnet.net*Subject*: [mg22098] Re: global real variables*From*: "Allan Hayes" <hay at haystack.demon.co.uk>*Date*: Mon, 14 Feb 2000 02:03:50 -0500 (EST)*References*: <87trds$5o3@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Naum. I'll take the last part of your question first. Here is a way to reduce the labour of saying what is real: Simplify[#1, Element[Join[#2, #2^-1], Reals] ] &[#, Level[#, {-1}]] &[ Conjugate[ x + x * p^-1 ]] (1 + 1/p)*x But then, for your question about global real variables I went back to the AddOn: << Algebra`ReIm` Surprisingly, this helps Simplify: Simplify[ Conjugate[ x + x * p^-1 ] , Element[ {x, p} , Reals ] ] (1 + 1/p)*x But, to come back to the global real variables, we enter x /: Im[x] = 0; p /: Im[p] = 0; and then find: Conjugate[ x + x * p^-1 ] x + x/p Allan --------------------- Allan Hayes Mathematica Training and Consulting Leicester UK www.haystack.demon.co.uk hay at haystack.demon.co.uk Voice: +44 (0)116 271 4198 Fax: +44 (0)870 164 0565 "Naum Phleger" <naum at cava.physics.ucsb.edu> wrote in message news:87trds$5o3 at smc.vnet.net... > I asked a dumb question a few weeks ago about making variables real and > found that Mathematica 4 took care of this better. I have been using it > since. I still have a couple of problems with it though. First, I can have > variables be treated as real by using the assumption Element[x,Reals] in a > simplify command, but I want x to be real in all commands so I don't have to > keep using Simplify each time I want x to be recognized as real. Second, > even this doesn't seem to work quite right. Here is what I mean. > > > Say I have tow var.s, x and p. Both are real so I can do this. > > Simplify[ Conjugate[ x ] , Element[ x , Reals ] ] ----> x > > amd I get the same thing for p, but it stops working if I have functions of > x and p, for instance I get > > > Simplify[ Conjugate[ x + x * p^-1 ] , Element[ {x,p} , Reals ] ] ----> > > Conjugate[ x + x * p^-1 ] > > > It works if I use FullSimplify AND put p^-1 into the list of variables > that I want to have real. How can I get around this without listing every > negative power of every variable and wasting time with FullSimplify. Thanks > for any help. Thanks. > > > -NAUM >