Evaluating a function using kramers-kronig relation
14 次查看(过去 30 天)
显示 更早的评论
Hello , I have this function :

and want to evalute the function nR using this integral (cauchy principal value)

The problem is this integral have 2 variables (one remains constant during the integration) , I spend a lot of time figuring it out and couldn't (I'm relatively new to matlab) , I would be happy if someone provides a code on how to evaluate nR as function for w
0 个评论
回答(2 个)
Dyuman Joshi
2023-5-2
编辑:Dyuman Joshi
2023-5-4
You can use symbolic integration (Note - Requires Symbolic Toolbox)
As you have not provided the value of P, I've defined it as a symbolic variable. You can either use the value of P directly by simply defining it, or use subs to substitute the value in the final expression.
syms w x
val = 2*sym(pi)*10^11;
Tau = 0.25*val;
w0 = 500*val;
K(w) = Tau^2/(2*sym(pi)*((w-w0)^2+Tau^2));
nr(w) = 1 + 2*int(x*K(x)/(x^2-w^2), x, 0, Inf, 'PrincipalValue', 1)/pi
2 个评论
Dyuman Joshi
2023-5-3
编辑:Dyuman Joshi
2023-5-4
Ah, I see, thanks for the info, I was not familiar with this syntax. I have edited my answer.
Torsten
2023-5-2
syms omega omega0 Omega Gamma real
kappa(omega) = 1/(2*pi) * Gamma^2/((omega-omega0)^2 + Gamma^2) ;
nR(omega) = 1 + 2/pi*int(Omega*kappa(Omega)/(Omega^2-omega^2),Omega,0,Inf,'PrincipalValue',1);
vpa(subs(nR(1.2),[Gamma omega0],[0.25*1e11*2*pi,500*1e11*2*pi]))
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
