I tried to solve a rather simple optimization problem, which Mathematica apparently cannot handle. A minimal example is the following:

Minimize[{a^2*Exp[-b^2], b > 0}, a, Reals]

(* Minimize[{a^2 E^-b^2, b > 0}, a, Reals] *)

Obviously, the answer should have been {0, {a -> 0}}. The minimization works when I drop the exponential term. My Mathematica version is 10.2.0 for Mac OS X x86 (64-bit) (July 29, 2015).

Are there any options I need to set to aid Mathematica in solving the above minimization or is this simply a bug, which I should report to Wolfram?

  • 2
    $\begingroup$ Have a look at NMinimize. $\endgroup$ – b.gates.you.know.what Aug 4 '15 at 13:48
  • $\begingroup$ Well, I have a more complicated expression with more parameters and I'd like to get the minimum as a function of these parameters. I also believe that the above minimization is simple enough that it could be solved analytically. $\endgroup$ – David Zwicker Aug 4 '15 at 14:55
  • $\begingroup$ If your expression is non polynomial I don't think Minimize will handle it. $\endgroup$ – b.gates.you.know.what Aug 4 '15 at 15:06
  • $\begingroup$ I understand that non-linear optimization is hard, but there are a couple of examples in the documentation. Also my optimization problem is polynomial in a, the parameter I optimize for. It would be sufficient if the function realizes that the factor Exp[-b^2] is non-negative. $\endgroup$ – David Zwicker Aug 4 '15 at 15:13
  • $\begingroup$ If you replace Exp[-b^2] with c, then you get an answer (although if you put in the constraint c > 0, that seems to be ignored). As @b.gatessucks states, Minimize seems to only deal with polynomials and I vaguely remember responses either here or a commmunity.wolfram.com stating so. $\endgroup$ – JimB Aug 4 '15 at 18:22

How about approaching the minization using derivatives?

Solve[D[a^2*Exp[-b^2], a] == 0, a]
{{a -> 0}}
  • $\begingroup$ That's a good solution, but I'm still surprised that Mathematica cannot solve the original problem. I guess I underestimate the difficulty of such code. $\endgroup$ – David Zwicker Aug 4 '15 at 17:53

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.