This is the first time I try to use FindMinimum. Am I using it correctly? Before that,

is it always possible to use FindMinimum or Minimize?

Here my code:

f[q_?NumberQ, a_?NumberQ, b_?NumberQ]:=NIntegrate[ (Sin[x]^2 Exp[-q^2 Sin[x]^2 Cos[y]^2])/((a ^2 Cos[y]^2 + 
    b ^2 Sin[y]^2) Sin[x]^2 + a^2 b^2 Cos[x]^2), {x, 0, Pi}, {y,0, Pi/2}]

FindMinimum[f[q, a, b], {q}, {a}, {b}] 

{0., {q -> 114451., a -> 95702.8, b -> 134094.}}

I think this was very easy. Is it just that?

  • 2
    $\begingroup$ I see no problem. If you need verification you may plot the nearby region and visually confirm the minimum. $\endgroup$ – Giovanni Baez Jun 29 '18 at 18:03
  • $\begingroup$ Suppose this function is the total energy of a physical system. So, $a$, $b$ and $q$ are the variational parameters that minimize the energy? $\endgroup$ – Dinesh Shankar Jun 29 '18 at 18:08
  • 1
    $\begingroup$ There are definitely systems that Minimize and FindMinimum will have trouble with, but I see no reason to believe that this would be one of them: it looks like the composition of a bunch of smooth functions, so it shouldn't be too hard on it. Generally I assume that numerical minimizers are going to be more robust than root finders, since the problem being solved is relaxed one step. Note that FindMinimum only attempts to find a local minima though. $\endgroup$ – eyorble Jun 29 '18 at 18:11
  • $\begingroup$ I'd personally would look at the region, Its hard to find a minimum without a good idea were it is. You might have found a local minima, but starting the search in another region leads to another answer. $\endgroup$ – Giovanni Baez Jun 29 '18 at 18:11
  • $\begingroup$ Hum. I got it. Thank you.. $\endgroup$ – Dinesh Shankar Jun 29 '18 at 18:15

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.