Numerical optimization: theory and algorithms