cobyla — performs nonlinear constrained optimization without derivatives
[x_opt, eval_func] = cobyla(x0, func, nb_constr, rhobeg, rhoend, message, eval_func_max)
Input parameters
the starting point
the function to minimize. This function must have the following prototype:
[fval, conval, info] = fobj(x)
where:
fval is the value of the objective function.
conval is the value of the constraints.
info is a return status:
0 - no error occurs
1 - a problem occurs.
number of constraints.
a reasonable initial change to the variables.
the required accuracy for the variables.
verbosity level. Allowed values are:
0 (COBYLA_MSG_NONE) - no messages
1 (COBYLA_MSG_EXIT) - exit reasons
2 (COBYLA_MSG_ITER) - rho and sigma changes
3 (COBYLA_MSG_INFO) - Informational messages
the maximum number of function evaluations
Output parameters
the solution found by cobyla.
the number of function evaluations done.
the return code of cobyla.
-2 (COBYLA_EINVAL) - N<0 or M<0.
-1 (COBYLA_ENOMEM) - Memory allocation failed.
0 (COBYLA_NORMAL) - Normal return from cobyla.
1 (COBYLA_MAXFUN) - Maximum number of function evaluations reach.
2 (COBYLA_ROUNDING) - Rounding errors are becoming damaging.
3 (COBYLA_USERABORT) - User requested end of minimization.
This software is a Scilab interface of COBYLA2, a contrained optimization by linear approximation package developed by Michael J. D. Powell in Fortran.
The original source code can be found at: http://plato.la.asu.edu/topics/problems/nlores.html
nb_constr_test_1 = 0; xopt_test_1 = [-1 0]'; function [f, con, info] = test_1(x) d__1 = x(1) + 1.; d__2 = x(2); f = d__1 * d__1 * 10. + d__2 * d__2; con = 0; info = 0; endfunction rhobeg = 1; rhoend = 1e-3; message_in = 3; eval_func_max = 200; x0 = ones(xopt_test_1); [x_opt, status, eval_func] = cobyla(x0, test_1, nb_constr_test_1, rhobeg, rhoend, message_in, eval_func_max); disp(x_opt); disp(xopt_test_1);