5

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?

David Zwicker
  • 968
  • 5
  • 14
  • 2
    Have a look at NMinimize. – b.gates.you.know.what Aug 04 '15 at 13:48
  • 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. – David Zwicker Aug 04 '15 at 14:55
  • If your expression is non polynomial I don't think Minimize will handle it. – b.gates.you.know.what Aug 04 '15 at 15:06
  • 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. – David Zwicker Aug 04 '15 at 15:13
  • 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. – JimB Aug 04 '15 at 18:22
  • Well, if Minimize only handles polynomials, I think this should clearly been stated in the documentation. I couldn't find anything along these lines, but I of course understand that a general minimization algorithm would be hard to implement. – David Zwicker Aug 04 '15 at 18:24
  • "Obviously, the answer should have been {0, {a -> 0}}" cannot be True with the constraint given as a > 0 which precludes a == 0. Although, even correcting the constraint does not resolve the basic issue. – Bob Hanlon Aug 04 '15 at 19:25
  • Thank you Bob! I played around with different constraints and the one mentioned in the question is obviously wrong. I corrected the question. – David Zwicker Aug 04 '15 at 20:24

1 Answers1

2

How about approaching the minization using derivatives?

Solve[D[a^2*Exp[-b^2], a] == 0, a]
{{a -> 0}}
bill s
  • 68,936
  • 4
  • 101
  • 191
  • 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. – David Zwicker Aug 04 '15 at 17:53