Group Abstract Group Abstract

Message Boards Message Boards

0
|
123 Views
|
1 Reply
|
1 Total Like
View groups...
Share
Share this post:

How to set constraints for QuadraticOptimization

Posted 14 days ago

Hi, I am trying to minimize a function with 9 variables using - QuadraticOptimization[{q,c},{a,b}] Here q is a 9X9 matrix whereas c is a 9X1 matrix.

{q, c} part is working fine when I use {a, b} = {{}, {}}, which means there are no constraints over the values of 9 variables. I get the o/p in this case.

However, I want to put a constraint that these nine variables have only positive values. How to put this constrain in form of {a, b}. According to the definition of a and b, ({a, b} is equivalent to ax+b>= 0), I should have a =1 and b = 0 for each of the nine variables. So I tried {{1, 0}, {1, 0}, {1, 0}, {1, 0}, {1, 0}, {1, 0}, {1, 0}, {1, 0}, {1, 0}}. However it did not work.

Will appreciate any suggestions. Thanks

POSTED BY: S G

The ax term in ax+b>= 0 is matrix multiplication, not scalar. I would try

a = IdentityMatrix[9];
b = Table[0, 9];
a . Array[x, 9] + b
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard