We have not had any reports of problems with the built-in sine function in the nonlinear curve fitter. Therefore, in an effort to test this I generated two sets of typical experimental sine wave data. The first set of data was generated using radian angle measurements (X=0 to X=2p). The second set of data was generated using degree angle measurements (X=0° to X=360°). I then fit the data generated in radians. Here's a quick description of how I did it:- I selected the Y column which contains the sine wave data generated in radians.
- I then selected Analysis:Nonlinear Curve Fit. This opened the fitter, created a sine curve from X=0 to X=2p and automatically assigned the Y and X datasets to be fitted.
- I selected the Waveform Category and then the Sine Function (Function:Select if in the advanced mode).
- I then initialized (Action:Fit in the advanced mode) the three parameters to the following values:
xc = 0
w = 3.14
A= 1
- I clicked the 10 Iter. button a few times to perform the fit.
- Finally, once I was satisfied with the fit I clicked the Done button to end the fitting session and exit out of the nonlinear curve fitter.
I then performed the same steps for the sine wave data generated in degrees. The initial parameters were quite similar. All I did was replace 3.14 (p) with 180 (°):
xc = 0
w = 180
A = 1
In both cases I was able to obtain very satisfying results. Since this is the case, I cannot say for sure why you aren't obtaining good results. Rather than suggest ways to improve your fit through scripts, perhaps you could describe the steps you are taking to perform the fit? I could then look them over and try to provide you with suggestions on how to improve your procedure. Or you might try performing the fit as I have above to see if there was a step you had missed.
Just out of curiosity, what is the name of the other curve fitting program?
Sincerely,
Ryan Toomey
[This message has been edited by rtoomey (edited 11-22-1999).]