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
 Error while fitting using External DLL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

aekalavya

USA
9 Posts

Posted - 11/30/2011 :  2:40:02 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.8.1 and Service ReleaseSR3 (Select Help-->About Origin):
Operating System:Win7Pro

Hello Origin team,
I am trying to fit some data using fitfunction by calling external DLL that uses GNU library.
I was able to simulate the curve with some parameters. But, when I try to fit the data, it is showing following error.

"This application has requested the runtime to terminate it in an unusual way. Please contact the application support team for more information".

I am attaching some of my data, FDF, and DLL files. http://dl.dropbox.com/u/5355142/OriginFiles.zip
Could you please troubleshoot this and help me out.
Thank you.



-Shiva

Sam Fang

293 Posts

Posted - 11/30/2011 :  8:38:46 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for reporting the problem.

I have reported your problem in our bug tracking database, ID ORG-4485.

We will look into it.

Sam
OriginLab Technical Services
Go to Top of Page

Sam Fang

293 Posts

Posted - 12/05/2011 :  01:49:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We found the problem may be caused by the integral function itself. When the integral function’s value is 1/0, the integral value may overflow. I noticed your integral function in “FitFuncs.c” is:
----------------------------------------------------------------------
return x * (x-alpha * intensity /beta) * exp(-factor*pow(x,0.66)/(8.617E-5*temp))/(x-alpha*intensity/beta*exp(-(x*beta-alpha*intensity)*time));

----------------------------------------------------------------------

The denominator part: (x-alpha*intensity/beta*exp(-(x*beta-alpha*intensity)*time)) may be zero. To avoid the overflow, you can change your code as follows.
----------------------------------------------------------------------
double dd = x-alpha*intensity/beta*exp(-(x*beta-alpha*intensity)*time);
if ( fabs(dd) < 1e-12 && dd >= 0 )
  dd = 1e-12;
else if ( fabs(dd) < 1e-12 && dd < 0 )
  dd = -1.0e-12;
return x * (x-alpha * intensity /beta) * exp(-factor*pow(x,0.66)/(8.617E-5*temp)) / dd;

----------------------------------------------------------------------

Sam
OriginLab Technical Services

Edited by - Sam Fang on 12/05/2011 01:50:21 AM
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