This repository contains a Matlab MEX interface for the nonlinear constrained multiobjective optimization algorithm KSOPT by Gregory A. Wrenn.
The repository is based on the KSOPT code from madebr/pyOpt converted from Fortran to C with f2c
.
The MEX file can be created by invoking
compile.ksopt;
and copies the created MEX file ksopt_optimize.mex*
to the root directory.
The interface of ksopt_optimize
is similar to fmincon
or fminimax
from the Optimization Toolbox.
The input arguments are:
fun
: objective function to minimizex_0
: initial value or matrix of initial values or StartPointSet of initial values to start optimization fromA
: matrix of linear inequlity constraintsb
: upper limits for linear inequality constraintsAeq
: matrix for linear equality constraintsbeq
: upper limits for linear equality constraintslb
: fixed lower bounds on xub
: fixed upper bounds on xnonlcon
: nonlinear inequality and equality constraintsoptions
: settings for optimizationvarargin
: additional arguments for objective function
A description of the input arguments can be found in the Matlab documentation of e.g. fminimax
.
The argument options
is a structure with the following fields
options = struct(...
'MaxIterations', 1000,...
'MaxFunctionEvaluations', 1000,...
'MaxTime', 60,...
'ObjectiveLimit', -1E20,...
'FiniteDifferenceStepSize', 1E-6,...
'FiniteDifferenceStepSizeMin', 1E-6,...
'OptimalityTolerance', 1E-6,...
'OptimalityToleranceAbs', 1E-6,...
'RhoIncrement', 0.01,...
'RhoMin', 0.001,...
'RhoMax', 0.1,...
'Display', 'iter-detailed',...
'Scale', 1,...
'ScaleVector', ones(size(x_0)),...
'SpecifyObjectiveGradient', true,...
'SpecifyConstraintGradient', true...
);
or can be of type optimoptions
or optimset
.
The function returns:
x
: optimal valuefval
: function value at optimal valueexitflag
: optimization result indicatoroutput
: structure with information about optimization
a1 = [1, 1];
b1 = [-1, 1];
c1 = [0, -1];
a0 = 2;
b0 = -3;
c0 = 4;
fun = @(x) [a1*x + a0; b1*x + b0; c1*x + c0];
x_0 = [0; 0];
A = [];
b = [];
Aeq = [];
beq = [];
lb = [];
ub = [];
nonlcon = [];
[x, fval, exitflag, output] = ksopt_optimize(fun, x_0, A, b, Aeq, beq, lb, ub, nonlcon)