On Fri, 3 Sept 2021 at 21:48, Aaron Meurer <[email protected]> wrote:
> On Fri, Sep 3, 2021 at 12:10 PM Chris Smith <[email protected]> wrote:
> >
> > I also realize that there is an aspect to solving systems of non-linear 
> > equations that I have not fully appreciated. I would normally think of 
> > working manually through a system  by solving for one variable, 
> > substituting it into all the other equations and then repeating the process 
> > until all equations have been solved. If the system is non-linear you may 
> > miss solutions depending on how you are solving the equations. Consider
> >
> > x*y -x = 0 and x + y - 2
> >
> > If you solve the first for y you get 1 and substitution into the second 
> > gives x = 1.
>
> The problem is you are dividing by x when solving for 1, which deletes
> that solution from the system. Dividing both sides of an equation by
> something can delete solutions in general, just as multiplying both
> sides can add spurious solutions.
>
> > If you solve the second for y you get 2-x and substitution into the first 
> > give x*(1-x) which has solutions of 0 and 1 so there are two ways to make 
> > these equations 0: x,y = (0,2) or (1,1). If the 2 is replaced with 2/y then 
> > there are 3 possible solutions.
> >
> > It's easy to track for this simple case though (I am surprised to admit) 
> > that I am less sensitive to recognizing this nuance than I should be. When 
> > there are more equations, what is the most efficient way to solve the set 
> > of equations and know that you have captured all solutions? (And if there 
> > are more variables than the number of equations, how do you pick an easy 
> > subset of symbols for which to solve?) Those are the questions that are 
> > driving the question at the outset.
>
> For polynomials, the correct way to do this is using Groebner bases,
> which rewrite the polynomials into an equivalent triangular system,
> which means the "correct order" of variables is trivial. Is there a
> reason we don't always use them?

Groebner bases are used but solve_poly_system only handles the
zero-dimensional case so underdetermined cases fall back to the more
general (and less rigorous) algorithm. Using Groebner bases does not
make the correct order of variables trivial because the Groebner basis
itself depends on some order of the variables and more importantly on
the associated monomial ordering.

--
Oscar

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxSzyfMA9%2Bqtzusw4%3Dq7j3h999QsOc8mJy_Wo5hjK_a03g%40mail.gmail.com.

Reply via email to