grzegorzmazur / yacas

Computer calculations made easy
http://www.yacas.org
GNU Lesser General Public License v2.1
124 stars 24 forks source link

Solve for polynomial equation #278

Closed mikldk closed 4 years ago

mikldk commented 4 years ago

This is related to #272. I just tried the finding critical points in a Rosenbrock function:

The function is (1 - x)^2 + 100*(y - x^2)^2. The partial derivative wrt. x is (-2)*(1-x)-400*x*(y-x^2) and wrt. y it is 200*(y-x^2). Trying to find roots gives

Solve({(-2)*(1-x)-400*x*(y-x^2), 200*(y-x^2)}, {x, y})
# Wrong Groebner basis

I am not sure whether this is because Groebner bases cannot solve this problem or whether the implementation is missing something.

Wolfram Alpha finds the solution (x, y) = (1, 1).

grzegorzmazur commented 4 years ago

Hi,

Good catch! The message is all wrong, the correct Groebner basis is generated, only it just happens to break an assumption I've made in solver. Seems fairly easy to fix, but if there's one wrong assumption there may be as well some other, so I'll think about it a couple of days before commiting a fix.

Thanks, Grzesiek

mikldk commented 4 years ago

Thanks. It's not at all urgent. I just reported my observation because I hoped it could help improve yacas.

Should this and the other system be included as test cases?

Thanks!

grzegorzmazur commented 4 years ago

Definitely! I've already added this system as a testcase (I try to do it for every fix). The ones you've reported previously were added along with the code for solving them.

And thanks a lot for the reports, it's much easier to fix issues I'm aware of :)

mikldk commented 4 years ago

Thanks!