From: "HAN ZHOU" <>
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$>
Reply-To: "HAN ZHOU" <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1334902827 29184 (20 Apr 2012 06:20:27 GMT)
NNTP-Posting-Date: Fri, 20 Apr 2012 06:20:27 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 3447095
Xref: 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 !!!)