Opened 7 years ago

Closed 6 years ago

#14306 closed defect (fixed)

regression in solve

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

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 7 years ago by kcrisman

  • Report Upstream changed from N/A to Reported upstream. No feedback yet.

I've reported this at Maxima bug 2564.

comment:2 Changed 7 years ago by zimmerma

  • Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.

comment:3 Changed 7 years ago by zimmerma

see #13973

comment:4 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.10 to sage-5.11
  • Report Upstream changed from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.

comment:5 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:6 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:7 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:8 Changed 6 years ago by kcrisman

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 6 years ago by zimmerma

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 6 years ago by kcrisman

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 6 years ago by zimmerma

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 6 years ago by kcrisman

  • Authors set to Karl-Dieter Crisman
  • Branch set to u/kcrisman/14306-maxima_solve_doctest
  • Commit set to 983492971662a0cfc337845a3e4bbe9b30b34cd1
  • Status changed from new to needs_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 6 years ago by kcrisman

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

comment:14 follow-up: Changed 6 years ago by pbruin

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

comment:15 Changed 6 years ago by git

  • Commit changed from 983492971662a0cfc337845a3e4bbe9b30b34cd1 to 058530226b99dbb70136bec21225f0f3153f9dc0

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

0585302Add second colon for doctest

comment:16 in reply to: ↑ 14 ; follow-up: Changed 6 years ago by kcrisman

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 6 years ago by nbruin

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 6 years ago by mmezzarobba

  • Cc mmezzarobba added

comment:19 Changed 6 years ago by pbruin

  • Reviewers set to Peter Bruin
  • Status changed from needs_review to positive_review

comment:20 Changed 6 years ago by vbraun

  • Branch changed from u/kcrisman/14306-maxima_solve_doctest to 058530226b99dbb70136bec21225f0f3153f9dc0
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.