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:
error in optimization function

Subject: error in optimization function

From: Toan Cao

Date: 24 May, 2011 05:02:04

Message: 1 of 5

hi everyone,

i am using 'fgoalattain' ,a function for multi-objective functions optimization in matlab. I have following code:
----------------------------------------------------------
x1=0.0000015;
x2=10^-12;
x=[x1 x2];
guess=[261 300 x ];
goal=[0 0];
weight=[1 1];
options=optimset('MaxFunEvals',800,'GoalsExactAchieve',length(goal));
lb=[160,240,0,1e-13];
ub=[320,400,10^-5, 1e-11];
optimized= fgoalattain(@vector_optimize2,guess,goal,weight,[],[],[],[],lb,ub,[],options,P);
----------------------------------------------------------
in my code, variable vector is a 4 element-vector. The fourth element of this vector, x2, is about 1e-12, so i set the bound for it : 1e-13< x2 <1e-11. However, when i run optimization , i get the error:
//////////////////////////////////////////////////////
Error using ==> finitedifferences at 119
Distance between lower and upper bounds, in dimension 4 is too small to
compute finite-difference approximation of derivative. Increase distance
between these bounds to be at least 2e-008.
////////////////////////////////////////////////////////.
Although my distance bound is smaller the required- smallest bound: 2e-8.
how can i solve this error? Every can help me avoid it.
Thanks in advance!

Subject: error in optimization function

From: Toan Cao

Date: 24 May, 2011 05:23:04

Message: 2 of 5

I am sorry, i make mistake in the first post, i modify it here in capital letter:
 ------------------------------------------------------------
 Although my distance bound is LARGER THAN the required- smallest bound: 2e-8.
-------------------------------------------------------------

Subject: error in optimization function

From: Torsten

Date: 24 May, 2011 07:05:18

Message: 3 of 5

On 24 Mai, 07:23, "Toan Cao" <toancv3...@gmail.com> wrote:
> I am sorry, i make mistake in the first post, i modify it here in capital letter:
>  ------------------------------------------------------------
>  Although my distance bound is LARGER THAN the required- smallest bound: 2e-8.
> -------------------------------------------------------------

1e-11 - 1e-13 is larger than 2e-8 ????

Best wishes
Torsten.

Subject: error in optimization function

From: Toan Cao

Date: 24 May, 2011 07:56:05

Message: 4 of 5

Torsten <Torsten.Hennig@umsicht.fraunhofer.de> wrote in message <6aa72bc5-d0c6-4c14-a66d-9fd464301361@14g2000yqo.googlegroups.com>...
> On 24 Mai, 07:23, "Toan Cao" <toancv3...@gmail.com> wrote:
> > I am sorry, i make mistake in the first post, i modify it here in capital letter:
> >  ------------------------------------------------------------
> >  Although my distance bound is LARGER THAN the required- smallest bound: 2e-8.
> > -------------------------------------------------------------
>
> 1e-11 - 1e-13 is larger than 2e-8 ????
>
> Best wishes
> Torsten.
Hi Torsten,
I mean that my distance bound ,(1e-11)/(1e-13)=100, is greater than the permitted distance bound, 2e-8, of the function 'fgoalattain'.

Subject: error in optimization function

From: Torsten

Date: 24 May, 2011 09:52:57

Message: 5 of 5

On 24 Mai, 09:56, "Toan Cao" <toancv3...@gmail.com> wrote:
> Torsten <Torsten.Hen...@umsicht.fraunhofer.de> wrote in message <6aa72bc5-d0c6-4c14-a66d-9fd464301...@14g2000yqo.googlegroups.com>...
> > On 24 Mai, 07:23, "Toan Cao" <toancv3...@gmail.com> wrote:
> > > I am sorry, i make mistake in the first post, i modify it here in capital letter:
> > >  ------------------------------------------------------------
> > >  Although my distance bound is LARGER THAN the required- smallest bound: 2e-8.
> > > -------------------------------------------------------------
>
> > 1e-11 - 1e-13 is larger than 2e-8 ????
>
> > Best wishes
> > Torsten.
>
> Hi Torsten,
> I mean that my distance bound ,(1e-11)/(1e-13)=100,  is greater than the permitted distance bound, 2e-8, of the function 'fgoalattain'.

ub - lb >= 2e-8 must be fulfilled, not ub/lb >= 2e-8.

Best wishes
Torsten.

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