backup save

This commit is contained in:
Jonas Kellerer
2021-03-04 11:47:03 +01:00
parent e7c298983e
commit 9e5c2f068f
241 changed files with 2354544 additions and 319 deletions
@@ -0,0 +1,210 @@
import numpy as np
import os
import sys
from astropy import units as u
from astropy import constants as const
import matplotlib
import matplotlib.pyplot as plt
import subprocess
from scipy import interpolate
import matplotlib.colors
homebase = os.getenv('HOMEBASE')
if homebase == None:
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
includes = homebase + "/src/grpic/boundaries_3d"
sys.path.append(includes)
import precalculation.functions.plasmaFunctions as plasmaFuncs
import analysis.plotDataFromAcronym.plot_standards as pltStd
# Input
# =======================
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
output_folder = thesis_path+"/fig/Chapter2_KATRIN/ParticleInteractions/"
k3_paul_10 = np.array([1.5E-28, 2.5E-28, 9.0E-28, 3.0E-27, 1.0E-26, 1.0E-26, 8.0E-27, 6.0E-27, 1.5E-27, 5.0E-28])
k3_paul_10_p = np.array([6.0E-28, 4.0E-27, 2.0E-26, 8.0E-27, 2.5E-26, 2.5E-26, 1.3E-26, 1.0E-26, 5.0E-27, 1.0E-27])
k3_paul_10_error = np.array([0.5E-28, 0.5E-28, 3.0E-28, 1.0E-27, 0.5E-26, 0.5E-26, 5E-27, 3.0E-27, 0.7E-27, 4.0E-28])
k3_paul_10_p_error = np.array([2.0E-28, 1.0E-27, 1.0E-26, 2.0E-27,1.5E-26, 1.5E-26, 0.5E-26, 0.5E-26, 3.0E-27, 0.5E-27])
kf_paul_10 = np.array([5.0E-16, 5.0E-16, 2.0E-14, 2.0E-13, 5.0E-13, 3.5E-13, 5.0E-13, 5.0E-13, 5.0E-13, 1.5E-12])
kf_paul_10_p = np.array([5.0E-16, 5.0E-16, 8.0E-14, 5.0E-13, 1.3E-12, 1.1E-12, 1.0E-12, 1.3E-13, 0.9E-13, 2.4E-12])
kf_paul_10_error = np.array([5.0E-16, 5.0E-16, 1.5E-14, 1.5E-13, 4.0E-13, 2.5E-13, 3.0E-13, 3.0E-13, 3.0E-13, 1.0E-12])
kf_paul_10_p_error = np.array([5.0E-16, 5.0E-16, 4.5E-14, 2.5E-13, 0.6E-12, 0.5E-12, 0.5E-12, 0.6E-13, 0.4E-13, 1.2E-12])
h_i = np.array([5,7,9,11,13,15,17,19,21,23])
k3_gerlich = np.array([1.2, 0.8, 6.5, 10])*1E-28
# definitions
#############################################
def kf(kf_given, T_given, T_new, delta_E):
kb = 8.617333262145E-5
kc = kf_given*np.exp(delta_E/(kb*T_given))
return kc*np.exp(-delta_E/(kb*T_new))
def k3(k3_given, T_given, T_new):
a = k3_given*T_given
return a/T_new
# gerlich
h3_gerlich = np.array([9E-1, 8.63E-1, 8.33E-1, 8E-1])
h5_gerlich = np.array([8E-2, 1.2E-1, 1.3E-1, 2.2E-1])
h7_gerlich = np.array([2.2E-3, 5E-3, 8E-3, 1.1E-2])
h9_gerlich = np.array([3.2E-4, 1E-3, 3E-3, 3.2E-3])
t_gerlich = np.array([0.5, 0.8, 1.2, 1.5])
import lmfit
from lmfit.models import ExpressionModel
mod_h3 = ExpressionModel('A *exp(k/x)')
pars_h3 = mod_h3.make_params(A = 1, k=1)
out_h3 = mod_h3.fit(h3_gerlich, pars_h3, x=t_gerlich)
mod_h5 = ExpressionModel('A *exp(k/x)')
pars_h5 = mod_h5.make_params(A = 1, k=1)
out_h5 = mod_h5.fit(h5_gerlich, pars_h5, x=t_gerlich)
mod_h7 = ExpressionModel('A *exp(k/x)')
pars_h7 = mod_h7.make_params(A = 1, k=1)
out_h7 = mod_h7.fit(h7_gerlich, pars_h7, x=t_gerlich)
mod_h9 = ExpressionModel('A *exp(k/x)')
pars_h9 = mod_h9.make_params(A = 1, k=1)
out_h9 = mod_h9.fit(h9_gerlich, pars_h9, x=t_gerlich)
def dH3_dt(t):
a = out_h3.values['A']
b = out_h3.values['k']
return -a*b/t**2 * np.exp(b/t)
def H3(t):
a = out_h3.values['A']
b = out_h3.values['k']
return a * np.exp(b/t)
def dH5_dt(t):
a = out_h5.values['A']
b = out_h5.values['k']
return -a*b/t**2 * np.exp(b/t)
def H5(t):
a = out_h5.values['A']
b = out_h5.values['k']
return a * np.exp(b/t)
def dH7_dt(t):
a = out_h7.values['A']
b = out_h7.values['k']
return -a*b/t**2 * np.exp(b/t)
def H7(t):
a = out_h7.values['A']
b = out_h7.values['k']
return a * np.exp(b/t)
def dH9_dt(t):
a = out_h9.values['A']
b = out_h9.values['k']
return -a*b/t**2 * np.exp(b/t)
def H9(t):
a = out_h9.values['A']
b = out_h9.values['k']
return a * np.exp(b/t)
n_H2 = 3.7E13
t = t_gerlich[1]
f_5 = (dH3_dt(t)/n_H2 + k3_gerlich[0]*n_H2*H3(t))/H5(t)
f_7 = (dH5_dt(t)/n_H2 - k3_gerlich[0]*n_H2*H3(t) + f_5*H5(t) - k3_gerlich[1]*n_H2*H5(t))/H7(t)
f_9 = (dH7_dt(t)/n_H2 - k3_gerlich[1]*n_H2*H5(t) + f_7*H7(t) - k3_gerlich[2]*n_H2*H7(t))/H9(t)
kf_gerlich_25 = np.array([f_5, f_7, f_9])
# calculations
############################################
kf_paul_25 = kf(kf_paul_10, 10, 25, 9E-3)
kf_paul_25_errobar = kf(kf_paul_10_error, 10, 25, 9E-3)
kf_paul_80 = kf(kf_paul_10, 10, 80, 9E-3)
kf_paul_80_errorbar = kf(kf_paul_10_error, 10, 80, 9E-3)
H2_gerlich = 3.7E13
H2_katrin = 1E15
k3_paul_25 = k3(k3_paul_10, 10, 25)
k3_paul_25_errorbar = k3(k3_paul_10_error, 10, 25)
k3_paul_80 = k3(k3_paul_10, 10, 80)
k3_paul_80_errorbar = k3(k3_paul_10_error, 10, 80)
# plots
############################################
pltStd.setRcParams()
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
(width, height) = pltStd.set_size('thesis')
fig, (ax,ax1) = plt.subplots(2, 1, figsize=(width, height*1.5))
# k3
ax.errorbar(h_i, k3_paul_10, yerr=k3_paul_10_error, linestyle='--', label=r'Paul et al. $(T=10K)$', capsize=3, fmt='.')
ax.errorbar(h_i, k3_paul_25, yerr=k3_paul_25_errorbar, linestyle='--',label=r'Paul et al., scaled $(T=25K)$ ', capsize=3, fmt='.')
ax.plot(h_i[0:4], k3_gerlich, 'x--', label=r'Gerlich et al. $(T=25K)$')
ax.set_ylabel(r'Rate constant $k_3$ [cm$^{6}$s$^{-1}$]')
ax.set_yscale('log')
ax.legend(loc="lower right")
ax.set_xticks(h_i)
#kf
ax1.errorbar(h_i, kf_paul_10, yerr=kf_paul_10_error, linestyle='--', label=r'Paul et al. $(T=10K)$', capsize=3, fmt='.')
ax1.errorbar(h_i, kf_paul_25, yerr=kf_paul_25_errobar, linestyle='--', label=r'Paul et al., scaled $(T=25K)$ ', capsize=3, fmt='.')
ax1.plot(h_i[0:3], kf_gerlich_25, 'x--', label=r'Gerlich et al. extrapolated $(T=25K)$')
ax1.set_yscale('log')
ax1.legend(loc="upper right")
ax1.set_ylabel(r'Rate constant $k_f$ [cm$^{3}$s$^{-1}$]')
ax1.set_xlabel(r'Cluster size H$_i$')
ax1.legend(loc="lower right")
ax1.set_xticks(h_i)
plt.savefig(output_folder + "clustering_25k.pdf",bbox_inches='tight')
plt.show()
(width, height) = pltStd.set_size('thesis')
fig, ax = plt.subplots(1, 1, figsize=(width, height))
# k3
ax.errorbar(h_i, k3_paul_10*H2_katrin, yerr=k3_paul_10_error*H2_katrin, linestyle='--', label=r'$k_3 \cdot [H2]$, $(T=10K)$', capsize=3, fmt='.')
ax.errorbar(h_i, k3_paul_80*H2_katrin, yerr=k3_paul_80_errorbar*H2_katrin, linestyle='-.',label=r'$k_3 \cdot [H2]$, $(T=80K)$', capsize=3, fmt='.')
ax.errorbar(h_i, kf_paul_10, yerr=kf_paul_10_error, linestyle='--', label=r'$k_f$, $(T=10K)$', capsize=3, fmt='.')
ax.errorbar(h_i, kf_paul_80, yerr=kf_paul_80_errorbar, linestyle='-.',label=r'$k_f$, $(T=80K)$', capsize=3, fmt='.')
ax.plot(h_i[0:3], kf_gerlich_25, '+:', label=r'$k_f$, Gerlich $(T=25K)$')
ax.set_ylabel(r'Rate constant $k$ [cm$^{3}$s$^{-1}$]')
ax.set_xlabel(r'Cluster size H$_i$')
ax.set_yscale('log')
ax.legend(loc="lower right")
ax.set_xticks(h_i)
plt.savefig(output_folder + "clustering_80k.pdf",bbox_inches='tight')
plt.show()
@@ -0,0 +1,131 @@
E sig_tot
1.00000e-05 2.85516e-20
1.20000e-05 2.92114e-20
1.40000e-05 2.97811e-20
1.60000e-05 3.02836e-20
1.80000e-05 3.07339e-20
2.00000e-05 3.11423e-20
2.50000e-05 3.20254e-20
3.00000e-05 3.27655e-20
3.50000e-05 3.34045e-20
4.00000e-05 3.39681e-20
5.00000e-05 3.49313e-20
6.00000e-05 3.57386e-20
7.00000e-05 3.64356e-20
8.00000e-05 3.70504e-20
9.00000e-05 3.76012e-20
1.00000e-04 3.81009e-20
1.20000e-04 3.89814e-20
1.40000e-04 3.97417e-20
1.60000e-04 4.04123e-20
1.80000e-04 4.10131e-20
2.00000e-04 4.15582e-20
2.50000e-04 4.27366e-20
3.00000e-04 4.37242e-20
3.50000e-04 4.45770e-20
4.00000e-04 4.53291e-20
5.00000e-04 4.66144e-20
6.00000e-04 4.76916e-20
7.00000e-04 4.86218e-20
8.00000e-04 4.94422e-20
9.00000e-04 5.01773e-20
1.00000e-03 5.08442e-20
1.20000e-03 5.20191e-20
1.40000e-03 5.30337e-20
1.60000e-03 5.39285e-20
1.80000e-03 5.47303e-20
2.00000e-03 5.54577e-20
2.50000e-03 5.70302e-20
3.00000e-03 5.83481e-20
3.50000e-03 5.94861e-20
4.00000e-03 6.04899e-20
5.00000e-03 6.22051e-20
6.00000e-03 6.36426e-20
7.00000e-03 6.48838e-20
8.00000e-03 6.59786e-20
9.00000e-03 6.69596e-20
1.00000e-02 6.78495e-20
1.20000e-02 6.94174e-20
1.40000e-02 7.07713e-20
1.60000e-02 7.19654e-20
1.80000e-02 7.30354e-20
2.00000e-02 7.41000e-20
3.00000e-02 7.71000e-20
4.00000e-02 8.08000e-20
5.00000e-02 8.32000e-20
6.00000e-02 8.51000e-20
7.00000e-02 8.69000e-20
8.00000e-02 8.84000e-20
9.00000e-02 8.99000e-20
1.00000e-01 9.13000e-20
1.20000e-01 9.33000e-20
1.50000e-01 9.55000e-20
2.00000e-01 9.83000e-20
2.50000e-01 1.00400e-19
3.00000e-01 1.02400e-19
4.00000e-01 1.06100e-19
5.00000e-01 1.09500e-19
6.00000e-01 1.12800e-19
7.00000e-01 1.15900e-19
8.00000e-01 1.18800e-19
9.00000e-01 1.21600e-19
1.00000e+00 1.23600e-19
1.25000e+00 1.30000e-19
1.50000e+00 1.35500e-19
2.00000e+00 1.41100e-19
3.00000e+00 1.41200e-19
4.00000e+00 1.32000e-19
5.00000e+00 1.25100e-19
6.00000e+00 1.14500e-19
8.00000e+00 9.85000e-20
1.00000e+01 8.58000e-20
1.20000e+01 7.61000e-20
1.40000e+01 6.92000e-20
1.60000e+01 6.32000e-20
1.80000e+01 5.78000e-20
2.00000e+01 5.26000e-20
2.50000e+01 4.23000e-20
3.00000e+01 3.40000e-20
3.50000e+01 2.81000e-20
4.00000e+01 2.36000e-20
5.00000e+01 1.73000e-20
6.00000e+01 1.31000e-20
7.00000e+01 1.06000e-20
8.00000e+01 8.90000e-21
9.00000e+01 8.10000e-21
1.00000e+02 7.40000e-21
1.20000e+02 6.61975e-21
1.40000e+02 5.66489e-21
1.60000e+02 4.94945e-21
1.80000e+02 4.39369e-21
2.00000e+02 3.94985e-21
2.50000e+02 3.15371e-21
3.00000e+02 2.62546e-21
3.50000e+02 2.24920e-21
4.00000e+02 1.96732e-21
5.00000e+02 1.57294e-21
6.00000e+02 1.31034e-21
7.00000e+02 1.12305e-21
8.00000e+02 9.82697e-22
9.00000e+02 8.73558e-22
1.00000e+03 7.86271e-22
1.20000e+03 6.55425e-22
1.40000e+03 5.62016e-22
1.60000e+03 4.91973e-22
1.80000e+03 4.37513e-22
2.00000e+03 3.93956e-22
2.50000e+03 3.15568e-22
3.00000e+03 2.63326e-22
3.50000e+03 2.26015e-22
4.00000e+03 1.98036e-22
5.00000e+03 1.58872e-22
6.00000e+03 1.32766e-22
7.00000e+03 1.14121e-22
8.00000e+03 1.00139e-22
9.00000e+03 8.92653e-23
1.00000e+04 8.05667e-23
1.20000e+04 6.75199e-23
1.40000e+04 5.82019e-23
1.60000e+04 5.12142e-23
1.80000e+04 4.57799e-23
2.00000e+04 4.14329e-23
@@ -0,0 +1,43 @@
# Rotational Excitation J = 0->2 by Yoon:2008aa
# E sig_tot
4.410E-02 0.000E+00
4.700E-02 1.850E-22
5.000E-02 2.700E-22
5.500E-02 3.500E-22
6.000E-02 4.200E-22
6.500E-02 4.800E-22
7.000E-02 5.300E-22
8.000E-02 6.200E-22
9.000E-02 6.800E-22
1.000E-01 7.400E-22
1.100E-01 7.900E-22
1.300E-01 8.800E-22
1.500E-01 9.700E-22
2.000E-01 1.150E-21
2.500E-01 1.320E-21
3.000E-01 1.520E-21
3.500E-01 1.750E-21
4.000E-01 2.000E-21
4.500E-01 2.280E-21
5.000E-01 2.600E-21
6.000E-01 3.230E-21
7.000E-01 3.940E-21
8.000E-01 4.690E-21
9.000E-01 5.550E-21
1.000E+00 6.380E-21
1.200E+00 7.960E-21
1.500E+00 1.036E-20
2.000E+00 1.370E-20
2.500E+00 1.585E-20
3.000E+00 1.704E-20
3.500E+00 1.755E-20
4.000E+00 1.758E-20
4.500E+00 1.732E-20
5.000E+00 1.689E-20
6.000E+00 1.579E-20
7.000E+00 1.462E-20
8.000E+00 1.350E-20
9.000E+00 1.248E-20
1.000E+01 1.156E-20
1.500E+01 7.300E-21
1.600E+01 0.000E+00
@@ -0,0 +1,32 @@
# Vibration Excitation v = 0->1 by Yoon:2008aa
# E sig_tot
5.160E-01 0.000E+00
5.500E-01 1.000E-22
6.000E-01 1.700E-22
6.600E-01 2.700E-22
7.400E-01 3.800E-22
8.000E-01 4.700E-22
8.500E-01 5.900E-22
1.000E+00 9.400E-22
1.250E+00 1.720E-21
1.480E+00 2.400E-21
2.000E+00 3.670E-21
2.460E+00 4.420E-21
3.000E+00 4.860E-21
3.800E+00 4.610E-21
4.600E+00 3.800E-21
5.000E+00 3.430E-21
5.300E+00 3.240E-21
5.600E+00 3.020E-21
6.100E+00 2.700E-21
7.000E+00 2.100E-21
1.500E+01 5.650E-22
2.000E+01 3.320E-22
2.500E+01 2.420E-22
3.000E+01 1.700E-22
4.000E+01 1.120E-22
5.000E+01 9.680E-23
6.000E+01 8.170E-23
8.000E+01 6.090E-23
1.000E+02 4.510E-23
1.100E+02 0.000E+00
@@ -0,0 +1,283 @@
import numpy as np
import os
import sys
from astropy import units as u
from astropy import constants as const
import matplotlib
import matplotlib.pyplot as plt
import subprocess
from scipy import interpolate
import matplotlib.colors
homebase = os.getenv('HOMEBASE')
if homebase == None:
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
includes = homebase + "/src/grpic/boundaries_3d"
sys.path.append(includes)
import precalculation.functions.plasmaFunctions as plasmaFuncs
import analysis.plotDataFromAcronym.plot_standards as pltStd
# Input
# =======================
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
output_folder = thesis_path+"/fig/Chapter2_KATRIN/ParticleInteractions/"
data_path = thesis_path + "/figCode/Chapter2_KATRIN/ParticleInteractions/data/"
# Calculation
# =======================
class electronCrossSection:
def elastic(E_eV):
#yoon
data = np.genfromtxt(
data_path+"TCS_concatenated.txt",
dtype=float,
delimiter=" ",
skip_header=1)
interpolation = interpolate.interp1d(
data[:,0], data[:,1], bounds_error=False,fill_value=np.any(E_eV))
return interpolation(E_eV)
def rotationalExcitation(E_eV):
#yoon
data = np.genfromtxt(
data_path+"rot_exc_j02.dat",
dtype=float,
delimiter=" ",
skip_header=2)
interpolation = interpolate.interp1d(
data[:,0], data[:,1], bounds_error=False,fill_value=np.any(E_eV))
factor = np.where(E_eV<data[0,0],0,1)
factor *= np.where(E_eV>data[-1,0],0,1)
return interpolation(E_eV) * factor
def vibrationalExcitation(E_eV):
#yoon
data = np.genfromtxt(
data_path+"vib_exc_v01.dat",
dtype=float,
delimiter=" ",
skip_header=2)
interpolation = interpolate.interp1d(
data[:,0], data[:,1], bounds_error=False,fill_value=np.any(E_eV))
factor = np.where(E_eV<data[0,0],0,1)
factor *= np.where(E_eV>data[-1,0],0,1)
return interpolation(E_eV) * factor
def Janev_eT2_Ionization_ndiss(E_eV):
deltaE_eV = 15.42
x = E_eV/deltaE_eV
C0 = 2.05*deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
1.828/x*pow(1-pow(x,-0.92),2.19)*np.log(C0*x)*1e-20))
def Janev_eT2_Ionization_diss_g(E_eV):
deltaE_eV = 18.15
x = E_eV/deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
0.02905*pow(x,-1.25)*pow(1-pow(x,-2.78),1.886)*1e-20))
def Janev_eT2_Ionization_diss_u(E_eV):
deltaE_eV = 30.6
x = E_eV/deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
0.5927*pow(x,-1.2)*pow(1-pow(x,-1.22),3.375)*1e-20))
def JanevIonizationTotal(E_eV):
return electronCrossSection.Janev_eT2_Ionization_ndiss(E_eV)\
+ electronCrossSection.Janev_eT2_Ionization_diss_g(E_eV)\
+ electronCrossSection.Janev_eT2_Ionization_diss_u(E_eV)
def JanevElectricExcitationNu(E_eV,n):
if n=='B1Sigmau':
deltaE_eV = 12.754
alpha = 0.550
A1 = 3.651e-2
A2 = -0.8405
A3 = 1.2365
A4 = 2.5236
if n=='Bp1Sigu':
deltaE_eV = 14.85
alpha = 0.550
A1 = 6.827e-3
A2 = -0.1572
A3 = 0.23122
A4 = 0.47191
if n=='Bpp1Sigu':
deltaE_eV = 15.47
alpha = 0.550
A1 = 2.446e-3
A2 = -5.631e-2
A3 = 6.2846e-2
A4 = 0.16908
if n=='C1Piu':
deltaE_eV = 13.29
alpha = 0.552
A1 = 3.653e-2
A2 = -0.8398
A3 = 1.2368
A4 = 2.8740
if n=='D1Piu':
deltaE_eV = 14.996
alpha = 0.552
A1 = 8.913e-3
A2 = -0.2049
A3 = 0.30178
A4 = 0.70126
if n=='Dp1Piu':
deltaE_eV = 15.555
alpha = 0.552
A1 = 3.872e-3
A2 = -8.902e-2
A3 = 0.13110
A4 = 0.30464
x = E_eV/deltaE_eV
fac1 = 5.984/deltaE_eV/x*pow(1-1/x,alpha)
fac2 = (A1 + A2/x + A3/x/x + A4*np.log(x))
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
fac1 * fac2 * 1e-20))
def JanevElectricExcitationNuTotal(E_eV):
return electronCrossSection.JanevElectricExcitationNu(E_eV,'B1Sigmau')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'Bp1Sigu')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'Bpp1Sigu')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'C1Piu')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'D1Piu')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'Dp1Piu')
def JanevElectricExcitationNg(E_eV, n):
if n=='EF1Sigpg':
deltaE_eV = 13.13
alpha = 2.71
A1 = 0.8322
if n=='HHb1Sigpg':
deltaE_eV = 14.98
alpha = 2.71
A1 = 2.913e-2
if n=='GK1Sigpg':
deltaE_eV = 14.816
alpha = 2.75
A1 = 1.43e-2
if n=='I1Pig':
deltaE_eV = 14.824
alpha = 2.80
A1 = 5.409e-2
x = E_eV/deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
5.984*A1/deltaE_eV/x*pow(1-1/x,alpha) * 1e-20))
def JanevElectricExcitationNgTotal(E_eV):
return electronCrossSection.JanevElectricExcitationNg(E_eV,'EF1Sigpg')\
+ electronCrossSection.JanevElectricExcitationNg(E_eV,'HHb1Sigpg')\
+ electronCrossSection.JanevElectricExcitationNg(E_eV,'GK1Sigpg')\
+ electronCrossSection.JanevElectricExcitationNg(E_eV,'I1Pig')
def JanevElectricExcitationN(E_eV, n):
if n=='a3Sigpg':
deltaE_eV = 11.72
beta = 4.5
gamma = 1.55
A = 0.544
if n=='b3Sigpu':
deltaE_eV = 7.93
beta = 2.33
gamma = 3.78
A = 11.16
if n=='c3Piu':
deltaE_eV = 11.72
beta = 5.5
gamma = 1.65
A = 1.43
if n=='e3Sigpu' :
deltaE_eV = 13.0
beta = 4.5
gamma = 1.60
A = 0.190
if n=='d3Piu':
deltaE_eV = 13.6
beta = 5.5
gamma = 1.75
A = 0.375
x = E_eV/deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
A*pow(x,-3)*pow(1-pow(x,-beta),gamma) * 1e-20))
def JanevElectricExcitationNTotal(E_eV):
return electronCrossSection.JanevElectricExcitationN(E_eV,'a3Sigpg')\
+ electronCrossSection.JanevElectricExcitationN(E_eV,'b3Sigpu')\
+ electronCrossSection.JanevElectricExcitationN(E_eV,'c3Piu')\
+ electronCrossSection.JanevElectricExcitationN(E_eV,'e3Sigpu')\
+ electronCrossSection.JanevElectricExcitationN(E_eV,'d3Piu')
def JanevElectricExcitationTotal(E_eV):
return electronCrossSection.JanevElectricExcitationNTotal(E_eV)\
+ electronCrossSection.JanevElectricExcitationNgTotal(E_eV)\
+ electronCrossSection.JanevElectricExcitationNuTotal(E_eV)
energies_eV = np.logspace(-3,4,100)
sigma_elastic = electronCrossSection.elastic(energies_eV)*1E4
sigma_rot_exc = electronCrossSection.rotationalExcitation(energies_eV)*1E4
sigma_vib_exc = electronCrossSection.vibrationalExcitation(energies_eV)*1E4
sigma_ionization = electronCrossSection.JanevIonizationTotal(energies_eV)*1E4
sigma_el_exc = electronCrossSection.JanevElectricExcitationTotal(energies_eV)*1E4
sigma_total = sigma_elastic + sigma_rot_exc + sigma_vib_exc + sigma_ionization + sigma_el_exc
# Plot
# =======================
pltStd.setRcParams()
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
(width, height) = pltStd.set_size('thesis')
fig, ax = plt.subplots(1, 1, figsize=(width, height))
ax.plot(energies_eV, sigma_total, '-', label=r'total')
ax.plot(energies_eV, sigma_elastic, '--',label=r'elastic scattering')
ax.plot(energies_eV, sigma_ionization, '-.',label=r'ionization')
ax.plot(energies_eV, sigma_el_exc, linestyle=(0, (3, 1, 1, 1, 1, 1)),label=r'el.exc.')
ax.plot(energies_eV, sigma_rot_exc, ':',label=r'rot. exc.')
ax.plot(energies_eV, sigma_vib_exc, ':',label=r'vib. exc.')
ax.set_ylim((1E-18, 2E-15))
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_ylabel(r'Cross section $\sigma$ [cm$^{2}$]')
ax.set_xlabel(r'Energy $E$ [eV]')
ax.legend(loc='center left')
plt.savefig(output_folder + "eT2_overview.pdf",bbox_inches='tight')
plt.show()
@@ -0,0 +1,343 @@
import numpy as np
import os
import sys
from astropy import units as u
from astropy import constants as const
import matplotlib
import matplotlib.pyplot as plt
import subprocess
from scipy import interpolate
import matplotlib.colors
homebase = os.getenv('HOMEBASE')
if homebase == None:
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
includes = homebase + "/src/grpic/boundaries_3d"
sys.path.append(includes)
import precalculation.functions.plasmaFunctions as plasmaFuncs
import analysis.plotDataFromAcronym.plot_standards as pltStd
# Input
# =======================
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
output_folder = thesis_path+"/fig/Chapter2_KATRIN/ParticleInteractions/"
data_path = thesis_path + "/figCode/Chapter2_KATRIN/ParticleInteractions/data/"
# Calculation
# =======================
class electronCrossSection:
def elastic(E_eV):
#yoon
data = np.genfromtxt(
data_path+"TCS_concatenated.txt",
dtype=float,
delimiter=" ",
skip_header=1)
interpolation = interpolate.interp1d(
data[:,0], data[:,1], bounds_error=False,fill_value=np.any(E_eV))
return interpolation(E_eV)
def rotationalExcitation(E_eV):
#yoon
data = np.genfromtxt(
data_path+"rot_exc_j02.dat",
dtype=float,
delimiter=" ",
skip_header=2)
interpolation = interpolate.interp1d(
data[:,0], data[:,1], bounds_error=False,fill_value=np.any(E_eV))
factor = np.where(E_eV<data[0,0],0,1)
factor *= np.where(E_eV>data[-1,0],0,1)
return interpolation(E_eV) * factor
def vibrationalExcitation(E_eV):
#yoon
data = np.genfromtxt(
data_path+"vib_exc_v01.dat",
dtype=float,
delimiter=" ",
skip_header=2)
interpolation = interpolate.interp1d(
data[:,0], data[:,1], bounds_error=False,fill_value=np.any(E_eV))
factor = np.where(E_eV<data[0,0],0,1)
factor *= np.where(E_eV>data[-1,0],0,1)
return interpolation(E_eV) * factor
def Janev_eT2_Ionization_ndiss(E_eV):
deltaE_eV = 15.42
x = E_eV/deltaE_eV
C0 = 2.05*deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
1.828/x*pow(1-pow(x,-0.92),2.19)*np.log(C0*x)*1e-20))
def Janev_eT2_Ionization_diss_g(E_eV):
deltaE_eV = 18.15
x = E_eV/deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
0.02905*pow(x,-1.25)*pow(1-pow(x,-2.78),1.886)*1e-20))
def Janev_eT2_Ionization_diss_u(E_eV):
deltaE_eV = 30.6
x = E_eV/deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
0.5927*pow(x,-1.2)*pow(1-pow(x,-1.22),3.375)*1e-20))
def JanevIonizationTotal(E_eV):
return electronCrossSection.Janev_eT2_Ionization_ndiss(E_eV)\
+ electronCrossSection.Janev_eT2_Ionization_diss_g(E_eV)\
+ electronCrossSection.Janev_eT2_Ionization_diss_u(E_eV)
def JanevElectricExcitationNu(E_eV,n):
if n=='B1Sigmau':
deltaE_eV = 12.754
alpha = 0.550
A1 = 3.651e-2
A2 = -0.8405
A3 = 1.2365
A4 = 2.5236
if n=='Bp1Sigu':
deltaE_eV = 14.85
alpha = 0.550
A1 = 6.827e-3
A2 = -0.1572
A3 = 0.23122
A4 = 0.47191
if n=='Bpp1Sigu':
deltaE_eV = 15.47
alpha = 0.550
A1 = 2.446e-3
A2 = -5.631e-2
A3 = 6.2846e-2
A4 = 0.16908
if n=='C1Piu':
deltaE_eV = 13.29
alpha = 0.552
A1 = 3.653e-2
A2 = -0.8398
A3 = 1.2368
A4 = 2.8740
if n=='D1Piu':
deltaE_eV = 14.996
alpha = 0.552
A1 = 8.913e-3
A2 = -0.2049
A3 = 0.30178
A4 = 0.70126
if n=='Dp1Piu':
deltaE_eV = 15.555
alpha = 0.552
A1 = 3.872e-3
A2 = -8.902e-2
A3 = 0.13110
A4 = 0.30464
x = E_eV/deltaE_eV
fac1 = 5.984/deltaE_eV/x*pow(1-1/x,alpha)
fac2 = (A1 + A2/x + A3/x/x + A4*np.log(x))
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
fac1 * fac2 * 1e-20))
def JanevElectricExcitationNuTotal(E_eV):
return electronCrossSection.JanevElectricExcitationNu(E_eV,'B1Sigmau')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'Bp1Sigu')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'Bpp1Sigu')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'C1Piu')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'D1Piu')\
+ electronCrossSection.JanevElectricExcitationNu(E_eV,'Dp1Piu')
def JanevElectricExcitationNg(E_eV, n):
if n=='EF1Sigpg':
deltaE_eV = 13.13
alpha = 2.71
A1 = 0.8322
if n=='HHb1Sigpg':
deltaE_eV = 14.98
alpha = 2.71
A1 = 2.913e-2
if n=='GK1Sigpg':
deltaE_eV = 14.816
alpha = 2.75
A1 = 1.43e-2
if n=='I1Pig':
deltaE_eV = 14.824
alpha = 2.80
A1 = 5.409e-2
x = E_eV/deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
5.984*A1/deltaE_eV/x*pow(1-1/x,alpha) * 1e-20))
def JanevElectricExcitationNgTotal(E_eV):
return electronCrossSection.JanevElectricExcitationNg(E_eV,'EF1Sigpg')\
+ electronCrossSection.JanevElectricExcitationNg(E_eV,'HHb1Sigpg')\
+ electronCrossSection.JanevElectricExcitationNg(E_eV,'GK1Sigpg')\
+ electronCrossSection.JanevElectricExcitationNg(E_eV,'I1Pig')
def JanevElectricExcitationN(E_eV, n):
if n=='a3Sigpg':
deltaE_eV = 11.72
beta = 4.5
gamma = 1.55
A = 0.544
if n=='b3Sigpu':
deltaE_eV = 7.93
beta = 2.33
gamma = 3.78
A = 11.16
if n=='c3Piu':
deltaE_eV = 11.72
beta = 5.5
gamma = 1.65
A = 1.43
if n=='e3Sigpu' :
deltaE_eV = 13.0
beta = 4.5
gamma = 1.60
A = 0.190
if n=='d3Piu':
deltaE_eV = 13.6
beta = 5.5
gamma = 1.75
A = 0.375
x = E_eV/deltaE_eV
return np.abs(np.where(
E_eV<deltaE_eV,
0.,
A*pow(x,-3)*pow(1-pow(x,-beta),gamma) * 1e-20))
def JanevElectricExcitationNTotal(E_eV):
return electronCrossSection.JanevElectricExcitationN(E_eV,'a3Sigpg')\
+ electronCrossSection.JanevElectricExcitationN(E_eV,'b3Sigpu')\
+ electronCrossSection.JanevElectricExcitationN(E_eV,'c3Piu')\
+ electronCrossSection.JanevElectricExcitationN(E_eV,'e3Sigpu')\
+ electronCrossSection.JanevElectricExcitationN(E_eV,'d3Piu')
def JanevElectricExcitationTotal(E_eV):
return electronCrossSection.JanevElectricExcitationNTotal(E_eV)\
+ electronCrossSection.JanevElectricExcitationNgTotal(E_eV)\
+ electronCrossSection.JanevElectricExcitationNuTotal(E_eV)
def radiativeRecombinationH(E_eV):
alpha = 1./137
a_bohr = 5.29E-11 #m
Jz = (4.8E-10)**4*9.1E-28/(2*(1.05E-27)**2)
nu = (Jz/(E_eV*1.6021E-12))**(1/2)
factor = nu**6 * np.exp(-4*nu*np.arctan(1/nu)) / ((1-np.exp(-2*np.pi*nu))*(nu**2+1)**2)
sig0 = 2**8*np.pi**2/3 * factor * alpha**3 * a_bohr**2
sig_factor = (1.202+0.5782*np.log(nu**2+1)+0.2148*np.log(nu**2+1)**2)/(1+0.3425*np.log(nu**2+1))
return sig_factor * sig0
def dissociativeRecombinationH2(E_eV):
const1 = ( (E_eV)**0.665 * (1 + 1.1*(E_eV)**0.512 + 0.011*(E_eV)**3.10))**(-1)
const2 = 0.133 * np.exp(-0.35*(E_eV-6.05)**2)
return 17.3e-20 * (const1+const2)
def dissociativeExcitationH3(E_eV):
delta_E = 14.75
expc = np.exp(- 50.32*(E_eV)**-1.177/(1+1.019e-14*(E_eV)**7.462))
cross_section = 82.56e-20*(E_eV)**-0.521*(1-(15.0/E_eV)**5.15) * expc
return np.where(E_eV < delta_E, 0, cross_section)
def dissociativeRecombinationH3(E_eV):
sigLDR = 3e-20*(E_eV)**(-0.725)/(1+4.45*(E_eV)**1.2)
sig_small = 0.0646e-20 * (E_eV)**1.478
sig_big = 634.22e-20 * (E_eV)**(-2.605)
sigHDR = 1/(1/sig_small + 1/sig_big)
return sigLDR + sigHDR;
def dissociatveRecombinationH5(E_eV):
# Pettersson
return np.where(
(E_eV<0.017),
pow(10,-18.87) * pow(E_eV, -1.2),
np.where(
(E_eV < 0.159),
pow(10,-19.93) * pow(E_eV, -1.78),
pow(10,-21.5) * pow(E_eV, -3.75))
)
energies_eV = np.logspace(-3,4,100)
sigma_elastic = electronCrossSection.elastic(energies_eV)*1E4
sigma_rot_exc = electronCrossSection.rotationalExcitation(energies_eV)*1E4
sigma_vib_exc = electronCrossSection.vibrationalExcitation(energies_eV)*1E4
sigma_ionization = electronCrossSection.JanevIonizationTotal(energies_eV)*1E4
sigma_el_exc = electronCrossSection.JanevElectricExcitationTotal(energies_eV)*1E4
sigma_total = sigma_elastic + sigma_rot_exc + sigma_vib_exc + sigma_ionization + sigma_el_exc
sigma_rec_h = electronCrossSection.radiativeRecombinationH(energies_eV)*1E4
sigma_rec_h2 = electronCrossSection.dissociativeRecombinationH2(energies_eV)*1E4
sigma_rec_h3 = electronCrossSection.dissociativeRecombinationH3(energies_eV)*1E4
sigma_dis_exc =electronCrossSection.dissociativeExcitationH3(energies_eV)*1E4
sigma_rec_h5 = electronCrossSection.dissociatveRecombinationH5(energies_eV)*1E4
# Plot
# =======================
pltStd.setRcParams()
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
(width, height) = pltStd.set_size('thesis')
fig, ax = plt.subplots(1, 1, figsize=(width, height))
ax.plot(energies_eV, sigma_total, '-', label=r'total H$_2$')
ax.plot(energies_eV, sigma_rec_h2, '--',label=r'diss rec. H$_2^+$')
ax.plot(energies_eV, sigma_rec_h3, '--',label=r'diss. rec. H$_3^+$')
ax.plot(energies_eV, sigma_rec_h5, '--',label=r'disc. rec. H$_5^+$')
ax.plot(energies_eV, sigma_rec_h, ':',label=r'rec. H$^+$')
ax.plot(energies_eV, sigma_dis_exc, '-.',label=r'diss. exc. H$_3^+$')
#ax.plot(energies_eV, sigma_elastic, '--',label=r'elastic scattering')
#ax.plot(energies_eV, sigma_ionization, '-.',label=r'ionization')
#ax.plot(energies_eV, sigma_el_exc, linestyle=(0, (3, 1, 1, 1, 1, 1)),label=r'el.exc.')
#ax.plot(energies_eV, sigma_rot_exc, ':',label=r'rot. exc.')
#ax.plot(energies_eV, sigma_vib_exc, ':',label=r'vib. exc.')
ax.set_ylim((1E-23, 8E-12))
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_ylabel(r'Cross section $\sigma$ [cm$^{2}$]')
ax.set_xlabel(r'Energy $E$ [eV]')
ax.legend(loc='upper right',ncol=2)
plt.savefig(output_folder + "eTI_overview.pdf",bbox_inches='tight')
plt.show()
@@ -0,0 +1,184 @@
import numpy as np
import os
import sys
from astropy import units as u
from astropy import constants as const
import matplotlib
import matplotlib.pyplot as plt
import subprocess
import matplotlib.colors
homebase = os.getenv('HOMEBASE')
if homebase == None:
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
includes = homebase + "/src/grpic/boundaries_3d"
sys.path.append(includes)
import precalculation.functions.plasmaFunctions as plasmaFuncs
import analysis.plotDataFromAcronym.plot_standards as pltStd
# Input
# =======================
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
output_folder = thesis_path+"/fig/Chapter2_KATRIN/ParticleInteractions/"
# Calculation
# =======================
def targetFrameSwitch(energy_eV, m1_eV, m2_eV):
return (energies_eV + m1_eV)*m2_eV/m1_eV - m2_eV
def energyToVelocity(E_eV, mass_eV):
return (2*E_eV/mass_eV)**(1/2)*const.c.value
class TritiumIon:
def crossSectionElastic_m2(E_eV):
sig0c1 = 5.74e-20
c2 = -5.765e-1
c3 = 2.79e-2
c2c4 = -5.765e-1 + 1.737
ERyd_eV = 13.605693009
return sig0c1*(E_eV/ERyd_eV)**c2 /(1 + (E_eV*1E-3/c3)**c2c4)
def crossSectionRadAsc_m2(E_eV):
mass_eV = 938.27208816E6 # mass proton
v_ms = energyToVelocity(E_eV, mass_eV)
return 1.3E-22 / v_ms
def crossSectionTerAsc_m2(E_eV, n_T2_m3):
mass_eV = 938.27208816E6
v_ms = energyToVelocity(E_eV, mass_eV)
return 5.4E-41 * n_T2_m3 /v_ms
def crossSectionProtonChargeTransfer(E_eV, nu):
E0nu = [2.67, 1.74, 1.17, 0.48, 0.0, 0.0, 0.0, 0.0, 0.0]
a1 = [18.6, 2.51, 3.01, 4.5, 24.0, 11.75, 11.58, 0., 0.]
a2 = [-1.66, -0.56, -0.63, -0.57, -0.32, 0.092, 0.091, 0., 0.]
a3 = [2.53, 4.21, 7.04, 5.0, 0.0, 0.0, 0.0, 0.0, 0.0]
a4 = [1.93, 4.07, 10.74, 14.62, 0.0, 0.0, 0., 0., 0.]
a5 = [0., 1E-5, 1E-5, 0.145, 3.86E-3, 3.84E-3, 0., 0.]
a6 = [0., 1., 1., 1., 1.84, 2.86, 2.87, 0., 0.]
b1 = [17.3, 58., 26.53, 39.50, 10.8, 20., 20.04, 33., 30.]
b2 = [105., 11.28, 25.20, 9.35, 0., 0., 0., 0., 0.]
b3 = [2., 0.246, 0.65, 0.51, 0., 0., 0., 0., 0.]
b4 = [1E4, 1., 1., 1., 1., 1., 1., 1., 1., 1.]
b5 = [-1.12, 0.0, 0.0, 0.0, -0.297, -0.193, -0.192, -0.022, -0.017]
b6 = [3.64E-4, 3.92E-5, 1.56E-6, 5.32E-7, 2.92E-4, 1.36E-5, 1.34E-5, 1.22E-2, 1.87E-2]
b7 = [0.9, 1.11, 1.45, 1.60, 0.76, 1.15, 1.15, 0.36, 0.375]
b8 = [5.03E-19, 4.95E-17, 5.5E-19, 3.52E-20, 4.93E-11, 4.46E-12, 4.46E-12, 6.51E-8, 9.0E-10]
b9 = [4.0, 3.65, 4.0, 4.25, 2.35, 2.61, 2.61, 1.78, 2.18]
b10 = [5.87E-28, 3.88E-26, 8.5E-27, 3.5E-27, 2.62E-27, 4.31E-27, 4.31E-27, 3.25E-23, 1.85E-25]
b11 = [5.5, 5.2, 5.3, 5.4, 5.5, 5.5, 5.5, 4.86, 5.25]
i = nu
sigsmall = a1[i]*E_eV**a2[i] * (1-(E0nu[i]/E_eV)**a3[i])**a4[i] * np.exp(-a5[i]*E_eV**a6[i])*1E-20
sigbig = b1[i]*np.exp(-b2[i]/E_eV**b3[i])/(b4[i]*E_eV**b5[i] + b6[i]*E_eV**b7[i] + b8[i]*E_eV**b9[i] + b10[i]*E_eV**b11[i]) * 1E-20
return sigsmall + sigbig;
#data_E = [0.1, 0.1334, 0.1778, 0.237, 0.316, 0.422, 0.562, 0.750, 1.0, 1.334, 1778, 2.37, 3.16, 4.22, 5.62, 7.50, 10., 13.3, 17.78, 23.7, 31.6, 42.2, 56.2., 75.0, 100., 133.4, 177.8, 237., 316., 421., 562., 750., 1000., 1334., 1778., 2371., 3162., 4217., 5623., 7499., 10000.]
def crossSectionH2Production(E_eV):
data_E = np.array([3.16, 4.22, 5.62, 7.50, 10., 13.3, 17.78, 23.7, 31.6, 42.2, 56.2, 75.0, 100., 133.4, 177.8, 237., 316., 421., 562., 750., 1000., 1334., 1778., 2371., 3162., 4217., 5623., 7499., 10000.])
data_sigma = np.array([0.59, 0.75, 0.71, 0.615, 0.54, 0.48, 0.435, 0.397, 0.365, 0.34, 0.333, 0.34, 0.37, 0.43, 0.54, 0.73, 1.03, 1.54, 2.3, 3.35, 4.5, 5.7, 6.8, 7.6, 8.2, 8.4, 8.4, 8.3, 8.1])
return np.where(E_eV < data_E[0], 0, np.interp(E_eV, data_E, data_sigma*1E-20))
def crossSectionRadiativeRecombinationLow(E_eV):
alpha = 1./137
a_bohr = 5.29E-11 #m
Jz = (4.8E-10)**4*9.1E-28/(2*(1.05E-27)**2)
nu = (Jz/(E_eV*1.6021E-12))**(1/2)
zeta = 1.202
return 128*np.pi*zeta/3 * nu**5 * alpha**3 * a_bohr**2
def crossSectionRadiativeRecombinationHigh(E_eV):
alpha = 1./137
a_bohr = 5.29E-11 #m
Jz = (4.8E-10)**4*9.1E-28/(2*(1.05E-27)**2)
nu = (Jz/(E_eV*1.6021E-12))**(1/2)
#return 32*np.pi/(3*np.sqrt(3))*alpha**3 * a_bohr**2 * nu**2 * np.log(nu)
return 16*np.pi/(3*np.sqrt(3)) * nu**2 * np.log(1+nu**2) * alpha**3 * a_bohr**2
def crossSectionRecombination1(E_eV):
alpha = 1./137
a_bohr = 5.29E-11 #m
Jz = (4.8E-10)**4*9.1E-28/(2*(1.05E-27)**2)
nu = (Jz/(E_eV*1.6021E-12))**(1/2)
factor = nu**6 * np.exp(-4*nu*np.arctan(1/nu)) / ((1-np.exp(-2*np.pi*nu))*(nu**2+1)**2)
return 2**8*np.pi**2/3 * factor * alpha**3 * a_bohr**2
def crossSectionRadiativeRecombinationFull(E_eV):
alpha = 1./137
a_bohr = 5.29E-11 #m
Jz = (4.8E-10)**4*9.1E-28/(2*(1.05E-27)**2)
nu = (Jz/(E_eV*1.6021E-12))**(1/2)
factor = (1.202+0.5782*np.log(nu**2+1)+0.2148*np.log(nu**2+1)**2)/(1+0.3425*np.log(nu**2+1))
return TritiumIon.crossSectionRecombination1(E_eV) * factor
density_T2 = 1E21
energies_eV = np.logspace(-3,4,100)
sigma_Ti_elastic = TritiumIon.crossSectionElastic_m2(energies_eV)*1E4
sigma_Ti_radasc = TritiumIon.crossSectionRadAsc_m2(energies_eV)*1E4
sigma_Ti_terasc = TritiumIon.crossSectionTerAsc_m2(energies_eV,density_T2)*1E4
sigma_Ti_ctrans = TritiumIon.crossSectionProtonChargeTransfer(energies_eV, 0)*1E4
sigma_Ti_ctrans7 = TritiumIon.crossSectionProtonChargeTransfer(energies_eV, 7)*1E4
sigma_Ti_h2production = TritiumIon.crossSectionH2Production(energies_eV)*1E4
energies_eV_target = targetFrameSwitch(energies_eV, 511E3, 1*938.272)
#sigma_Ti_radiative_recombination_low = TritiumIon.crossSectionRadiativeRecombinationLow(energies_eV_target)*1E4
#sigma_Ti_radiative_recombination_high = TritiumIon.crossSectionRadiativeRecombinationHigh(energies_eV_target)*1E4
#sigma_Ti_radiative_recombination_full = TritiumIon.crossSectionRadiativeRecombinationFull(energies_eV_target)*1E4
sigma_Ti_radiative_recombination_low = TritiumIon.crossSectionRadiativeRecombinationLow(energies_eV)*1E4
sigma_Ti_radiative_recombination_high = TritiumIon.crossSectionRadiativeRecombinationHigh(energies_eV)*1E4
sigma_Ti_radiative_recombination_full = TritiumIon.crossSectionRadiativeRecombinationFull(energies_eV)*1E4
# Plot
# =======================
pltStd.setRcParams()
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
(width, height) = pltStd.set_size('thesis')
fig, ax = plt.subplots(1, 1, figsize=(width, height))
ax.plot(energies_eV, sigma_Ti_elastic, '-',label=r'elastic scattering')
ax.plot(energies_eV, sigma_Ti_radasc, '--',label=r'radiative association')
ax.plot(energies_eV, sigma_Ti_terasc, '--', label=r'ternary association')
ax.plot(energies_eV, sigma_Ti_ctrans, ':', label=r'charge. trans $\nu =0$')
ax.plot(energies_eV, sigma_Ti_ctrans7, ':', label=r'charge. trans $\nu =8$')
#ax.plot(energies_eV, sigma_Ti_h2production, ':', label=r'H$_2^+$ and fast H')
#ax.plot(energies_eV, sigma_Ti_radiative_recombination_low, label="low")
#ax.plot(energies_eV, sigma_Ti_radiative_recombination_high, label="high")
ax.plot(energies_eV, sigma_Ti_radiative_recombination_full, '-.', label=r'recombination (e$^-$)')
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_ylabel(r'Cross section $\sigma$ [cm$^{2}$]')
ax.set_xlabel(r'Energy $E$ [eV]')
ax.set_ylim((1E-23, 2E-13))
ax.legend(loc='lower right')
plt.savefig(output_folder+"TIintercactions.pdf",bbox_inches='tight')
plt.show()
@@ -0,0 +1,141 @@
import numpy as np
import os
import sys
from astropy import units as u
from astropy import constants as const
import matplotlib
import matplotlib.pyplot as plt
import subprocess
import matplotlib.colors
homebase = os.getenv('HOMEBASE')
if homebase == None:
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
includes = homebase + "/src/grpic/boundaries_3d"
sys.path.append(includes)
import precalculation.functions.plasmaFunctions as plasmaFuncs
import analysis.plotDataFromAcronym.plot_standards as pltStd
# Input
# =======================
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
output_folder = thesis_path+"/fig/Chapter2_KATRIN/ParticleInteractions/"
# Calculation
# =======================
def targetFrameSwitch(energy_eV, m1_eV, m2_eV):
return (energies_eV + m1_eV)*m2_eV/m1_eV - m2_eV
def targetFrameToCenterOfMassFrame(energy_eV, m1_eV, m2_eV):
return np.sqrt(2*(energy_eV+m1_eV)*m2_eV + m1_eV**2 + m2_eV**2) - m1_eV - m2_eV
class TritiumIon2:
def crossSectionCluster_m2(E_eV):
numerator = 17.76e-20
denominator = (E_eV)**0.477 * (1 + 0.0291*(E_eV)**3.61 + 1.53e-5*(E_eV)**6.55);
return numerator/denominator;
def crossSectionExcitation_m2(E_eV):
sig_small_1 = 6.59e-20*(E_eV)**-0.5/(1+2.29*(E_eV)**1.78)
numerator1 = 12.85e-20*np.exp(-1.84*(E_eV)**-1.55)
denominator1 = E_eV**0.0673 * (1+ 2.6e-3*(E_eV)**0.97 + 1.63e-10*(E_eV)**2.76)
sig_small_2 = numerator1/denominator1;
numerator2 = 11.38e-20*np.exp(-61.8*(E_eV)**0.54)
denominator2 = 1+ 8.21e-10*(E_eV)**2.08 + 3.8e-26*(E_eV)**5.15;
sig_big = numerator2/denominator2;
return sig_small_1 + sig_small_2 + sig_big;
def crossSectionDisRec(E_eV):
const1 = ( (E_eV)**0.665 * (1 + 1.1*(E_eV)**0.512 + 0.011*(E_eV)**3.10))**(-1)
const2 = 0.133 * np.exp(-0.35*(E_eV-6.05)**2)
return 17.3e-20 * (const1+const2);
def crossSectionDisExc(E_eV):
#janev page 71, eq 180
num1 = 13.2E-20*np.log(np.exp(1)+2.55E-4*E_eV)
num2 = E_eV**(0.31)*(1+0.017*E_eV**(0.76))
return num1/num2
def crossSectionFastH2(E_eV):
data_E = np.array([0.1, 0.1334, 0.1778, 0.237, 0.316, 0.422, 0.562, 0.750, 1.0, 1.334, 1.778, 2.37, 3.16, 4.22, 5.62, 7.50, 10., 13.3, 17.78, 23.7, 31.6, 42.2, 56.2, 75.0, 100., 133.4, 177.8, 237., 316., 421., 562., 750., 1000., 1334., 1778., 2371., 3162., 4217., 5623., 7499., 10000.])
data_sigma = np.array([0.28, 0.34, 0.43, 0.49, 0.60, 0.75, 0.95, 1.19, 1.53, 2.03, 2.6, 4.1, 5.9, 8.5, 10.4, 11.0, 10.8, 10.6, 10.2, 9.9, 9.6, 9.2, 8.9, 8.6, 8.4, 8.2, 7.9, 7.7, 7.4, 7.2, 7.1, 6.8, 6.4, 6.2, 5.9, 5.9, 5.9, 6.1, 6.4, 6.8, 7.0])
return np.where(E_eV < data_E[0], 0, np.interp(E_eV, data_E, data_sigma*1E-20))
def crossSectionChargeTarsfer(E_eV):
sigma_small = 6.59/(E_eV**0.5 * (1+2.29*E_eV**1.78)) \
+ 12.85*np.exp(-1.84/E_eV**1.55)/(E_eV**0.0673*(1+2.60E-3*E_eV**0.97 + 1.63E-10*E_eV**2.76))
sigma_big = 11.38*np.exp(-61.80/E_eV**0.54)/ \
(1+8.21E-10*E_eV**2.08 + 3.8E-26*E_eV**5.15)
return (sigma_small+sigma_big)*1E-20
"""
def crossSectionCollisionInducesDissociation(E_eV):
b = 3.15/((E_eV-2)**(1.65))
sig_small = 4.05e-20*(E_eV)**(-0.653)*np.exp(b)
numerator = 0.139e-20 * (E_eV)**0.318*np.exp(-680*(E_eV)**-2.10)
denominator = 1 + 2.75e-12*(E_eV)**2.65 + 9.04e-23*(E_eV)**4.65
sig_big = numerator/denominator;
return np.where(E_eV > 10, sig_small, sig_big)
"""
density_T2 = 1E21
energies_eV = np.logspace(-3,4,100)
sigma_Ti2_cluster = TritiumIon2.crossSectionCluster_m2(energies_eV)*1E4
sigma_Ti2_fastH2 = TritiumIon2.crossSectionFastH2(energies_eV)*1E4
energies_eV_target = targetFrameSwitch(energies_eV, 511E3, 2*938.272)
#sigma_Ti2_diss_exc = TritiumIon2.crossSectionDisExc(energies_eV_target)*1E4
#sigma_Ti2_discrec = TritiumIon2.crossSectionDisRec(energies_eV_target)*1E4
sigma_Ti2_diss_exc = TritiumIon2.crossSectionDisExc(energies_eV)*1E4
sigma_Ti2_discrec = TritiumIon2.crossSectionDisRec(energies_eV)*1E4
#sigma_Ti2_exc = TritiumIon2.crossSectionExcitation_m2(energies_eV)*1E4
#sigma_Ti2_CID = TritiumIon2.crossSectionCollisionInducesDissociation(energies_eV)*1E4
sigma_Ti2_ct = TritiumIon2.crossSectionChargeTarsfer(energies_eV)*1E4
# Plot
# =======================
pltStd.setRcParams()
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
(width, height) = pltStd.set_size('thesis')
fig, ax = plt.subplots(1, 1, figsize=(width, height))
ax.plot(energies_eV, sigma_Ti2_cluster, '-', label=r'H$_3^+$ cluster formation')
ax.plot(energies_eV, sigma_Ti2_ct, '-.', label=r'charge transfer')
#ax.plot(energies_eV[sigma_Ti2_fastH2>0], sigma_Ti2_fastH2[sigma_Ti2_fastH2>0], '-.', label=r'H$^+$ + fast H$_2$')
ax.plot(energies_eV, sigma_Ti2_discrec, '--', label=r'diss. rec. (e$^-$)')
ax.plot(energies_eV, sigma_Ti2_diss_exc, ':', label=r'diss. exc. (e$^-$)')
#ax.plot(energies_eV, sigma_Ti2_exc, label=r'T$^+_2$ exc.')
#ax.plot(energies_eV, sigma_Ti2_CID, label=r'T$^+_2$ CID.')
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_ylabel(r'Cross section $\sigma$ [cm$^{2}$]')
ax.set_xlabel(r'Energy $E$ [eV]')
ax.set_ylim((1E-17, 3E-13))
ax.legend()
plt.savefig(output_folder + "T2Iintercactions.pdf",bbox_inches='tight')
plt.show()
@@ -0,0 +1,141 @@
import numpy as np
import os
import sys
from astropy import units as u
from astropy import constants as const
import matplotlib
import matplotlib.pyplot as plt
import subprocess
import matplotlib.colors
homebase = os.getenv('HOMEBASE')
if homebase == None:
homebase = "/home/jonas/new_workspace/Coding/ACRONYM/acronym"
includes = homebase + "/src/grpic/boundaries_3d"
sys.path.append(includes)
import precalculation.functions.plasmaFunctions as plasmaFuncs
import analysis.plotDataFromAcronym.plot_standards as pltStd
# Input
# =======================
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
output_folder = thesis_path+"/fig/Chapter2_KATRIN/ParticleInteractions/"
# Calculation
# =======================
def targetFrameSwitch(energy_eV, m1_eV, m2_eV):
return (energies_eV + m1_eV)*m2_eV/m1_eV - m2_eV
def energyToVelocity(E_eV, mass_eV):
return (2*E_eV/mass_eV)**(1/2)*const.c.value
print(energyToVelocity(2.3E-3*80/30, 3*938.27208816E6))
class TritiumIon3:
def crossSectionElastic_m2(E_eV):
sig0c1 = 1.16e-20
c2 = -8.12e-1
c3 = 4.29e-4
c4c2 = (-1.38e-1) - (-8.12e-1)
c5 = 1.28e-2
c4c6 = (-1.38e-1) + 1.33
c7 = 8.67e-2
c4c8 = (-1.38e-1) + 2.18
ERyd_eV = 13.605693009
x_keV = E_eV*1E-3
fac1 = sig0c1*(E_eV/ERyd_eV)**c2
fac2 = 1 + (x_keV/c3)**c4c2
div = 1 + (x_keV/c5)**c4c6 + (x_keV/c7)**c4c8
return fac1*fac2/div
def crossSectionRadAsc_m2(E_eV):
mass_eV = 3*938.27208816E6 # mass proton
v_ms = energyToVelocity(E_eV, mass_eV)
return 5E-23 / v_ms
def crossSectionTerAsc_m2(E_eV, n_T2_m3):
mass_eV = 3*938.27208816E6
v_ms = energyToVelocity(E_eV, mass_eV)
return 2.5E-41 * n_T2_m3 /v_ms
def crossSectionDis(E_eV):
delta_E = 14.75
expc = np.exp(- 50.32*(E_eV)**-1.177/(1+1.019e-14*(E_eV)**7.462))
cross_section = 82.56e-20*(E_eV)**-0.521*(1-(15.0/E_eV)**5.15) * expc
return np.where(E_eV < delta_E, 0, cross_section)
def crossSectionDisRec(E_eV):
sigLDR = 3e-20*(E_eV)**(-0.725)/(1+4.45*(E_eV)**1.2)
sig_small = 0.0646e-20 * (E_eV)**1.478
sig_big = 634.22e-20 * (E_eV)**(-2.605)
sigHDR = 1/(1/sig_small + 1/sig_big)
return sigLDR + sigHDR;
def crossSectionCollisionInducedDissociationToTi(E_eV):
sig_small = 18.5*np.exp(-54.5/E_eV**(1.65))/(E_eV**0.63*(1 + 4.66E-6*E_eV**1.93))*(1-(4.32/E_eV)**2.32)**4.06 * 1E-20
sig_big = 3.84E-20*np.exp(-44.2/E_eV**0.48)/(1 + 7.49E-11*E_eV**1.85+ 7.55E-28*E_eV**4.6)
return sig_small + sig_big
def crossSectionCollisionInducedDissociationToT2i(E_eV):
sig_small = 17.35E-20*np.exp(-5.35/(E_eV-6.16)**1.65)/(E_eV**1.08*(1+1.32E-8*E_eV**3.26))
sig_big = 9.68E-3*E_eV**(0.602)*np.exp(-1.30E4/E_eV**2.57)/(1+7.95E-6*E_eV**1.25+1.03E-12*E_eV**2.62)*1E-20
return sig_big + sig_small
density_T2 = 1E21
energies_eV = np.logspace(-3,4,100)
sigma_Ti3_elastic = TritiumIon3.crossSectionElastic_m2(energies_eV)*1E4
sigma_Ti3_radasc = TritiumIon3.crossSectionRadAsc_m2(energies_eV)*1E4
sigma_Ti3_terasc = TritiumIon3.crossSectionTerAsc_m2(energies_eV,density_T2)*1E4
sigma_Ti3_CID_T = TritiumIon3.crossSectionCollisionInducedDissociationToTi(energies_eV)*1E4
sigma_Ti3_CID_T2 = TritiumIon3.crossSectionCollisionInducedDissociationToT2i(energies_eV)*1E4
energies_eV_target = targetFrameSwitch(energies_eV, 511E3, 3*938.272)
sigma_Ti3_disc = TritiumIon3.crossSectionDis(energies_eV)*1E4
sigma_Ti3_discrec = TritiumIon3.crossSectionDisRec(energies_eV)*1E4
#sigma_Ti3_disc = TritiumIon3.crossSectionDis(energies_eV_target)*1E4
#sigma_Ti3_discrec = TritiumIon3.crossSectionDisRec(energies_eV_target)*1E4
# Plot
# =======================
pltStd.setRcParams()
prop_cycle = plt.rcParams['axes.prop_cycle']
colors = prop_cycle.by_key()['color']
(width, height) = pltStd.set_size('thesis')
fig, ax = plt.subplots(1, 1, figsize=(width, height))
ax.plot(energies_eV, sigma_Ti3_elastic, '-', label=r'elastic sc.')
ax.plot(energies_eV, sigma_Ti3_radasc, '--', label=r'radiative ass.')
ax.plot(energies_eV, sigma_Ti3_terasc, '--', label=r'ternary ass.')
ax.plot(energies_eV, sigma_Ti3_CID_T, linestyle=(0, (3, 1, 1, 1, 1, 1)), label=r'CID to H$^+$')
ax.plot(energies_eV, sigma_Ti3_CID_T2, linestyle=(0, (3, 1, 1, 1, 1, 1)), label=r'CID to H$^+_2$')
ax.plot(energies_eV, sigma_Ti3_disc, ':', label=r'dissociative exc. (e$^-$)')
ax.plot(energies_eV, sigma_Ti3_discrec, '-.', label=r'dissociative rec. (e$^-$)')
ax.set_xscale('log')
ax.set_yscale('log')
ax.set_ylabel(r'Cross section $\sigma$ [cm$^{2}$]')
ax.set_xlabel(r'Energy $E$ [eV]')
ax.set_ylim((1E-23, 1E-12))
ax.legend(loc='lower left')
plt.savefig(output_folder+"T3Iintercactions.pdf",bbox_inches='tight')
plt.show()
File diff suppressed because one or more lines are too long