8000 Regression in solve command · Issue #15499 · sagemath/sage · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content 8000
Regression in solve command #15499
Open
Open
@ppurka

Description

@ppurka

From google spreadsheet which no one reads X-(

The following is a vector calculus example. It supposedly should solve the critical point equations for the given function (symbolically, where possible, otherwise numerically):

x,y=var('x,y')
f(x,y)=((x-1)^2+(y-3)^2)*((x+1)^2+(y+2)^2)/(x^2+y^2+1)
solve([f.gradient()[0]==0,f.gradient()[1]==0],x,y)

Works with 5.5.rc0 (assuming answer is correct)

sage: solve([f.gradient()[0]==0,f.gradient()[1]==0],x,y)
[[x == (0.45 + 1.65*I), y == (-11/20*I + 27/20)], [x == (0.45 - 1.65*I), y == (11/20*I + 27/20)], [x == (2.14624170747e-08 + 2.50000000895*I), y == (-I + 1/2)], [x == (-2.14624155595e-08 + 2.49999999105*I), y == (-I + 1/2)], [x == (-1.22085882983e-09 - 2.49999999706*I), y == (I + 1/2)], [x == (1.22085741408e-09 - 2.50000000294*I), y == (I + 1/2)], [x == 0.108848345629, y == 0.064959221634], [x == 2.0690897184, y == -0.785458685751], [x == -2.08897196262, y == 0.935164613209], [x == (0.00551694210392 + 1.15257220423*I), y == (-0.0573325779446 + 2.78408620946*I)], [x == (0.00551694210392 - 1.15257220423*I), y == (-0.0573325779446 - 2.78408620946*I)], [x == (-0.4 + 1.2*I), y == (-3/5*I - 4/5)], [x == (-0.4 - 1.2*I), y == (3/5*I - 4/5)], [x == -1, y == -2], [x == 1, y == 3]]

Breaks with 5.5

sage: solve([f.gradient()[0]==0,f.gradient()[1]==0],x,y)
[2*(x - 1)*((y + 2)^2 + (x + 1)^2)/(x^2 + y^2 + 1) + 2*(x + 1)*((y - 3)^2 + (x - 1)^2)/(x^2 + y^2 + 1) - 2*((y + 2)^2 + (x + 1)^2)*((y - 3)^2 + (x - 1)^2)*x/(x^2 + y^2 + 1)^2 == 0, 2*(y - 3)*((y + 2)^2 + (x + 1)^2)/(x^2 + y^2 + 1) + 2*(y + 2)*((y - 3)^2 + (x - 1)^2)/(x^2 + y^2 + 1) - 2*((y + 2)^2 + (x + 1)^2)*((y - 3)^2 + (x - 1)^2)*y/(x^2 + y
542F
^2 + 1)^2 == 0]

Update: it works again with sage 7.6.beta4,
but not all results are correct

CC: @kcrisman @sagetrac-jakobkroeker

Component: calculus

Keywords: regression

Stopgaps: wrongAnswerMarker

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0