[sage-support] Re: Unable to Solve Simple Problem
On Saturday, October 27, 2012 8:52:36 PM UTC+2, Robert Dodier wrote: On 2012-10-26, Jan derwur...@gmail.com javascript: wrote: I have a similar problem I can't solve d==b*sqrt(d)+c for d. All suggestions (to_poly_solve, use_grobner) did not work. For the record, here's what I get with Maxima 5.28.0. I think to_poly_solve has been updated in the not so distant past so maybe Sage is using an older version? (%i2) load (to_poly_solve); (%i3) to_poly_solve (d = b * sqrt(d) + c, d); (%o3) %union(%if(?%and(-%pi/2 parg(b-sqrt(4*c+b^2)), parg(b-sqrt(4*c+b^2)) = %pi/2), [d = -(b*sqrt(4*c+b^2)-2*c-b^2)/2],%union()), %if(?%and(-%pi/2 parg(sqrt(4*c+b^2)+b), parg(sqrt(4*c+b^2)+b) = %pi/2), [d = (b*sqrt(4*c+b^2)+2*c+b^2)/2],%union())) I didn't check the result; sorry about that. best Robert Dodier Thanks, this output is what I expected. So it seems to be the version of Maxima. best Jan -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
Re: [sage-support] Re: Unable to Solve Simple Problem
Please, could you explain more what is the problem. According to my understand. b and c are two parameters and you want to solve for d. and you try to use grobner basis, but what I know grobner basis for polynomial and this is not polynomial because the square root. So , you can write d=y^2, y^2==b*y+c if d is real. And if d is complex, d=-y^2, -y^2==i*b*y+c. On 26 October 2012 12:42, Jan derwurzel...@gmail.com wrote: I have a similar problem I can't solve d==b*sqrt(d)+c for d. All suggestions (to_poly_solve, use_grobner) did not work. Thanks, Jan -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en. -- Doaa Mostafa Ali Elsakout PhD student at Heriot-Watt University Institute of Petroleum Engineering *Phone:* +44 (0) 131 451 3563 Mobile +44 (0) 7450722558 *Email:* doaa.elsak...@pet.hw.ac.uk *Address:* - Energy Academy 1.14, Heriot-Watt University, Edinburgh EH14 4AS -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Unable to Solve Simple Problem
On 2012-10-26, Jan derwurzel...@gmail.com wrote: I have a similar problem I can't solve d==b*sqrt(d)+c for d. All suggestions (to_poly_solve, use_grobner) did not work. For the record, here's what I get with Maxima 5.28.0. I think to_poly_solve has been updated in the not so distant past so maybe Sage is using an older version? (%i2) load (to_poly_solve); (%i3) to_poly_solve (d = b * sqrt(d) + c, d); (%o3) %union(%if(?%and(-%pi/2 parg(b-sqrt(4*c+b^2)), parg(b-sqrt(4*c+b^2)) = %pi/2), [d = -(b*sqrt(4*c+b^2)-2*c-b^2)/2],%union()), %if(?%and(-%pi/2 parg(sqrt(4*c+b^2)+b), parg(sqrt(4*c+b^2)+b) = %pi/2), [d = (b*sqrt(4*c+b^2)+2*c+b^2)/2],%union())) I didn't check the result; sorry about that. best Robert Dodier -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Unable to Solve Simple Problem
On 2012-10-27, Robert Dodier robert.dod...@gmail.com wrote: On 2012-10-26, Jan derwurzel...@gmail.com wrote: I have a similar problem I can't solve d==b*sqrt(d)+c for d. All suggestions (to_poly_solve, use_grobner) did not work. For the record, here's what I get with Maxima 5.28.0. I think to_poly_solve has been updated in the not so distant past so maybe Sage is using an older version? it does; it's still 5.26.0 -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Unable to Solve Simple Problem
I have a similar problem I can't solve d==b*sqrt(d)+c for d. All suggestions (to_poly_solve, use_grobner) did not work. Thanks, Jan -- You received this message because you are subscribed to the Google Groups sage-support group. 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. Visit this group at http://groups.google.com/group/sage-support?hl=en.
[sage-support] Re: Unable to Solve Simple Problem
Now THAT seriously needs to be made clearer in the documentation, including some examples. Also, how to use use_grobner because use_grobner=True don't work. Joal Heagney -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
I'm not sure but: sage: solve(x==sqrt(x+1),x,to_poly_solve='use_grobner=True') [x == 1/2*sqrt(5) + 1/2] On 11 Kwi, 12:24, ancienthart joalheag...@gmail.com wrote: Now THAT seriously needs to be made clearer in the documentation, including some examples. Also, how to use use_grobner because use_grobner=True don't work. Joal Heagney -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
to_poly_solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y], use_grobner=true); works in wxmaxima 0.8.7 but does not in maxima_console() On 11 Kwi, 13:06, achrzesz achrz...@wp.pl wrote: I'm not sure but: sage: solve(x==sqrt(x+1),x,to_poly_solve='use_grobner=True') [x == 1/2*sqrt(5) + 1/2] On 11 Kwi, 12:24, ancienthart joalheag...@gmail.com wrote: Now THAT seriously needs to be made clearer in the documentation, including some examples. Also, how to use use_grobner because use_grobner=True don't work. Joal Heagney -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
sage: solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y],to_poly_solve='use_grobner=True') [[x == -9/68*sqrt(55) + 135/68, y == -15/68*sqrt(5)*sqrt(11) + 123/68], [x == 9/68*sqrt(55) + 135/68, y == 15/68*sqrt(5)*sqrt(11) + 123/68]] On 11 Kwi, 13:29, achrzesz achrz...@wp.pl wrote: to_poly_solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y], use_grobner=true); works in wxmaxima 0.8.7 but does not in maxima_console() On 11 Kwi, 13:06, achrzesz achrz...@wp.pl wrote: I'm not sure but: sage: solve(x==sqrt(x+1),x,to_poly_solve='use_grobner=True') [x == 1/2*sqrt(5) + 1/2] On 11 Kwi, 12:24, ancienthart joalheag...@gmail.com wrote: Now THAT seriously needs to be made clearer in the documentation, including some examples. Also, how to use use_grobner because use_grobner=True don't work. Joal Heagney -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
Oops! without to_poly_solve='use_grobner=True' also works On 11 Kwi, 13:37, achrzesz achrz...@wp.pl wrote: sage: solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y],to_poly_solve='use_grobner=True') [[x == -9/68*sqrt(55) + 135/68, y == -15/68*sqrt(5)*sqrt(11) + 123/68], [x == 9/68*sqrt(55) + 135/68, y == 15/68*sqrt(5)*sqrt(11) + 123/68]] On 11 Kwi, 13:29, achrzesz achrz...@wp.pl wrote: to_poly_solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y], use_grobner=true); works in wxmaxima 0.8.7 but does not in maxima_console() On 11 Kwi, 13:06, achrzesz achrz...@wp.pl wrote: I'm not sure but: sage: solve(x==sqrt(x+1),x,to_poly_solve='use_grobner=True') [x == 1/2*sqrt(5) + 1/2] On 11 Kwi, 12:24, ancienthart joalheag...@gmail.com wrote: Now THAT seriously needs to be made clearer in the documentation, including some examples. Also, how to use use_grobner because use_grobner=True don't work. Joal Heagney -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
So it seems that in Sage use_grobner is not as essential as in Maxima sage: maxima('load(to_poly_solver)') sage: maxima('to_poly_solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y])') %union() sage: maxima('to_poly_solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y],use_grobner=true)') %union([x=-(9*sqrt(55)-135)/68,y=-(3*5^(3/2)*sqrt(11)-123)/68], [x=(9*sqrt(55)+135)/68,y=(3*5^(3/2)*sqrt(11)+123)/68]) Oops! without to_poly_solve='use_grobner=True' also works On 11 Kwi, 13:37, achrzesz achrz...@wp.pl wrote: sage: solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y],to_poly_solve='use_grobner=True') [[x == -9/68*sqrt(55) + 135/68, y == -15/68*sqrt(5)*sqrt(11) + 123/68], [x == 9/68*sqrt(55) + 135/68, y == 15/68*sqrt(5)*sqrt(11) + 123/68]] On 11 Kwi, 13:29, achrzesz achrz...@wp.pl wrote: to_poly_solve([(x-5)^2+y^2-16, (y-3)^2+x^2-9], [x,y], use_grobner=true); works in wxmaxima 0.8.7 but does not in maxima_console() On 11 Kwi, 13:06, achrzesz achrz...@wp.pl wrote: I'm not sure but: sage: solve(x==sqrt(x+1),x,to_poly_solve='use_grobner=True') [x == 1/2*sqrt(5) + 1/2] On 11 Kwi, 12:24, ancienthart joalheag...@gmail.com wrote: Now THAT seriously needs to be made clearer in the documentation, including some examples. Also, how to use use_grobner because use_grobner=True don't work. Joal Heagney -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
Unfortunately, that method could produce extraneous solutions. There is an additional constraint from the original equation that x=0 since the square root of something must be =0 (no complex number is a solution, either). That is missing from x^2-x-1=0. Is there a way to make Sage check it with the original equation before displaying the final solutions, or somehow force it to solve the original? Although this may be a simple problem, there are difficult problems with constraints that may be overlooked by someone. -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
Which is why I did the sanity checking in the last step. I admit n( ) on lhs() and rhs() is ugly, but I'm sure others could suggest ways to check for equality in an equation. On the other hand, you didn't mention in the original problem that x had to be in the reals. :D Joal Heagney -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
Here's a one-liner to filter the solutions: filter((lambda x: n(eq.subs(x).lhs()) == n(eq.subs(x).rhs())),solns -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
Here's a one liner to filter the solutions. filter((lambda x: n(eq.subs(x).lhs()) == n(eq.subs(x).rhs())),solns) -- 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 URL: http://www.sagemath.org
[sage-support] Re: Unable to Solve Simple Problem
sage: solve(x==sqrt(x+1),x,to_poly_solve='force') [x == 1/2*sqrt(5) + 1/2] On 10 Kwi, 09:01, ancienthart joalheag...@gmail.com wrote: Here's a one liner to filter the solutions. filter((lambda x: n(eq.subs(x).lhs()) == n(eq.subs(x).rhs())),solns) -- 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 URL: http://www.sagemath.org