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
 convolution
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

modelocking

Posts

Posted - 04/29/2007 :  11:17:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin):7.0
Operating System:Win XP

Hi guys!
I need to fit experimental data with a convolution of gaussian and exponential decay. I tried to follow instrunction found in this forum and wrote what fallows:


static double Bstore, Cstore;
//static property retains the parameter values over iterations
BOOL bErr;
Dataset dsX("Data1_A");
Dataset dsE("Data1_E");
Dataset dsInteg("Data1_F");
if(B!=Bstore || C!=Cstore) { //parameter checking
dsE = (C*(exp(-0.5*((dsX-15)/4)^2))*exp((-x+dsX)/B)); //vector notation
Curve W( "Data1_A", "Data1_E" );
IntegrationResult ir;
bErr = Curve_integrate(&W, &ir, NULL, &dsInteg, TRUE );
// Perform integration
Bstore=B; Cstore=C
}
y = Data_table(x, &dsInteg, &dsX);

This function compiles succesfully, but curve fitting doesn't work!
Any good idea?
Thanks

Edited by - modelocking on 04/29/2007 12:38:37 PM

Deanna

China
Posts

Posted - 04/29/2007 :  10:32:36 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Did you mean this article in our k-base?
http://www.originlab.com/www/support/resultstech.aspx?ID=121&language=English&Version=7.5

You mentioned that "curve fitting doesn't work". Is it because of improper initial parameter values (note that you have to enter initial values by yourself)? Could you please provide us more details on how the curve fitting "doesn't work"?

Deanna
OriginLab Technical Services
Go to Top of Page

modelocking

Posts

Posted - 04/30/2007 :  02:58:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Yes, I wrote the function fallowing that example.
I don't think the problem is parameters initialization: C and B have physical meanings, so I know their values a priori. Anyway I try to initialize with many several values, but it always appears the message that the function is not generating values.I'm working on Y-Script.
Maybe the problem is that independent variable x and integrating variable dsX works on the same data column?
Thanks
Go to Top of Page

larry_lan

China
Posts

Posted - 04/30/2007 :  04:11:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Maybe you can provide your data and initial values to tech@originlab.com ?

Larry
OriginLab Technical Services

Edited by - larry_lan on 04/30/2007 04:12:01 AM
Go to Top of Page

Deanna

China
Posts

Posted - 04/30/2007 :  04:22:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
My data is in Column A and B of the Data1 workbook. And the example works fine for me.

Deanna
OriginLab Technical Services
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 04/30/2007 :  09:21:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
I'm working on Y-Script.
I'm pretty sure you should use Equations when you fit with OriginC. In fact, you don't even see that option unless the Use Origin C option is unchecked. Select Form = Equations and then check the Use Origin C option.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 04/30/2007 09:26:30 AM
Go to Top of Page

modelocking

Posts

Posted - 04/30/2007 :  1:06:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Mike but you're wrong.
When "compile before use" is checked both Y-Script and Equation are interpreted in Origin C......I read it on the help...
Anyway.... I made a little algebra on the convolution, added a new data column for the integration variable and now it seems to work well...
I will let you Know.
Thank a lot everybody!!!!
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