137 lines
4.0 KiB
Python
137 lines
4.0 KiB
Python
import numpy as np
|
|
import os
|
|
import sys
|
|
from astropy import units as u
|
|
import matplotlib
|
|
import matplotlib.pyplot as plt
|
|
|
|
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
|
|
|
|
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
|
|
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
|
|
|
|
# Input
|
|
# =======================
|
|
|
|
thesis_path = "/home/jonas/new_workspace/notes/katrin-plasma/docs/phd/jkellerer"
|
|
output_file = thesis_path+"/fig/Chapter2_KATRIN/TritiumBetaDecay/tritium_beta_decay.pdf"
|
|
|
|
me_eV = 0.511e6
|
|
decay_constant = 1.2072343416696292e-47
|
|
end_point_eV = 18.574e3
|
|
Z = 2
|
|
normation = 1.2078059173513103e-24
|
|
Ue1 = 0.82
|
|
Ue2 = 0.55
|
|
Ue3 = 0.145
|
|
|
|
# Calculation
|
|
# =======================
|
|
|
|
def beta_dist_mass(E_eV, mnue_eV):
|
|
if E_eV > (end_point_eV-mnue_eV):
|
|
return -1.
|
|
if E_eV <= 0:
|
|
return 0.
|
|
gamma = 1+E_eV/me_eV
|
|
beta = np.sqrt(1 - pow(gamma,-2))
|
|
eta =Z/beta/137.
|
|
fermi_function = 2*np.pi*eta/(1-np.exp(-2*np.pi*eta));
|
|
|
|
p_eV = np.sqrt(E_eV*E_eV + 2 * E_eV * me_eV)
|
|
sqrtterm = np.sqrt(pow(end_point_eV-E_eV,2) - mnue_eV**2)
|
|
|
|
return decay_constant*fermi_function*p_eV*(E_eV+me_eV)*(end_point_eV-E_eV)*sqrtterm*1e28
|
|
beta_dist_mass = np.vectorize(beta_dist_mass)
|
|
|
|
|
|
E_eV = np.linspace(1e-5, end_point_eV, 300)
|
|
n = beta_dist_mass(E_eV,0 )
|
|
|
|
Eend_eV = np.linspace(end_point_eV-3, end_point_eV, 300)
|
|
n_0 = beta_dist_mass(Eend_eV, 0)
|
|
n_1 = beta_dist_mass(Eend_eV, 1)
|
|
|
|
# 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, 0.5*height))
|
|
|
|
ax.plot(E_eV, n, linewidth=2)
|
|
ax.set_xlabel(r'Electron energy $E$ [$E_0$]')
|
|
ax.set_xlim (0,2.5e4)
|
|
ax.set_xticks([0,end_point_eV/2,end_point_eV])
|
|
ax.set_xticklabels(['0','0.5','1'])
|
|
|
|
ax.set_ylim (0,1.5)
|
|
ax.set_ylabel('Intensity $I$ [arb. u]')
|
|
ax.set_yticks([])
|
|
ax.set_yticklabels([])
|
|
|
|
axins = zoomed_inset_axes(ax, 5500, loc=1) # zoom = 6
|
|
axins.plot(Eend_eV,n_0*4e3,linewidth=2)
|
|
axins.plot(Eend_eV,n_1*4e3,linewidth=2)
|
|
axins.set_xlim(end_point_eV-2.2, end_point_eV+0.25)
|
|
|
|
axins.set_ylim(0, 0.15e-3)
|
|
axins.set_xticks([end_point_eV-2, end_point_eV-1, end_point_eV])
|
|
axins.set_xticklabels([-2, -1, 0],size = 8, va = 'center')
|
|
axins.tick_params(direction='out', length=1, width=0)
|
|
axins.set_yticklabels([])
|
|
|
|
mark_inset(ax, axins, loc1=3, loc2=4, fc="none", ec="0.5")
|
|
axins.text(end_point_eV-0.95, 0.4e-4, r'$m_{\nu}=0\,$eV', color=colors[0], size=10, ha='left')
|
|
axins.text(end_point_eV-1.8, 0.1e-4, r'$m_{\nu}=1\,$eV', color=colors[1], size=10, ha='left')
|
|
axins.set_xlabel(r'$E - E_0$ [eV]',size=8, ha='right', x=0.64, alpha=1, y=0.2)
|
|
|
|
plt.show()
|
|
#plt.savefig(output_file,bbox_inches='tight')
|
|
"""
|
|
|
|
(width, height) = pltStd.set_size('thesis')
|
|
fig, (ax, ax1) = plt.subplots(1, 2, figsize=(width, 0.6*height))
|
|
|
|
ax.plot(E_eV, n, linewidth=2)
|
|
ax.set_xlabel(r'Electron energy $E$ ($E_0$)')
|
|
ax.set_xlim (0,2.5e4)
|
|
ax.set_xticks([0,end_point_eV/2,end_point_eV])
|
|
ax.set_xticklabels(['0','0.5','1'])
|
|
|
|
ax.set_ylim (0,1.5)
|
|
ax.set_ylabel('Intensity $I$ (arb. u)')
|
|
ax.set_yticks([])
|
|
ax.set_yticklabels([])
|
|
|
|
ax1.plot(Eend_eV,n_0*4e3,linewidth=2)
|
|
ax1.plot(Eend_eV,n_1*4e3,linewidth=2)
|
|
ax1.set_xlim(end_point_eV-2.2, end_point_eV+0.25)
|
|
|
|
|
|
ax1.set_ylabel('Intensity $I$ (arb. u)')
|
|
ax1.set_ylim(0, 0.15e-3)
|
|
ax1.set_xticks([end_point_eV-2, end_point_eV-1, end_point_eV])
|
|
ax1.set_xticklabels([-2, -1, 0])
|
|
|
|
ax1.set_yticks([])
|
|
ax1.set_yticklabels([])
|
|
|
|
ax1.text(end_point_eV-0.95, 0.4e-4, r'$m_{\nu}=0\,$eV', color=colors[0], size=10, ha='left')
|
|
ax1.text(end_point_eV-1.8, 0.1e-4, r'$m_{\nu}=1\,$eV', color=colors[1], size=10, ha='left')
|
|
ax1.set_xlabel(r'Electron energy $E - E_0$ (eV)')
|
|
|
|
plt.savefig(output_file,bbox_inches='tight')
|
|
plt.show() |