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
 Origin Forum
 Question on partial derivatives in 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

skyocean

USA
2 Posts

Posted - 04/15/2002 :  11:10:30 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

For non-linear least squares fitting with a user supplied fitting function, I want to supply the partial derivatives of the parameters. For example, I define the following script(actually it comes from the origin help):
y=m*x+b;
y'm=x;
y'b=1;
check "Compile before use", then press "Check" button, origin will complain the following message in script window:
Error, Invalid statement
Error, error(s) found in compiling function _nlsfFittingFunction
Otherwise, if i don't check "Compile before use", it works, the fitting speed, however, is extremely slow. Does anyone has this kind of experience, thanks.

easwar

USA
1964 Posts

Posted - 04/16/2002 :  12:17:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Support for specifying partial derivatives was added at the LabTalk level in 6.x. This is not yet supported in Origin C in 7.0.

When you check the Compile check box, your code in the edit window is expected to be in C syntax, and this is why you get the error from the compiler.

Now, partial derivative support was added earlier to speed things up with LabTalk scripts in fitting - specifying partial derivatives only gave a gain in speed of about 30% or so.

Now, with Origin C, the gain in speed can be a factor of 20 or so over LabTalk, when fitting. So the best option for you would be to NOT put in partial derivatives in your code, and then CHECK the Compile check box.

Easwar
OriginLab.

Edited by - easwar on 04/16/2002 12:19:53

Edited by - easwar on 04/16/2002 12:20:57
Go to Top of Page

skyocean

USA
2 Posts

Posted - 04/17/2002 :  09:30:24 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Easwar,

Thank you so much for your reply. However, I suggest the origin help should explain this, it only says partial derivatives will give a gain in speed, so make me fuzzy about what I have tried. Thanks again, Easwar.
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