# Why can't I use FindInstance to find more than one solution when I know they all exist?

For example, it is easy to find one solution for this code:

FindInstance[1/(6 m) (6 q1 (r - w) t + q1^3 (t (-1 + m) + 4 (-r + s) m) +
q2 (6 (-r + w) m + q2^2 (t + 4 r m - 4 s m))) > 0 && -((c q1^2 (-1 + m) + 2 (-r + w) m +
q1^2 (r + t + 2 r m - 3 s m - t m))/(2 m)) == 0 && (c q2^2 + 2 (r - w) m - q2^2 (r + t + 3 r m - 3 s m))/(2 m) == 0 &&  r > w > s > 0 && t >= 0 && c >= t + m r + (1 - m) s && 0 < m < 1 && 0 < q2 < q1 < m/(1 + m), {q1, q2, r, c, w, s, m, t}, Reals]


But when I want to find 10 solutions, it is running for about half an hour but still not finishing:

FindInstance[1/(6 m) (6 q1 (r - w) m + q1^3 (t (-1 + m) + 4 (-r + s) m) +
q2 (6 (-r + w) m + q2^2 (t + 4 r m - 4 s m))) > 0 && -((c q1^2 (-1 + m) + 2 (-r + w) m +
q1^2 (r + t + 2 r m - 3 s m - t m))/(2 m)) == 0 && (c q2^2 + 2 (r - w) m - q2^2 (r + t + 3 r m - 3 s m))/(2 m) == 0 && r > w > s > 0 && t >= 0 && c >= t + m r + (1 - m) s && 0 < m < 1 && 0 < q2 < q1 < m/(1 + m), {q1, q2, r, c, w, s, m, t}, Reals,10]

• What do you mean by " it fails to give me the answer"? The calculation never finishes, or something else? – xzczd Mar 24 at 4:42
• Yes, it is running for about half an hour but still not finishing. Does it mean that it will never finish? – lin zang Mar 24 at 4:45
• It's better to clarify this in the body of question. "Does it mean that it will never finish?" I won't be surprised if it never finishes, symbolically solving polynomial equation system is not easy. Related: mathematica.stackexchange.com/a/2672/1871 – xzczd Mar 24 at 4:52
• Thank you very much！ – lin zang Mar 24 at 5:08
• Do you have any idea about my last question? Is it the same as this one because the whole system is too complex? Is there any advice to change the way I handle them? Thank you! – lin zang Mar 24 at 8:59

Another workaround is to assign a value to one (or more) of the variables and re-order the equations. For example, this works

With[{m = 1/2},
eqns = {
0 < m < 1,
r > w > s > 0,
t >= 0,
c >= t + m r + (1 - m) s,
0 < q2 < q1 < m/(1 + m),

1/(6 m) (6 q1 (r - w) m + q1^3 (t (-1 + m) + 4 (-r + s) m) +
q2 (6 (-r + w) m + q2^2 (t + 4 r m - 4 s m))) > 0,

-((c q1^2 (-1 + m) + 2 (-r + w) m +
q1^2 (r + t + 2 r m - 3 s m - t m))/(2 m)) == 0,

(c q2^2 + 2 (r - w) m - q2^2 (r + t + 3 r m - 3 s m))/(2 m) == 0};

FindInstance[eqns,
{q1, q2, r, s, c, w, t}, Reals, 10]
] // Column


It also works with other (random?) choices of $$0.

• Thank you very much for your reply. Is it because I have too many variables? But how to deal with it if I do not want to give real numbers to this whole system? – lin zang Mar 24 at 8:53
• @linzang I do not know why your approach did not work. The reason is probably a combination of things, including the number of nonlinear equations. I'm not sure what you mean by "give real numbers to the whole system". Do you mean some of the variables may be complex or integer? Or, are you looking for range of $q_1$ and $q_2$ in terms of the other variables? You can edit your question to explain what you are really trying to do. – LouisB Mar 24 at 9:19
• Never mind. I should learn how to clearly illustrate a question. But I think you have answered my question. Thank you so much! – lin zang Mar 24 at 9:39