summaryrefslogtreecommitdiff
path: root/useful_functions.m
diff options
context:
space:
mode:
Diffstat (limited to 'useful_functions.m')
-rw-r--r--useful_functions.m22
1 files changed, 16 insertions, 6 deletions
diff --git a/useful_functions.m b/useful_functions.m
index e675ba1..9127cab 100644
--- a/useful_functions.m
+++ b/useful_functions.m
@@ -287,7 +287,7 @@ function [dEdz_linear, dEdz_left, dEdz_right]=dEdz( atom_field_problem)
endfor
endfunction
-function total_absorption=total_field_absorption(atom_field_problem)
+function relative_transmission=total_relative_transmission(atom_field_problem)
% summed across all frequencies field absorption coefficient
global atom_properties;
[dEdz_linear, dEdz_left, dEdz_right]=dEdz( atom_field_problem);
@@ -300,11 +300,21 @@ function total_absorption=total_field_absorption(atom_field_problem)
E_field.linear = atom_field_problem.E_field.linear;
E_field.right = atom_field_problem.E_field.right;
E_field.left = atom_field_problem.E_field.left;
- total_absorption_v = ...
- abs(E_field.linear).^2 - abs(E_field.linear - (1i)*dEdz_linear).^2 ...
- +abs(E_field.right).^2 - abs(E_field.right - (1i)*dEdz_right).^2 ...
- +abs(E_field.left).^2 - abs(E_field.left - (1i)*dEdz_left).^2;
- total_absorption=sum(total_absorption_v);
+
+ modulation_freq = atom_field_problem.modulation_freq ;
+ pos_freq_indexes=(modulation_freq>0);
+ transmited_intensities_vector = ...
+ abs(E_field.linear + (1i)*dEdz_linear).^2 ...
+ +abs(E_field.right + (1i)*dEdz_right).^2 ...
+ +abs(E_field.left + (1i)*dEdz_left).^2;
+ transmited_intensities_vector = transmited_intensities_vector(pos_freq_indexes);
+ input_intensities_vector = ...
+ abs(E_field.linear).^2 ...
+ +abs(E_field.right).^2 ...
+ +abs(E_field.left).^2;
+ input_intensities_vector = input_intensities_vector(pos_freq_indexes);
+
+ relative_transmission = sum(transmited_intensities_vector) / sum(input_intensities_vector);
endfunction
% create full list of atom modulation frequencies from positive light frequency amplitudes