# Can the following problems be solved using CVX?

problem: min A*(1+x+x^2)+By+Bz+C+Dz+2E+Ft

x、y、z、t are optimization variables.（x, y, z, t is a 100×4 optimization variable matrix）
A 、E is a known matrix of 100×40。B、C、D are a known matrix of 100×25. F is a known matrix of 100×25.

The first time I came into contact with CVX, I also read the rules of use of CVX, but I don’t
know if CVX can be used to achieve this optimization goal.

1 Like

First of all, the objective function has to evaluate to a scalar, which your does not. Until you address that, you can’t use any optimization tool.

As for your program, you define P as your only optimization variable, but then redefine as something else, and as yet something else, so your CVX problem has not optimization variables. You can only have one minimization statement per `cvx_begin ... cvx_end`. if you wish to solve several different problems, the `for ... end` should be outside, not inside, `cvx_begin ... cvx__end`.

I recommend you read the entire CVX Users’ Guide, and first try modifying and solving variants of the examples there.

1 Like

1. I would like to ask you if the scalar in the objective function means that the matrices of ABCDEF should have the same dimension?
2. Regarding P should be an optimization variable matrix, I learned that when running CVX, it is necessary to set the initial value of the optimization variable, maybe I should assign it first in cvx begin…cvx end.
1 Like

5 is a scalar. [5 1;2 3] is not a scalar.

In CVX you never set the initial value of a variable,

1 Like

Thank you very much for your answer, I understand what you said. It’s true that my objective function does not have a scalar, so I can’t solve it with the CVX toolbox

1 Like

You really can’t solve it with anything. You need to formulate something which can be optimized.

1 Like

Is it wrong to simplify the optimization goal? I refer to this article Task Allocation Optimization Scheme Based on Queuing Theory for Mobile Edge Computing in 5G Heterogeneous Networks, I may be caught in an infinite loop of thinking

1 Like

I think you need to lean some basics of optimization, such as what is an objective function. This forum is not the place to acquire such basic knowledge.

1 Like

Thank you very much for your answer, I have learned a lot from it, I will calm down and study hard, I hope I can solve this difficulty one day, sorry to bother you

1 Like

Sorry to bother you again, I re-simplified the optimization goal yesterday, and found that my optimization goal is in the form of a matrix (optimization variable matrix N*4)*row vector (known), so I still can’t use it Convex optimization solution, please. If not, can other algorithms be used to solve it? I’ve never seen anyone more stupid than me.

1 Like

`Objective function` is the expression inside maximize() or minimize(), it should be evaluated to scalar value rather than a vector or matrix, since you can’t compare between vectors and matrixs, let alone minimize. But `variables` can be vector or matrix.

1 Like

Thank you very much for your answer, I understand, I suddenly found that I fell into the misunderstanding of my thinking, and now I have come to it. 1 Like