Thank you so much!
the code can run smoothly
however what if I want the numbers in matrix a and s to be random decimals from 0 to 1, now the numbers in matrix a are the same number, and I want them to be four different decimals,what should i do?
yeah i know this function
but what should i write in the code?a and s is the decision variable I defined(
variable a(2,2) nonnegative
variable s(2,2) nonnegative )
do I need to add some restrictions?
i add the
0 <= a <= 1
0 <= s <= 1
however there are only four identical elements in the matrix,i want them be the different
thank you so much!
a and s are 2 by 2 matrix decision variables. There is nothing random about them. You want all elements of each matrix to be different? That is non-convex. So you will need to implement Big M logic constraints and decide on a tolerance for what constitutes “different” - search at https://or.stackexchange.com/ and seek further help there if necessary.
I have the same problem,please help me .here is my code
maximize sum( R_min_allo);
In order to be a convex optimization problem, it needs to be jointly convex in all the optimization variables, which in your case are the elements of beta.
Let’s look at a simplex example: minimize sin(x)^2 with respect to x. That is not a convex optimization problem. Your claim is analogous to defining y = sin(x), and stating your problem is minimize y^2 , which is convex with respect to y. But it is not convex with respect to the optimization variable x.
Indeed, your rationale, were it valid, would enable convexification of any optimization problem. Have a non-convex objective? No problem, just define y = objective function, and voila it is convex with respect to y. Similarly with constraints. (Every optimization problem could even be made into a Linear Programming problem by that rationale.) That is of course nonsense. Expressions in CVX are just a shorthand way of making complicated formulas more understandable by writing them with placeholders (expressions) which hide.some of the complexity - they don’t change the inherent convexirty, or not, of anything.