Constraint violation

Dear Mark, I’ve got exactly the error you seen.I want to attach the formulation in pdf, but don’t know how?

Illegal operation: {concave} .^ {2}
(Consider POW_P, POW_POS, or POW_ABS instead.)

Error in ==> cvx.power at 55
z = pow_cvx( x, y, ‘power’ );

Error in ==> new at 122
c_5_b(t)=(b_5(t)(-eta_5_2)b_5(t))+(b_5(t)(-eta_5_2)b_5(t))+eta_5_3(min((b_5(t)-eta_5_4B_5_max),0)).^2;

Do you know what the sign of the “thing” you are squaring is? Look up POW_P, POW_POS, or POW_ABS in the CVX User’s Guide and see if you can satisfy their requirements while still correctly modeling your situation.

thanks a lot, your comment was so helpful. Now there is a problem that I couldn’t solve it. I have b_5 as a 24 by 1 matrix bounded with (-0.25,0.25). for t=1:24, I get a " not a square" error in this expression:" eta2(t)=eta*b_5(t-)*b_5(t+1) " where eta is a positive constant. What should I do?

This is not in your code above. You have a typo at least in your comment:eta2(t)=etab_5(t-)b_5(t+1) missing something after t- .Please edit a previous post (add it to the end of the post), with the complete code in which your problem occurs, and include the exact output/error messages from CVX.

Maryam, with all due respect, you seem not to be familiar with the DCP ruleset. All of your expressions and sub-expressions must satisfy these rules, or CVX cannot solve the model—even if it is convex.

These rules are a fundamental and critical part of the design of CVX. They cannot be ignored or worked around in any way. I am going to hazard a guess that your problem is still not convex; and even if it is, you have a lot of rewriting to do for CVX to accept it.