Thanks a lot Mike. Defining a variable as a member of a particular
field such as RR is exactly what I have been wanting to do and I did
not really undersand how to do it until I saw your domain=RR example.


On Feb 17, 11:13 pm, Mike Hansen <[email protected]> wrote:
> On Thu, Feb 17, 2011 at 1:30 PM, Jeff <[email protected]> wrote:
> > To be consistent with the assumption, though, I think that iimag(a)
> > should return zero.
>
> > Can anyone comment?
>
> Unfortunately, the assumptions system (still) is not well integrated
> with the Pynac code.  When you do assume(a, 'real'), it sends that
> assumption to Maxima, and Sage/Pynac does not really know anything
> about it.  In order for it to be "in effect", you have to send the
> expression to Maxima and ask it to simplify it:
>
> sage: var('a')
> a
> sage: assume(a, 'real')
> sage: imag(a)
> imag_part(a)
> sage: imag(a).simplify()
> 0
>
> Additionally, you can specify the "domain" (complex, real, positive)
> of a variable within Pynac directly by doing
>
> sage: a = var('a', domain=RR)
> sage: imag(a)
> 0
>
> However, this does not create the corresponding assumption within Maxima.
>
> --Mike

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to