Initial coding of objective function + docs for scipy.optimize