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

5 visualizaciones (últimos 30 días)
Chirag Patil
Chirag Patil el 15 de Ag. de 2015
Comentada: Star Strider el 15 de Ag. de 2015
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 comentario
Star Strider
Star Strider el 15 de Ag. de 2015
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’.

Iniciar sesión para comentar.

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by