From 8cf18ef2c11ec787df4a670270235545bc191b8f Mon Sep 17 00:00:00 2001 From: Eugeniy Mikhailov Date: Sat, 16 Jan 2010 00:14:49 +0000 Subject: i think this is better absorption calculation --- useful_functions.m | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/useful_functions.m b/useful_functions.m index f799f90..2eef299 100644 --- a/useful_functions.m +++ b/useful_functions.m @@ -291,10 +291,20 @@ function total_absorption=total_field_absorption(atom_field_problem) % summed across all frequencies field absorption coefficient global atom_properties; [dEdz_linear, dEdz_left, dEdz_right]=dEdz( atom_field_problem); - dEdz_total= dEdz_linear .* conj(dEdz_linear) ... - +dEdz_left .* conj(dEdz_left) ... - +dEdz_right .* conj(dEdz_right); - total_absorption = sum(dEdz_total); + %dEdz_total= dEdz_linear .* conj(dEdz_linear) ... + %+dEdz_left .* conj(dEdz_left) ... + %+dEdz_right .* conj(dEdz_right); + %total_absorption = sum(dEdz_total); + + %total_absorption = |E|^2 - | E - dEdz | ^2 + 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); endfunction -- cgit v1.2.3