Opened 6 years ago

Closed 4 years ago

#21946 closed defect (fixed)

solve(x==x, x) returns [x == r1]

Reported by: Peleg Michaeli Owned by: Ashutosh Ahelleya
Priority: minor Milestone: sage-8.4
Component: symbolics Keywords: solve, days79
Cc: Merged in:
Authors: Ashutosh Ahelleya Reviewers: Bryan Gin-ge Chen
Report Upstream: N/A Work issues:
Branch: 224e064 (Commits, GitHub, GitLab) Commit: 224e0641f083472bda753ca8c1a833073b08a218
Dependencies: #21554 Stopgaps:

Status badges

Description (last modified by Bryan Gin-ge Chen)

Not sure if it's a bug or a problem with the documentation, but without any assumptions on x, solve(x==x, x) returns [x == r1]. The documentation does not state what r1 is, but gives the following example:

   If there is a parameter in the answer, that will show up as a new
   variable.  In the following example, "r1" is a real free variable
   (because of the "r"):

      sage: solve([x+y == 3, 2*x+2*y == 6],x,y)
      [[x == -r1 + 3, y == r1]]

However, without assumptions on x, there's no reason to believe that x is real.

This ticket also fixes a grammar issue introduced in #21554 (see comments).

Change History (18)

comment:1 Changed 6 years ago by Ashutosh Ahelleya

Owner: set to Ashutosh Ahelleya

comment:2 Changed 6 years ago by Ashutosh Ahelleya

Branch: u/aashu12/documentation

comment:3 Changed 6 years ago by Ashutosh Ahelleya

Authors: Ashutosh Ahelleya
Commit: e8760d5ba490fa59a043879c2993b14c8ababde3

New commits:

c7acfd6Fixes #21554
e8760d5 Fixed: #21946

comment:4 Changed 6 years ago by Ashutosh Ahelleya

Status: newneeds_review

comment:5 Changed 6 years ago by Dima Pasechnik

Dependencies: #21554

comment:6 Changed 6 years ago by Dima Pasechnik

Milestone: sage-7.5sage-7.6

what do you mean to say by

+    In case one of the solutions while solving an equation is a real number::

First of all, I would have written

+    In case one of the solutions of an equation is a real number::

Still, it's unclear what the following sequence of assumptions following this line has to do with the one of solutions being real. Do you mean to say that in order to make sure that one (rather, every?) solution is real, you need to make the following assumptions? Something else?

comment:7 in reply to:  6 ; Changed 6 years ago by Ashutosh Ahelleya

Replying to dimpase:

what do you mean to say by

+    In case one of the solutions while solving an equation is a real number::

First of all, I would have written

+    In case one of the solutions of an equation is a real number::

It was a part of ticket #21554 which has already been merged.

Still, it's unclear what the following sequence of assumptions following this line has to do with the one of solutions being real. Do you mean to say that in order to make sure that one (rather, every?) solution is real, you need to make the following assumptions? Something else?

According to the documentation provided earlier, the solution of the equation described in the issue is r1, which is a real number (That is what the documentation says!). But the solution to this equation can be a complex number too! So, I just changed the documentation and redefined r1 to be any arbitrary constant. You can refer to this conversation: https://groups.google.com/forum/#!topic/sage-support/_XWjrYjk_3A

Last edited 6 years ago by Ashutosh Ahelleya (previous) (diff)

comment:8 in reply to:  7 ; Changed 6 years ago by Dima Pasechnik

Replying to aashu12:

Replying to dimpase:

what do you mean to say by

+    In case one of the solutions while solving an equation is a real number::

First of all, I would have written

+    In case one of the solutions of an equation is a real number::

It was a part of ticket #21554 which has already been merged.

OK, I didn't notice this. But this makes no sense regardless, and you should fix it here.

Still, it's unclear what the following sequence of assumptions following this line has to do with the one of solutions being real. Do you mean to say that in order to make sure that one (rather, every?) solution is real, you need to make the following assumptions? Something else?

According to the documentation provided earlier, the solution of the equation described in the issue is r1, which is a real number (That is what the documentation says!). But the solution to this equation can be a complex number too! So, I just changed the documentation and redefined r1 to be any arbitrary constant. You can refer to this conversation: https://groups.google.com/forum/#!topic/sage-support/_XWjrYjk_3A

I understand this --- my question is wholly about the commit from #21554. How does this docstring clarify anything about assuming non-integer? I don't get it.

comment:9 in reply to:  8 ; Changed 6 years ago by Ashutosh Ahelleya

Replying to dimpase:

I understand this --- my question is wholly about the commit from #21554. How does this docstring clarify anything about assuming non-integer? I don't get it.

No. The commits are different. I pushed them in different branches. But they showed up when I changed the author name. That was what my doubt was about -> https://groups.google.com/forum/#!topic/sage-support/iqqEhA4K2Gg

comment:10 in reply to:  9 ; Changed 6 years ago by Dima Pasechnik

Replying to aashu12:

Replying to dimpase:

I understand this --- my question is wholly about the commit from #21554. How does this docstring clarify anything about assuming non-integer? I don't get it.

No. The commits are different. I pushed them in different branches. But they showed up when I changed the author name. That was what my doubt was about -> https://groups.google.com/forum/#!topic/sage-support/iqqEhA4K2Gg

Differently named branches always have some common commits (and as I wrote on sage-support, it is the case that the commit c7acfd6 from #21554 is present in the branch here). Branch names are merely labels in the directed graph of commits in a repo.

Anyhow, c7acfd6 needs fixing, if only because it's broken English there...

comment:11 in reply to:  10 Changed 6 years ago by Ashutosh Ahelleya

Replying to dimpase:

Differently named branches always have some common commits (and as I wrote on sage-support, it is the case that the commit c7acfd6 from #21554 is present in the branch here). Branch names are merely labels in the directed graph of commits in a repo.

Anyhow, c7acfd6 needs fixing, if only because it's broken English there...

Yea, I will fix it :)

comment:12 Changed 6 years ago by git

Commit: e8760d5ba490fa59a043879c2993b14c8ababde3b88104716685c7864077452950ceee7280933b67

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

b881047 Fixed #21946

comment:13 Changed 6 years ago by git

Commit: b88104716685c7864077452950ceee7280933b67ea063c358af8349cac165083099a381a29f5e922

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

ea063c3Fixed #21946 and added example for #21554

comment:14 Changed 4 years ago by Bryan Gin-ge Chen

Status: needs_reviewneeds_work

This no longer merges.

comment:15 Changed 4 years ago by Bryan Gin-ge Chen

Branch: u/aashu12/documentationpublic/21946_solve_returns_r1
Commit: ea063c358af8349cac165083099a381a29f5e922224e0641f083472bda753ca8c1a833073b08a218
Description: modified (diff)
Status: needs_workpositive_review

I fixed the merge conflict. Unless there are other outstanding objections, I'm setting this to positive_review as this is certainly an improvement to the docs.


New commits:

e8760d5 Fixed: #21946
b881047 Fixed #21946
ea063c3Fixed #21946 and added example for #21554
224e064Merge branch 'u/aashu12/documentation' of git://trac.sagemath.org/sage into 21946_solve_returns_r1

comment:16 Changed 4 years ago by Bryan Gin-ge Chen

Reviewers: Bryan Gin-ge Chen

comment:17 Changed 4 years ago by Frédéric Chapoton

Milestone: sage-7.6sage-8.4

comment:18 Changed 4 years ago by Volker Braun

Branch: public/21946_solve_returns_r1224e0641f083472bda753ca8c1a833073b08a218
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.