Re: [sympy] Possible bug in method 'refine_root()' of class sympy.polys.polytools.Poly

2013-06-18 Thread Heiner Kirchhoffer
Hi Mateusz and all, refine_root() doesn't work with non-squarefree polynomials. Unfortunately > it's not written in the documentation. Remove root multiplicities with > sqf() and then proceed with your original approach, e.g.: > > In [8]: sqf_list(f) > Out[8]: > ⎛ ⎡⎛ 2 ⎞⎤⎞ > ⎝1, ⎣

Re: [sympy] Diophantine Equation Module

2013-06-18 Thread Chris Smith
sorry - correction. I was thinking to return a Dummy but then realized that if you are making the name uniq you can pass back a Symbol def uniqparam(eq, t='t'): s = eq.atoms(Symbol) while any(si.name == t for si in s): t = "_" + t return Symbol(t) -- You received this message because y

Re: [sympy] Diophantine Equation Module

2013-06-18 Thread Chris Smith
I would say they should pass the symbol to use; in order to do anything with it (like substitute a value) they will have to create the symbol. And if you create it and put assumptions on it (like being an integer) but they don't then their subs will fail: >>> Symbol('t').subs(Symbol('t',integer=1)

Re: [sympy] Diophantine Equation Module

2013-06-18 Thread Chris Smith
> > > For example, the equation 2*x*y + 5*x + 56*y + 7 = 0 (which is a special >> > case of the >> > quadratic equation) has 8 solution pairs (x, y). (-27, 64), (-29, -69), >> > (-21, 7) and five more. >> > Does this mean that there is no additional parameter -- only these few solutions? -- You r

Re: [sympy] Diophantine Equation Module

2013-06-18 Thread Thilina Rathnayake
When we ask the user to specify the parameter to be used, what should be the input? should it be a symbol or a string which contain the symbol to be used. What I am asking is whether we should use, >>>var("t") >>>diop_solve(3*x*y + 5*y -7, param=t) or >>>diop_solve(3*x*y + 5*y -7, param="t") O

Re: [sympy] Diophantine Equation Module

2013-06-18 Thread Thilina Rathnayake
Thank you Ondrej for the reply. I think that's the way we should go at it. I can implement the moduels to find the solution and return those naturally as a list. Later we consider about the high level API's. On Wed, Jun 19, 2013 at 1:28 AM, Ondřej Čertík wrote: > Hi Thilina, > > On Tue, Jun 18,

Re: [sympy] Re: Possible bug in method 'refine_root()' of class sympy.polys.polytools.Poly

2013-06-18 Thread Chris Smith
yeah, I thought about that but wasn't sure of the best way of doing that. Perhaps if eps: dig = -round((log(eps)/log(10.))) rv = [i.round(dig) for i in rv] -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop rec

Re: [sympy] args invariant

2013-06-18 Thread Aaron Meurer
Well this discussion got buried, but I still do care about it. We should talk at SciPy too (if we have time between all the other stuff we should talk about). On Sun, May 26, 2013 at 8:50 AM, Matthew Rocklin wrote: > > > > On Sat, May 25, 2013 at 4:38 PM, Aaron Meurer wrote: >> >> OK, sorry for

Re: [sympy] economical srepr for SparseMatrix

2013-06-18 Thread Aaron Meurer
Yes, the same for str too. And perhaps even something should be added to the pretty printer to print ellipses if there is a large block of zeros. But first let's merge https://github.com/sympy/sympy/pull/2088 (it's too bad this wasn't merged already; now there are merge conflicts). Aaron Meurer

Re: [sympy] Re: Possible bug in method 'refine_root()' of class sympy.polys.polytools.Poly

2013-06-18 Thread Aaron Meurer
Perhaps you should give Float a precision corresponding to eps. Aaron Meurer On Tue, Jun 18, 2013 at 4:52 PM, smichr wrote: > So altogether, finding the real roots might look something like this: > > ... def rroots(eq, x, eps=None): > ... p = sqf(Poly(eq, x, extension=True).lift()) > ..

[sympy] Re: Possible bug in method 'refine_root()' of class sympy.polys.polytools.Poly

2013-06-18 Thread smichr
So altogether, finding the real roots might look something like this: >>> ... def rroots(eq, x, eps=None): ... p = sqf(Poly(eq, x, extension=True).lift()) ... if p.is_Mul: ... p = [pi.base if pi.is_Pow else pi for pi in p.args] ... else: ... p = [p] ... intv = flatt

Re: [sympy] Diophantine Equation Module

2013-06-18 Thread Ondřej Čertík
Hi Thilina, On Tue, Jun 18, 2013 at 12:39 PM, Thilina Rathnayake wrote: > Hi everyone, > > Before continuing further with the Diophantine module development (PR #2168) > I thought it would be better for me to get other people's views on the > representation > of solutions returned by diop_solve()

Re: [sympy] Diophantine Equation Module

2013-06-18 Thread Thilina Rathnayake
Yes, I have been thinking about that too. I didn't find a workaround to that problem. I'll take a look at the link you have given. Thank you for the reply On Wed, Jun 19, 2013 at 12:37 AM, Aaron Meurer wrote: > You may want to look at > https://code.google.com/p/sympy/issues/detail?id=3560 and

Re: [sympy] Diophantine Equation Module

2013-06-18 Thread Aaron Meurer
You may want to look at https://code.google.com/p/sympy/issues/detail?id=3560 and some of the ideas for a unified solve object. Already you have the issue that you are returning a parameter, but there is no easy way to access that parameter (and what happens if t is one of the variables?). Aaron M

[sympy] Diophantine Equation Module

2013-06-18 Thread Thilina Rathnayake
Hi everyone, Before continuing further with the Diophantine module development (PR #2168 ) I thought it would be better for me to get other people's views on the representation of solutions returned by diop_solve(). The main routine of the module is di

[sympy] Re: The Vectors and Electromagnetism GSoC projects

2013-06-18 Thread Prasoon Shukla
@ Everyone : I couldn't do any work today - I had to make an unexpected trip to a certain city and back. Traveled a total of 15+ hours and got stuck in a 3 km long traffic jam. I had thought that I'll be able to work while travelling - I have never been more wrong :( Anyway, I just got back. I'

Re: [sympy] Possible bug in method 'refine_root()' of class sympy.polys.polytools.Poly

2013-06-18 Thread Mateusz Paprocki
Hi, On 18 June 2013 12:26, Chris Smith wrote: > There is still a potential problem here: > > Consider an unfactorable polynomial > > >>> eq = x**5-x**3+1 > >>> factor(_) > x**5 - x**3 + 1 > > find where it has zeros > > >>> df = eq.diff(x) > >>> solve(df) > [0, -sqrt(15)/5, sqrt(15)/5] > > shift

Re: [sympy] Re: is planet.sympy.org not updating again?

2013-06-18 Thread Matthew Rocklin
When posting to planet.sympy I've had to push a commit to the repo. This forces the page to rebuild. I've just done this so the recent posts should be available soon and be pushed by rss shortly after. This is not a long term fix. On Tue, Jun 18, 2013 at 8:38 AM, Aaron Meurer wrote: > I thin

Re: [sympy] Re: is planet.sympy.org not updating again?

2013-06-18 Thread Aaron Meurer
I think it was never fixed. The last fix was just someone forcing the gh pages to build. Aaron Meurer Sent from my iPad On Jun 18, 2013, at 5:49 AM, Saurabh Jha wrote: > I discussed this issue with Aaron a few days before. He thinks that > there is a problem with bot. Unfortunately, I was unab

[sympy] Re: is planet.sympy.org not updating again?

2013-06-18 Thread Saurabh Jha
I discussed this issue with Aaron a few days before. He thinks that there is a problem with bot. Unfortunately, I was unable to help since I don't know anything about this system. -Saurabh On Jun 18, 3:01 pm, Stefan Krastanov wrote: > The last post is from some time ago. -- You received this m

[sympy] Re: solve((re(x)-2,im(x)-1),x) returns 2

2013-06-18 Thread Jaime Alonso-Martínez
Thank you all for solving this issue and for taking time to make sympy so awesome. Jaime. El martes, 18 de junio de 2013 12:11:05 UTC+2, smichr escribió: > > Jaime, thanks for taking time to report this. The solver has been upgraded > to handle these sorts of expression. We'll see with time how

Re: [sympy] Possible bug in method 'refine_root()' of class sympy.polys.polytools.Poly

2013-06-18 Thread Chris Smith
There is still a potential problem here: Consider an unfactorable polynomial >>> eq = x**5-x**3+1 >>> factor(_) x**5 - x**3 + 1 find where it has zeros >>> df = eq.diff(x) >>> solve(df) [0, -sqrt(15)/5, sqrt(15)/5] shift the polynomial to put one of the zeros on the x axis >>> eq.subs(x,_[1])

[sympy] Re: solve((re(x)-2,im(x)-1),x) returns 2

2013-06-18 Thread smichr
Jaime, thanks for taking time to report this. The solver has been upgraded to handle these sorts of expression. We'll see with time how robust the fix is. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receivi

[sympy] is planet.sympy.org not updating again?

2013-06-18 Thread Stefan Krastanov
The last post is from some time ago. -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@goog

Re: [sympy] Possible bug in method 'refine_root()' of class sympy.polys.polytools.Poly

2013-06-18 Thread Mateusz Paprocki
Hi, On 18 June 2013 09:35, Heiner Kirchhoffer wrote: > Hi smichr and all, > > Thank you for your quick response. > Does that mean that the method 'refine_root()' of class 'Poly' is not > capable of finding isolation intervals for all real roots of an arbitrary > polynomial? > If so, this would, u

Re: [sympy] Possible bug in method 'refine_root()' of class sympy.polys.polytools.Poly

2013-06-18 Thread Heiner Kirchhoffer
Hi smichr and all, Thank you for your quick response. Does that mean that the method 'refine_root()' of class 'Poly' is not capable of finding isolation intervals for all real roots of an arbitrary polynomial? If so, this would, unfortunately, render the method 'refine_root()' useless for my ap