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
 Origin Forum
 curve fitting with duoble integral

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
modelocking Posted - 06/22/2007 : 10:30:13 AM
Hi guys!
I need o fit thermoluminescence data with the ensuing eq:



I wrote this code (with dsX=T', dsY=E ) but it didn't compile. Someone can help me?
Thanks a lot

static double Bstore, Cstore, Astore, Gstore, y0store, Sstore, Dstore;
//static property retains the parameter values over iterations
BOOL bErr;
Dataset dsX("Data1_Q");
Dataset dsE("Data1_E");
Dataset dsInteg("Data1_F");
Dataset dsY("Data1_R");
Dataset dsM("Data1_P");
Dataset dsInteg2("Data1_T");
if(B!=Bstore || C!=Cstore || A!=Astore || G!=Gstore || y0!=y0store || S!=Sstore || D!=Dstore ) { //parameter checking
dsE = exp(-dsY/(8.5e-5*dsX)); //vector notation
Curve W( "Data1_Q", "Data1_E" );
IntegrationResult ir;
bErr = Curve_integrate(&W, &ir, NULL, &dsInteg, TRUE );
// Perform integration
dsM = B/(2.5*C)*S*exp(-((dsY-G)^2)/(2*C^2))*exp(-dsY/(8.5e-5*dsX))*exp(-S/0,2*dsInteg); //vector notation
Curve Z( "Data1_Q", "Data1_T" );
IntegrationResult ir;
bErr = Curve_integrate(&Z, &ir, NULL, &dsInteg2, TRUE );
// Perform integration
Bstore=B; Cstore=C; Astore=A; Gstore=G; y0store=y0; Sstore=S; Dstore=D
}
y = y0+D*Data_table(x, &dsInteg2, &dsX, &dsY);
7   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 06/22/2007 : 1:58:03 PM
Err, I hope you realize that both integrals range over the X values of dsX or Data1_Q. In particular, the outer integral does not extend to infinity as shown in your equation.

Mike Buess
Origin WebRing Member
modelocking Posted - 06/22/2007 : 12:53:30 PM
MIKE YOU ARE GREAT!!!!!!!!!!!!!!
I changed coma with dot and deleted he 2nd Intregrateresult ir, and now it compiles succesfully!!!!
The problem now is that the function doesn't generate values....
Thank your very much


Edited by - modelocking on 06/22/2007 12:57:50 PM

Edited by - modelocking on 06/22/2007 1:21:12 PM
Mike Buess Posted - 06/22/2007 : 12:35:29 PM
Double click on the first error message and see which line the cursor moves to.
quote:
If I can't use IntegrationResult ir twice how can I calculate the double integral?
IntegrationResult ir just holds certain parameters such as the total area. You don't use those parameters and only use the integration curve. Therefore you can reuse the first ir. Just comment out the second IntegrationResult ir. It is odd that this wasn't flagged by your compiler. That's the first error that popped up when I tried your function in O70 and O75.

...The last factor in the equation for dsM always draws my attention. In your initial code you write that factor as exp(-S/0,2*dsInteg) which doesn't make sense unless you are using the European decimal notation with comma as separator. The only way I can get your function to compile is to change the comma to dot. However, all other numbers in your code already use dot as decimal separator. Is this just a misprint? Is the misprint there in your actual code?

Mike Buess
Origin WebRing Member]

Edited by - Mike Buess on 06/22/2007 12:47:33 PM
modelocking Posted - 06/22/2007 : 12:20:56 PM
Hi Mike! Thanks for Your help.
I delete the last argument in the data table...but this is the error message:

Error, function call and declaration mismatch
Error, general compile error
Error, general compile error
Error, error(s) found in compiling function _nlsfFittingFunction
Error, function call and declaration mismatch
Error, general compile error
Error, general compile error
Error, error(s) found in compiling function _nlsfFittingFunction


Mike Buess Posted - 06/22/2007 : 12:15:06 PM
quote:
The error message is " funtion call and declaration mismatch", but it does not point at any line of my code (I use Origin 7.0).
Double-click on the error message and it will take you directly to the offending line. I suspect that is the final equation for y in which you misused the Data_table() function.

Mike Buess
Origin WebRing Member
modelocking Posted - 06/22/2007 : 12:11:31 PM
The error message is " funtion call and declaration mismatch", but it does not point at any line of my code (I use Origin 7.0).
x is the independent variable and y is the dependent one.
If I can't use IntegrationResult ir twice how can I calculate the double integral?




Edited by - modelocking on 06/22/2007 12:14:02 PM

Edited by - modelocking on 06/22/2007 12:15:33 PM

Edited by - modelocking on 06/22/2007 12:16:45 PM
Mike Buess Posted - 06/22/2007 : 11:50:41 AM
What is the error message and which line in the code you showed us does the error point to?

...Also, what your dependent variable(s), independent variable(s) and parameters?

...Even without knowing the answers to those questions I found two mistakes.

1. You use IntegrationResult ir twice.

2. The final equation for y is clearly wrong because Data_table() takes only three arguments.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 06/22/2007 11:52:25 AM

Edited by - Mike Buess on 06/22/2007 12:10:11 PM

Edited by - Mike Buess on 06/22/2007 12:11:44 PM

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