COBYLA
Constrained Optimization BY Linear Approximation, also known as COBYLA, is a gradient-free optimization algorithm. This solver uses the ‘COBYLA’ algorithm from the Scipy library.
Note
COBYLA cannot solve problems with equality constraints.
Please use other gradient-free algorithms such as COBYQA
if your problem has equality constraints.
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.
To use the COBYLA solver, start by importing it as shown in the following code:
from modopt import COBYLA
Options could be set by just passing them within the solver_options dictionary when
instantiating the COBYLA optimizer object.
For example, we can set the maximum number of iterations maxiter
and the absolute tolerance for the constraint violations catol as shown below.
optimizer = COBYLA(prob, solver_options={'maxiter':1000, 'catol':1e-6})
A limited number of options are available for the COBYLA solver in modOpt as given in the following table.
For more information on the Scipy ‘COBYLA’ algorithm, visit
Scipy documentation.
Option |
Type (default value) |
Description |
|---|---|---|
|
int ( |
Maximum number of function evaluations. |
|
float( |
Reasonable initial changes to the variables. |
|
float ( |
Final accuracy in the optimization (not precisely guaranteed). |
|
float ( |
Absolute tolerance for the constraint violations. |
|
bool ( |
Set to |
|
callable ( |
Function to be called after each iteration. |