[sage-support] Re: Unable to Solve Simple Problem

2012-11-02 Thread Jan
On Saturday, October 27, 2012 8:52:36 PM UTC+2, Robert Dodier wrote:
>
> On 2012-10-26, Jan > 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.




[sage-support] Re: Unable to Solve Simple Problem

2012-10-27 Thread Dima Pasechnik
On 2012-10-27, Robert Dodier  wrote:
> On 2012-10-26, Jan  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

2012-10-27 Thread Robert Dodier
On 2012-10-26, Jan  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.




Re: [sage-support] Re: Unable to Solve Simple Problem

2012-10-27 Thread Doaa El-Sakout
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  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

2012-10-26 Thread Jan
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

2011-04-11 Thread achrzesz
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  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  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  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  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

2011-04-11 Thread achrzesz
Oops!
without "to_poly_solve='use_grobner=True'"
also works

On 11 Kwi, 13:37, achrzesz  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  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  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  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

2011-04-11 Thread achrzesz
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  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  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  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

2011-04-11 Thread achrzesz
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  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  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

2011-04-11 Thread achrzesz
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  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

2011-04-11 Thread ancienthart
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

2011-04-10 Thread achrzesz
sage: solve(x==sqrt(x+1),x,to_poly_solve='force')
[x == 1/2*sqrt(5) + 1/2]

On 10 Kwi, 09:01, ancienthart  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


[sage-support] Re: Unable to Solve Simple Problem

2011-04-10 Thread ancienthart
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

2011-04-10 Thread ancienthart
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

2011-04-09 Thread ancienthart
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

2011-04-09 Thread The_Fool
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