summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2012-01-13 00:15:25 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2012-01-13 00:17:13 -0500
commit8a56ad5f67b534aca62b6e6c561aaa9fac0893f6 (patch)
treeb1ecb22592cdf398261b40f6fa437b302c2418d3
parentdfa371fd839e92434503628457da13df3e6ba0b4 (diff)
downloadNresonances-8a56ad5f67b534aca62b6e6c561aaa9fac0893f6.tar.gz
Nresonances-8a56ad5f67b534aca62b6e6c561aaa9fac0893f6.zip
Doppler: Temperature and Ndens argument properly treated
-rw-r--r--xmds2/Nlevels_with_doppler_with_z_4wm/Nlevels_with_doppler_with_z_4wm.xmds26
-rw-r--r--xmds2/TODO15
2 files changed, 20 insertions, 21 deletions
diff --git a/xmds2/Nlevels_with_doppler_with_z_4wm/Nlevels_with_doppler_with_z_4wm.xmds b/xmds2/Nlevels_with_doppler_with_z_4wm/Nlevels_with_doppler_with_z_4wm.xmds
index 7f13652..bcb6b39 100644
--- a/xmds2/Nlevels_with_doppler_with_z_4wm/Nlevels_with_doppler_with_z_4wm.xmds
+++ b/xmds2/Nlevels_with_doppler_with_z_4wm/Nlevels_with_doppler_with_z_4wm.xmds
@@ -50,7 +50,7 @@
const double lambda=794.7e-9; //wavelength in m
const double Kvec = 2*M_PI/lambda; // k-vector
const double Gamma_super=6*(2*M_PI*1e6); // characteristic decay rate of upper level used for eta calculations expressed in [1/s]
- // eta will be calculated in the sequence -> filter element to use --Ndens parameter
+ // eta will be calculated in the <arguments> section
double eta = 0; // eta constant in the wave equation for Rabi frequency. Units are [1/(m s)]
// --------- Atom and cell properties -------------------------
@@ -59,9 +59,10 @@
// above mass expression is written as (expression is isotopic_mass * atomic_mass_unit)
// Average sqrt(v^2) in Maxwell distribution for one dimension
- const double v_thermal_averaged=sqrt(k_boltzmann*Temperature/mass);
+ // Maxwell related parameters will be calculated in <arguments> section
+ double v_thermal_averaged=0;
// Maxwell distribution velocities range to take in account in [m/s]
- const double V_maxwell_min = -4*v_thermal_averaged, V_maxwell_max = -V_maxwell_min; // there is almost zero probability for higher velocity p(4*v_av) = 3.3e-04 * p(0)
+ double V_maxwell_min = 0, V_maxwell_max = 0;
// repopulation rate (atoms flying in/out the laser beam) in [1/s]
const double gt=0.01 *(2*M_PI*1e6);
@@ -107,6 +108,20 @@
I am guessing detunings are too large and thus it became a stiff equation-->
<!--! make sure it is not equal to zero!-->
<argument name="Temperature" type="real" default_value="5" />
+ <!-- This will be executed after arguments/parameters are parsed -->
+ <!-- Read the code Luke: took me a while of reading the xmds2 sources to find it -->
+ <![CDATA[
+ // Average sqrt(v^2) in Maxwell distribution for one dimension
+ if (Temperature == 0)
+ _LOG(_ERROR_LOG_LEVEL, "ERROR: Temperature should be >0 to provide range for Maxwell velocity distribution\n");
+ v_thermal_averaged=sqrt(k_boltzmann*Temperature/mass);
+ // Maxwell distribution velocities range to take in account in [m/s]
+ // there is almost zero probability for higher velocity p(4*v_av) = 3.3e-04 * p(0)
+ V_maxwell_min = -4*v_thermal_averaged; V_maxwell_max = -V_maxwell_min;
+
+ // eta constant in the wave equation for Rabi frequency. Units are [1/(m s)]
+ eta = 3*lambda*lambda*Ndens*Gamma_super/8.0/M_PI;
+ ]]>
</arguments>
<bing />
<fftw plan="patient" />
@@ -288,11 +303,6 @@
</vector>
<sequence>
- <filter>
- <![CDATA[
- eta = 3*lambda*lambda*Ndens*Gamma_super/8.0/M_PI; // eta constant in the wave equation for Rabi frequency. Units are [1/(m s)]
- ]]>
- </filter>
<!--For this set of conditions ARK45 is faster than ARK89-->
<!--ARK45 is good for small detuning when all frequency like term are close to zero-->
<integrate algorithm="ARK45" tolerance="1e-5" interval="Lcell">
diff --git a/xmds2/TODO b/xmds2/TODO
index c152093..c77e332 100644
--- a/xmds2/TODO
+++ b/xmds2/TODO
@@ -1,14 +1,3 @@
-- TODO Fix Ndens argument treatment:
+- TODO Fix Temperature > 10 misbehavior
+ Suspected stiff equation at this condition
-Right now code is oblivius to --Ndens
-parameter, since eta ~1/Ndens sits in global parameter section and already
-defined. So it is not recalculated after the parameter assignment.
-
-Ugly hack would be to make variable eta_times_Ndens instead of eta, and
-recalculate eta=eta_times_Ndens/Ndens in the ODE part around where it
-needed. It will have performance penalty but probably not too large.
-
-
-- TODO Fix Temperature argument treatment:
-
-Same problem as above