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
 nlsf fitting from script

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
evanm Posted - 06/21/2004 : 06:21:03 AM
Hello,
I have been trying to perform a Lorentzian fit on a section of data but I have run into a few problems. My code looks as follows:

nlsf.begin();
nlsf.init();
nlsf.func$ = "Lorentz";
nlsf.fitdata1$ = %(%H,@D); //gets dataset of active graph
nlsf.dataBegin = Estarti+1; //starting index
nlsf.dataEnd = Eendi+1; //end index
nlsf.dataStep = 1;
nlsf.iterate(20);
//deal with fitting parameters here
nlsf.unInit();
nlsf.cleanUpFitData();
nlsf.end();

My script is designed to be ran and then the user clicks on the active graph from which I calculate the indices Estarti and Eendi. I have found that when I run this I get garbage values for the nlsf parameters (nlsf.p#). But then if I perform the same fit by clicking "Alanysis->Fit Lorentzian" and then rerun the script I get the propper values. Does anyone know why this is?

Thanks, Evan.
3   L A T E S T    R E P L I E S    (Newest First)
evanm Posted - 06/22/2004 : 09:57:43 AM
Ok now after getting it to work seemingly just fine I have run into another problem. It basically goes as follows: I can run my fitting script sequentially as many times as I like and all is good. Then if I fit the same graph data using the menu it also works fine. But then if I run my script on the same graph I get the following error:

The number of cells in a matrix (rows X columns) must not exceed 90,000,000. Please re-enter your matrix row and column dimensions accordingly.
unknown error
unknown error

When this happens I also have the problem that a curve created from the graph's datasets is not created properly, so if I try to access its elements I get garbage values. ie...
Curve cvData(dsXName, dsYName);
Then if I do Curve_x(&cvData, 0) I get -0.0000 which makes no sense and is not the value in the worksheet. (And yes I have the dataset names correct). Does anyone know what is going on here, or has anyone ever had a problem like this before?

Thank you, Evan Morris.
evanm Posted - 06/22/2004 : 03:57:41 AM
Ok I figured out my problem. I simply had to provide the fitter with some initial fitting parameter values to help it along. This is why it worked after I fitted from the pull down menu.
Mike Buess Posted - 06/21/2004 : 8:24:38 PM
Hi Evan,

%C holds the name of the active dataset, so try this...

nlsf.fitdata1$=%C;

Mike Buess
Origin WebRing Member

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