Re: [sage-support] Sage error HELP

2015-08-13 Thread Vincent Delecroix

What is your question?!

On 13/08/15 13:22, Luis Molina wrote:

def slopeline(x=(-5,5)):
p=plot(x^n, (n,0,6), ymin=-5^4, ymax= 5^4)
show(p)



--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Sage error HELP

2015-08-13 Thread Luis Molina
def slopeline(x=(-5,5)):
p=plot(x^n, (n,0,6), ymin=-5^4, ymax= 5^4)
show(p)

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Sage error HELP

2015-08-13 Thread Luis Molina
There's an operand error... And I dont know how to fix it!

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] quick way to factor integer coefficients of a polynomial?

2015-08-13 Thread Ursula Whitcher
Is there a quick way to factor the coefficients of a polynomial over the 
integers in Sage? 

For example, given x^2+9, I would like to rewrite it as x^2+3^2. 

I can see a slow way to do this (iterate over poly.factor_list(), extract 
coefficients, factor, rebuild the polynomial).  But perhaps there is a 
shortcut built into Sage?

--Ursula.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Sage error HELP

2015-08-13 Thread Anton Sherwood

On 2015-8-13 04:22, Luis Molina wrote:

def slopeline(x=(-5,5)):
p=plot(x^n, (n,0,6), ymin=-5^4, ymax= 5^4)
show(p)



What is (-5,5)^n supposed to be?

--
*\\*  Anton Sherwood  *\\*  www.bendwavy.org

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: quick way to factor integer coefficients of a polynomial?

2015-08-13 Thread Whitcher, Ursula A.

On 8/13/2015 1:19 PM, Volker Braun wrote:
 On Thursday, August 13, 2015 at 10:09:25 PM UTC+2, Ursula Whitcher wrote:

   sage: map(factor, (x^2+9).coefficients())
   [3^2, 1]

 Can you write it as a symbolic expression?


 Not really, see http://trac.sagemath.org/ticket/10069

OK, is there a quick way to go from [3^2,1] to the LaTeX version of 
x^2+3^2?  And what if I started with (x^2+9)(x^3+27) and wanted to end 
up with the LaTeX version of (x^2+3^2)(x^3+3^3)?

UAW

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Sage error HELP

2015-08-13 Thread Luis Molina
Wow you're right thanks!! Yes I was supposed to have an (x,0,6) (: 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: quick way to factor integer coefficients of a polynomial?

2015-08-13 Thread Volker Braun
There is the following one-liner but you can't write it as polynomial (Sage 
polynomials always evaluate the coefficients)

sage: R.x = ZZ[]
sage: map(factor, (x^2+9).coefficients())
[3^2, 1]



On Thursday, August 13, 2015 at 8:48:08 PM UTC+2, Ursula Whitcher wrote:

 Is there a quick way to factor the coefficients of a polynomial over the 
 integers in Sage? 

 For example, given x^2+9, I would like to rewrite it as x^2+3^2. 

 I can see a slow way to do this (iterate over poly.factor_list(), extract 
 coefficients, factor, rebuild the polynomial).  But perhaps there is a 
 shortcut built into Sage?

 --Ursula.


-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Plotting a q analogue function as a challenge?

2015-08-13 Thread saad khalid
Hello everyone:

I'm currently trying to get support from my professors in order for our 
school to move from Mathematica to Sage Math. One of them challenged me to 
simply plot the q-gamma function on sage math, which he does on Mathematica 
simply by calling on the QGamma function. Here is some information about it:

http://mathworld.wolfram.com/q-GammaFunction.html

My problem is, I don't actually know that much about the q-gamma function, 
or really much about the gamma function. But, I don't want to let him down, 
though he seemed very doubtful that Sage would be able to do it. I was 
looking for the q-gamma function on Sage/maxima but I couldn't find 
anything that fit what I was looking for. I'm hoping that maybe I just 
don't know the name or the format for how it's done outside of Mathematica? 

To be honest, I'm fairly new to Sage as well. I'm sorry if I'm asking in 
the wrong place, it's because I simply don't know where to ask. If there's 
a better place for me to ask this, I would be happy to ask there! 

Thanks for your help. I'm really hoping that I can get our college to 
support Sage :) 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Sage error HELP

2015-08-13 Thread Luis Molina
There is no (-5,5)^n ?

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Plotting a q analogue function as a challenge?

2015-08-13 Thread David Joyner
This is implemented in sympy, which is included with sage, according to google. 
I haven't tried it.

Sent from TypeMail



On Aug 13, 2015, 15:38, at 15:38, saad khalid saad1...@gmail.com wrote:
Hello everyone:

I'm currently trying to get support from my professors in order for our

school to move from Mathematica to Sage Math. One of them challenged me
to 
simply plot the q-gamma function on sage math, which he does on
Mathematica 
simply by calling on the QGamma function. Here is some information
about it:

http://mathworld.wolfram.com/q-GammaFunction.html

My problem is, I don't actually know that much about the q-gamma
function, 
or really much about the gamma function. But, I don't want to let him
down, 
though he seemed very doubtful that Sage would be able to do it. I was 
looking for the q-gamma function on Sage/maxima but I couldn't find 
anything that fit what I was looking for. I'm hoping that maybe I just 
don't know the name or the format for how it's done outside of
Mathematica? 

To be honest, I'm fairly new to Sage as well. I'm sorry if I'm asking
in 
the wrong place, it's because I simply don't know where to ask. If
there's 
a better place for me to ask this, I would be happy to ask there! 

Thanks for your help. I'm really hoping that I can get our college to 
support Sage :) 

-- 
You received this message because you are subscribed to the Google
Groups sage-support group.
To unsubscribe from this group and stop receiving emails from it, send
an email to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Plotting a q analogue function as a challenge?

2015-08-13 Thread D. S. McNeil
While qgamma isn't a native function, there's a qgamma implementation in
mpmath, one of the libraries included in Sage, so:

from mpmath import qgamma
plot(lambda x: qgamma(4,x), (x, 2, 10))

should give you a plot of gamma_(q=4).


Doug

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Plotting a q analogue function as a challenge?

2015-08-13 Thread Vincent Delecroix



On 13/08/15 22:56, D. S. McNeil wrote:

While qgamma isn't a native function, there's a qgamma implementation in
mpmath, one of the libraries included in Sage, so:

from mpmath import qgamma
plot(lambda x: qgamma(4,x), (x, 2, 10))

should give you a plot of gamma_(q=4).


Nice! And in 3d

sage: var('q,x')
sage: from mpmath import qgamma
sage: plot3d(lambda q,x: qgamma(q,x), (q, 0.5, 3), (x, 2, 10))

Vincent

--
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: quick way to factor integer coefficients of a polynomial?

2015-08-13 Thread Whitcher, Ursula A.
On 8/13/2015 11:57 AM, Volker Braun wrote:
 There is the following one-liner but you can't write it as polynomial
 (Sage polynomials always evaluate the coefficients)

 sage: R.x = ZZ[]
 sage: map(factor, (x^2+9).coefficients())
 [3^2, 1]

Can you write it as a symbolic expression?

UAW

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Re: quick way to factor integer coefficients of a polynomial?

2015-08-13 Thread Volker Braun
On Thursday, August 13, 2015 at 10:09:25 PM UTC+2, Ursula Whitcher wrote:

  sage: map(factor, (x^2+9).coefficients()) 
  [3^2, 1] 

 Can you write it as a symbolic expression? 


Not really, see http://trac.sagemath.org/ticket/10069

sage: SR(3).mul(SR(3), hold=True)
9*

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Plotting a q analogue function as a challenge?

2015-08-13 Thread saad khalid


 While qgamma isn't a native function, there's a qgamma implementation in 
 mpmath, one of the libraries included in Sage, so:

 from mpmath import qgamma
 plot(lambda x: qgamma(4,x), (x, 2, 10))

 should give you a plot of gamma_(q=4).


Thank you! Though, looking at the documentation, I think you meant that 
it's q-gamma at x=4?  Also, I was wondering, what does the lambda x:  
part of your code do? Or rather, how do I go about calling x later?

Also, what is the best way for me to find functions like this, whose 
implementation I don't know in Sage? When I tried searching q-gamma Sage 
Math on google, nothing came up, so I tried q-gamma Maxima,  but still 
nothing. I hadn't even thought of looking at Sympy. Is there a good way for 
me to know where to look? 

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


Re: [sage-support] Plotting a q analogue function as a challenge?

2015-08-13 Thread David Joyner
On Fri, Aug 14, 2015 at 12:16 AM, saad khalid saad1...@gmail.com wrote:

 While qgamma isn't a native function, there's a qgamma implementation in
 mpmath, one of the libraries included in Sage, so:

 from mpmath import qgamma
 plot(lambda x: qgamma(4,x), (x, 2, 10))

 should give you a plot of gamma_(q=4).


 Thank you! Though, looking at the documentation, I think you meant that it's
 q-gamma at x=4?  Also, I was wondering, what does the lambda x:  part of
 your code do? Or rather, how do I go about calling x later?

 Also, what is the best way for me to find functions like this, whose
 implementation I don't know in Sage? When I tried searching q-gamma Sage
 Math on google, nothing came up, so I tried q-gamma Maxima,  but still
 nothing. I hadn't even thought of looking at Sympy. Is there a good way for
 me to know where to look?

I googled sympy q-gamma and got this:
http://docs.sympy.org/dev/modules/mpmath/functions/qfunctions.html


 --
 You received this message because you are subscribed to the Google Groups
 sage-support group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to sage-support+unsubscr...@googlegroups.com.
 To post to this group, send email to sage-support@googlegroups.com.
 Visit this group at http://groups.google.com/group/sage-support.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.


[sage-support] Re: Sage error HELP

2015-08-13 Thread saad khalid
You wrote x = (-5,5), and then you wanted to plot x^n, which is the same as 
(-5,5)^n. What were you intending with that? I'm assuming you wanted the 
plots of x^n for x = -5 to x=5? Or were you wanting (-5,5) to be your xmin 
and xmax? 

On Thursday, August 13, 2015 at 6:24:25 AM UTC-5, Luis Molina wrote:

 def slopeline(x=(-5,5)): 
 p=plot(x^n, (n,0,6), ymin=-5^4, ymax= 5^4) 
 show(p)

-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.