What if the objective and constraints are in the same function rather than separate ones? How do I pass parameters that are not design variables? What options are most useful? How do I post-process convergence data? **EDIT**: you should use xlast = np.copy(x). Without the copy you are only doing pointer assignment and the optimizer might change some of values of x (e.g., in a finite difference) which will then mess up xlast.