Re: Re: What is happening here? (TagSet)
- To: mathgroup at smc.vnet.net
- Subject: [mg28082] Re: [mg28061] Re: What is happening here? (TagSet)
- From: BobHanlon at aol.com
- Date: Fri, 30 Mar 2001 04:12:31 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
x/:Im[x]=0;
y/:Im[y]=0;
Note the following results without the other upvalues:
test = {Re[x], Re[y], Re[x+y]};
Re[test]
{Re[x], Re[y], Re[x + y]}
{Simplify[Re[test]], Simplify[Re[test], Element[{x, y}, Reals]]}
{{Re[x], Re[y], Re[x + y]},
{x, y, x + y}}
{FullSimplify[Re[test]], FullSimplify[Re[test],Element[x, Reals]],
FullSimplify[Re[test],Element[y, Reals]],
FullSimplify[Re[test],Element[{x, y}, Reals]]}
{{Re[x], Re[y], x + y},
{x, Re[y], x + Re[y]},
{Re[x], y, y + Re[x]},
{x, y, x + y}}
Bob Hanlon
In a message dated 2001/3/29 3:55:18 AM, johntodd at fake.com writes:
>One other quick related question:
>
>if I do the following:
>
>x/:Im[x]=0;
>y/:Im[y]=0;
>
>all of the equations and problems work just as well as if I had done
>this:
>
>x/:Im[x]=0;
>y/:Im[y]=0;
>x/:Re[x]=x;
>y/:Re[y]=y;
>
>which makes sense to me, because the last two 'upvalues' for x seem
>redundant in my mind, at least from a mathematical viewpoint. Is
>there some reason that I should go with the latter form as opposed to
>the former, or will the former suffice?
>