Let me define $p : \mathbb{R}^n \to \mathbb{R}$ as a penalty function for the feasible set $\mathcal F$ of an equality and inequality constrained problem $(P)$
$$(P) : \text{min}\space f(x) \space \text{subject to}\space h(x) = 0 , g(x)\leq 0$$ Where $h(x):= (h_1(x), ..., h_m(x)), g(x):=(g_1(x),...,g_r(x))$
IF it holds that $p(x) = 0 \space \forall \space x \in \mathcal F$ and $p(x) > 0 \space \forall \space x \notin \mathcal F$
So for the following functions:
$q_1(x) : = \sum_{i=1}^m (h_i(x))^k + \sum_{j=1}^r g_j^+(x)$, with $k \in \mathbb{N}$ an odd number
$q_2(x): = \sum_{i=1}^m \text{exp}h_i(x) + \sum_{j=1}^r \exp g_j^+(x)$
$q_3(x): = \sum_{i=1}^m \ln ((h_i(x))^2+1) + \sum_{j=1}^r(g_j^+(x))^3 $
Can I double check that in fact:
$q_1(x) \text{is not a penalty function}$, (take $h<0$ and then $q<0$)
$q_2(x) $ is not either (at $h=0, q_2 >0$)
$q_3(x) $ is a penalty function.
We can modify $q_1(x)$ to being a penalty function if we take $k \in \mathbb{N}$ is an even number.
I can't think of a way to modify $q_2$ to change it into a penalty function. Any ideas?