diff options
-rw-r--r-- | xmds2/Nlevels_with_doppler_with_z_4wm/Nlevels_with_doppler_with_z_4wm.xmds | 26 | ||||
-rw-r--r-- | xmds2/TODO | 15 |
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"> @@ -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 |