I have not been able to get the following behaviour out of maxima
directly, but the following code illustrates that maxima's solve
forgets about some solutions:
def realzeros(f,g):
t = polygen(QQbar)
P = parent(f)
R = f.resultant(g,P.0)
yvals = [yval[0] for yval in R(0,t).roots() if yval[0] in RR]
result = []
for yval in yvals:
xpol = GCD(f(t,yval),g(t,yval))
result += [(xval[0],yval) for xval in xpol.roots() if xval[0]
in RR]
return result
var("x,y")
f=(x^2-y^2+y^4)*(x^2+y^2-1)
g=diff(f,x)+2*diff(f,y)
temp=solve([f,g],x,y)
S1 = [ (RR(p[0]),RR(p[1])) for p in [(x.subs(s[0]),y.subs(s[1])) for s
in temp] if p[0] in RR and p[1] in RR]
S2 = realzeros(f.polynomial(QQ),g.polynomial(QQ))
implicit_plot(g,(x,-2,2),(y,-2,2))+implicit_plot(f,(x,-2,2),(y,-2,2))
+points(S1,color="red",pointsize=40)+points(S2,color="blue",pointsize=20)
This code produces a picture that clearly shows that maxima's solve
misses some of the intersection points that a straightforward
resultant-and-roots-of-univariate-polynomials does find.
Perhaps someone more expert in using maxima can get this problem to
happen directly in maxima so that it can be reported upstream?
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org