MATLAB: I have a problem with bounds in ga

ga constrained minimisationGlobal Optimization Toolbox

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….

Best Answer

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