summaryrefslogtreecommitdiff
path: root/useful_functions.m
diff options
context:
space:
mode:
Diffstat (limited to 'useful_functions.m')
-rw-r--r--useful_functions.m11
1 files changed, 11 insertions, 0 deletions
diff --git a/useful_functions.m b/useful_functions.m
index 5522afb..2ae4ced 100644
--- a/useful_functions.m
+++ b/useful_functions.m
@@ -141,3 +141,14 @@ function [rhoLiouville_dot, L]=constran_rho_and_match_L(
rhoLiouville_dot(1)=1;
endfunction
+% calculate sucseptibility for the field at given frequency index
+function kappa=sucseptibility(wi, rhoLiouville, dipole_elements, Nlevels, Nfreq)
+
+ rho=rhoOfFreq(rhoLiouville, wi, Nlevels, Nfreq);
+ kappa=0;
+ for i=1:Nlevels
+ for j=1:Nlevels
+ kappa+=dipole_elements(j,i)*rho(i,j);
+ endfor
+ endfor
+endfunction