I was hoping to get some help in modelling the following logic. I tried to solve it by "Big-M method" but failed. Thank you in advance!
$a(k,n)$ and $b(k,n)$ are known constants, $\lambda$ and $\mu_k$ are variables used for optimization, and such logic is used at a gp model.
My original logic is as follows: if $a_{k,n}-b_{k,n}\ge\dfrac{\lambda}{\mu_k}$
(To ensure that the following expression has a real number solution)
$$p_{k,n} = \frac{1}{2}\left[\sqrt{\left(\frac1{a_{k,n}}-\frac1{b_{k,n}}\right)^2+\frac{4\mu_k}{\lambda}\left(\frac1{b_{k,n}}-\frac1{a_{k,n}}\right)}-\left(\frac1{a_{k,n}}+\frac1{b_{k,n}}\right)\right]$$
else $p_{k,n} = 0$.
I first tried to avoid the condition $a_{k,n}-b_{k,n} \ge \frac{\lambda}{\mu_k}$ by changing to the following constraints:
\begin{align}\text{tmp1} &= \left[\left(\frac1{a_{k,n}}-\frac1{b_{k,n}}\right)^2+\frac{4\mu_k}{\lambda}\left(\frac1{b_{k,n}}-\frac1{a_{k,n}}\right)\right]^+\\\text{tmp2}&=\sqrt{\text{tmp1}}-\left(\frac1{a_{k,n}}+\frac1{b_{k,n}}\right)\\p_{k,n}&=\frac{1}{2}[\text{tmp2}]^+\end{align}
where $[x]^+=\max\{0,x\}$, but got the following error
Disciplined convex programming error:
Cannot perform the operation max({constant},{concave})
due to \begin{align}\text{tmp1} &= \left[\left(\frac1{a_{k,n}}-\frac1{b_{k,n}}\right)^2+\frac{4\mu_k}{\lambda}\left(\frac1{b_{k,n}}-\frac1{a_{k,n}}\right)\right]^+\\&=\max\left\{0,\left(\frac1{a_{k,n}}-\frac1{b_{k,n}}\right)^2+\frac{4\mu_k}{\lambda}\left(\frac1{b_{k,n}}-\frac1{a_{k,n}}\right)\right\}\end{align}
Now I feel that the if-then-else constraint may be converted in a big-M way, but I don't know how to express it; but maybe this intuition is wrong.