Matlab: Optimization problem with objective function and constraints involving summation

292 Views Asked by At

I am trying to solve the following constrained nonlinear optimization problem using fmincon function in Matlab. I am finding it difficult to implement the objective function and constraints in Matlab as these involve summation.

$$ \begin{align} \max_{v_{mn}y_{mn}} & K \sum\limits^{M}_{m=1}\sum\limits^N_{n=1} v_{mn}\mathbb{E}\left[\log_2(1+\dfrac{B_{mn}y_{mn}}{v_{mn}})\right]\\ \text{subject to:} &\sum\limits^{M}_{m=1}\sum\limits^N_{n=1} \mathbb{E}[y_{mn}] \leq W_{max},\\ &\sum\limits^M_{n=1} \sum\limits^N_{n=1} I_{n}\mathbb{E}[y_{mn}] \leq I_{\text{max}},\\ &\sum\limits^M_{m=1}v_{mn}\leq 1, \forall n\in N,\\ & y_{mn} \geq 0, \forall m\in M, n\in N,\\ &v_{mn}\geq 0,\forall m\in M, n\in N. \end{align} $$

I can simplify this problem by considering only one decision variable i.e. $y_{mn}$ and by dropping the expectation as under

$$ \begin{align} \max_{y_{mn}} & K \sum\limits^{M}_{m=1}\sum\limits^N_{n=1} v_{mn}\left[\log_2(1+\dfrac{B_{mn}y_{mn}}{v_{mn}})\right]\\ \text{subject to:} &\sum\limits^{M}_{m=1}\sum\limits^N_{n=1} y_{mn} \leq W_{max},\\ &\sum\limits^M_{n=1} \sum\limits^N_{n=1} I_{n}y_{mn} \leq I_{\text{max}},\\ % &\sum\limits^M_{m=1}v_{mn}\leq 1, \forall n\in N,\\ & y_{mn} \geq 0, \forall m\in M, n\in N. % &v_{mn}\geq 0,\forall m\in M, n\in N. \end{align} $$

To give a better view of the problem involved, typical values are $K=20000$, $M=3$, $N=10$ and each of $v_{mn}$, $B_{mn}$ and $y_{mn}$ are elements of matrices of size $M \times N$. These elements are fractions with values between 0 and 1. Typically, $W_{max}=1.5$ and ${I_{max}=5\times 10^{-10}}$. $I_n$ is a vector where each element is of the order of $10^{-11}$.

Now, I am trying to solve this using optimization function fmincon provided in Matlab with the format:

[x,fval,exitflag,output] = fmincon(fun,x0,A,b,Aeq,beq,lb,ub)

I think I can pass on the objective function, initial values of the decision variable and the constraints using the fun, x0, A, b and lb arguments of the above function. However, I am finding it difficult to do so as the objective function and the constraints involve summation. Can some one help to figure out the right way to do this in Matlab.

Thanks in advance.

A