how to define constraint on objective function in ga toolbox?
显示 更早的评论
hi, this my optimization code:
lb=[0.01,0.0075,0.01];
ub=[0.2,0.07,0.07];
func=@efficiency;
[x,fvar]=gamultiobj(func,3,[],[],[],[],lb,ub);
plot(fvar(:,1),fvar(:,2),'o');
I have 3 decision variable sand two objective functions which are electrical and thermal efficiencies, so these efficiencies can not be higher that 100%, but ga calculated efficiencies higher than 100%. How can I define constraint (efficiencies <100%) on objective functions?
11 个评论
Torsten
2022-10-4
Are lb and ub bounds on the efficiencies ? But you want to optimize the process - so why do you set upper bounds ?
And what value becomes greater than 1 ?
Hannah Mohebi
2022-10-4
Torsten
2022-10-4
And how do you get efficiency from your decision variables ? In other words: How does your objective function looks like ?
Hannah Mohebi
2022-10-4
Torsten
2022-10-4
Can the numerical values for the efficiencies you calculate in the objective function become greater than 1 ? If yes: return min(1,efficiency) to ga or use nonlcon to limit efficiencies to 1 by the nonlinear constraint c(d1,d2,d3) <= 1.
Hannah Mohebi
2022-10-4
Please answer the questions:
Does your objective function return efficiency as value to be maximized ?
o Yes o No
If yes, is it possible that the numerical value computed in the objective function for the efficiencies exceeds 1 ?
o Yes o No
If yes, define c(x) in function nonlcon such that efficiencies = c(x) <= 1.
Hannah Mohebi
2022-10-6
Torsten
2022-10-6
Just copy what you calculate in the objective function to the function nonlcon to define c(x). What's the problem ?
Hannah Mohebi
2022-10-6
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Surrogate Optimization 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!