I have a problem with bounds in ga

3 次查看(过去 30 天)
I am new to GA & Matlab. I have written a code to minimise an objective function in matlab. But every time i run it vaible X(2) & x(3) are always the upperbound values specified. f i change the ub the again X(2) & X(3) again becomes the ub values.. Please help................!!!!!!!!
I am attaching the codes...... Thanks in Advance....

采纳的回答

Alan Weiss
Alan Weiss 2015-5-26
Your fitness function is
function y= simple_fitcat1(x)
y =(300*x(1)-(pi*x(2)*x(3)^2*0.25))*1000*0.05 + ((7.85*10^-6*x(2)*pi*x(3)^2*1000)*10);
and your lower bounds ensure that all variables are positive. So it is obvious that minimizing simple_fitcat1 entails making x(2) and x(3) as large as possible.
ga is just solving the problem that you gave it. Try using fmincon, you'll get the same answer, but more quickly and reliably.
Alan Weiss
MATLAB mathematical toolbox documentation

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Problem-Based Optimization Setup 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by