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

pegor

Germany
Posts

Posted - 01/23/2008 :  2:02:32 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
I want to make a fit with a complex function, that is i want to fit the real part of the complex function to my data. Is it possible to do that?

larry_lan

China
Posts

Posted - 01/23/2008 :  9:43:50 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pegor:

The Dependent / Independent variable should be Real. So if your source data is complex, you can seperate the real and imaginary part into two columns, and pass the real value to the fitter.

Otherwise, if you want to include complex calculation in your function, and your input/output is real, you can define an Origin C fitting function like:


complex cc(0.0, b), dd; // cc = bi
dd = a*x+cc; // dd = a*x+bi
y = cc.m_re; // Return the real part of the complex number

(where a, b are fitting parameters)

Thanks
Larry
OriginLab Technical Services
Go to Top of Page

pegor

Germany
Posts

Posted - 01/24/2008 :  07:54:55 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Lary,

My dependent /independent variables are all real. This is the function i have.
y=(x-G)/((x-G)^2)-D^2)^0.5;

G and D are the variables wich i want to fit. I want to fit the real part of this function to my data.

How can i seperate the real and the imaginary parts into two coloumns?

Thank you
Pegor
Go to Top of Page

larry_lan

China
Posts

Posted - 01/24/2008 :  8:27:29 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Pegor:

You don't need to seperate the real and the imaginary parts since the dependent/independent variables are all real. I think you got a complex number during the calculation. So you can define the function body like:

complex cc;
cc = (x-G)/((x-G)^2)-D^2)^0.5;
y = cc.m_re; // variable.m_re returns the real part of a complex number


BTW: What's your Origin version? Such complex calculation requires Origin 7.0 or later.

Thanks
Larry
OriginLab Technical Services

Edited by - larry_lan on 01/24/2008 8:31:29 PM
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