trouble with solve()

3 views
Skip to first unread message

Stan Schymanski

unread,
Jun 26, 2009, 6:57:02 AM6/26/09
to sage-support
Dear all,

How can I get sage to solve a simple equation such as the one below?

----------------------------------------------------------------------
| Sage Version 4.0.2, Release Date: 2009-06-18 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: var('x y n')
(x, y, n)
sage: solve(y == x^n,x)
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
[...]
TypeError: Computation failed since Maxima requested additional
constraints (try the command 'assume(>0)' before integral or limit
evaluation, for example):
Is n an integer?

MMA solves similar equation using inverse functions and spits out a
warning, no matter whether n is an integer or not. I thought that
Maxima would do the same as stated in the docu.

Here is an excerpt from the Maxima 5_15 docu:

"Let E be the expression and X be the variable. If E is linear in X
then it is trivially solved for X. Otherwise if E is of the form A*X^N
+ B then the result is (-B/A)^1/N) times the N'th roots of unity."

Is this a problem with the sage->maxima interface? I also wanted to
try Sympy as suggested in another post, but Sympy does not seem to be
included in the new version of sage any more. Am I misunderstanding
something?

Thanks for your help!

Stan

Stan Schymanski

unread,
Jun 26, 2009, 7:11:16 AM6/26/09
to sage-s...@googlegroups.com
Update:
In maxima, I simply have to answer 'no' to the question whether n is an
integer and I obtain the solution. How can I pass the 'no' to maxima
through sage??

Stan
--
________________________________________

Stan Schymanski
Scientist
Max Planck Institute for Biogeochemistry
Postfach 10 01 64
D-07701 Jena

Phone: +49.3641.576264
Fax: +49.3641.577274
WWW: http://www.bgc-jena.mpg.de/~sschym

Biospheric Theory and Modelling Group
http://www.bgc-jena.mpg.de/bgc-theory/
_________________________________________

Kjetil Halvorsen

unread,
Jun 26, 2009, 6:18:27 PM6/26/09
to sage-s...@googlegroups.com
On Fri, Jun 26, 2009 at 07:11, Stan Schymanski<schy...@gmail.com> wrote:
>
> Update:
> In maxima, I simply have to answer 'no' to the question whether n is an
> integer and I obtain the solution. How can I pass the 'no' to maxima
> through sage??
>

Try to use assume() befotre the call to maxima?
--
"... an entire human genome would fit on a music CD."

--- www.thinkgene.com

Stan Schymanski

unread,
Jun 27, 2009, 4:50:21 AM6/27/09
to sage-s...@googlegroups.com
Thanks, but this does not help in this case:

----------------------------------------------------------------------
| Sage Version 4.0.2, Release Date: 2009-06-18 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: var('x y n')
(x, y, n)
sage: assume(n,'real')

sage: solve(y == x^n,x)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
...
TypeError: Computation failed since Maxima requested additional
constraints (try the command 'assume(>0)' before integral or limit
evaluation, for example):
Is n an integer?

This even happens in maxima. No matter what I assume for n, it is still
possible that it is an integer, so maxima keeps asking. Only if I assume
that it is indeed an integer, it will evaluate, but this assumption is
wrong as n does not need to be an integer. So the assume() method allows
passing the answer 'yes', but not the answer 'no' in this case.

Stan

Reply all
Reply to author
Forward
0 new messages