rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

algsys failure #3031

Open rtoy opened 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 09:34:13 Created by billingd on 2018-08-25 02:21:30 Original: https://sourceforge.net/p/maxima/bugs/3461


Reported to maxima list by Jan-Magnus Økland on 2018-08-25.

I have a nonlinear system of two polynomial equations in two variables x,y with a parameter t that has a double solution for all t (for t=0 one circle reduces to a point that lies on the other circle).

eq1:expand((x-(2+3*(40/t)/sqrt(10)))^2+(y-(-5+(40/t)/sqrt(10)))^2-(40/t)^2);
eq2:expand((x-(-2+3*t/sqrt(10)))^2+(y-(7+t/sqrt(10)))^2-t^2);
solve([eq1,eq2],[x,y]); /* yields [] */

but the following gives a solution sub-optimally:

solve([eq1-eq2],[x]);
x0:rhs(%[1]);
solve([subst(x0,x,eq2)],[y]);
y1:rhs(%[1]);
x1:subst(y1,y,x0); /* ‘ratsimp's to quotient of degree 4 polys */
/* the resulting parametric circle plotted */
plot2d([parametric, x1, y1, [t, -100,100]]);

mathematica can do something like the above from Reduce (I actually used WA).

maple finds quotients of degree two polynomials for both x and y from solve:

[x = (2*(12*t*sqrt(10)+t^2-40))/(t^2+40),
 y = (280-5*t^2+8*t*sqrt(10))/(t^2+40)]

Does anyone know what stops solve from finding this solution?

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 09:34:14 Created by billingd on 2018-08-25 02:23:42 Original: https://sourceforge.net/p/maxima/bugs/3461/#dbb2


Diff:


--- old
+++ new
@@ -4,12 +4,15 @@
 x,y with a parameter t that has a double solution for all t (for t=0 one
 circle reduces to a point that lies on the other circle).

+~~~
 eq1:expand((x-(2+3*(40/t)/sqrt(10)))^2+(y-(-5+(40/t)/sqrt(10)))^2-(40/t)^2);
 eq2:expand((x-(-2+3*t/sqrt(10)))^2+(y-(7+t/sqrt(10)))^2-t^2);
 solve([eq1,eq2],[x,y]); /* yields [] */
+~~~

 but the following gives a solution sub-optimally:

+~~~
 solve([eq1-eq2],[x]);
 x0:rhs(%[1]);
 solve([subst(x0,x,eq2)],[y]);
@@ -17,13 +20,15 @@
 x1:subst(y1,y,x0); /* ‘ratsimp's to quotient of degree 4 polys */
 /* the resulting parametric circle plotted */
 plot2d([parametric, x1, y1, [t, -100,100]]);
-
+~~~

 mathematica can do something like the above from Reduce (I actually used WA).

 maple finds quotients of degree two polynomials for both x and y from solve:

+~~~
 [x = (2*(12*t*sqrt(10)+t^2-40))/(t^2+40),
  y = (280-5*t^2+8*t*sqrt(10))/(t^2+40)]
+~~~

 Does anyone know what stops solve from finding this solution?
rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 09:34:17 Created by billingd on 2018-08-25 02:35:50 Original: https://sourceforge.net/p/maxima/bugs/3461/#dc10


The factor sqrt(10) is part of the problem. With the change of variables t = u*sqrt(10)

(%i33) eq3:eq1,t=u*sqrt(10);
(%o33) y^2-(8*y)/u+10*y+x^2-(24*x)/u-4*x+8/u+29
(%i34) eq4:eq2,t=u*sqrt(10);
(%o34) y^2-2*u*y-14*y+x^2-6*u*x+4*x+2*u+53
(%i35) algsys([eq3,eq4],[x,y]);
(%o35) [[x = (2*u^2+24*u-8)/(u^2+4),y = -(5*u^2-8*u-28)/(u^2+4)]]