I don’t know what you are really trying to do, and whether that is convex. Therefore, I don’t know whether it can be written in a form which CVX will accept… Nevertheless, I will mark is as non-convex until such time as you show a convex model formulation.
Your code has some strange things, including:
The objective function evaluates to s scalar (it does not involve any CVX variables o expressions); therefore, your problem in effect has no objective function, i.e., is a feasibility problem.
The constraints inside the for loop do not involve the for loop index, i, . Therefore, the exact same constraints are repeated each time through the loop, i.e., 101 times. Obviously, this is not what you want to do.
Thanks so much for an respond.
I recognized I have not understood CVX.
I read CXV’s DCP rules.as you say,
The problem I am trying to reproduce is the example of a relatively optimal control(https://ieeexplore.ieee.org/document/4177469).
This is convex optimization, so I think this problem can solved using CVX.(but I couldn’t…)
In this problem, should I use other methods insted of CVX?
I think you will need to extract the model out of that paper, to which I do not have access.
Per Why isn’t CVX accepting my model? READ THIS FIRST! , your first obligation is to formulate a convex optimization problem and show that it is convex. Citing a convexity claim in a paper is not sufficient, because you may either be losing critical context, or the paer’s claim cold be wrong - that happens a lot.
If it is convex, it may or may not be possible to enter or reformulate for entry into CVX. If you present the model and convexirty proof, readers on this forum can attempt to assist you in (re)formulating it for entry into CVX.
Have you studied convex optimization, or any optimization? If not, you are better off spending time and effort reading and solving exercises in a book such as “Convex Optimization”, Boyd and Vandenberghe http://web.stanford.edu/~boyd/cvxbook/ rather than starting off trying to implement a model in a journal article.