Plotting a convex optimization problem

194 Views Asked by At

I have an optimization problem like below:

$\text{minimize } - \sum_k w_k \log r_k$

$ a \leq r_k \leq b_k, k = 1, \cdots, 10$

Here, $w $ and $b$ is a set of constant: $w = [w_1, \cdots, w_{10}]$ and $b = [b_1, \cdots, b_{10}]$. Also $a$ is a constant too.

I can create a random array for $w$ and $b$, and then assign values to each $w_k$, $b_k$ and then simulate the problem to get the minimized result.

But my concern is to see the problem graphically. What is the best way to plot the graph of the objective function along with constraints? Any help or guidance is highly appreciated.

1

There are 1 best solutions below

0
On BEST ANSWER

Let $s_k = \log r_k$. Your problem is equivalent to $$\text{minimize} - \sum_k w_k s_k$$ subject to $$\log a \leq s_k \leq \log b_k$$ The optimal solution is easy to obtain, if $w_k$ is positive, you should take $s_k = \log b_k$. Otherwise you should take $s_k = \log a$.

Your plot really depends on what you want to show or illustrate. Here we see that the objective function dependence is linear on $w_k$ and logarithmic on $b_k$. If you want to show that, pick $b_k$'s and $w_k$'s of different order of magnitude and plot the value of the objective function as a function of the order of magnitude. Vary each order of magnitude separately and make 2 graphs.

If you want to show what the optimal solution is, make a plot with 10 parts. In each part, show the value of $a$, the value of $r_k$, the value of $b_k$ and whether $w_k$ is positive or negative. Just one example is enough to show how it behaves.