From: maria on
Hi,
I am using lsqcurvefit to solve an optimization problem. I specify upper and lower bounds for the solutuion, how ever, watching ont the parameters evolution, I have noticed that my fourth parameter goes out of the bounds, it is suppose to be smaller that 0.5 and the algorithm is testing in 30!. Problem is that the algorithm might have found a local minimun there and for this reason, it keeps on trying in this region, which is actually physically imposible.

Anybody has any idea about why is the algorithm testing outside the bounds?. My cost function gives a vector of size 2 which should be near to 0.


lb=[0.05, 0.05, 2, 1e-6, 300];
ub=[2 ,3 , 0.1, 0.5, 600];
options=optimset('TolFun',tol);
x2=lsqcurvefit(@costfunction_V1,parameters,0,[0,0],lb,ub,options);

Thanks in advance.

Mary
From: nico cruz on
I know it sounds pretty obvious,

but did you check the order of your parameter vector?

also why are xdata and ydata so small and not equal?

coudl you maybe send some more info about your problem?

nico

"maria " <mariaame(a)gmail.com> wrote in message <hmocec$fkn$1(a)fred.mathworks.com>...
> Hi,
> I am using lsqcurvefit to solve an optimization problem. I specify upper and lower bounds for the solutuion, how ever, watching ont the parameters evolution, I have noticed that my fourth parameter goes out of the bounds, it is suppose to be smaller that 0.5 and the algorithm is testing in 30!. Problem is that the algorithm might have found a local minimun there and for this reason, it keeps on trying in this region, which is actually physically imposible.
>
> Anybody has any idea about why is the algorithm testing outside the bounds?. My cost function gives a vector of size 2 which should be near to 0.
>
>
> lb=[0.05, 0.05, 2, 1e-6, 300];
> ub=[2 ,3 , 0.1, 0.5, 600];
> options=optimset('TolFun',tol);
> x2=lsqcurvefit(@costfunction_V1,parameters,0,[0,0],lb,ub,options);
>
> Thanks in advance.
>
> Mary
From: Stefan on
M;aybe I'm missing something, but why is in

lb=[0.05, 0.05, 2, 1e-6, 300];
ub=[2 ,3 , 0.1, 0.5, 600];

at the third position the lower bound greater than the upper bound?

Regards,
Stefan

"maria " <mariaame(a)gmail.com> wrote in message <hmocec$fkn$1(a)fred.mathworks.com>...
> Hi,
> I am using lsqcurvefit to solve an optimization problem. I specify upper and lower bounds for the solutuion, how ever, watching ont the parameters evolution, I have noticed that my fourth parameter goes out of the bounds, it is suppose to be smaller that 0.5 and the algorithm is testing in 30!. Problem is that the algorithm might have found a local minimun there and for this reason, it keeps on trying in this region, which is actually physically imposible.
>
> Anybody has any idea about why is the algorithm testing outside the bounds?. My cost function gives a vector of size 2 which should be near to 0.
>
>
> lb=[0.05, 0.05, 2, 1e-6, 300];
> ub=[2 ,3 , 0.1, 0.5, 600];
> options=optimset('TolFun',tol);
> x2=lsqcurvefit(@costfunction_V1,parameters,0,[0,0],lb,ub,options);
>
> Thanks in advance.
>
> Mary
From: Paul Kerr-Delworth on
Hi Stefan,

I meant that the third element of lb is greater than the third element of ub. To see this, run the following at the MATLAB command prompt

lb=[0.05, 0.05, 2, 1e-6, 300];
ub=[2 ,3 , 0.1, 0.5, 600];
lb > ub

ans =

0 0 1 0 0

(Because the third element of lb (2) is greater than the third element of ub (0.1))

Best regards,

Paul

"Stefan" <nospam(a)yahoo.com> wrote in message <hn5bjk$mer$1(a)fred.mathworks.com>...
> M;aybe I'm missing something, but why is in
>
> lb=[0.05, 0.05, 2, 1e-6, 300];
> ub=[2 ,3 , 0.1, 0.5, 600];
>
> at the third position the lower bound greater than the upper bound?
>
> Regards,
> Stefan
>
> "maria " <mariaame(a)gmail.com> wrote in message <hmocec$fkn$1(a)fred.mathworks.com>...
> > Hi,
> > I am using lsqcurvefit to solve an optimization problem. I specify upper and lower bounds for the solutuion, how ever, watching ont the parameters evolution, I have noticed that my fourth parameter goes out of the bounds, it is suppose to be smaller that 0.5 and the algorithm is testing in 30!. Problem is that the algorithm might have found a local minimun there and for this reason, it keeps on trying in this region, which is actually physically imposible.
> >
> > Anybody has any idea about why is the algorithm testing outside the bounds?. My cost function gives a vector of size 2 which should be near to 0.
> >
> >
> > lb=[0.05, 0.05, 2, 1e-6, 300];
> > ub=[2 ,3 , 0.1, 0.5, 600];
> > options=optimset('TolFun',tol);
> > x2=lsqcurvefit(@costfunction_V1,parameters,0,[0,0],lb,ub,options);
> >
> > Thanks in advance.
> >
> > Mary
From: Stefan on
Hi Paul,

my question was directed to Maria. Unfortunately I didn't read your post carefully. ;)

Regards,
Stefan


"Paul Kerr-Delworth" <paul.kerr-delworth(a)mathworks.co.uk> wrote in message <hnaguu$9v2$1(a)fred.mathworks.com>...
> Hi Stefan,
>
> I meant that the third element of lb is greater than the third element of ub. To see this, run the following at the MATLAB command prompt
>
> lb=[0.05, 0.05, 2, 1e-6, 300];
> ub=[2 ,3 , 0.1, 0.5, 600];
> lb > ub
>
> ans =
>
> 0 0 1 0 0
>
> (Because the third element of lb (2) is greater than the third element of ub (0.1))
>
> Best regards,
>
> Paul
>
> "Stefan" <nospam(a)yahoo.com> wrote in message <hn5bjk$mer$1(a)fred.mathworks.com>...
> > M;aybe I'm missing something, but why is in
> >
> > lb=[0.05, 0.05, 2, 1e-6, 300];
> > ub=[2 ,3 , 0.1, 0.5, 600];
> >
> > at the third position the lower bound greater than the upper bound?
> >
> > Regards,
> > Stefan
> >
> > "maria " <mariaame(a)gmail.com> wrote in message <hmocec$fkn$1(a)fred.mathworks.com>...
> > > Hi,
> > > I am using lsqcurvefit to solve an optimization problem. I specify upper and lower bounds for the solutuion, how ever, watching ont the parameters evolution, I have noticed that my fourth parameter goes out of the bounds, it is suppose to be smaller that 0.5 and the algorithm is testing in 30!. Problem is that the algorithm might have found a local minimun there and for this reason, it keeps on trying in this region, which is actually physically imposible.
> > >
> > > Anybody has any idea about why is the algorithm testing outside the bounds?. My cost function gives a vector of size 2 which should be near to 0.
> > >
> > >
> > > lb=[0.05, 0.05, 2, 1e-6, 300];
> > > ub=[2 ,3 , 0.1, 0.5, 600];
> > > options=optimset('TolFun',tol);
> > > x2=lsqcurvefit(@costfunction_V1,parameters,0,[0,0],lb,ub,options);
> > >
> > > Thanks in advance.
> > >
> > > Mary