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
 Forum for Origin C
 NLSF
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ardaerhan

Germany
Posts

Posted - 03/04/2005 :  12:05:17 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System:Windows XP

Hi All,

i am performing non linear fitting using the following labtalk commands:

// Perform nonlinear fit with ExpDec function
using NLSF = LabTalk.NLSF; // Point to LabTalk NLSF object
NLSF.Init(); // Initialize NLSF object
NLSF.Func$ = "exp"; // Select function
NLSF.P1 = A; // Perform parameter initialization
NLSF.P2 = L;
NLSF.FitData$ = expData.GetName(); // Set fit dataset name
NLSF.Wtype = 3; // Set NLSF weighting method to arbitrary dataset
NLSF.W$ = expErr.GetName(); // Set error dataset name
NLSF.ChiSqrErr = 0; // Turn off scaling of parameters with chisqr
NLSF.Fit(100); // Perform 100 iterations
NLSF.Fit(100); // Repeat a couple of times to ensure convergence
NLSF.Fit(100); // Not all 100 iterations will be performed each time
NLSF.PasteParams("P"); // Paste parameters to plot
NLSF.End(); // End fitting session


what i need is just the parameters of the fitting, i dont want origin to plot the graph, because im performing 100 fits and this takes so long time if it will plot the 100 curves.

Thank you
Arda

easwar

USA
1965 Posts

Posted - 03/04/2005 :  12:29:26 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Arda,

Add the following line right after NLSF.Init():
NLSF.output(0);

Also, please change the lines
NLSF.Fit(100)
to
NLSF.IterateEx(100);
Otherwise you will get multiple NLSF result worskheets - this was a mistake in the example area - we will update.

You should also then remove the line
NLSF.PasteParams("P")

Easwar
OriginLab

Go to Top of Page

ardaerhan

Germany
Posts

Posted - 03/04/2005 :  4:08:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Easwar;

I did as you said :
using NLSF = LabTalk.NLSF;
NLSF.Init();
NLSF.output(0);
NLSF.Func$ = "user6";
NLSF.P1 = Io;
NLSF.P2 = p;
NLSF.P3 = xo;
NLSF.P4 = dL;
NLSF.V4 = 0;
NLSF.FitData$ = cosData.GetName();
NLSF.Wtype = 3;
NLSF.W$ = D.GetName();
NLSF.ChiSqrErr = 0;
NLSF.IterateEx(100);
NLSF.End();

but im still getting the graphs? is there a problem with what i did.
thank you for your help

quote:

Hi Arda,

Add the following line right after NLSF.Init():
NLSF.output(0);

Also, please change the lines
NLSF.Fit(100)
to
NLSF.IterateEx(100);
Otherwise you will get multiple NLSF result worskheets - this was a mistake in the example area - we will update.

You should also then remove the line
NLSF.PasteParams("P")

Easwar
OriginLab



Go to Top of Page

easwar

USA
1965 Posts

Posted - 03/04/2005 :  4:53:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Arda,

I tried the function pasted below in 7SR4 and 7.5SR5 and in both cases, I do not get a graph created. Perhaps you can debug the code and see when the graph gets created?

Note that I used NLSF.end(13) instead of nlsf.end() - but that is to turn off reporting to result log, turn off the result worksheet etc. and using 13 or leaving it as no argument both did not create a graph for me.

Easwar
OriginLab


void test()
{
using NLSF = LabTalk.NLSF;
NLSF.Init();
NLSF.output(0);
NLSF.Func$ = "expdecay1";
NLSF.P1 = 70;
NLSF.P2 = 0.01;
NLSF.P3 = 80;
NLSF.P4 = 0.2235;
NLSF.V4 = 0;
NLSF.FitData$ = "data1_b";
NLSF.Wtype = 3;
NLSF.W$ = "data1_c";
NLSF.ChiSqrErr = 0;
NLSF.IterateEx(100);
NLSF.IterateEx(100);
NLSF.IterateEx(100);
NLSF.End(13);
}


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