# How to express and solve this minimization problem in Mathematica?

Let $T>0$, $H>0$, $D$, and $No>0$ are known parameter.

Let $\{p_1,p_2,\cdots, p_T\}$ are the optimization variables.

Let $\{w_1,w_2,\cdots, w_T\}$ are known parameters.

Now, I want to perform the following optimization

minimize $\sum_{t=1}^Tp_t$

subject to $\sum_{t=1}^Tw_t\log_2\left(1+\frac{Hp_t}{w_t No}\right)=Do$

I want to express $P_t$ as a function of other parameters.

I want to do it as follows

W = Array[w, T];
P = Array[p, T];

Expr = Total[W Log2[1 + H P/(W No)]];

Assuming[H > 0 && No > 0 && T > 0 && Do > 0, Simplify[Minimize[{Total[P], Expr == Do}, P]]]


How to denote $W$ and $P$ so that I can perform the optimization and express $P_t$ as a function of other system parameters?

• N and D are already defined in Mathematica, you shouldn't use them for variables. More constructively, if you put in your known values for H, N, T, D, and the w_i, the minimisation you've written should work. – AnotherShruggingPhysicist Oct 13 '17 at 9:14
• @AnotherShruggingPhysicist, Thank you very much. But I need to express $p_t$ in a symbolic form. – George Farnandez Oct 13 '17 at 9:31
• Since this is a frequent issue: Do you just want $p_t$ in symbolic form or do you really need it in symbolic form? – Henrik Schumacher Oct 13 '17 at 17:13
• @HenrikSchumacher, I really need it in symbolic form. Can you help me out? – George Farnandez Oct 16 '17 at 2:45

If you are really interested in a symbolic solution, I would propose to investigate the KKT-conditions for this optimization problem. Here a quick script that generates them for $T=5$ variables. (\[Lambda] is a Lagrange multiplier.)

Off[Part::partd]
T = 5;
W = Table[w[[i]], {i, 1, T}];
P = Table[p[[i]], {i, 1, T}];
F = P \[Function] Evaluate[Total[P]];
DF = P \[Function] Evaluate[D[F[P], {P, 1}]];
G = p \[Function] Evaluate[Total[W + Log[1 + c P/W]]];
DG = p \[Function] Evaluate[D[G[P], {P, 1}]];
eq = Join[DF[P] + \[Lambda] DG[P], {G[P] - c0}]; These can be simplified a bit; moreover, I eleminated \[Lambda]:

eq2 = Join[Table[w[[i]] + c p[[i]] + c \[Lambda], {i, 1, T}], eq[[{-1}]]];
lambdasol = Solve[Total[eq2[[1 ;; T]]] == 0, \[Lambda]][];
p1sol = Solve[eq2[[-1]] == 0, p[]][] /. ConditionalExpression[bla_, blubb_] :> bla;
eq3 = T eq2[[1 ;; T-1]] /. lambdasol /. p1sol // Expand; Multiplying everything by with the nasty denominator would produce T-1 polynomial equations of order T in the T-1variables p[],...,p[[T]]. Good luck with solving them!