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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Error while fitting using External DLL

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
aekalavya Posted - 11/30/2011 : 2:40:02 PM
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
2   L A T E S T    R E P L I E S    (Newest First)
Sam Fang Posted - 12/05/2011 : 01:49:41 AM
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
Sam Fang Posted - 11/30/2011 : 8:38:46 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000