Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Problem with "lsqnonlin" function in matlab
Replies: 6   Last Post: Sep 10, 2011 8:05 AM

 Messages: [ Previous | Next ]
 fsalehi Posts: 13 Registered: 8/30/11
Re: Problem with "lsqnonlin" function in matlab
Posted: Aug 31, 2011 10:27 AM

Torsten <Torsten.Hennig@umsicht.fraunhofer.de> wrote in message <8c035249-4dfe-4bf1-9c3b-6df1f60c80c5@h17g2000vbz.googlegroups.com>...
> On 30 Aug., 09:34, "fsalehi " <fsal...@gmail.com> wrote:
> > I  have a problem with 'lsqnonlin' function in matlab. I used it to optimizing this function:
> >
> >     objfun = @(z) y - ( z(5).*exp(-z(1).*(t-z(7)).^2).*cos(2*pi.*z(2).*(t-z(7))+z(3)) + z(6).*exp(-z(1).*(t-z(8)).^2).*cos(2*pi.*z(2).*(t-z(8))+z(4)) );
> >
> > % y is my signal and I optimize a guassian pulse function for Model Base Estimation
> >
> > options = optimset(options, 'MaxFunEvals', 10000, 'TolX', 1e-3, 'TolFun', 1e-2, 'MaxIter', 800, 'LargeScale', 'on', 'LevenbergMarquardt', 'on', 'DiffMaxChange', 1e-7, 'DiffMinChange', 1e-10, 'Display', 'off', 'Diagnostics', 'off');
> >
> >     [Z,q,w,e,r]=lsqnonlin(objfun,...
> >     [alpha         Fc       amptf(1:4) phase phase],...
> >     [alpha-(2e6)^2 Fc-(2e6) toll(1:4)  []    [] ],...
> >     [alpha+(2e6)^2 Fc+(2e6) tolu(1:4)  []    [] ],options);
> >
> > the problem is the result of optimization, I have 8 variable to optimizing, but in result Z, only 7 of them changes and one of them (alpha) doesnt change.
> >
> > why this happend?!

>
> Do you start with a value of alpha = 1.749262265091693e+013 ?
> Then evaluate your objfun for this value and see what you get for exp(-
> alpha*...) ...
>
> Best wishes
> Torsten.
>

Dear Torsten,
yes the alpha=1.7493...e+13 but I should note that the t and tf is around 1.9e-06. I have exp(-alpha*(t-tf)^2).. its about 1

Thank you,
Farzaneh

Date Subject Author
8/30/11 fsalehi
8/30/11 Torsten
8/31/11 fsalehi
8/31/11 spasmous
9/1/11 fsalehi
9/6/11 Steve
9/10/11 fsalehi