0
$\begingroup$

I'm no expert on non linear optimization, so I have been having trouble finding a way to code the following problem

$$ \begin{aligned} & \underset{P_i}{\text{max}} & & \sum_{i=1}^n \big[ -BR_i \log(BR_i)-(1-BR_i) \log(1-BR_i)\big] \\ & \text{s.t.} & & BR_i = \hat{\alpha_i} P_i \\ \\ & & & K \leq \sum_{i=1}^{n} G(P_i) \leq L \\ & & & P_i\geq 0 \; \forall i \in N. \\ \\ & & & P_i\geq P_{i+1} \; \forall i \in N. \\ \end{aligned} $$

Okay so the problem is the function $G(X)$. What I want is that function $G$ to take $P_i$ and use it as a cutoff value, as the value of $P_i$ is used to separate each group $i$ into two groups of different size, and I want the sum of the sizes of those groups to be constrained by $L$ and $K$.

I'm not even sure this is a problem that can be solved in this way or if I should be using other tools, as I can't find a way to code this function anywhere.

I'm planning on solving it with Julia + JuMP (cbc solver).

Any help is greatly appreciated.

$\endgroup$
2
  • $\begingroup$ can $G$ be expressed with a formula? $\endgroup$
    – LinAlg
    Jun 29, 2018 at 16:49
  • $\begingroup$ yes, a a function by parts though. $\endgroup$ Jul 3, 2018 at 15:59

0

You must log in to answer this question.

Browse other questions tagged .