Simulating an optimization problem

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.

Now I want to simulate this problem. I can create a random array for $w$ and $b$, and then assign values to each $w_k$, $b_k$ using below code:

SeedRandom[42];
Array[(x[#] = RandomReal[1]) &, 10];
Definition @ x


But then how can I write the $\textbf{Nminimize}$ command so that it optimizes for all 10 equations? My question is, do I have to write all the equations? This is important because if I want to simulate with 100 constraints then it is not possible to write all the constraints. Is there any smart way in Mathematica to do this?

w = RandomReal[{0, 1}, 10];

• @dont_give_up Please evaluate Thread[a < rr < b, 2*rr < 3] on your front end and look at the result. Then evaluate Thread[2*rr < 3].Then search the docs for Join[ ]:D Commented Aug 21, 2015 at 4:50
• I could not understand the use of Join[ ]. My question is: what if I have some other constraints? For the above problem there was only one but how should I add another if there were another constraints. thanks for replying. really appreciate your help. Commented Aug 22, 2015 at 0:23