I have a mathematical function:

$f = \frac{c^3}{2 a (k T)^3} \sqrt{\frac{\pi u v w}{2 b}} \exp \left[ - \frac{c}{k T} \sqrt{\frac{x^2+y^2}{a}+\frac{z^2}{b}} + \frac{1}{2} \left( \frac{x^2}{u} + \frac{y^2}{v} + \frac{z^2}{w} \right) \right]$

where k, T, a, b, c are constants.

fun[x_, y_, z_, k_, T_, a_, b_, c_, u_, v_, w_] := (
c^3 E^(-((c Sqrt[(x^2 + y^2)/a + z^2/b])/(k T)) + 
1/2 (x^2/u + y^2/v + z^2/w)) Sqrt[\[Pi]] Sqrt[u v w])/(
2 Sqrt[2] a Sqrt[b] k^3 T^3)
  1. I would like to find the maximum value of the function (lets call it m) when I put in the values of k, T, a, b, c, u, v and w.

  2. Then I would like to find the combination of u, v and w that will give the minimum value of m.

So I tried the following:

k = 1;
T = 0.1;
a = 1;
b = 1;
c = 1;

  fun[x, y, z, k, T, a, b, c, u, v, w],
  {x, y, z}
 {u, v, w}

Mathematica can't execute the code above.

  • 1
    $\begingroup$ See here and here and let us know if you need more help. $\endgroup$ – Szabolcs Apr 10 '15 at 16:40

I think your attempt is impossible:

f = c^3/(2 a (k t)^3) Sqrt[(π u v w)/(2 b)]
    Exp[-(c/(k t)) Sqrt[(x^2 + y^2)/a + z^2/b] + 1/2 (x^2/u + y^2/v + z^2/w)]
g = f/.{k -> 1, t -> 1/10, a -> 1, b -> 1, c -> 1}
(* 250 E^(1/2 (x^2/u + y^2/v + z^2/w - 
     20 Sqrt[x^2 + y^2 + z^2])) Sqrt[2 π] Sqrt[u v w] *)

The squares in the Exp will grow without bounds, so: There is no maximum.

  • 1
    $\begingroup$ @user29615 Your formula suggests that you're studying a spectrum (governed by Planck's Law) over an ellipse in three dimensions, but have your signs wrong. Please check the physics of your problem first, then carefully (re)craft your optimization problem. $\endgroup$ – David G. Stork Apr 10 '15 at 17:14

Not the answer you're looking for? Browse other questions tagged or ask your own question.