Re: How can I minimize it?
- To: mathgroup at smc.vnet.net
- Subject: [mg94738] Re: How can I minimize it?
- From: dh <dh at metrohm.com>
- Date: Mon, 22 Dec 2008 05:16:50 -0500 (EST)
- References: <gig3qh$2lq$1@smc.vnet.net>
Hi,
is your function given analytically and are you actually searching for a
Sattle point? If both question are answered with yes, you better solve
the equations D[f[x,y],x]==0, D[f[x,y],y]==0 than doing a lengthy
numerical proceedure.
If your really need to do a minimize of maximize numerically, you can
do this, but convergence is slow. Here is an example where you can watch
the slow convergence:
f[x_?NumericQ, y_?NumericQ] = (x^2 + y^2) + 2 Exp[-10 (x - .25)^2];
f1[y_?NumericQ] := (PrintTemporary[y];
NMaximize[{f[x, y], -.5 < x < .5}, x][[1]])
ContourPlot[f[x, y], {x, -1, 1}, {y, -1, 1}, ContourLabels -> True,
Contours -> 20]
NMinimize[{f1[y], -.5 < y < .5}, y, PrecisionGoal -> 2]
the answer is: {2.06579, {y -> -3.35259*10^-10}}
hope this helps, Daniel
amber wrote:
> There is a function f(x, y).
> I need to find the minimum among the maximum of fixed y.
> Namely:
> g(x, y) = max_{B1<=x<=B2} f(x,y)
> I need to get min_{A1<=y<=A2} g(x, y)
>
> But...
> g[x_,y_] := First[Maximize[{f[x,y], B1<=x<=B2},x]];
> Minimize[{g[x,y], A1<=y<=A2},y]
>
> It doesn't work. How can I do?
>
>
>
>