How to optimize this equation using GA tool?

6 visualizzazioni (ultimi 30 giorni)
Hi all, I have polynomial equation: y =89.81+1.96*x(1)-3.02*x(2)-1.46*x(1)^2-1*x(2)^2-4.45*x(3)^2-1.57*x(1)*x(3)-2.74*x(2)*x(3) and I am looking for optimization of the above equation with Lower bounds [-1.68 -1.68 -1.68] and Upper bounds [1.68 1.68 1.68]. When I feed this equation in GA tool and run....I get an output of
"Objective function value: 56.37940293199839 Optimization terminated: average change in the fitness value less than options.TolFun."
But for the same equation, by polynomial regression I get an output of 94.73! can anybody help?

Risposta accettata

Alan Weiss
Alan Weiss il 25 Lug 2013
I don't understand what you think the problem is. The objective function that ga found is better than the one you get by "polynomial regression." So is your problem that ga got a better answer? Or that you think the answer is wrong?
I just ran your problem, and here is what I got:
fun = @(x)89.81+1.96*x(1)-3.02*x(2)-1.46*x(1)^2-1*x(2)^2-4.45*x(3)^2-1.57*x(1)*x(3)-2.74*x(2)*x(3);
lb = -1.68*ones(3,1);
ub = -lb;
[x,fval] = ga(fun, 3,[],[],[],[],lb,ub)
Optimization terminated: average change in the fitness value less than options.TolFun.
x =
1.6789 1.6800 1.6800
fval =
56.3686
Checking with fmincon shows that this is a good answer.
Alan Weiss
MATLAB mathematical toolbox documentation

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by