Hi,

Sir, I want to write D-sqrt(x^2-A^2) in cvx. Could you please help me writing it in cvx.

Thanks

Hi,

Sir, I want to write D-sqrt(x^2-A^2) in cvx. Could you please help me writing it in cvx.

Thanks

How does that appear in the model? In the objective? In a constraint? And what is constants and what is variables?

Thanks for reply.

It appears in objective function x is optimization variable. In the domain of my interest its 2nd derivative is positive. My problem is just to make it compatible with cvx and ‘a’ is constant.

Something like:

\begin{array}[lc]
\mbox{min} & D -t \\
st. &(x+a)(x-a) \geq t^2 \\
& x-a \geq 0 \\
\end{array}

should do it.

The two constraints can expressed using a rotated quadratic cone.

Note we are actually saying

|t| \leq (x+a)^{0.5} (x-a)^{0.5}

so t has to be less than the geometric average of (x+a) and (x-a).

1 Like

Thanks for your prompt reply. I am just curious if this function appear in constraint then how would we right it.