Ask Your Question
1

How to print out Maxima commands being used by Sage?

asked 2013-03-05 04:52:39 +0100

kevinfat gravatar image

updated 2013-03-05 05:54:44 +0100

The documentation says that solve_ineq is implemented with Maxima fourier_elim. I am trying to figure out why the output below of Sage and Maxima are different. Is there a way I can have Sage print out the exact Maxima commands it issued to try to understand why I'm not getting the same result as from Using Maxima directly?

sage: x,y = var('x,y')
sage: solve_ineq([x^2*y^2 <= x^2*y, x^2*y^2 > x^2*y],[x,y])
[[x == 0, 1 < y, 0 != 0], [x == 0, y < 0, 0 != 0]]

(%i1) load(fourier_elim);
(%i2) fourier_elim([x^2*y^2 <= x^2*y, x^2*y^2 > x^2*y],[x,y]);
(%o2)                              emptyset
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-03-05 06:50:12 +0100

Sage sets the domain of all variables to complex when initializing Maxima. You can get the same result as Sage by doing this manually on the Maxima prompt:

$ ./sage -maxima
;;; Loading #P"/home/burcin/sage/sage-5.5.rc0/local/lib/ecl/sb-bsd-sockets.fas"
;;; Loading #P"/home/burcin/sage/sage-5.5.rc0/local/lib/ecl/sockets.fas"
;;; Loading #P"/home/burcin/sage/sage-5.5.rc0/local/lib/ecl/defsystem.fas"
;;; Loading #P"/home/burcin/sage/sage-5.5.rc0/local/lib/ecl/cmp.fas"
Maxima 5.26.0 http://maxima.sourceforge.net
using Lisp ECL 11.1.1
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) domain: complex;
(%o1)                               complex
(%i2) load(fourier_elim);
(%o2) /home/burcin/sage/sage-5.5.rc0/local/share/maxima/5.26.0/share/contrib/f\
ourier_elim/fourier_elim.lisp
(%i3) fourier_elim([x^2*y^2 <= x^2*y, x^2*y^2 > x^2*y],[x,y]);
(%o3)           [x = 0, 1 < y, 0 # 0] or [x = 0, y < 0, 0 # 0]

If you want to take a look at the code, Maxima initialization is done at the beginning of sage/interfaces/maxima_lib.py. Line 141 has the default options set by Sage.

edit flag offensive delete link more

Comments

Can you have a look at ticket 14229 where I have put up a patch to potentially remove such vacuous solutions? Are there cases where the patch could fail, or give wrong answers? It passes all doctests in sage/symbolic.

ppurka gravatar imageppurka ( 2013-03-05 08:14:09 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-03-05 04:52:39 +0100

Seen: 624 times

Last updated: Mar 05 '13