% = fmincon(FUN,X0,A,B,Aeq,Beq,LB,UB,NONLCON,OPTIONS) Matlab fmincon % create file nlcon.m for nonlinear constraints Here is a comparison of fmincon and gekko on the same problem (Hock Schittkowski #71). One alternative is to try using a modeling platform such as pyomo or gekko to provide the derivatives. From the comments, it sounds like one of the issues is that the Hessian or Jacobian is not correct in cyipopt. There are several high-quality nonlinear programming solvers in Python. Are there any other Python packages that come close to the performance of fmincon()? Both of these optimizers are also much slower than fmincon(). trust-constr doesn't perform as well and in particular might be struggling with parameter scaling (variables with smaller values are far away from the optimal value), while cyipopt doesn't converge at all. So far I've attempted to use trust-constr algorithm in and cyipopt but neither of these have worked. (Other available algorithms: 'active-set', 'sqp', 'sqp-legacy', 'trust-region-reflective') Options used by current Algorithm ('interior-point'): For reference, the Matlab code passes the following options to fmincon(): fmincon options: I've verified that the Python code is correct by calling the Python hessian/jacobian function from fmincon() and making sure that the same solution is reached. The Matlab code has analytic solutions for both the objective and constraint hessian and jacobian, which I've rewritten entirely in Python. There already exists a Matlab implementation of this script, so I'm essentially just trying to find a Python solver that has equivalent performance to Matlab's fmincon(). I'm currently trying to implement a Python script for solving a constrained nonlinear optimization problem with ~1000 variables and ~700 constraints (both linear and nonlinear).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |