The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 gauss fit with two peaks
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

axel3

Germany
6 Posts

Posted - 01/28/2003 :  10:17:07 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I try to write a script to fit 1 column with two peaks (gauss). I have got some results but if I compare the results ( xc1 and xc2 ) I have never got the same as from the fit made usig the normal origin features. Where is my mistake?
I use this script:

B=390;
E=450;
S=1;

for (j=0;j<=S-1;j+=1)


{ nlsf.init(); // initialize fit

nlsf.dataBegin=B; // Fitbereich begin
nlsf.dataEnd=E; // Fitbereich ende

nlsf.func$=Gauss; // define function to be used during fitting
nlsf.fitData$=Data1_c$(j); // define data to be fitted
nlsf.numReplica=1; // =1 implies 2 peaks
nlsf.p1=0; // initialize y0
nlsf.p2=1.266; // init xc1(center 1)
nlsf.p5=1.277; // init xc2 (center 2)
nlsf.funcX$=data1_a; // X data to be used to create fit dataset
nlsf.funcCol$=Data1_c$(j); // fit dataset



for(ii=1;ii<=2;ii+=1) // Parameterbestimmung

{

nlsf.p$(3*ii)=0,01124; // initialize widths p3 (w1), and p6 (w2)
nlsf.p$((3*ii)+1)=0.001; // initialize Areas p4 (A1), and p7 (A2);

};


nlsf.fit(50); // perform 20 iterations
Can anybody help me? Thanks!!

easwar

USA
1965 Posts

Posted - 01/28/2003 :  10:34:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Does increasing the number of iterations in your script help? Depending on your data, you may have a rather broad/flat chi-sq surface and if that is the case, you may get different parameters based on how many iterations, because the chi-sq may not be changing when the parameters change slightly.

If the above does not help, you should send your data to your local tech support representative so that they can run your script and see what the problem could be.

Easwar
OriginLab.

Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000