# Minimizing a function which involves Maximize [duplicate]

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;

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


Mathematica can't execute the code above.

## marked as duplicate by Szabolcs, Dr. belisarius, m_goldberg, bbgodfrey, Simon WoodsApr 10 '15 at 21:08

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

f = c^3/(2 a (k t)^3) Sqrt[(π u v w)/(2 b)]

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