HELP! I need a help!

cvx_begin 
variable P(LenTr)
maximize (-sum((AErFa.*P')./Dis))
subject to
    sum(P)<=PMax;
    P(1)>=0;
    P(2)>=0;
    P(3)>=0;
    P(4)>=0;
    P(5)>=0;
    P(6)>=0;
    (sum(P.*AL')+sum(P.*BL'))<=PosAcc*(sum(P.*AL')*sum(P.*BL')-sum(P.*CL')^2);
cvx_end

The window tell me:
Disciplined convex programming error:
Invalid quadratic form(s): not a square.

where only P is variable, LenTr=6. AL, BL, CL are vectors in which each value is known.I know the domain is convex, but I can’t prove the convexity on both sides of the <= sign in the last constraint.Can someone help me?

That is quadratic only if the RHS of the last constraint is altogether a concave quadratic. Whether it is, depends on the values of PosAcc, AL, BL, CL Even if it is concave, you would have to formulate it in the form of P'*M*P, or quad_form(P,M) for a negative semidefinite matrix M.

Thank you for your reply. But I don’t understand why the right side of the last constraint should be represented as a quadratic form of the specification? Why can’t the last constraint be a normal nonlinear constraint?

Because CVX requires its DCP rules to be followed. Given that the RHS is quadratic, and the LHS is affine, the RHS must be a concave quadratic in order for the constraint to be convex. CVX requires a the quadratic (bilinear) terms of a concave quadratic to be expressed in one of the two equivalent forms I listed. Or you can move the quadratic to the LHS, in which case it must be convex.

You need to carefully read link I provided. And also read CVX Users’ Guide.