On Wed, Dec 17, 2008 at 2:41 PM, Simon King <k...@mathematik.uni-jena.de> wrote:
>
> Dear Sage supporters,
>
> inspired by 
> http://groups.google.com/group/sage-support/browse_thread/thread/729f4a557d970195?hl=en,
> I was playing around with the solve command.
>
> I found two questions:
> 1. How can one add assumptions (such as x>0 or x is an integer)?
> The following does not work:
>  sage: assume(x>0)
>  sage: solve(x^2-1,x)
>  [x == -1, x == 1]
> The Sage Tutorial doesn't mention assumptions in the section about
> solving equations.


I don't know the answer but if assume doesn't work then I would vote to
deprecate it and replace it by an option such as

solve(x^2-1,x,assume="x>0")
or
solve(x^2-1,x,options="assume(x>0)")
or something. Then just pass the assume statement to
maxima before the solve statement.


>
> 2. Why does it take so long to return the solution dictionary?
> From the solve-docstring:
>  sage: ct=cputime()
>  sage: time solve([x^2+y^2 == 1, y^2 == x^3 + x + 1], x, y,
> solution_dict=True)
>  CPU times: user 0.07 s, sys: 0.00 s, total: 0.07 s
>  Wall time: 0.18 s
>  [{y: -sqrt(3 - sqrt(3)*I)/sqrt(2), x: (-sqrt(3)*I - 1)/2},
>  {y: sqrt(3 - sqrt(3)*I)/sqrt(2), x: (-sqrt(3)*I - 1)/2},
>  {y: -sqrt(sqrt(3)*I + 3)/sqrt(2), x: (sqrt(3)*I - 1)/2},
>  {y: sqrt(sqrt(3)*I + 3)/sqrt(2), x: (sqrt(3)*I - 1)/2},
>  {y: -1, x: 0},
>  {y: 1, x: 0}]
>  sage: cputime(ct)
>  2.6121629999999989
>
> So, for computing the solutions 0.07 CPU-seconds suffice, but for
> printing them 2.6 CPU-seconds are needed??
>
> Best regards,
>    Simon
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to