Building a good penalizing function

97 Views Asked by At

Currently I'm working with the following penalizing function: $$ \psi(x) = \left\{ \begin{array}{lr} 0 & : x < 0 \\ \frac{1}{1+e^{\frac{1}{x-1}+\frac{1}{x}}} = \frac{g(x)}{g(x)+g(1-x)} & : x \in [0,1]\\ 1 & : x >1 \end{array} \right. $$

with $\displaystyle g(x)=e^{-\frac{1}{x}}$. The $\psi$ function has the following form: enter image description here

and it is useful because I can control the maximal penalization, and how fast it penalizes with parameters $\alpha$ and $\beta$: $\alpha \ \psi(\beta x)$. Aditionally, values under $0$ should not be penalized (problem specification).

However I also need the derivatives, and they are 'ugly' (second derivative expression is to big to put it down) and hard to evaluate numerically: $$ \psi'(x) = \frac{4 (x-1) x+2}{4 (x-1)^2 x^2 \left(\cosh \left(\frac{1}{x}+\frac{1}{x-1}\right)+1\right)} \ \ \ \ x \in [0,1] \\ $$

So, my question is if there is a simpler function which has the same properties, but with more manageable derivatives.