Hi guys,
I am using a PC with 2014b and run the MOGA files. Now two questions appear:
The first is:
The option set for gamultiobj is
options_moga = gaoptimset(@gamultiobj) .
If the parameters in gamultiobj are set according to its syntax without options_moga , i.e., like this:
gamultiobj( AIM1 , 9 , ...
A_inequation , power_constraint , ...
AEQ_modify , BEQ_modify , ...
lower_bound , upper_bound , ...
nonliear_constraint );
the PC run the file for round 100 seconds and the results seem right, because they are quite similar to the those from fmincon.
But , if the parameters in gamultiobj are set according to its syntax with options_moga , i.e., like this:
gamultiobj( AIM1 , 9 , ...
A_inequation , power_constraint , ...
AEQ_modify , BEQ_modify , ...
lower_bound , upper_bound , ...
nonliear_constraint , options_moga ) ;
the PC run the file for round 20 seconds only and the results are not right, because they are quite far from those by fmincon.
Could u pls tell me why it behaves like this?
The second is:
the 9 unknowns set by gamultiobj is a 1*9 rank vector, but if they are used in fmincon, they are a 9*1 column vector. Is it right?
Thanks so much for these two questions!

 Réponse acceptée

Alan Weiss
Alan Weiss le 18 Jan 2017

0 votes

I do not understand at all what you are asking in your first question, sorry.
For the second question, ga and gamultiobj require population members to be row vectors. In contrast, fmincon does not care whether the x0 argument is a row vector, column vector, or array, as explained here.
Alan Weiss
MATLAB mathematical toolbox documentation

5 commentaires

Tony Cheng
Tony Cheng le 21 Jan 2017
Dear Alan,
Thanks so much for ur answers. The answer to the second question is satisfactory!
For the first one, I want to know if I write codes like this:
gamultiobj( AIM1 , 9 , ... A_inequation , power_constraint , ... AEQ_modify , BEQ_modify , ... lower_bound , upper_bound , ... nonliear_constraint );
the options for gamultiobj is not given manually. So will Matlab offer its default options gaoptimset(@gamultiobj) ?
Thanks so much!
Cheers Tony
Alan Weiss
Alan Weiss le 23 Jan 2017
If you don't give any options, then yes, gamultiobj uses its default option values.
Alan Weiss
MATLAB mathematical toolbox documentation
Walter Roberson
Walter Roberson le 23 Jan 2017
I just did some testing in a recent version.
The case where you use no options is the same as if you use optimoptions(@gamultiobj) . optimoptions(@gamultiobj) is handled by calling gamultiobj('defaults') which returns the default options structure that you would get if you used no options.
For either of those two cases, the options are filled out nicely in a structure, but then (again, recent version) it detects that you had only used default options and it throws those contents away in favor of a structure with a series of options all set to []. Then it calls gaoptimset(@gamultiobj) to fill it all in. So the result is exactly the same as if you had called gaoptimset(@gamultiobj) to initialize your options.
Tony Cheng
Tony Cheng le 13 Fév 2017
All right!
Thank you very much, Walter!
Tony Cheng
Tony Cheng le 14 Fév 2017
Hi Walter,
Could you tell me the time consumed in testing the settings with and without optimoptions(@gamultiobj)?
If optimoptions(@gamultiobj) is explicitly given in gamultiobj like this gamultiobj( AIM1 , 9 , ... A_inequation , power_constraint , ... AEQ_modify , BEQ_modify , ... lower_bound , upper_bound , ... nonliear_constraint , gaoptimset(@gamultiobj) ) ;
then it uses for about 15 seconds.
If gamultiobj( AIM1 , 9 , ... A_inequation , power_constraint , ... AEQ_modify , BEQ_modify , ... lower_bound , upper_bound , ... nonliear_constraint );
then it cost about 110 seconds to finish the codes.
The results from these two settings are quite different. The former setting produces smaller values which looks like wrong, while the latter produces larger ones which looks like right.
I am using 2014b.
Thanks man!

Connectez-vous pour commenter.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by