0

Suppose I have a LP problem, in which:

  • w is a constant column vector of dimension r

  • a is a constant column vector of dimension r

  • p is a constant column vector of dimension T

  • d is a matrix variable of dimensions (r,T)

I have to insert the following constraint in an LP problem:

constraint

I've been using R and CVXR for a short time, so I can't figure out how to insert that double summation. Would anyone know how to help me?

ThomasIsCoding
  • 96,636
  • 9
  • 24
  • 81
  • sorry, i forgot to define: WCb and L are constant scalars. – DAVIDE MANTOVANI Aug 12 '20 at 14:39
  • Hi welcome to Stack Overflow. You could consider adding the code you already have as a reporducible example.Also, you can edit your comment back into the original post. – Mark Neal Aug 13 '20 at 01:48
  • Yes. You can build up a list of constraints. But of course, you can also use matrix notation. Something like `tr(A^T * D)` where `A=p*v^T` and `v(j)=w(j)/a(j)`. – Erwin Kalvelagen Aug 18 '20 at 14:55

0 Answers0