A pow_pos function problem

Dear Friends

I would like to apply the penalty method to design my algorithm by cvx. The constraints here are
norm(v(n))==1, which v is a complex vector and n=1,…,N is the number of elements. Therefore the penalty term should be p*||norm(v(n))-1)||^2, p is the penalty factor and it could be added to the objective function. However, there will be the case that norm(v(n))-1<=0 during the iterations. And the cvx function pow_pos cannot solve it because when norm(v(n))-1<=0, the pow_pos(norm(v(n))-1,2) will return 0 directly, which cannot realize the purpose of the penalty. Could you please offer me some help dealing with this issue? Thank you very much!

Kind Regards

Its not convex. see a special case (|x|-1)^2. this is not convex for the whole real domain of x, x is a scalar.

You can “move” a convex constraint the objective via penalty term, and have the objective remain convex. But when you try to move a non-convex constraint to the objective via penalty term, the objective will become non-convex. @jackfsuia pointed out the non-convexity, hence your dilemma.