[sage-support] Generating functions slow in Sage?

2014-08-29 Thread kcrisman
Some of you may want to know about this question: http://stackoverflow.com/questions/25570037/best-language-to-do-some-annoying-generating-function-computations excerpt: The computation relies on a few ingredients. 1. The first is that I need to be able to compute characters of the

[sage-support] Re: apparent numerical integration bug in sage

2014-08-29 Thread kcrisman
f1(x)=1/sqrt(x^3+2) f2(x)=1/sqrt(x^4+2) r1=RR(integrate(f1(x),(x,1,10^(10 r2=RR(integrate(f2(x),(x,1,10^(10 s1=RR(integrate(f1(x),(x,1,10^(11 s2=RR(integrate(f2(x),(x,1,10^(11 Note that probably using something like sage: numerical_integral(f2,1,10^8)

[sage-support] monomials of polynomial_zz_pex.Polynomial_ZZ_pEX

2014-08-29 Thread Juan Grados
Dears members, How I will be able to extract the monomials of univariate polynomial ring P of type polynomial_zz_pex.Polynomial_ZZ_pEX? K = GF(2^128,'t') PR.X = PolynomialRing(K,X) P = PR.random_element() -- - MSc. Juan del

Re: [sage-support] monomials of polynomial_zz_pex.Polynomial_ZZ_pEX

2014-08-29 Thread Vincent Delecroix
Dear Juan, Here is an example, {{{ sage: K = GF(2^128,'t') sage: PR.X = PolynomialRing(K,X) sage: P = PR.random_element() sage: P[0] # constant coeff (in X) ... sage: P[10] # coeff of degree 10 ... }}} But be careful, if the polynomial P has degree less than 10 then the code P[10] will raise an

[sage-support] Re: apparent numerical integration bug in sage

2014-08-29 Thread Robert Dodier
On 2014-08-29, kcrisman kcris...@gmail.com wrote: sage: numerical_integral(f2,1,10^8) (0.8815690504421161, 3.309409685784312e-09) sage: numerical_integral(f2,1,10^9) (0.8815690594421439, 2.7280605832086615e-08) sage: numerical_integral(f2,1,10^10) (0.8815690603426408, 6.194229607849825e-07)

[sage-support] a bug with region_plot -- please help!

2014-08-29 Thread Pierre
Dear all, Let's draw two discs with region_plot: sage: disc1= region_plot(lambda x, y : x^2+y^2 1, (x, -1, 1), (y, -1, 1)) sage: disc2= region_plot(lambda x, y : (x-0.7)^2+(y-0.7)^2 0.5, (x, -2, 2), (y, -2, 2) ) If we plot them separately, no problem. However if we try sage: disc1 + disc2

[sage-support] Re: a bug with region_plot -- please help!

2014-08-29 Thread Pierre
PS the tilings work fine in the upper half-plane, using hyperbolic_triangle. It looks as though whoever wrote hyperbolic_triangle did not rely on region_plot. On what, then? trying hyperbolic_triangle?? was pretty useless, it told me that hyperbolic_triangle relies on HyperbolicTriangle, whose

Re: [sage-support] Re: a bug with region_plot -- please help!

2014-08-29 Thread Vincent Delecroix
Salut Pierre! Let's draw two discs with region_plot: sage: disc1= region_plot(lambda x, y : x^2+y^2 1, (x, -1, 1), (y, -1, 1)) sage: disc2= region_plot(lambda x, y : (x-0.7)^2+(y-0.7)^2 0.5, (x, -2, 2), (y, -2, 2) ) If we plot them separately, no problem. However if we try sage:

[sage-support] Re: Generating functions slow in Sage?

2014-08-29 Thread Dima Pasechnik
On 2014-08-29, kcrisman kcris...@gmail.com wrote: Some of you may want to know about this question: http://stackoverflow.com/questions/25570037/best-language-to-do-some-annoying-generating-function-computations excerpt: The computation relies on a few ingredients. 1. The first is

[sage-support] Solving system of nonlinear equations

2014-08-29 Thread Chris Corio
Hello - I'm an experienced developer but new to Sage. I've stumbled into a somewhat complex system of equations and I'm trying to solve them under certain conditions. I have a system of equations: var('x y h k r t d') eq1 = x^2 + y^2 == d^2 eq2 = y == tan(t) * x eq3 = (x-h)^2 + (y-k)^2 == r^2

[sage-support] Re: Solving system of nonlinear equations

2014-08-29 Thread Harald Schilly
On Friday, August 29, 2014 6:46:39 PM UTC+2, Chris Corio wrote: Can anyone point me at the functions that I can use to solve these equations or have any suggestions for the solutions? I appreciate the help. Sage's solve is explicit, I don't know if it gives you a solution. What you

Re: [sage-support] Solving system of nonlinear equations

2014-08-29 Thread Vincent Delecroix
Hello Chris, 2014-08-29 18:46 UTC+02:00, Chris Corio chris.co...@gmail.com: somewhat complex system of equations and I'm trying to solve them under certain conditions. I have a system of equations: var('x y h k r t d') eq1 = x^2 + y^2 == d^2 eq2 = y == tan(t) * x eq3 = (x-h)^2 + (y-k)^2

[sage-support] Re: apparent numerical integration bug in sage

2014-08-29 Thread Harald Schilly
On Friday, August 29, 2014 7:15:27 PM UTC+2, Robert Dodier wrote: QUADPACK ... I've tried this in mpmath's quad. I think it works there, but maybe I've overlooked the actual problem. sage: import mpmath as mp sage: f1 = lambda _ : 1. / mp.sqrt(_^3 + 2) sage: f2 = lambda _ : 1. /

Re: [sage-support] Re: a bug with region_plot -- please help!

2014-08-29 Thread Pierre
To track further the code you can use the magic import_statements inside Sage which tells you where to find a class/function {{{ sage: import_statements('HyperbolicTriangle') from sage.plot.hyperbolic_triangle import HyperbolicTriangle sage: HyperbolicTriangle?? }}} It appears

[sage-support] backward substitution during solving polynomial equation

2014-08-29 Thread Daniel Krenn
I want to solve polynomial equations and in order to do so, I do something like: sage: R.x,y = PolynomialRing(QQ, order='lex') sage: I = R.ideal([x*y-1, x^2-y^2]) sage: I.groebner_basis() [x - y^3, y^4 - 1] Now I have to take the equation with only one variable, find the solutions for it (over

Re: [sage-support] Re: a bug with region_plot -- please help!

2014-08-29 Thread kcrisman
To track further the code you can use the magic import_statements inside Sage which tells you where to find a class/function {{{ sage: import_statements('HyperbolicTriangle') from sage.plot.hyperbolic_triangle import HyperbolicTriangle sage: HyperbolicTriangle?? }}} Or

Re: [sage-support] Re: a bug with region_plot -- please help!

2014-08-29 Thread kcrisman
It appears that it uses BezierPaths. I see. In turn the filling property is inherited from the BezierPath class. I've had a look at the code but I can hardly understand anything. I will note that someone didn't actually doctest _hyperbolic_arc, grr! I'll look at this - it's almost

[sage-support] Re: a bug with region_plot -- please help!

2014-08-29 Thread kcrisman
On Friday, August 29, 2014 1:19:32 PM UTC-4, Pierre wrote: Dear all, Let's draw two discs with region_plot: sage: disc1= region_plot(lambda x, y : x^2+y^2 1, (x, -1, 1), (y, -1, 1)) sage: disc2= region_plot(lambda x, y : (x-0.7)^2+(y-0.7)^2 0.5, (x, -2, 2), (y, -2, 2) ) If we plot

[sage-support] Re: a bug with region_plot -- please help!

2014-08-29 Thread kcrisman
This is now http://trac.sagemath.org/ticket/16907 -- 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

[sage-support] Re: Question About Finite Field propertie in polynomial ring

2014-08-29 Thread Peter Bruin
Hello, Let be the field q = 2 K.t = GF(q^n) and the Polynomial Ring PR = PolynomialRing(K,X) Let be a random monomial of PR for example P = t*X^(q^a). Is there any method in sage to reduce X degree of polynomial P, such that equivalent polynomial is t*X^(q^b) where b =

Re: [sage-support] backward substitution during solving polynomial equation

2014-08-29 Thread Vincent Delecroix
(solve seems to be very much an overkill and it is not that transparent in what it does...) Definitely! And I won't even believe the output... I want to solve polynomial equations and in order to do so, I do something like: sage: R.x,y = PolynomialRing(QQ, order='lex') sage: I =

[sage-support] Re: apparent numerical integration bug in sage

2014-08-29 Thread kcrisman
Sage punts numerical integrals to QUADPACK or a translation of it, What does GSL use? I forgot that Scipy also has quadrature, in addition to Maxima... wealth of riches. right? QUADPACK is based on Gauss-Kronrod rules which are essentially Gaussian integration + an efficient

[sage-support] Re: apparent numerical integration bug in sage

2014-08-29 Thread Robert Dodier
On 2014-08-29, kcrisman kcris...@gmail.com wrote: sage: gp.eval('intnum(x=1,1000,1/sqrt(x^4+2))') '0.88156906043147435374520375967552406680' sage: gp.eval('intnum(x=1,1,1/sqrt(x^4+2))') '0.88156906044791138558085421922579474969' Hmm, what method does PARI/GP use? The

[sage-support] Re: apparent numerical integration bug in sage

2014-08-29 Thread Peter Bruin
Hello Robert, Hmm, what method does PARI/GP use? The documentation for intnum doesn't seem to mention any algorithms. ... I just looked at the source code (intnum.c) and I can't tell what's going on. There is some code for Romberg's method (intnumromb) but it's not called from intnum