Opened 10 years ago

Closed 8 years ago

#14306 closed defect (fixed)

regression in solve

Reported by: Paul Zimmermann Owned by: Burcin Erocal
Priority: major Milestone: sage-6.3
Component: calculus Keywords:
Cc: Marc Mezzarobba Merged in:
Authors: Karl-Dieter Crisman Reviewers: Peter Bruin
Report Upstream: Fixed upstream, in a later stable release. Work issues:
Branch: 0585302 (Commits, GitHub, GitLab) Commit: 058530226b99dbb70136bec21225f0f3153f9dc0
Dependencies: Stopgaps:

Status badges

Description

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/

Change History (20)

comment:1 Changed 10 years ago by Karl-Dieter Crisman

Report Upstream: N/AReported upstream. No feedback yet.

I've reported this at Maxima bug 2564.

comment:2 Changed 10 years ago by Paul Zimmermann

Report Upstream: Reported upstream. No feedback yet.Fixed upstream, but not in a stable release.

comment:3 Changed 10 years ago by Paul Zimmermann

see #13973

comment:4 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.10sage-5.11
Report Upstream: Fixed upstream, but not in a stable release.Fixed upstream, in a later stable release.

comment:5 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:6 Changed 9 years ago by For batch modifications

Milestone: sage-6.1sage-6.2

comment:7 Changed 9 years ago by For batch modifications

Milestone: sage-6.2sage-6.3

comment:8 Changed 9 years ago by Karl-Dieter Crisman

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 ?

comment:9 Changed 8 years ago by Paul Zimmermann

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

comment:10 Changed 8 years ago by Karl-Dieter Crisman

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.

comment:11 Changed 8 years ago by Paul Zimmermann

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

comment:12 Changed 8 years ago by Karl-Dieter Crisman

Authors: Karl-Dieter Crisman
Branch: u/kcrisman/14306-maxima_solve_doctest
Commit: 983492971662a0cfc337845a3e4bbe9b30b34cd1
Status: newneeds_review

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

comment:13 Changed 8 years ago by Karl-Dieter Crisman

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

comment:14 Changed 8 years ago by Peter Bruin

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

comment:15 Changed 8 years ago by git

Commit: 983492971662a0cfc337845a3e4bbe9b30b34cd1058530226b99dbb70136bec21225f0f3153f9dc0

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

0585302Add second colon for doctest

comment:16 in reply to:  14 ; Changed 8 years ago by Karl-Dieter Crisman

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

Right you are! I've fixed this now.


<rant>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.</rant>


New commits:

0585302Add second colon for doctest

New commits:

0585302Add second colon for doctest

comment:17 in reply to:  16 Changed 8 years ago by Nils Bruin

Replying to kcrisman:

<rant>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.</rant>

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?

comment:18 Changed 8 years ago by Marc Mezzarobba

Cc: Marc Mezzarobba added

comment:19 Changed 8 years ago by Peter Bruin

Reviewers: Peter Bruin
Status: needs_reviewpositive_review

comment:20 Changed 8 years ago by Volker Braun

Branch: u/kcrisman/14306-maxima_solve_doctest058530226b99dbb70136bec21225f0f3153f9dc0
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.