From cd2b70a897ec5b7f45be9df10209f493635208d8 Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Sun, 13 Dec 2009 18:15:41 +0000 Subject: added function which convert frequency to its iondex in the frequency array --- liouville.m | 2 +- useful_functions.m | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/liouville.m b/liouville.m index 4ce714c..2f6a28e 100644 --- a/liouville.m +++ b/liouville.m @@ -79,7 +79,7 @@ for detuning_p_cntr=1:N_detun_steps+1; %rho_d=rhoOfFreq(rhoLiouville, 3, Nlevels, Nfreq); % drive frequency %rho_m=rhoOfFreq(rhoLiouville, 4, Nlevels, Nfreq); % opposite sideband frequency - kappa_p(detuning_p_cntr)=susceptibility(2, rhoLiouville, dipole_elements, Nlevels, Nfreq); + kappa_p(detuning_p_cntr)=susceptibility(freq2index(wp,modulation_freq), rhoLiouville, dipole_elements, Nlevels, Nfreq); %kappa_m(detuning_p_cntr)=susceptibility(4, rhoLiouville, dipole_elements, Nlevels, Nfreq); detuning_freq(detuning_p_cntr)=detuning_p; diff --git a/useful_functions.m b/useful_functions.m index c0fdd7e..dda3d1d 100644 --- a/useful_functions.m +++ b/useful_functions.m @@ -202,4 +202,9 @@ function kappa=susceptibility(wi, rhoLiouville, dipole_elements, Nlevels, Nfreq) endfor endfunction +function index=freq2index(freq, modulation_freq) +% convert modulation freq to its index in the modulation_freq vector + index=[1:length(modulation_freq)](modulation_freq==freq); +endfunction + % vim: ts=2:sw=2:fdm=indent -- cgit v1.2.3