COBYQA
Constrained Optimization BY Quadratic Approximations, also known as COBYQA, is a gradient-free optimization algorithm developed to improve upon the COBYLA algorithm. COBYQA employs a derivative-free, trust-region SQP approach, utilizing quadratic models derived from underdetermined interpolation. Unlike COBYLA, COBYQA also supports equality constraints and can handle general nonlinear optimization problems.
Note
For better efficiency, we recommend using general nonlinear programming algorithms such as PySLSQP or IPOPT, if first order derivative information is available for the objective and constraints of your problem.
Before using the COBYQA solver in modOpt, ensure that you
have the cobyqa optimizer installed.
Warning
cobyqa is available with scipy>=1.14.0 which requires python>=3.10.0.
If your machine does not satisfy these requirements, install the ‘cobyqa’
package by running pip install cobyqa.
To use the COBYQA solver in modOpt, start by importing it as shown in the following code:
from modopt import COBYQA
Options could be set by just passing them within the solver_options dictionary when
instantiating the COBYQA optimizer object.
For example, we can set the maximum number of function evaluations maxfev
and the tolerance on the maximum constraint violation feasibility_tol as shown below.
optimizer = COBYQA(prob, solver_options={'maxiter':1000, 'feasibility_tol':1e-6})
The options available for the COBYQA solver in modOpt are given in the following table.
For more information on the COBYQA algorithm and for advanced options, visit
COBYQA documentation.
Option |
Type (default value) |
Description |
|---|---|---|
|
int ( |
Maximum number of function evaluations. |
|
int ( |
Maximum number of iterations. |
|
float( |
Target value for the objective function. |
|
float ( |
Tolerance on the maximum constraint violation. |
|
float ( |
Initial trust region radius. |
|
float ( |
Final trust region radius. |
|
int ( |
Number of interpolation points used to build the quadratic model |
|
bool ( |
Set to |
|
int ( |
Maximum number of points in the filter. |
|
bool ( |
Set to |
|
int ( |
Maximum number of function evaluations to store in the history. |
|
bool ( |
Set to |
|
bool ( |
Set to |
|
callable ( |
Function to be called after each iteration. The function is |