Optimization by Penalty Function