user394706
user394706

Reputation: 125

Solving polynomial equation system possibly having infinite solutions?

I have to solve polynomial equation system which gives error as it has infinite solutions and i just require few solutions(any 2 or 3) so how can i get them? , Can i specify condition on solution like solutions whose values range between 1 to 10 so that i can get few value. Equations are actually long complicated but infinite solutions are due to "sin(0)" at root.

Upvotes: 0

Views: 2278

Answers (8)

Dr. belisarius
Dr. belisarius

Reputation: 61056

Mathematica provides quite a few features to help you. For example:

Plot3D[{0, x^2 - y^2}, {x, -1, 1}, {y, -1, 1},
 PlotStyle -> {Red, Green}]  

enter image description here

a = ToRules@Reduce[x^2 - y^2 == 0, {x, y}];
Plot[Evaluate@({x, y} /. {a}), {x, -1, 1}]

enter image description here

Upvotes: 0

user359781
user359781

Reputation:

If the system is big or there are many solutions (isolated or high dimension components) you can use packages like HOM4PS2. If the system is (extremely) small you can solve it symbolically by finding the so called Grobner's basis, which gives you a equivalent (but different) set of polynomials whose solutions are almost obvious. Both Maple and Mathematica 7 can do this.

Upvotes: 0

David Z
David Z

Reputation: 131730

Mathematica's FindRoot function will give you the closest solution to a given value, so you can use FindRoot a few times with various inputs.

Any other mathematical program should have something similar, it just happens that I'm most familiar with Mathematica at the moment.

Upvotes: 1

Andrew Moylan
Andrew Moylan

Reputation: 2913

In Mathematica you could use FindInstance to find one or more solutions to your equations. Here's how to get 2 solutions of a particular set of equations:

In[2]:= FindInstance[
 x^2 + y^2 + z^2 == -1 && z^2 == 2 x - 5 y, {x, y, z}, 2]

Out[2]= {{x -> -(46/5) - (6 I)/5, 
  y -> 1/10 (25 - Sqrt[-5955 - 1968 I]), 
  z -> -Sqrt[1/10 ((-309 - 24 I) + 5 Sqrt[-5955 - 1968 I])]}, {x -> 
   11/5 - (43 I)/5, y -> 1/10 (25 - Sqrt[6997 + 5504 I]), 
  z -> Sqrt[(1/5 - I/10) ((2 - 85 I) + (2 + I) Sqrt[6997 + 5504 I])]}}

You can also give inequalities like 1 < var < 10 to FindInstance or to Reduce to further restrict possible solutions, as you suggested.

Upvotes: 1

JB King
JB King

Reputation: 11910

Which definition of a solution are you meaning here: That a given function has a value of zero for certain inputs or that a given system of multiple equations overlap in multiple points? The latter could be described as 2 planes intersecting on a line but this isn't necessarily what people may think of when they picture solving a polynomial equation system.

For example: x^2 =4 has only 2 solutions, but x^2=y^2 may have infinitely many solutions as x=y and x=-y are both lines that define where that equality would hold, yet both can be considered polynomial equations to my mind.


I presume you have read through things like SOLUTION OF EQUATIONS USING MATLAB, MATLAB Programming/Symbolic Toolbox, and Solving non linear equations, right? Those may have some ideas for how to use Matlab to do that.

Upvotes: 1

n00dle
n00dle

Reputation: 6043

In a similar manner to Jonas, if you solve for f(x) = 0 numerically in Matlab, you can use fsolve. Should the polynomial have many potential outputs, you may well be able to iterate towards these from different initial points.

Beware local minima in your solution space though, they can be a serious problem for iterative solutions as they guide your algorithm to an answer that is not actually correct.

Upvotes: 0

sth
sth

Reputation: 229844

You can try to add additional equations to the system, like x1 = 0, x2 = 0 etc., to restrict the number of possible solutions.

Upvotes: 3

Jonas
Jonas

Reputation: 74940

If you solve a system of the form f(x)=0 numerically, you can use FMINCON to add constraints. For example, you can specify that the solution should be between 1 and 10.

Upvotes: 0

Related Questions