Path: news.mathworks.com!not-for-mail
From: "HAN ZHOU" <repeatcloud@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: lsqcurvefit-initial guess better than fitting
Date: Fri, 20 Apr 2012 06:20:27 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 13
Message-ID: <jmqv7a$sg0$1@newscl01ah.mathworks.com>
Reply-To: "HAN ZHOU" <repeatcloud@gmail.com>
NNTP-Posting-Host: www-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1334902827 29184 172.30.248.47 (20 Apr 2012 06:20:27 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 20 Apr 2012 06:20:27 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3447095
Xref: news.mathworks.com comp.soft-sys.matlab:765281

Hi there!

I have writing a program to fitting a trigonalmetrical series solution with the form

myfun(X,t) = - X(1)*X(2)*sum of [-exp(i^2*X(2)*t)], i goes from 1 to infinity (I take 100 terms)

however, when I use lsqcurvefit to get X (2 coefficients) the resulting curve was not close to the raw data at all, since the X value it found did not make sense (too far from initial guess, order of magnitude difference) 

And I plot the function with my initial guess of X0, it matched even better than the X.

Can anyone shed some light on it (I have been trying this fitting for weeks !!!)

Thanks.