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
 complex fit function in Origin 8?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

radoslavb

USA
Posts

Posted - 08/25/2008 :  5:24:42 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
This question is for OriginPro 8.0 SP2

I have data in 3 columns:
col(omega) = (x-axis)
col(y_Re) = real part
col(y_Im) = imaginary part

I need to fit simultaneously the real and imaginary part to the complex Debye equation
A/(1+i*omega*tau),

where "A" and "tau" are fitting parameters (both are real).

The Debye equation can be separated in Re and Im parts analytically (and I have already done independent fits to the Re and Im parts), however I need the fit to satisfy both parts simultaneously with one set of parameters. In addition, there are generalizations of the Debye eqn. which cannot be separated analytically in Re and Im parts. Is there a way to define a complex fitting function?

Thanks,
rb

Echo_Chu

China
Posts

Posted - 08/26/2008 :  05:15:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Your function is

y1 + i * y2 = A/(1+i*omega*tau),

Then it can be write as

y1 + i * y2 = A/(1+(omega*tau)^2) - i * (A*tao)/(1+(omega*tau)^2)

That is,

y1 = A/(1+(omega*tau)^2);
y2 = -(A*tao)/(1+(omega*tau)^2)

So it can be solved by defining a function with multiple independents. You can refer to this page to see how to fit with multiple independent variable.

Echo
OriginLab Corp

quote:
Originally posted by radoslavb

This question is for OriginPro 8.0 SP2

I have data in 3 columns:
col(omega) = (x-axis)
col(y_Re) = real part
col(y_Im) = imaginary part

I need to fit simultaneously the real and imaginary part to the complex Debye equation
A/(1+i*omega*tau),

where "A" and "tau" are fitting parameters (both are real).

The Debye equation can be separated in Re and Im parts analytically (and I have already done independent fits to the Re and Im parts), however I need the fit to satisfy both parts simultaneously with one set of parameters. In addition, there are generalizations of the Debye eqn. which cannot be separated analytically in Re and Im parts. Is there a way to define a complex fitting function?

Thanks,
rb


Go to Top of Page

radoslavb

USA
Posts

Posted - 08/26/2008 :  11:40:14 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by Echo_Chu


...
So it can be solved by defining a function with multiple independents. You can refer to this page to see how to fit with multiple independent variable.




Do you mean multiple Dependents (y1, y2)?
Go to Top of Page

greg

USA
1378 Posts

Posted - 08/26/2008 :  3:16:56 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I tested the following which works in Origin8 (and should work in earlier versions as well). Note that the y2 formula is different than in Echo's post:

Indpendent Variable omega
Dependent Variables y1,y2
Parameter Names A,tau
Function
y1= A/(1+(omega*tau)^2);
y2=-(A*tau*omega)/(1+(omega*tau)^2);
and check Use OriginC.

For Parameter initialization, you can use:
A=1;
tau=1;
(unless you have a better idea of what you parameters are close to.)

When you use this function, you will need to assign omega, y1 and y2 to three datasets.

Edited by - greg on 08/26/2008 5:31:10 PM
Go to Top of Page

greg

USA
1378 Posts

Posted - 08/26/2008 :  3:58:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can also use complex numbers within OriginC:

Independent Var omega
Dependent var y1,y2
Parameter names A,tau
Using OriginC our function definition becomes:

complex cc = A/(1+1i*omega*tau);
y1 = cc.m_re;
y2 = cc.m_im;


Edited by - greg on 08/26/2008 5:29:55 PM
Go to Top of Page

radoslavb

USA
Posts

Posted - 08/27/2008 :  5:11:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, Greg!
Your second comment is particularily useful, since it will work even if the complex function does not have a nice analytical separation of real and imaginary parts. I've tested both methods and they both work.
-Regards!
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