1
$\begingroup$

I am very new to Mathematica. I need to formulate and solve this optimization problem in Mathematica.

$$\min \sum_{t\in\mathcal{T}}p_t$$

s.t. $$\text{c1: }~~~~\sum_{t\in \mathcal{T}}w_t\log_2\left(1+\frac{h}{w_tn_0}p_t\right)\le \min (TR, D/\alpha)$$

$$\text{c2: }~~~~p_t\ge 0$$

Here,

The left side of c1 is the total resources assigned and the right side is the desired amount of resources.

$\alpha$ is the price per unit of resources and $D$ is the maximum amount that can be afforded.

My requirement is: if $D$ is large enough, then c1 is satisfied. If the maximum affordable amount $D$ is not large enough to buy the desired amount of resources, then the user receives according to the amount it can afford.

I am not sure whether my formulation is CORRECT or not.

Here, $p_t$ are the optimization variables.

$\alpha$, $h$, $T$, $R$, $D$, $w_t$, and $\eta_0$ are real and positive. $\mathcal{T}$ is index set with $T$ elements, i.e., $\mathcal{T}=\{1,2,\cdots, T\}$.

Therefore, the right side of c1 is a constant.

Some one please help me to formulate this in Mathematica.

$\endgroup$
  • $\begingroup$ "the paper" - then, can you provide a link to this paper? $\endgroup$ – J. M. will be back soon Aug 31 '17 at 6:51
  • $\begingroup$ @J.M., Link provided... $\endgroup$ – George Farnandez Aug 31 '17 at 6:59
  • 2
    $\begingroup$ Perhaps I'm misunderstanding the problem; but is the option $p_t=0\forall t$ not permitted? It seems to satisfy all the constraints (except possibly the last one)? $\endgroup$ – AnotherShruggingPhysicist Aug 31 '17 at 12:25
  • $\begingroup$ I think you have to provide some code sample and explain what part of it doesn't work for you, in order to get help. Please note that my answer is fairly straightforward on how to produce the inputs required by optimization methods available in Mathematica. As far as your formulation is concerned, I don't know the exact nature of the problem, but I think that from the way you describe it, you are not solving the same problem you probably think you are. Please take this with a grain of salt, but when your $c_1$ binds, it has been already decided if $TR>D/a$ or not by Min. $\endgroup$ – user42582 Sep 4 '17 at 7:19
2
$\begingroup$

The following lines produce the required input for the problem at hand for most (if not all) optimization routines in Mathematica.

prep[a_, T_, h_, R_, Dd_, n0_] := Module[{ps, ws, expr},
  ps = Table[ToExpression[StringJoin["p", ToString[i]]], {i, 1, T}];
  ws = Table[ToExpression[StringJoin["w", ToString[i]]], {i, 1, T}];
  expr = Total[ws Log2[1 + h/(ws n0) ps]];
  {Total[ps], Flatten[{expr <= T R, a expr <= Dd, Thread[ps >= 0]}],ps}
 ]

also

{obj, constrs, vars} = prep[a, T, h, R, Dd, n0]

recovers the objective function (obj) to optimize (minimize in the current case), the constraints (constrs) and the variables (vars).

Please note that in the current form, the objective function and the constraints contain parameters $w_j$. It is not clear from the question if they should be treated as variables or free parameters (current state).

$\endgroup$
  • $\begingroup$ Thanks for your answer. Please have a look at my edit. How can I express p_t in terms of other parameters? $\endgroup$ – George Farnandez Sep 4 '17 at 1:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.