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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Lorentz fit with 2 peaks in multiple curve fitting

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
jeanne Posted - 09/16/2003 : 6:13:31 PM
Hello!

I try to write a script to fit 400 graphs with the same fitting Lorentz function (2 peaks).
It works if I fit only one graph, but when I try to integrate the fitting routine in a loop it doesn’t work anymore.

Can anybody help me?
Thank you in advance !!
Jeanne.

Here is the script:

for (ii=10;ii<32;ii ++)
{

window -n wks jeanne4_$(ii);# new worksheet;
worksheet -a 2;# init column;
open -w G:\home\AS $(ii) 001.txt;# file path;
window -r AS$(ii)001 LOR001$(ii);# rename

worksheet -t 1 4;# column 1= X;# X;
worksheet -n 2 intensity;# Y column name;

worksheet -s 2 0;# select column;
worksheet -p 201; # graph type;

# trace ;

window -r %H GRAS$(ii)001;# graph name;
window -i GRAS$(ii)001; #iconize it ;
window -a LOR001$(ii); #select ;
window -i LOR001$(ii);#iconize it;

#fit bilorentz;

nlsf.init(); // initialize the fit ;
nlsf.func$=Gauss; // define function to be used during fitting ;
nlsf.fitData$=LOR001$(ii)_intensity; // define data to be fitted;
nlsf.numReplica=1; // implies 2 peaks ;
nlsf.p1=150; // initialize y0 ;
nlsf.p2=-88; // init xc1(center 1) ;
nlsf.p5=88; // init xc2 (center 2) ;
nlsf.p3=18; // init w1;
nlsf.p6=23; // init w2;
nlsf.p4=5000; // init A1 ;
nlsf.p7=5000; // init A2 ;
nlsf.funcX$=LOR001$(ii)_a; // X data to be used to create fit dataset ;
nlsf.funcCol$=LOR001$(ii)_c; // fit dataset;

nlsf.fit(20); // perform 20 iterations ;
nlsf.end(); // report fit results to log and fit label;

};

I still have to do the following :

#PURPOSE: put the data in a array:;
#first colunm number of graph 1 to 400;
#2nd height pic1 Y0 en X0;
#3rd width half hight W0;
#4th area pic1 A0;
#5th height pic2 Y1 en X1;
#6th width half hight W1;
#7eme area pic2 A1;
#8eme height average Y3;
#9eme width half hight average W3;
#10eme area average A3;

1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 09/26/2003 : 10:13:34 AM
Hi Jeanne,

I think you'll have to tell us where and how the script goes wrong. The script is fairly long and we need a clue about where to focus.

Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000