Similarly, when trying to solve system of equations given below, the wrong result is given. Instead of (x1,y1) and (x2,y2), the correct solution should be (x1,y2) and (x2,y1):
--- old+++ new@@ -1,4 +1,7 @@In Maxima 5.32.1, solving this equation fails.
-(%i1) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=9],[x,y]);++ (%i1) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=9],[x,y]);+which gives []. But a similar equation solves without problem
-(%i2) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=10],[x,y]);++ (%i2) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=10],[x,y]);
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems that the function 'solve' can return the answer if x or y is equal to 0.
I think it is a weakness in the function algsys called by the function solve.
if you do:
load(grobner);
poly_reduced_grobner([x^2+y^2-1,(x-2)^2+(y-3)^2-9],[x,y]);
algsys(%,[x,y]);
you get the solution
float(%)
gives the float values
hisham...
It seems that the function 'solve' can return the
answer if x or y is equal to 0.
I think it is a weakness in the function algsys called by
the function solve.
Anyway we can get the answer as follows:
(%i1) load (to_poly_solve);
(%o1) /sw/share/maxima/5.33.0/share/to_poly_solve/to_poly_solve.mac
(%i2) to_poly_solve ([x^2+y^2=1, (x-2)^2+(y-3)^2=9], [x,y], 'use_grobner = true);
5/2 5/2
3
Thank you for your response.
It makes me notice that the function to_poly_solve calls the function poly_reduced_grobner and the algsys.
It is helpful for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
(Maxima 5.31.2)
Similarly, when trying to solve system of equations given below, the wrong result is given. Instead of (x1,y1) and (x2,y2), the correct solution should be (x1,y2) and (x2,y1):
(%i78) p:1/(1-cos(1));
(%o78) 1/(1-cos(1))
(%i82) solution_1:float(solve([x*y=p,x-y=3],[x,y]));
(%o82) [[x=3.603649840080336,y=-3.603649840080335],[x=-0.60364984008034,y=0.60364984008034]]
But, if we convert p to float before solving the system of equations, the result will be correct:
(%i80) solution_2:float(solve([x*y=float(p),x-y=3],[x,y]));
rat: replaced -2.17534264967002 by -8846603/4066763 = -2.17534264967002
(%o80) [[x=-0.60364984008034,y=-3.603649840080335],[x=3.603649840080335,y=0.60364984008034]]
Last edit: Goran Igaly 2014-05-28
Hi,
It seems the simple expression is best.
So that another solution is as follows:
My environment:
Maxima version: "5.33.0"
Maxima build date: "2014-04-20 04:11:32"
Host type: "x86_64-apple-darwin10.8.0"
Lisp implementation type: "SBCL"
Lisp implementation version: "1.1.17"
Diff:
Hi,
It seems that the function 'solve' can return the answer if x or y is equal to 0.
I think it is a weakness in the function algsys called by the function solve.
Anyway we can get the answer as follows:
My environment:
Maxima version: "5.33.0"
Maxima build date: "2014-04-20 04:11:32"
Host type: "x86_64-apple-darwin10.8.0"
Lisp implementation type: "SBCL"
Lisp implementation version: "1.1.17"
if you do:
load(grobner);
poly_reduced_grobner([x^2+y^2-1,(x-2)^2+(y-3)^2-9],[x,y]);
algsys(%,[x,y]);
you get the solution
float(%)
gives the float values
hisham...
On Fri, 6/6/14, Tomio Arisaka tomio-arisaka@users.sf.net wrote:
Subject: [maxima:bugs] #2736 Bug in solving equation
To: "[maxima:bugs]" 2736@bugs.maxima.p.re.sf.net
Date: Friday, June 6, 2014, 8:34 AM
Hi,
(%i1) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=9],[x,y]);
(%o1)
[]
(%i2) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=10],[x,y]);
5 12
(%o2) [[x = 1, y = 0], [x = - --, y = --]]
13 13
(%i3) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=8],[x,y]);
12 5
(%o3) [[x = --, y = --], [x = 0, y = 1]]
13 13
It seems that the function 'solve' can return the
answer if x or y is equal to 0.
I think it is a weakness in the function algsys called by
the function solve.
Anyway we can get the answer as follows:
(%i1) load (to_poly_solve);
(%o1) /sw/share/maxima/5.33.0/share/to_poly_solve/to_poly_solve.mac
(%i2) to_poly_solve ([x^2+y^2=1, (x-2)^2+(y-3)^2=9], [x,y], 'use_grobner = true);
5/2 5/2
3
(%o2) %union([x = - ---------, y = -----------],
26 78
5/2 5/2
3 + 10 2 3 - 45
[x = ---------, y = - -----------])
26 78
(%i3) float (%);
(%o3) %union([x = - 0.2149406641584574, y = 0.9766271094389715],
[x = 0.9841714333892265, y = 0.1772190444071823])
My environment:
Maxima version: "5.33.0"
Maxima build date: "2014-04-20 04:11:32"
Host type: "x86_64-apple-darwin10.8.0"
Lisp implementation type: "SBCL"
Lisp implementation version: "1.1.17"
[bugs:#2736]
Bug in solving equation
Status: open
Group: None
Labels: solve
Created: Mon May 26, 2014 06:45 AM UTC by
idlerlestat
Last Updated: Thu Jun 05, 2014 03:09 AM
UTC
Owner: nobody
In Maxima 5.32.1, solving this equation fails.
(%i1) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=9],[x,y]);
which gives []. But a similar equation solves without
problem
(%i2) solve([x^2+y^2=1,(x-2)^2+(y-3)^2=10],[x,y]);
Sent from sourceforge.net because you indicated interest
in https://sourceforge.net/p/maxima/bugs/2736/
To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/
Related
Bugs:
#2736Hi,
Thank you for your response.
It makes me notice that the function to_poly_solve calls the function poly_reduced_grobner and the algsys.
It is helpful for me.
Fixed by commit [2986fc] See [bugs:#3208] for details.
Related
Bugs:
#3208Commit: [2986fc]
Last edit: David Billinghurst 2016-10-02
Reopen as the issues in the second post are not fixed.
Closing this. Issues in the second post fixed by commit [640ca7]. I will add the problem to maxima testsuite
Related
Commit: [640ca7]