How to use a Digamma function with a complex argument.?

4 ビュー (過去 30 日間)
Chirag Patil
Chirag Patil 2015 年 8 月 15 日
コメント済み: Star Strider 2015 年 8 月 15 日
Hello, I'm trying to fit a curve with some experimental values. But I cant solve the equation with complex argument in the Digamma function (psi).
if true
% code
end
h=6.62606957e-34;
f0=5.45e9;
kB=1.3806488e-23;
%T0=200e-3; %in kelvin
T0=130e-3;
x=0.5+((h*f0)/(2*pi*1i*kB*T0));
g2=real(psi(sym(x)));
T=200e-3;
x=0.5+((h.*f0)./(2*pi*1i*kB.*T));
g1=real(psi(sym (x)));
delf0=(f-f(7))./f(7);
freq=@(b,x) (b(1)/pi)*(log(x./T0)-(g1-g2));
b0=7.8893e-05;
beta=nlinfit(T,delf0,freq,b0);
---------------- I get the follow error ----------------
if true
% code
end
Undefined function 'isfinite' for input arguments of
type 'sym'.
Error in nlinfit (line 242)
if funValCheck && ~isfinite(sse), checkFunVals(r); end
Error in f0_temp_fit (line 26)
beta=nlinfit(T,delf0,freq,b0);
What is wrong with the code ? PS: I have not included the data acquisition part in this code above.
Thanks, /C
  1 件のコメント
Star Strider
Star Strider 2015 年 8 月 15 日
Some problems:
  1. Don’t use sym. There is no reason for it in your code;
  2. Your ‘g1’ and ‘g2’ are exactly the same, so (g1-g2)=0;
  3. ‘T’ has to be a vector the same size as ‘delf0’.

サインインしてコメントする。

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by