[sage-support] Re: why doesn`t solve() give a proper answer
Thank you! to_poly_solve() is a strong function, and it works fast. --~--~-~--~~~---~--~~ 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/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: why doesn`t solve() give a proper answer
On Fri, Jan 9, 2009 at 9:05 AM, William Stein wst...@gmail.com wrote: On Fri, Jan 9, 2009 at 9:01 AM, Robert Dodier robert.dod...@gmail.com wrote: On Jan 9, 6:51 am, Slava slava_se...@mail.ru wrote: I`m trying to solve such simple system of equations: [sqrt(x) == 1, x == y], so I type: x,y = var('x,y'); solve([sqrt(x) == 1, x == y], x, y); the answer is: [] If I understand correctly, Sage punts to Maxima to solve equations. Maxima's built-in solver is not too strong. There is an add-on package which can solve equations which contain radicals. Dunno how to call it from Sage, but in Maxima itself it's like this: load (topoly_solver); to_poly_solve ([sqrt(x) = 1, x = y], [x, y]); = [[x = 1, y = 1]] Maybe at some point in the not-too-distant future, the built-in solver would call to_poly_solve automatically Robert, Is there any reason not to just *always* use topoly_solver? I.e., maybe Sage's solve should just 100% always only call topoly_solver. What do you think? William That would be nice. Here's doing the above in sage: sage: x,y=var('x,y') sage: v = [sqrt(x)==1, x==y] sage: w = maxima(v) sage: maxima.load('topoly_solver') sage: w.to_poly_solve([x,y]) [[x=1,y=1]] There's currently no simple code in sage to turn the output of to_poly_solve into native sage objects. William -- William Stein Associate Professor of Mathematics University of Washington http://wstein.org --~--~-~--~~~---~--~~ 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/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: why doesn`t solve() give a proper answer
William Stein wrote: Is there any reason not to just *always* use topoly_solver? I.e., maybe Sage's solve should just 100% always only call topoly_solver. What do you think? to_poly_solve can only handle equations in polynomials and radicals, while solve can handle a somewhat wider range of equations. I guess one could invent heuristics -- e.g. try to_poly_solve first and if it can't find anything then try solve. Of course such heuristics could be applied within solve itself (and there are already some in place to handle different kinds of equations). If you 'd like to press for modify solve to call to_poly_solve, then I'll encourage you to take it up on the Maxima mailing list. Robert Dodier --~--~-~--~~~---~--~~ 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/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: why doesn`t solve() give a proper answer
On Jan 9, 6:51 am, Slava slava_se...@mail.ru wrote: I`m trying to solve such simple system of equations: [sqrt(x) == 1, x == y], so I type: x,y = var('x,y'); solve([sqrt(x) == 1, x == y], x, y); the answer is: [] If I understand correctly, Sage punts to Maxima to solve equations. Maxima's built-in solver is not too strong. There is an add-on package which can solve equations which contain radicals. Dunno how to call it from Sage, but in Maxima itself it's like this: load (topoly_solver); to_poly_solve ([sqrt(x) = 1, x = y], [x, y]); = [[x = 1, y = 1]] Maybe at some point in the not-too-distant future, the built-in solver would call to_poly_solve automatically HTH Robert Dodier --~--~-~--~~~---~--~~ 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/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: why doesn`t solve() give a proper answer
On Fri, Jan 9, 2009 at 9:01 AM, Robert Dodier robert.dod...@gmail.com wrote: On Jan 9, 6:51 am, Slava slava_se...@mail.ru wrote: I`m trying to solve such simple system of equations: [sqrt(x) == 1, x == y], so I type: x,y = var('x,y'); solve([sqrt(x) == 1, x == y], x, y); the answer is: [] If I understand correctly, Sage punts to Maxima to solve equations. Maxima's built-in solver is not too strong. There is an add-on package which can solve equations which contain radicals. Dunno how to call it from Sage, but in Maxima itself it's like this: load (topoly_solver); to_poly_solve ([sqrt(x) = 1, x = y], [x, y]); = [[x = 1, y = 1]] Maybe at some point in the not-too-distant future, the built-in solver would call to_poly_solve automatically That would be nice. Here's doing the above in sage: sage: x,y=var('x,y') sage: v = [sqrt(x)==1, x==y] sage: w = maxima(v) sage: maxima.load('topoly_solver') sage: w.to_poly_solve([x,y]) [[x=1,y=1]] There's currently no simple code in sage to turn the output of to_poly_solve into native sage objects. William --~--~-~--~~~---~--~~ 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/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---
[sage-support] Re: why doesn`t solve() give a proper answer
On Fri, Jan 9, 2009 at 9:05 AM, William Stein wst...@gmail.com wrote: On Fri, Jan 9, 2009 at 9:01 AM, Robert Dodier robert.dod...@gmail.com wrote: On Jan 9, 6:51 am, Slava slava_se...@mail.ru wrote: I`m trying to solve such simple system of equations: [sqrt(x) == 1, x == y], so I type: x,y = var('x,y'); solve([sqrt(x) == 1, x == y], x, y); the answer is: [] If I understand correctly, Sage punts to Maxima to solve equations. Maxima's built-in solver is not too strong. There is an add-on package which can solve equations which contain radicals. Dunno how to call it from Sage, but in Maxima itself it's like this: load (topoly_solver); to_poly_solve ([sqrt(x) = 1, x = y], [x, y]); = [[x = 1, y = 1]] Maybe at some point in the not-too-distant future, the built-in solver would call to_poly_solve automatically That would be nice. Here's doing the above in sage: sage: x,y=var('x,y') sage: v = [sqrt(x)==1, x==y] sage: w = maxima(v) sage: maxima.load('topoly_solver') sage: w.to_poly_solve([x,y]) [[x=1,y=1]] There's currently no simple code in sage to turn the output of to_poly_solve into native sage objects. I should correct myself and say it doesn't have any trivial to use function to do that. Of course we wrote code to do that when implementing our solve command (which does work as you suggest above). William --~--~-~--~~~---~--~~ 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/sage-support URLs: http://www.sagemath.org -~--~~~~--~~--~--~---