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:
parallel computing with fmincon

Subject: parallel computing with fmincon

From: kamuran turksoy

Date: 20 Nov, 2011 21:05:15

Message: 1 of 2

Hi everybody

I have a nonlinear constraint minimization problem and i try to solve it with fmincon, but since i have 238 variable fmincon works very slow. To seed up i want to use parallel computing. In matlab help forums i found:

matlabpool open 2
options = optimset('UseParallel','always');
matlabpool close

but whenever i use this way it gives error as:

??? Error using ==> parallel_function at
Error in ==> objective at 12
Matrix dimensions must agree.

Error in ==> parfinitedifferences at 110
Error in ==> nlconst at 355
                = ...

Error in ==> fmincon at 724

When i remove matlabpool open 2 and matlabpool close, the algorithm works without error but in that case i noticed it does not work as parallel.

Can anybody help to figure out why i am getting this error?


Subject: parallel computing with fmincon

From: kamuran turksoy

Date: 20 Nov, 2011 21:52:13

Message: 2 of 2

I just noticed what is the problem. In my objective function i have multiple variables. I use only variable that optimization depends on, i define others as global variable. I found that in optimization iteration these global variables first gets their real value but after second iteration inside fmincon they becomes zero and that's why it gives that dimension problem, and i have no idea why after first iteration these globals becomes zero?

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