Evaluating a function using kramers-kronig relation
33 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (2)
Dyuman Joshi
am 2 Mai 2023
Bearbeitet: Dyuman Joshi
am 4 Mai 2023
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 Kommentare
Dyuman Joshi
am 3 Mai 2023
Bearbeitet: Dyuman Joshi
am 4 Mai 2023
Ah, I see, thanks for the info, I was not familiar with this syntax. I have edited my answer.
Torsten
am 2 Mai 2023
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 Kommentare
Siehe auch
Kategorien
Mehr zu Calculus finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
