Ask Your Question
1

How to print out Maxima commands being used by Sage?

asked 12 years ago

kevinfat gravatar image

updated 12 years ago

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
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

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.

Preview: (hide)
link

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 ( 12 years ago )

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: 12 years ago

Seen: 650 times

Last updated: Mar 05 '13