Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Testing Rastrigin's function

110 views
Skip to first unread message

Erwin Daculan

unread,
Aug 12, 2011, 10:27:13 PM8/12/11
to
Greetings!

I am a novice at MATLAB programming and I was assigned to use TurboGA to test the global minimum of Rastrigin's function. TurboGA is found here - http://www.mathworks.com/matlabcentral/fileexchange/24053-turboga-a-simple-genetic-algorithm-with-a-powerful-performance-enhancing-tweak/content/turboGA.m

How should I proceed?

Thanks.

Alan Weiss

unread,
Aug 15, 2011, 8:52:06 AM8/15/11
to

I'm not sure what you want to know. I suppose you know how to download
TurboGA and try it. The definition of Rastrigin's Function is given here:
http://www.mathworks.com/help/toolbox/gads/bsa_e27.html

If you have Global Optimization Toolbox, simply use rastriginsfcn;
otherwise, it is easy to program.

If I didn't answer your question, please ask again, stating what you
have done and what you still need to know.

Alan Weiss
MATLAB mathematical toolbox documentation

Erwin Daculan

unread,
Aug 15, 2011, 10:02:29 PM8/15/11
to
Alan Weiss <awe...@mathworks.com> wrote in message
>
> I'm not sure what you want to know. I suppose you know how to download
> TurboGA and try it. The definition of Rastrigin's Function is given here:
> http://www.mathworks.com/help/toolbox/gads/bsa_e27.html
>
> If you have Global Optimization Toolbox, simply use rastriginsfcn;
> otherwise, it is easy to program.
>
> If I didn't answer your question, please ask again, stating what you
> have done and what you still need to know.
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

Sorry about that.
I want to find the global minimum/maximum of the Rastrigin function using TurboGA. I don't know where to place the Rastrigin function with two variables inside the TurboGA code. I am a novice in both Matlab and genetic algorithm - and therefore need all the help I can get. If I know how to proceed with the Rastrigin function, then I will be able to test other functions I still need to define later.
Thank you.

Paul Kerr-Delworth

unread,
Aug 16, 2011, 6:04:10 AM8/16/11
to
"Erwin Daculan" wrote in message <j2cj3l$iep$1...@newscl01ah.mathworks.com>...

Hi Erwin,

As Alan says, if you have access to Global Optimization Toolbox, you can easily find the minimum of Rastrigins function. If you'd like to minimize the Rastrigins function in 2-d, just type the following at the MATLAB command prompt

>> [x, fval, exitflag] = ga(@rastriginsfcn, 2)

For N-d Rastrigins function, just type

>> [x, fval, exitflag] = ga(@rastriginsfcn, N)

There are more details on how to minimize Rastrigins function in the Global Optimization toolbox documentation.
<<http://www.mathworks.com/help/toolbox/gads/f14773.html#f15854>>

If you want to use TurboGA, perhaps you could contact the author of the TurboGA code for an example.

Hope this helps

Best regards,

Paul

Erwin Daculan

unread,
Aug 17, 2011, 7:24:10 PM8/17/11
to
"Paul Kerr-Delworth" wrote in message <j2dfaq$788$1...@newscl01ah.mathworks.com>...

Thanks.

Erwin B. Daculan

0 new messages