Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.9K Views
|
11 Replies
|
2 Total Likes
View groups...
Share
Share this post:

What algorithm does NSolve use for real solutions of underdetermined system

Posted 8 years ago

Hi, I am trying to write up a paper with some results form Mathematica (11.2) among other things. I need to know what algorithm does it use when I solve a system of polynomial equations which is underdetermined (infinitely many solutions). In particular, sometimes Mathematica also find real solutions that are embedded into the complex positive-dimensional components. I couldn't find a mentioned of the specific algorithm that Mathematica is using. I believe this code is written by @DanielLichtblau ? I know this discussion: https://mathematica.stackexchange.com/questions/47112/what-algorithms-does-nsolve-use? Also, I have looked into NSolve's documentation, but it does not mention the specific algorithm for underdetermined polynomial systems and in particular for finding real solutions embedded in complex curves (though Mathematica certainly find these!). e.g.

In= NSolve[{x^2 + y^2 - 1} == 0, {x, y}, Reals]
Out= {{x -> -0.997714, y -> 0.0675708}, {x -> -0.335987, y -> -0.941867}}

While this example may be easy enough, Mathematica also finds real solutions for larger systems.

I also wonder if Mathematica finds ALL the real solutions from all the complex curves? Again, to know this, one needs to know what algorithm/method does Mathematica uses.

Thanks.

POSTED BY: dbm368
11 Replies
Posted 8 years ago

Try

Trace[
 NSolve[x^2 + y^2 - 1 == 0, {x, y}, Reals],
 _GroebnerBasis,
 TraceInternal -> True
 ]

It does use GroebnerBasis. I do not see why NSolve cannot use complex methods and then verify "all variables, parameters, constants, and function values are restricted to be real."

POSTED BY: Updating Name
Posted 8 years ago

@MichaelRogers, No, I am not saying that. Nor it is surprising that the NSolve command solves this small and well-known system accurately when Reals is specified or not. The main concern is as follows. The system x^2 + y^2 - 1 ==0 is not the 'same' if x, y \in C as opposed to x, y \in R. The NSolve command has to use different methods based on if the option 'Reals' is specified. If this option is not specified, then I can understand that the NSolve command uses the GB method and then it would spit out some representation of the complex positive dimensional solution space. But if 'Reals' is specified, the GB method can't be used as it is. I want to know what method/algorithm would NSolve use for underdetermined systems when Reals is specified.

POSTED BY: dbm368
Posted 8 years ago

@DanielLichtblau, Thanks for your message! For this particular example, it would be straightforward, sure. That's why I had made a comment in my original question "While this example may be easy enough, Mathematica also finds real solutions for larger systems." How does Mathematica find isolated real solutions out of underdetermined system of polynomial equations when the number of equations/variables are larger? The GB method assumes complex variables. For underdetermined systems, it is very tricky to extract real isolated solutions which would now be embedded in complex positive dimensional components. I can send you a more complicated problem if you want. Or I think you would already know such examples anyway.

POSTED BY: dbm368

It does not take much work to find an example for which no real solutions are found. A simple modification of the example under scrutiny will suffice.

In[193]:= NSolve[{x^2 + y^2 - 1/100} == 0, {x, y}, Reals]

During evaluation of In[193]:= NSolve::infsolns: Infinite solution set has dimension at least 1. Returning intersection of solutions with -((92291 x)/87992)-(121001 y)/175984 == 1.

Out[193]= {}

All solutions found using a hyperplane had nontrivial imaginary parts.

I am not sure what is the goal here, but if it is to determine whether or not an underdetermined system has real solutions, this approach using NSolve is not going to do that.

One approach you might try is to find critical points for some distance-like function, maybe a random weighted sum of squares or distance to a random point (the randomization being useful to avoid degeneracy situations). Greg Reid and coauthors have done work along these lines. Below are a few links that might be of use.

https://dl.acm.org/citation.cfm?doid=2465506.2465954

https://dl.acm.org/citation.cfm?doid=2631948.2631969

https://www.semanticscholar.org/paper/Computing-real-witness-points-of-positive-dimensio-Wu-Reid/99e240fef15e8c3c1b94edb88450b02ebc6106ac

POSTED BY: Daniel Lichtblau
Posted 8 years ago
POSTED BY: dbm368
POSTED BY: Michael Rogers
Posted 8 years ago
POSTED BY: dbm368

What @MichaelRogers wrote is correct at least for the example under discussion. Linear conditions (one in this example) are added to make the system exactly determined for the highest dimensional components. In this instance the intersection happens to contain real valued solutions.

POSTED BY: Daniel Lichtblau

I get this message when I run your code:

NSolve::infsolns: Infinite solution set has dimension at least 1. Returning intersection of solutions with
-((92291 x)/87992)-(121001 y)/175984 == 1.

It is omitted from your quoted result. Did you not get it? Obviously, NSolve adds linear conditions until the system is not underdetermined. (I say, obviously, because that's what the message says.) With that in mind, Frank's response seems to be exactly what is done to find the solutions (at least the Gröbner basis part).

For the following equation, it adds two hyperplanes:

NSolve[x^2 + y^2 + z^2 - 1 == 0, {x, y, z}, Reals]

By the way, you can turn off that method and get parametrized solutions (at least for many algebraic equations):

SetSystemOptions["NSolveOptions" -> "UseSlicingHyperplanes" -> False]
NSolve[x^2 + y^2 + z^2 - 1 == 0, {x, y, z}, Reals]

NSolve::svars: Equations may not give solutions for all "solve" variables.

Out[] = {
 {z ->  ConditionalExpression[-1.` Sqrt[1.` - 1.` x^2 - 1.` y^2],
   -1.` < x < 1.` && -1.` Sqrt[1.` - 1.` x^2] <= y <= Sqrt[1.` - 1.` x^2]]},
 {z -> ConditionalExpression[Sqrt[1.` - 1.` x^2 - 1.` y^2],
   -1.` < x < 1.` && -1.` Sqrt[1.` - 1.` x^2] <= y <= Sqrt[1.` - 1.` x^2]]},
 {x -> -1.`, y -> 0, z -> 0},
 {x -> 1.`, y -> 0, z -> 0}}
POSTED BY: Michael Rogers
Posted 8 years ago

@FrankKampas, thanks, but that does not address my specific question.

POSTED BY: dbm368

For sparse linear systems, Solve and NSolve use several efficient numerical methods, mostly based on Gauss factoring with Markowitz products (approximately 250 pages of code). For systems of algebraic equations, NSolve computes a numerical Gröbner basis using an efficient monomial ordering, then uses eigensystem methods to extract numerical roots.

http://reference.wolfram.com/language/tutorial/SomeNotesOnInternalImplementation.html

POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard