how to define constraint on objective function in ga toolbox?
Show older comments
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 Comments
Torsten
on 4 Oct 2022
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
on 4 Oct 2022
Torsten
on 4 Oct 2022
And how do you get efficiency from your decision variables ? In other words: How does your objective function looks like ?
Hannah Mohebi
on 4 Oct 2022
Torsten
on 4 Oct 2022
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
on 4 Oct 2022
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
on 6 Oct 2022
Torsten
on 6 Oct 2022
Just copy what you calculate in the objective function to the function nonlcon to define c(x). What's the problem ?
Hannah Mohebi
on 6 Oct 2022
Answers (0)
Categories
Find more on Surrogate Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!