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에서 Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!