Hi
I am trying to evaluate the minimum of a function, which may seem complicated at first sight but is in fact quite simple, it is just a sum of inverses of sines squared. I want 20 digits of precision, thus set WorkingPrecision to 20.
In[22]:= min =
FindMinimum[
Sin[ (x2 - x3)/2]^(-2) + Sin[ (x4 - x3)/2]^(-2) +
Sin[ (x4 - x2)/2]^(-2) + Sin[ (x5 - x3)/2]^(-2) +
Sin[ (x4 - x5)/2]^(-2) + Sin[ (x5 - x2)/2]^(-2) +
Sin[ (x2 + x3)/2]^(-2) + Sin[ (x4 + x3)/2]^(-2) +
Sin[(x4 + x2)/2]^(-2) + Sin[ (x5 + x3)/2]^(-2) +
Sin[ (x4 + x5)/2]^(-2) + Sin[ (x5 + x2)/2]^(-2) -
1, {{x2, -1.1}, {x3, 4.2}, {x4, 3.1}, {x5, 6.2}},
WorkingPrecision -> 20]
During evaluation of In[22]:= FindMinimum::sszero: The step size in the search has become less than the tolerance prescribed by the PrecisionGoal option, but the gradient is larger than the tolerance specified by the AccuracyGoal option. There is a possibility that the method has stalled at a point that is not a local minimum. >>
Out[22]= {26.000000000000014553, {x2 -> -1.1071487225113589847,
x3 -> 4.2487413858936085020, x4 -> 3.1415926678804502181,
x5 -> 6.2831853137302564605}}
The minimum seems to be around 26. But then if I evaluate the function at the given values of x2,x3,x4,x5, this is what I get :
In[23]:= Sin[ (x2 - x3)/2]^(-2) + Sin[ (x4 - x3)/2]^(-2) +
Sin[ (x4 - x2)/2]^(-2) + Sin[ (x5 - x3)/2]^(-2) +
Sin[ (x4 - x5)/2]^(-2) + Sin[ (x5 - x2)/2]^(-2) +
Sin[ (x2 + x3)/2]^(-2) + Sin[ (x4 + x3)/2]^(-2) +
Sin[(x4 + x2)/2]^(-2) + Sin[ (x5 + x3)/2]^(-2) +
Sin[ (x4 + x5)/2]^(-2) + Sin[ (x5 + x2)/2]^(-2) - 1 /. min[[2]]
Out[23]= 27.00000000000001455
Here it finds 27 ! I know from analytical calculation that the correct result is indeed 27. I am aware of the error message above, but I don't understand the reason for the shift by 1 in the answer. A few remarks :
- This strange behaviour occurs only for sufficiently high WorkingPrecision.
- It disappears if I remove the "-1" at the end of the function whose minimum I am looking for.
Any explanation would be highly appreciated !