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

This is the result of my program
Successive approximation method to be employed.
For improved efficiency, SDPT3 is solving the dual problem.
SDPT3 will be called several times to refine the solution.
Original size: 13 variables, 4 equality constraints
1 exponentials add 8 variables, 5 equality constraints

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

version predcorr gam expon scale_data
NT 1 0.000 1 0
it pstep dstep pinfeas dinfeas gap prim-obj dual-obj cputime

0|0.000|0.000|1.6e+00|1.4e+00|2.1e+01| 0.000000e+00 0.000000e+00| 0:0:00| chol 1 1
1|1.000|1.000|2.8e-06|2.2e-02|2.2e+00|-1.541481e+00 -3.662905e+00| 0:0:00| chol 1 1
2|1.000|0.959|5.1e-08|3.0e-03|7.4e-02|-1.961811e+00 -2.021858e+00| 0:0:00| chol 1 1
3|0.988|0.988|1.2e-08|2.6e-04|9.0e-04|-2.003281e+00 -2.003023e+00| 0:0:00| chol 1 1
4|0.989|0.989|1.0e-08|2.5e-05|9.9e-06|-2.003785e+00 -2.003684e+00| 0:0:00| chol 1 1
5|0.990|0.990|1.8e-10|2.6e-07|1.2e-07|-2.003791e+00 -2.003790e+00| 0:0:00| chol 1 1
6|0.990|0.990|2.7e-12|2.7e-09|1.4e-09|-2.003791e+00 -2.003791e+00| 0:0:00|
stop: max(relative gap, infeasibilities) < 1.49e-08

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.

For additional explanation, see
CVXQUAD: How to use CVXQUAD's Pade Approximant instead of CVX's unreliable Successive Approximation for GP mode, log, exp, entr, rel_entr, kl_div, log_det, det_rootn, exponential cone. CVXQUAD's Quantum (Matrix) Entropy & Matrix Log related functions

thanks very much ,Mark