Design Optimization Toolbox MATLAB based on 2 or more outputs
1 次查看(过去 30 天)
显示 更早的评论
Hi,
I want to carry out a design optimization task. I have a code which has a set of input variables and using different formulas it gives me different outputs but the ones I want to optimize are only 2 specific outputs. It works fine when I want to optimize one output but it doesn't do it for 2.
I created an objective function which starts like this:
function [pressure_drop,Max_walltemp]=codeNoc(noc)
....
and then i created and optimization file to run fmincon
%----------------------------------------------------
objFcn = @(noc) codeNoc(noc);
noc0 = 80;
lb = 2;
ub = 110;
options = optimset('Algorithm','interior-point','Disp','iter');
[xOpt, fVal] = fmincon(objFcn, noc0,[],[],[],[],lb,ub,[],options);
%----------------------------------------------------
Unfortuantely it only optimizes based the first output which is 'pressure_drop' but i want to find the optimum 'noc' to minimize both the 'pressure_drop' and 'Max_walltemp'.
I am new to Matlab Optimization. Can someone please help me?
Am I using the right solver and algorithm?
Thank you!!
0 个评论
回答(2 个)
Mario Malic
2020-11-8
编辑:Mario Malic
2020-11-8
Use fgoalattain to minimise both functions
function fobj = codeNoc(noc)
%Code
fobj(1) = pressure_drop;
fobj(2) = Max_walltemp
end
You could also do it with fmincon, but it's better not to, unless you really have to do it with it. However, keep in mind, fmincon accepts only scalar as the value of objective function.
Please read the documentation on fgoalattain as you should define few other parameters such as weight and goals.
0 个评论
Steve Grikschat
2020-11-14
Most solvers in Optimization and Global Optimization toolboxes are for single objectives.
As Mario shared, you can use a "goal-attainment" formulation (fgoalattain) to try to minimize both simultaneously, or you can look for *Pareto optimal* solutions using a Global Optimization toolbox solver like gamultiobj or paretosearch.
*These are a set of solutions where none is said to "dominate" the other. That is, you must give up a little bit in one objective in order to improve the other, and vice versa. Note: this only applies if your 2 objectives "compete" with each other and you must explore trade-offs. This is most often the case in design problems.
If, by the way, your objectives are completely independent, then the best way to solve them is to do 2 separate optimizations.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multiobjective Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!