Is there a way to change the default when calling "solve"?

Fernando

On 12/3/2023 8:37 AM, Dima Pasechnik wrote:
Yes, Sage modifies the defaults of Maxima, in particular we set domain to 
complex.

On 3 December 2023 12:28:45 GMT, Oscar Benjamin<oscar.j.benja...@gmail.com>  
wrote:
On Wed, 29 Nov 2023 at 12:40, Eric Gourgoulhon<egourgoul...@gmail.com>  wrote:
Le mardi 28 novembre 2023 à 18:25:04 UTC+1, kcrisman a écrit :

Yes.  Maxima's attitude is that the square root of negative one is an 
expression which might have multiple values, rather than just picking one you 
hope might be consistent over branch points.

To enforce Maxima to work in the real domain, avoiding to play too much with 
complex square roots, one can add at the beginning of the Sage session:

maxima_calculus.eval("domain: real;")

Then the second example in the initial message of this thread yields

[[x == 2/5*sqrt(6)*sqrt(5), y == 16, l == 1/9*18750^(1/6)], [x == 
-2/5*sqrt(6)*sqrt(5), y == 16, l == -1/9*18750^(1/6)]]

instead of an empty list.
When using Maxima (5.45.1) directly I get this result with default settings:

(%i1) f: 10*x^(1/3)*y^(2/3)$

(%i2) g: 5*x^2 + 6*y$

(%i3) solve([diff(f,x)=l*diff(g,x), diff(f,y)=l*diff(g,y), g=120], [x,y,l]);
                                        1/6
            2 sqrt(6)              18750
(%o3) [[x = ---------, y = 16, l = --------],
             sqrt(5)                  9
                                                                          1/6
                                            2 sqrt(6)                18750
                                     [x = - ---------, y = 16, l = - --------]]
                                             sqrt(5)                    9

Does Sage modify some Maxima settings related to this or does it call
something other than solve?

--
Oscar

--
=============================================================
Fernando Q. Gouveahttp://www.colby.edu/~fqgouvea
Carter Professor of Mathematics
Dept. of Mathematics
Colby College
5836 Mayflower Hill
Waterville, ME 04901

Mother Nature -- unlike Ivy League admissions committees --
doesn't like suck-ups.
  -- David Brooks, The New York Times, 4/24/2005

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-support/b2e8c972-3127-47a4-8187-a5a16cf3f712%40colby.edu.

Reply via email to