# Some practical problems about CVX

I applied CVX to solve some academic research problems. There were some errors in the CVX program I wrote. I hope I can get your help

## Cones | Errors | Mov/Act | Centering Exp cone Poly cone | Status --------±--------------------------------±-------- 1/ 1 | 5.957e+00 8.600e+00 0.000e+00 | Failed 1/ 1 | 3.712e-01 1.166e-02 0.000e+00 | Solved 1/ 1 | 5.631e-02 2.602e-04 0.000e+00 | Solved 1/ 1 | 7.236e-03 4.256e-06 0.000e+00 | Solved 1/ 1 | 9.074e-04 3.453e-08 0.000e+00 | Solved 0/ 0 | 1.133e-04 0.000e+00 0.000e+00 | Solved

Status: Solved
Optimal value (cvx_optval): -776.199

## The following is a very good CVX example Calling SDPT3 4.0: 17 variables, 9 equality constraints For improved efficiency, SDPT3 is solving the dual problem.

num. of constraints = 9
dim. of socp var = 17, num. of socp blk = 1

SDPT3: Infeasible path-following algorithms

## number of iterations = 6 primal objective value = -2.00379086e+00 dual objective value = -2.00379085e+00 gap := trace(XZ) = 1.43e-09 relative gap = 2.85e-10 actual relative gap = -2.12e-09 rel. primal infeas (scaled problem) = 2.67e-12 rel. dual " " " = 2.66e-09 rel. primal infeas (unscaled problem) = 0.00e+00 rel. dual " " " = 0.00e+00 norm(X), norm(y), norm(Z) = 1.4e+00, 2.6e+00, 2.8e+00 norm(A), norm(b), norm© = 1.2e+01, 2.0e+00, 4.5e+00 Total CPU time (secs) = 0.09 CPU time per iteration = 0.02 termination code = 0 DIMACS: 2.7e-12 0.0e+00 4.7e-09 0.0e+00 -2.1e-09 2.8e-10

Status: Solved
Optimal value (cvx_optval): +2.00379

Obviously, the two results are a little different. My is not quite correct. Why? If you need, I can provide you with my source program.

You show two different outputs, but the forum readers have no idea what the relation between the tow problems is.

Well, the first result is the output of my own research object, and I don’t know right or wrong. The second result is the answer to a correct convex optimization reference example on the network. Through the comparison between my object and the correct example, I found my own mistakes. I hope I can get some answers from you.

The forum readers are not subject matter experts in your research area. We have no idea what you are trying to do or whether your model is suited for whatever your purposes are.

If you want help, you will have to be much more specific in your questions, and as relates to CVX syntax and usage, not electrical engineering modeling.

Ok，This is my complete code. I want to see how PBAT and PFC allocate power at the same time. I have given the constraint conditions and objective functions, but the results are very poor. Where are the main problems?

OK，Then I want to know what may cause these two output results? Why do my results look rare?

I have no idea what you are talking about.

Sorry for my limited expression ability. I found that the first result and the second result are different in text structure. The correct output result should be “calling sdpt3 4.0: 17 variables, 9 equality constraints
For improved efficiency, SDPT3 is solving the dual problem.”
However, my output result is "for improved efficiency, sdpt3 is solving the dual problem
Sdpt3 will be called severe times to refine the solution?

If you can’t give an answer, I will continue to study whether the programming language contains logic errors. I hope the next communication can give me great inspiration.

The first of the two outputs corresponds to CVX"s Successive Approximation method, which was used because there were CVX expressions in the exp and log family in the program. The second output must correspond to a program which didn’t have such CVX expressions.

thanks very much ，Mark