reimplemented optimization problem in R w/ IPOPT