[sage-support] Re: list(factor(1)) yields []: Is this consequent?

2011-09-14 Thread Volker Braun
As Maarten already said, 1 is not prime. Also, note that the empty product equals one: sage: prod([]) 1 -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this gr

[sage-support] gsl in sage outside of notebook

2011-09-14 Thread Rajeev Singh
Hi, The following examples compiles from the notebook %cython cimport sage.gsl.ode import sage.gsl.ode include 'gsl.pxi' cdef class van_der_pol(sage.gsl.ode.ode_system): cdef double beta def __cinit__(self, double beta=1.0): self.beta = beta cdef int c_f(self,double t, double

[sage-support] for loop in 3d image

2011-09-14 Thread MathLynx
What is wrong with x,y,z = var('x,y,z') P = implicit_plot3d(x^2 +y^2 -z^2 ==1, (x,-3.2,3.2),(y,-3.2,3.2), (z,-3,3),opacity=.2,color='blue') for k in range(20) P += parametric_plot3d([cos((2*pi*k)/(20))+sin((2*pi*k)/ (20))*t,sin((2*pi*k)/(20))-cos((2*pi*k)/(20))*t,t], (t,-3,3),color='red',thick

[sage-support] Re: for loop in 3d image

2011-09-14 Thread MathLynx
let me alter the first line to x,y,z,t = var('x,y,z,t') On Sep 14, 5:49 pm, MathLynx wrote: > What is wrong with > > x,y,z = var('x,y,z') > P = implicit_plot3d(x^2 +y^2 -z^2 ==1, (x,-3.2,3.2),(y,-3.2,3.2), > (z,-3,3),opacity=.2,color='blue') > for k in range(20) >     P += parametric_plot3d([cos(

[sage-support] Re: for loop in 3d image

2011-09-14 Thread John H Palmieri
Try adding a colon at the end of "for k in range(20)"? -- John -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sag

[sage-support] Asking whether a number is in QQ or not

2011-09-14 Thread Alex Lara
Hi all, I have a question about the following behavior of Sage: sage: z = (-1+sqrt(-3))/2 sage: b = (1+z)^3 sage: b in QQ False sage: b.expand() in QQ True Why b in QQ return False and b.expand() in QQ return True? Since b is -1, I expected True in both cases. Also, QQ(b) return an error: TypeE

[sage-support] Simplify an expression containing a derivative

2011-09-14 Thread Michael Orlitzky
I pulled an expression out of a piecewise function that contains some derivatives. The full_simplify() method seems unhappy; can anyone decipher this error or think up a workaround? sage: load('recovery.py') sage: r = ZZ(3) sage: t = SR.symbol('t', domain='real') sage: x = SR.symbol('x', domain=

[sage-support] Re: gsl in sage outside of notebook

2011-09-14 Thread Rajeev Singh
On Wed, Sep 14, 2011 at 3:01 PM, Rajeev Singh wrote: > Hi, > > The following examples compiles from the notebook > > %cython > cimport sage.gsl.ode > import sage.gsl.ode > include 'gsl.pxi' > > cdef class van_der_pol(sage.gsl.ode.ode_system): >    cdef double beta >    def __cinit__(self, double b

[sage-support] complex parts

2011-09-14 Thread Anton Sherwood
Is there a function inverse to complex(x,y), such that (x,y) == ReIm(complex(x,y)) ? I could obviously write one -- def ReIm(z): return (z.real,z.imag) -- but presumably a library function if it exists would be speedier. -- Anton Sherwood *\\* www.bendwavy.org *\\* www.zazzle.com/tamfang -- T

Re: [sage-support] complex parts

2011-09-14 Thread Robert Bradshaw
On Wed, Sep 14, 2011 at 7:57 PM, Anton Sherwood wrote: > Is there a function inverse to complex(x,y), > such that (x,y) == ReIm(complex(x,y)) ? > > I could obviously write one -- def ReIm(z): return (z.real,z.imag) -- but > presumably a library function if it exists would be speedier. For Sage's

Re: [sage-support] gsl in sage outside of notebook

2011-09-14 Thread Robert Bradshaw
On Wed, Sep 14, 2011 at 2:31 AM, Rajeev Singh wrote: > Hi, > > The following examples compiles from the notebook > > %cython > cimport sage.gsl.ode > import sage.gsl.ode > include 'gsl.pxi' > > cdef class van_der_pol(sage.gsl.ode.ode_system): >    cdef double beta >    def __cinit__(self, double b