How to derive this augmented Lagrangian function? In elastic frictionless contact, the following inequality constrained problem should be solved,
$\underset{\varphi}{\text{min}} \, \Pi(\varphi) \; \text{subject to} \; g_N\geq 0 \; \text{on} \; \Gamma_c$
where $\Pi$ is the potential energy, $g_N$ is the gap between the contactor and the surface, $\varphi$ is the deformation mapping and $\Gamma_c$ is the surface boundary. 
Using the augmented Lagrangian method, the above inequality constrained problem is transformed to the following unconstrained saddle point problem
$\underset{\varphi}{\text{min}}\,\underset{\lambda_N}{\text{max}} \, \mathcal{L} (\varphi,\lambda_N)$
where $\lambda_N$ is the Lagrange multiplier and $\mathcal{L}$ is the augmented Lagrangian function defined as
$\mathcal{L} (\varphi,\lambda_N)= \Pi(\varphi)+\int_{\Gamma_c}l_N(g_N,\lambda_N) {\rm d} V$ 
with
$l_N(g_N,\lambda_N) = \begin{cases}
(\lambda_N+\displaystyle\frac{\varrho}{2}g_N)g_N, & \hat{\lambda}_N \leq 0 \quad \text{(contact),} \\ \displaystyle -\frac{1}{2\varrho} \lambda_N^2 & \hat{\lambda}_N >0 \quad \text{(sepration)}.
\end{cases}$ 
where $\hat{\lambda}_N=\lambda_N+\varrho \, g_N$.
I was wondering if anyone has experience in this field. Because I need to know how to derive the function $l_N$. I have gone through some books and have derived something similar but couldn't obtain the same. Does anyone know how to do this?
 A: I found the answer in Chapter 3 of the book "Constrained minimization and Lagrange multiplier methods" by Dimitri P. Bertsekas. 
Consider the following one-sided constrained minimization problem,
\begin{equation}
\min f(x) \quad \text{subject to} \quad \alpha_j < g_j(x), \qquad j=1,...,r
\end{equation}
The above problem is equivalent to the following problem,
\begin{equation}
\min f(x) \quad \text{subject to} \quad \alpha_j < g_j(x) - u_j, \qquad u_j=0,\quad j=1,...,r
\end{equation}
We consider a multiple method for the above minimization where only the constraints $u_j=0$ are eliminated by means of a quadratic penalty function, viz.
\begin{equation}
\min f(x) + \sum_{j=1}^r \{ \mu_j^k u_j + \frac{1}{2} c_k |u_j|^2 \} \qquad \text{subject to} \quad \alpha_j < g_j(x) -u_j \quad j=1,...,r
\end{equation}
The above minimization can be carried out first with respect to $u_j$ yielding the following equivalent problem 
\begin{equation}
\begin{gathered}
\min f(x) + \sum_{j=1}^r p_j[g_j(x),\mu_j^k,c^k] \qquad \text{subject to} \quad x\in R^n \\
\text{where} \quad p_j[g_j(x),\mu_j^k,c^k]=\min_{\alpha_j \leq g_j(x)-u_j} \{ \mu_j^k u_j + \frac{1}{2}c^k |u_j|^2 \}.
\end{gathered}
\end{equation}
Performing the above minimization with respect to $u_j$ we obtain the expression $u_j=-\mu_j^j/c^k$ for $u_j$. We only consider the upper limit for $u_j$, i.e.,
\begin{equation}
g_j(x)-u_j > \alpha_j \longrightarrow g_j(x)-\alpha_j > u_j,
\end{equation}
which means that $g_j(x)-\alpha_j \leq u_j$ hits the boundary of the admissible range. Thus
\begin{equation}
g_j(x)-\alpha_j \leq -\frac{\mu_j^k}{c^k} \longrightarrow \mu_j^k + c^k (g_j(x)-\alpha_j)\leq0 
\end{equation}
lies on the surface and outside the surface of admissible range and if the above equation  holds then $u_j$ must remain on its admissible surface value, i.e. $u_j \rightarrow g_j(x)-\alpha_j$. Consequently, the value of $u_j$ is calculated as
\begin{equation}
u_j=\begin{cases}
g_j(x)-\alpha_j & \text{if} \quad \mu_j^k + c^k (g_j(x)-\alpha_j)\leq0, \\ -\mu_j^k/c^k & \text{if otherwise}.
\end{cases}
\end{equation}
Substituting the value of $u_j$ into the expression of $p_j$, the augmented Lagrangian function is obtained as
\begin{equation}
p_j[g_j(x),\mu_j^k,c^k]=\begin{cases}
\mu_j^k (g_j(x)-\alpha_j) + \frac{1}{2} c |g_j(x)-\alpha_j|^2 & \text{if} \quad \mu_j^k + c^k (g_j(x) - \alpha_j)\leq0, \\
-\mu_j^{k,2}/2c^k & \text{if otherwise}.
\end{cases}
\end{equation}
In the elastic frictionless contact problem that is in the question, the terms appearing in the expression of $p_j$ are as following,
\begin{equation}
g_j(x)=g_N(x), \quad \mu_j^k=\lambda_j^k,\quad c^k=\varrho,\quad \alpha_j=0,
\end{equation}
which upon substituting in the expression of $p_j$ yields the following augmented Lagrangian function as,
\begin{equation}
p_j[g_j(x),\lambda_j^k]=\begin{cases}
(\lambda_j^k+\frac{\varrho}{2}g_N)g_N, & \text{if} \quad \lambda_j^k + \varrho g_N \leq 0, \\
-\lambda_j^{k,2}/2\varrho & \text{if otherwise}.
\end{cases}
\end{equation}
Note that the first condition in the above equation shows the contact state between the contactor and the target and the second condition shows the separation state between the contactor and the target.
