Author |
Topic |
|
pegor
Germany
Posts |
Posted - 01/23/2008 : 2:02:32 PM
|
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
|
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 |
|
|
pegor
Germany
Posts |
Posted - 01/24/2008 : 07:54:55 AM
|
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 |
|
|
larry_lan
China
Posts |
Posted - 01/24/2008 : 8:27:29 PM
|
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 |
|
|
|
Topic |
|
|
|