Author |
Topic  |
|
skyocean
USA
2 Posts |
Posted - 04/15/2002 : 11:10:30 PM
|
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
1965 Posts |
Posted - 04/16/2002 : 12:17:59 PM
|
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 |
 |
|
skyocean
USA
2 Posts |
Posted - 04/17/2002 : 09:30:24 AM
|
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. |
 |
|
|
Topic  |
|
|
|