Express (||x-a||-b)^2 in cvx

Nonconvex
Sep 18, 2022
P

Hello.
I currenly have an onjective: (||x-a||-b)^2.
It is a fucntion of variable x and x is a vector.
Is there a way to express this function in cvx?
Thanks.

J

this is neither convex nor concave. see a special case (|x|-1)^2. so it can’t be done.

P
Replying to #2

What if I change ||x-a|| to sqrt( (x-a)^2+(y-c)^2 ). The expresion here becomes ( sqrt( (x-a)^2+(y-c)^2 ) -b )^2, which I think is a convex function w.r.t. x and y.
Thanks.

M

That’s doesn’t change the (non-convexity). It just adds yet another DCP violation.