0
$\begingroup$

I'm trying to find the minimum y-coordinate of a point which lies on a side of an equilateral triangle. FindMinimum doesn't work when I change the position of the point on the side of the triangle.

Here is the code which gives the error:

FindMinimum[
  {y3,(x1 - x2)^2 + (y1 - y2)^2 == 20^2,
   x2^2 + y2^2 == 20^2,
   x1^2 + y1^2 == 20^2,
   (x1 - x3)^2 + (y1 - y3)^2 == 17^2,
   (x2 - x3)^2 + (y2 - y3)^2 == 3^2,
   x1 < x2,
   y1 < 0,
   y2 < 0},
  {x1, x2, x3, y1, y2, {y3, -20}}]

the error is:

FindMinimum::infeas: Possible infeasibility detected. Returning the best solution found. Setting a different initial point or Method -> InteriorPoint may lead to a better solution.

The weird thing is that when I want to solve the problem which is symmetrical around the y axis, the function works and gives the correct answer.

FindMinimum[
  {y3, (x1 - x2)^2 + (y1 - y2)^2 == 20^2,
   x2^2 + y2^2 == 20^2,
   x1^2 + y1^2 == 20^2,
   (x1 - x3)^2 + (y1 - y3)^2 == 3^2,
   (x2 - x3)^2 + (y2 - y3)^2 == 17^2,
   x1 < x2,
   y1 < 0,
   y2 < 0},
  {x1, x2, x3, y1, y2, {y3, -20}}]
{-18.6815, 
   {x1 -> -2.78144, x2 -> 15.7615, x3 -> -1.3585*10^-7,
    y1 -> -19.8056, y2 -> -12.3116, y3 -> -18.6815}}

I tried to put some other constraints to help the function to find the answer but it fails too.

The Concept

$\endgroup$
  • $\begingroup$ Your first code runs with absolutely no issues and in no time returns {-18.6815, {x1 -> -15.7615, x2 -> 2.78144, x3 -> 1.41251*10^-7, y1 -> -12.3116, y2 -> -19.8056, y3 -> -18.6815}} on both v10.4 and v11.3. $\endgroup$ – corey979 Aug 8 '18 at 21:28
  • $\begingroup$ I'm using 11.3 student edition. could it be the issue? $\endgroup$ – SMAH0092 Aug 8 '18 at 21:33
  • $\begingroup$ No. Quit[] the kernel and try again; maybe you have some old definitions. I cannot help with solving a problem that I cannot reproduce. $\endgroup$ – corey979 Aug 8 '18 at 21:37
  • $\begingroup$ Thanks for your quick answer. I did what you said, but it gives the same error. Basically I simplified my question. my main problem was: $\endgroup$ – SMAH0092 Aug 8 '18 at 21:40
  • $\begingroup$ z = 7; FindMinimum[{y5, x5 == 0, x2^2 + y2^2 == 20^2, x3^2 + y3^2 == 20^2, (x2 - x3)^2 + (y2 - y3)^2 == 20^2, x2 < x3, (x4 - x2)^2 + (y4 - y2)^2 == 20^2, y4 < y2 < 0, (x6 - x3)^2 + (y6 - y3)^2 == 20^2, (x4 - x6)^2 + (y4 - y6)^2 == 20^2, x4 < x6, (x5 - x4)^2 + (y5 - y4)^2 == z^2, (x5 - x6)^2 + (y5 - y6)^2 == (20 - z)^2, y6 < y3 < 0, -40 <= x2 <= 0, 0 <= x3 <= 40, -20 <= x4 <= 0, 0 <= x6 <= 20 }, {x2, x3, x4, x5, x6, y2, y3, y4, {y5, -40}, y6}] $\endgroup$ – SMAH0092 Aug 8 '18 at 21:43

Your Answer

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

Browse other questions tagged or ask your own question.