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
 nlsf fitting from script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

evanm

Canada
Posts

Posted - 06/21/2004 :  06:21:03 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Mike Buess

USA
3037 Posts

Posted - 06/21/2004 :  8:24:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Evan,

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

nlsf.fitdata1$=%C;

Mike Buess
Origin WebRing Member
Go to Top of Page

evanm

Canada
Posts

Posted - 06/22/2004 :  03:57:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
Go to Top of Page

evanm

Canada
Posts

Posted - 06/22/2004 :  09:57:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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.
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