I have programmed a conjugate gradient method for a nonlinear program that works just fine.
Now, I would like to include some restrictions and I have a few doubts.
For the available possibilities, I think barrier method is a good option since I want a derivable function.
The restriction is simple $x<1$, so I update my new cost function such as:
$$F(x)=F'(x) + \sum \left(-\frac{1}{x-1} \right)$$
This creates an asymptote at $x=1$. But, after $x=1$ it goes to zero again, so, who is stopping the method to go towards $x \gg 1$?
Also, the method penalizes values close to $1$ but smaller than $1$. How to avoid that? Could a limitation on the step size solve the problem?