# Plotting Minimize output for a range of constraint values

I want to plot the minimum of a function returned by Minimize over a range of constraint values.

Plot[Minimize[{2*Exp[-x] + 0.5*Exp[-y], x >= 0, y >= 0, x + y == z}, {x, y}], {z, 4, 20}]


This is the command I used: for a range of $z$, I wan to plot the minimum of this optimisation program. However I get no graph, though I get values for the Minimize command in isolation. How do I use plot appropriately here?

Here are the $x$ and $y$ values that minimize your function:

mydata = Table[
{x, y} /.
Minimize[{2*Exp[-x] + 0.5*Exp[-y], x >= 0, y >= 0, x + y == z}, {x,
y}][[2]], {z, 0, 3, .1}];


Here are the actual minima values of your function for the minimizing values of $x$ and $y$:

myminima = 2*Exp[-#[[1]]] + 0.5*Exp[-#[[2]]] & /@ mydata;


Here are the simple $z$ values in a range:

myzvalues = Table[z, {z, 0, 3, .1}]


Here is a plot of the minimum of your function for various values of $z$:

 ListPlot[Transpose[{myzvalues, myminima}]]


• Thanks. No I want to plot the min value of the program as a function of $z$. It is $F(z)$ v $z$, where $F(z)$ is the value of the objective function at the $(x,y)$ that your table provides. – Bravo Apr 30 '15 at 15:14
• What [2] means in mydata? – Dinesh Shankar Sep 21 '19 at 18:14
• The second (realistic) of the two solutions. – David G. Stork Sep 21 '19 at 19:33