MATLAB: Should I treat this as a single or multiobjective optimization

genetic algorithmGlobal Optimization ToolboxmultiobjectiveoptimizationOptimization Toolbox

Hi!
I'm trying to solve a nonlinear programming problem in which I have to minimize functions k1 and k2. However, even though they are different functions, the values of k1 and k2 MUST be equal at the end.
I'm not quite sure on the best approach to solve this. Some options I've thought of:
Single objective:
– Consider both "k1" and "k2" as "k" and minimize "(k1 + k2)/2" = "2k/2" = k
or
– Consider both "k1" and "k2" as "k" and minimize "sqrt(k1*k2)" = sqrt(kˆ2) = k
or
Multiobjective:
– Minimize k1 AND k2. (maybe using generic algorithm?)
In this last case, it's not clear to me how I would set k1=k2. I thought I could maybe write this as constraint but I just don't know how, since k1 and k2 are not variables.
I'm new to MATLAB so if anyone could help me with this I'd really appreciate that!
Thanks

Best Answer

gamultiobj can solve a multiobjective function with nonlinear constraints since R2014b. Your nonlinear constraint is that k1 = k2. Make sure you write this constraint in the ceq form, and that c = []:
function [c,ceq] = nonlcon(x)
c = [];
% Calculate k1 and k2 here
ceq = k1 - k2;
Of course, you could just as well use fmincon to solve an optimization for k1 and have the nonlinear constraint be the same as the above, k1 = k2. In fact, that is likely to be faster and more reliable.
Alan Weiss
MATLAB mathematical toolbox documentation