Skip to content
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

inconsistent behaviour of solve #13286

Closed
fchapoton opened this issue Jul 24, 2012 · 9 comments
Closed

inconsistent behaviour of solve #13286

fchapoton opened this issue Jul 24, 2012 · 9 comments

Comments

@fchapoton
Copy link
Contributor

I have found the following :

sage: w,z=var('w','z')
sage: solve([z-4,w-3],[z,w])
[[z == 4, w == 3]]
sage: solve([z-4],z)                                       
[z == 4]
sage: solve([z-4,z-2],z)
[]
sage: solve([z-4,z-2],[z])
[]
sage: solve([z-4],[z])
TypeError: [z] is not a valid variable.

The last line is a really bad behaviour ! It forces to distinguish the case when there is only one equation and one variable. Compare also with the first solve.

Component: symbolics

Keywords: solve, symbolic

Author: Punarbasu Purkayastha

Reviewer: Frédéric Chapoton

Merged: sage-5.3.beta2

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

@kcrisman
Copy link
Member

comment:1

At first I thought this was part of #10750, but apparently not. Thanks for this report.

On the plus side, the behavior isn't that bad; it doesn't return a mathematically wrong result, gives a readable error message (this doesn't always happen in Sage!), and by reading solve? one can see the proper syntax. It isn't a good thing, but isn't horrendous.

@ppurka
Copy link
Member

ppurka commented Jul 29, 2012

comment:2

Added a simple patch.

@ppurka
Copy link
Member

ppurka commented Jul 29, 2012

Author: Punarbasu Purkayastha

@fchapoton
Copy link
Contributor Author

comment:4

Thanks for the ticket. Are you sure of the syntax of the links to trac ? According to #12490, it seems rather to be

:trac:`13077`

with no # inside.

@ppurka
Copy link
Member

ppurka commented Jul 31, 2012

Attachment: trac_13286-allow_list_in_solve.patch.gz

Apply to devel/sage

@ppurka
Copy link
Member

ppurka commented Jul 31, 2012

comment:5

Replying to @fchapoton:

Thanks for the ticket. Are you sure of the syntax of the links to trac ?

Thanks for checking this. Indeed, it was incorrect. Have corrected the patch now.

@fchapoton
Copy link
Contributor Author

comment:6

ok, positive review

@jdemeyer
Copy link

Reviewer: Frédéric Chapoton

@jdemeyer
Copy link

Merged: sage-5.3.beta2

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

5 participants