MathGroup Archive 2009

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

Search the Archive

Re: confused about asserting variable is element of Reals

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103118] Re: confused about asserting variable is element of Reals
  • From: kostka <kostka at gmail.com>
  • Date: Tue, 8 Sep 2009 06:00:05 -0400 (EDT)
  • References: <h829lj$3tg$1@smc.vnet.net>

On Sep 6, 11:36 pm, dushan <dush... at spinn.net> wrote:
> I'm still learning Mathematica (using 7.0.1) and don't understand
> Mathematica's response.  After finally finding out how to assert that a
> variable is real, I tried to verify this by asking Mathematica to show me that
> it knew the imaginary part of the variable is zero.  But I couldn't
> find a way to do that..  Here're my instructions:
>
>     In[1]:=   a (ESC)el(ESC) Reals
>     Out[1]:= a (the element-of symbol) Reals
>
>     In[2]:=   ##Im[a]
>     Out[2]:= Im[a]
>
> where '##' is any of {null, Refine[, Simplify[, FullSimplify[}.  I
> also tried some other combinations, such as 'a^2 - Re[a]^2', but these
> didn't help either.
>
> What am I doing wrong?  How do I verify such things?
>
> Thanks.
>
> - Dushan Mitrovich

Dushan,

I believe the correct way to go about declaring something as real is
during a Simplify or Reduce.  For example:

In[1]:= Simplify[Im[a], Element[a, Reals]]
Out[1]= 0

I don't know if there's a way to tell Mathematica "this will always be
a Real in all future statements" since you could easily contradict
yourself later by saying "a=Sqrt[-1]".

Regards,

Tim


  • Prev by Date: Re: Optimizing a function with a list as a parameter
  • Next by Date: SendMail and Novell Groupwise
  • Previous by thread: Re: confused about asserting variable is element of Reals
  • Next by thread: Optimizing a function with a list as a parameter