Skip to content

regression in solve #14306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zimmermann6 opened this issue Mar 19, 2013 · 21 comments
Closed

regression in solve #14306

zimmermann6 opened this issue Mar 19, 2013 · 21 comments

Comments

@zimmermann6
Copy link
Contributor

the following example, which we use in our book (in french) about Sage, does not work any more with Sage 5.7:

With Sage 5.1:

sage: var('y z')
sage: solve([x^2*y*z==18,x*y^3*z==24,x*y*z^4==6],x,y,z)                        
[[x == 3, y == 2, z == 1], [x == (1.33721506733 - 2.68548987407*I), y == (-1.70043427146 + 1.05286432575*I), z == (0.932472229404 - 0.361241666187*I)], [x == (1.33721506733 + 2.68548987407*I), y == (-1.70043427146 - 1.05286432575*I), z == (0.932472229404 + 0.361241666187*I)], [x == (-2.55065140719 - 1.57929648863*I), y == (-0.547325980144 + 1.92365128635*I), z == (-0.982973099684 - 0.183749517817*I)], [x == (-2.55065140719 + 1.57929648863*I), y == (-0.547325980144 - 1.92365128635*I), z == (-0.982973099684 + 0.183749517817*I)], [x == (0.27680507839 - 2.98720252889*I), y == (1.47801783444 - 1.34739128729*I), z == (-0.85021713573 - 0.526432162877*I)], [x == (0.27680507839 + 2.98720252889*I), y == (1.47801783444 + 1.34739128729*I), z == (-0.85021713573 + 0.526432162877*I)], [x == (-0.820988970216 + 2.88547692952*I), y == (-1.20526927276 - 1.59603445456*I), z == (0.0922683594633 - 0.995734176295*I)], [x == (-0.820988970216 - 2.88547692952*I), y == (-1.20526927276 + 1.59603445456*I), z == (0.0922683594633 + 0.995734176295*I)], [x == (-1.80790390914 - 2.39405168184*I), y == (0.891476711553 - 1.79032658271*I), z == (0.739008917221 - 0.673695643647*I)], [x == (-1.80790390914 + 2.39405168184*I), y == (0.891476711553 + 1.79032658271*I), z == (0.739008917221 + 0.673695643647*I)], [x == (2.21702675166 + 2.02108693094*I), y == (1.86494445881 + 0.722483332374*I), z == (-0.273662990072 - 0.961825643173*I)], [x == (2.21702675166 - 2.02108693094*I), y == (1.86494445881 - 0.722483332374*I), z == (-0.273662990072 + 0.961825643173*I)], [x == (2.79741668821 - 1.08372499856*I), y == (-1.96594619937 + 0.367499035633*I), z == (-0.602634636379 - 0.79801722728*I)], [x == (2.79741668821 + 1.08372499856*I), y == (-1.96594619937 - 0.367499035633*I), z == (-0.602634636379 + 0.79801722728*I)], [x == (-2.94891929905 + 0.55124855345*I), y == (0.184536718927 + 1.99146835259*I), z == (0.445738355777 - 0.895163291355*I)], [x == (-2.94891929905 - 0.55124855345*I), y == (0.184536718927 - 1.99146835259*I), z == (0.445738355777 + 0.895163291355*I)]]

With Sage 5.7:

sage: var('y z')                                    
(y, z)
sage: solve([x^2*y*z==18,x*y^3*z==24,x*y*z^4==6],x,y,z)                        
[x^2*y*z == 18, x*y^3*z == 24, x*y*z^4 == 6]

Cf http://sagebook.gforge.inria.fr/

Upstream: Fixed upstream, in a later stable release.

CC: @mezzarobba

Component: calculus

Author: Karl-Dieter Crisman

Branch/Commit: 0585302

Reviewer: Peter Bruin

Issue created by migration from https://trac.sagemath.org/ticket/14306

@kcrisman
Copy link
Member

comment:1

I've reported this at Maxima bug 2564.

@kcrisman
Copy link
Member

Upstream: Reported upstream. No feedback yet.

@zimmermann6
Copy link
Contributor Author

Changed upstream from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.

@zimmermann6
Copy link
Contributor Author

comment:3

see #13973

@jdemeyer
Copy link
Contributor

Changed upstream from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.

@jdemeyer jdemeyer modified the milestones: sage-5.10, sage-5.11 Jun 13, 2013
@jdemeyer jdemeyer modified the milestones: sage-5.11, sage-5.12 Aug 13, 2013
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.2, sage-6.3 May 6, 2014
@kcrisman
Copy link
Member

comment:8

Wait a minute. This is already almost a doctest in Sage.

Sage example in ./calculus.tex, line 583::

    sage: x, y, z = var('x, y, z')
    sage: solve([x^2 * y * z == 18, x * y^3 * z == 24,\
    ....:        x * y * z^4 == 3], x, y, z)
    [[x == (-2.76736473308 - 1.71347969911*I), y == (-0.570103503963 + 2.00370597877*I), z == (-0.801684337646 - 0.14986077496*I)], ...]

and it passes

$ ./sage -t src/sage/tests/french_book/calculus_doctest.py 
Running doctests with ID 2014-05-30-08-56-36-7a1afdf4.
Doctesting 1 file.
sage -t src/sage/tests/french_book/calculus_doctest.py
    [246 tests, 7.59 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Total time for all tests: 7.7 seconds
    cpu time: 5.6 seconds
    cumulative wall time: 7.6 seconds

But assuming we want to add this back: Paul, where should this appear - presumably in src/sage/tests/french_book/calculus_doctest.py ?

@zimmermann6
Copy link
Contributor Author

comment:9

in our book we originally had the example in the description (at that time we were using Sage 5.1) but
we had to change the last equation from x*y*z^4==6 to x*y*z^4==3 to get Sage to really solve the system (the final version of the book is based on Sage 5.9).

With x*y*z^4==6 as last equation, Sage 6.2 is still unable to solve the system as Sage 5.1 did in the description, thus the problem is still open for me.

Paul

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

comment:10

Ah, but with #13973 we have

sage: var('y,z')
(y, z)
sage: solve([x^2*y*z==18,x*y^3*z==24,x*y*z^4==6],x,y,z)                        
[[x == 3, y == 2, z == 1], [x == (1.33721506733 - 2.68548987407*I), y == (-1.70043427146 + 1.05286432575*I), z == (0.932472229404 - 0.361241666187*I)],

As you see, Maxima fixed it. So are you saying that you don't need this for your book? We can still add this as a doctest elsewhere, of course.

@zimmermann6
Copy link
Contributor Author

comment:11

yes we don't need this (with x*y*z^4==6) for the current version of our book.
But it would be good to add this as a doctest, to check the Maxima fix remains ok.

Paul

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

Commit: 9834929

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

Author: Karl-Dieter Crisman

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

Last 10 new commits:

13d48c2Trac 13973: fix doctests with changed floating point format/precision
a130eedTrac 13973: realpart should be real_part
3d927bfMerge remote-tracking branch 'trac/u/pbruin/13973-maxima_update' into ticket/13712
c715aabMerge branch 'public/ticket/inf_sum_doctest-13712' of git://trac.sagemath.org/sage into ticket/11894-maxima_sum_zero_division
1dd0f05Trac 11894: add doctest for error detection in Maxima sum
0ede45cMerge branch 'u/pbruin/11894-maxima_sum_zero_division' of trac.sagemath.org:sage into maxima_upgrade
b6657b9Trac #15386 - document that Maxima 5.33 fixes this limit
54d0609Trac #14209 - verify Maxima fix for doing improper integral twice
999e21fTrac #14209 - Forget assumptions from earlier doctest
9834929Trac 14306 - doctest Maxima bugfix in solve

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

comment:13

Once again sorry for the looong branch - I'll do this better after the current Maxima upgrade things are done.

@pjbruin
Copy link
Contributor

pjbruin commented Jun 4, 2014

comment:14

The last colon before the example should be a double colon.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 4, 2014

Changed commit from 9834929 to 0585302

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 4, 2014

Branch pushed to git repo; I updated commit sha1. New commits:

0585302Add second colon for doctest

@kcrisman
Copy link
Member

kcrisman commented Jun 4, 2014

comment:16

The last colon before the example should be a double colon.

Right you are! I've fixed this now.


I just want to point out that in Mercurial, I could always "roll back" the previous commit and fix such trivialities. Now it has to clutter up the log/tree/directed acyclic graph/whatever for a one-character fix.


New commits:

0585302Add second colon for doctest

New commits:

0585302Add second colon for doctest

@nbruin
Copy link
Contributor

nbruin commented Jun 4, 2014

comment:17

Replying to @kcrisman:

I just want to point out that in Mercurial, I could always "roll back" the previous commit and fix such trivialities. Now it has to clutter up the log/tree/directed acyclic graph/whatever for a one-character fix.

You still can. You'll just have to "force push" and deal with a grumpy Volker. It's a trade-off: do you want a clean history or a (small) chance for more difficult merge issues later on, in case someone based some work on your now abandoned commit?

@pjbruin
Copy link
Contributor

pjbruin commented Jun 5, 2014

Reviewer: Peter Bruin

@vbraun
Copy link
Member

vbraun commented Jun 6, 2014

Changed branch from u/kcrisman/14306-maxima_solve_doctest to 0585302

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants