1
$\begingroup$

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]
$\endgroup$
  • $\begingroup$ What do you mean by " it fails to give me the answer"? The calculation never finishes, or something else? $\endgroup$ – xzczd Mar 24 at 4:42
  • $\begingroup$ Yes, it is running for about half an hour but still not finishing. Does it mean that it will never finish? $\endgroup$ – lin zang Mar 24 at 4:45
  • $\begingroup$ 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 $\endgroup$ – xzczd Mar 24 at 4:52
  • $\begingroup$ Thank you very much! $\endgroup$ – lin zang Mar 24 at 5:08
  • $\begingroup$ 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! $\endgroup$ – lin zang Mar 24 at 8:59
1
$\begingroup$

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<m<1$.

| improve this answer | |
$\endgroup$
  • $\begingroup$ 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? $\endgroup$ – lin zang Mar 24 at 8:53
  • $\begingroup$ @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. $\endgroup$ – LouisB Mar 24 at 9:19
  • $\begingroup$ Never mind. I should learn how to clearly illustrate a question. But I think you have answered my question. Thank you so much! $\endgroup$ – lin zang Mar 24 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.