Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Genetic Algorithm and Speed Problem

Subject: Genetic Algorithm and Speed Problem

From: kamuran turksoy

Date: 18 Nov, 2011 18:17:32

Message: 1 of 6

Hi Everybody

I have a nonlinear constraint optimization problem. My objective function is quadratic and i have constraints with very high order of non-linearity. I found that matlab Genetic algorithm can solve nonlinear constraints problem and it works. But the problem is it works very slowly. For 238 variables each iteration takes more than 3 hours. I have to do it in real time so i need a faster way. Now i am using default options for ga function.

Does any of you now which option parameter should i change to make it faster? Or any other algorithm to solve nonlinear constraint problem faster than matlab ga?


Regards

Subject: Genetic Algorithm and Speed Problem

From: Alan Weiss

Date: 18 Nov, 2011 19:14:45

Message: 2 of 6

On 11/18/2011 1:17 PM, kamuran turksoy wrote:
> Hi Everybody
>
> I have a nonlinear constraint optimization problem. My objective
> function is quadratic and i have constraints with very high order of
> non-linearity. I found that matlab Genetic algorithm can solve nonlinear
> constraints problem and it works. But the problem is it works very
> slowly. For 238 variables each iteration takes more than 3 hours. I have
> to do it in real time so i need a faster way. Now i am using default
> options for ga function.
>
> Does any of you now which option parameter should i change to make it
> faster? Or any other algorithm to solve nonlinear constraint problem
> faster than matlab ga?
>
>
> Regards

fmincon will almost certainly be orders of magnitude faster than ga.

Alan Weiss
MATLAB mathematical toolbox documentation

Subject: Genetic Algorithm and Speed Problem

From: kamuran turksoy

Date: 18 Nov, 2011 20:07:29

Message: 3 of 6

Alan Weiss <aweiss@mathworks.com> wrote in message <ja6ar5$fco$1@newscl01ah.mathworks.com>...
> On 11/18/2011 1:17 PM, kamuran turksoy wrote:
> > Hi Everybody
> >
> > I have a nonlinear constraint optimization problem. My objective
> > function is quadratic and i have constraints with very high order of
> > non-linearity. I found that matlab Genetic algorithm can solve nonlinear
> > constraints problem and it works. But the problem is it works very
> > slowly. For 238 variables each iteration takes more than 3 hours. I have
> > to do it in real time so i need a faster way. Now i am using default
> > options for ga function.
> >
> > Does any of you now which option parameter should i change to make it
> > faster? Or any other algorithm to solve nonlinear constraint problem
> > faster than matlab ga?
> >
> >
> > Regards
>
> fmincon will almost certainly be orders of magnitude faster than ga.
>
> Alan Weiss
> MATLAB mathematical toolbox documentation

But fmincon does not work for "nonlinear constraints"

Subject: Genetic Algorithm and Speed Problem

From: kamuran turksoy

Date: 18 Nov, 2011 21:44:29

Message: 4 of 6

My fault, fmincon works for nonlinear constraints, thanks for suggestion

Subject: Genetic Algorithm and Speed Problem

From: kamuran turksoy

Date: 20 Nov, 2011 00:10:15

Message: 5 of 6

"kamuran turksoy" <kamuranturksoy@gmail.com> wrote in message <ja6jjt$gn8$1@newscl01ah.mathworks.com>...
> My fault, fmincon works for nonlinear constraints, thanks for suggestion

Even fmincon works very slowly for nonlinear constraints. how can i make fmincon work faster for nonliner constraints?

Subject: Genetic Algorithm and Speed Problem

From: Alan Weiss

Date: 21 Nov, 2011 15:22:40

Message: 6 of 6

On 11/19/2011 7:10 PM, kamuran turksoy wrote:
> "kamuran turksoy" <kamuranturksoy@gmail.com> wrote in message
> <ja6jjt$gn8$1@newscl01ah.mathworks.com>...
>> My fault, fmincon works for nonlinear constraints, thanks for suggestion
>
> Even fmincon works very slowly for nonlinear constraints. how can i make
> fmincon work faster for nonliner constraints?

For suggestions on speeding up solvers, see
http://www.mathworks.com/help/toolbox/optim/ug/br44iv5-1.html#br44pif
There are other suggestions on examining the progress and adjusting
things here:
http://www.mathworks.com/help/toolbox/optim/ug/br44iv5-1.html#br44i1u

Good luck,

Alan Weiss
MATLAB mathematical toolbox documentation

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us