backup save
This commit is contained in:
@@ -0,0 +1,198 @@
|
||||
#!/bin/python3
|
||||
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
|
||||
|
||||
# Specific includes
|
||||
# =======================
|
||||
|
||||
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/Chapter3_Classification/LengthScales/"
|
||||
|
||||
density_min = 1E0
|
||||
density_max = 1E8
|
||||
|
||||
B_total = 2.5*u.T
|
||||
|
||||
temp1 = 30*u.K
|
||||
temp2 = 80*u.K
|
||||
|
||||
column_density_factor = 0.7
|
||||
|
||||
density_neutrals_center = column_density_factor*1E15/u.cm**3
|
||||
density_neutrals_rw = 1E11/u.cm**3
|
||||
|
||||
length_wgts = 1500
|
||||
diameter_wgts = 9
|
||||
|
||||
# Calculation
|
||||
# =======================
|
||||
num_points = 100
|
||||
|
||||
densities = np.linspace(density_min,density_max,num_points)
|
||||
debyle_length1 = np.zeros_like(densities)
|
||||
debyle_length2 = np.zeros_like(densities)
|
||||
|
||||
gyro_radius_electrons = plasmaFuncs.gyroRadiusElectron(B_total, temp2).value
|
||||
gyro_radius_ions = plasmaFuncs.gyroRadiusIon(B_total, temp2, mass=6*const.m_p ).value
|
||||
|
||||
inertial_length_electron = plasmaFuncs.electronInertialLength(densities/u.cm**3)
|
||||
mean_distance_electrons = plasmaFuncs.meanDistance(densities/u.cm**3)
|
||||
|
||||
|
||||
mfp_electronic_interaction = plasmaFuncs.meanFreePathElectronicInteraction(densities/u.cm**3, temp2)
|
||||
mfp_electrons_neutrals_center = plasmaFuncs.meanFreePath(density_neutrals_center, 1E-15*u.cm**2).value
|
||||
mfp_electrons_neutrals_rw = plasmaFuncs.meanFreePath(density_neutrals_rw, 1E-15*u.cm**2).value
|
||||
|
||||
mfp_H3ions_neutrals_center = plasmaFuncs.meanFreePath(density_neutrals_center, 1E-13*u.cm**2).value
|
||||
mfp_H3ions_neutrals_rw = plasmaFuncs.meanFreePath(density_neutrals_rw, 1E-13*u.cm**2).value
|
||||
|
||||
|
||||
landau_length = plasmaFuncs.landauLength(temp2*u.K).value
|
||||
|
||||
debyle_length1 = plasmaFuncs.debyeLength(densities/u.cm**3, temp1).value
|
||||
debyle_length2 = plasmaFuncs.debyeLength(densities/u.cm**3, temp2).value
|
||||
|
||||
# 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*2.))
|
||||
|
||||
ax.plot(densities, debyle_length2, '-', label=r'$\lambda_D$',color=colors[0])
|
||||
ax.plot(densities, inertial_length_electron, '-.', color=colors[1],label=r'$l_{skin}$')
|
||||
ax.plot(densities, mfp_electronic_interaction, '--', label=r'$\lambda_{ee}$', color=colors[2])
|
||||
ax.plot(densities, mean_distance_electrons, ':', label=r'$a$', color=colors[3])
|
||||
|
||||
ax.hlines(gyro_radius_electrons, density_min, density_max, linestyles=':',color='k')
|
||||
ax.hlines(gyro_radius_ions, density_min, density_max, linestyles=':',color='k')
|
||||
ax.hlines(landau_length, density_min, density_max, linestyles=':',color='k')
|
||||
ax.hlines(mfp_electrons_neutrals_center, density_min, density_max, linestyles=':',color='k')
|
||||
ax.hlines(mfp_electrons_neutrals_rw, density_min, density_max, linestyles=':',color='k')
|
||||
|
||||
ax.hlines(mfp_H3ions_neutrals_center, density_min, density_max, linestyles=':',color='k')
|
||||
ax.hlines(mfp_H3ions_neutrals_rw, density_min, density_max, linestyles=':',color='k')
|
||||
|
||||
|
||||
ax.hlines(diameter_wgts, density_min, density_max, linestyles=':',color='grey')
|
||||
ax.hlines(length_wgts, density_min, density_max, linestyles=':',color='grey')
|
||||
|
||||
#ax.text(1.5E4, 4.5, "radius wgts",horizontalalignment='left')
|
||||
|
||||
|
||||
ax.set_yscale("log")
|
||||
ax.set_xscale("log")
|
||||
|
||||
ax.set_xlim((1E4,1E8))
|
||||
ax.set_ylim((1E-9,1E4))
|
||||
|
||||
ax.set_yticks(np.logspace(-9, 3, num=13))
|
||||
|
||||
|
||||
#ax.set_ylim((1E-2,1E4))
|
||||
ax.set_ylabel(r'Characteristic length [cm]')
|
||||
ax.set_xlabel(r'Electron density $n_e$ [cm$^{-3}$]')
|
||||
ax.legend(loc='lower left')
|
||||
|
||||
ax.set_facecolor('#e7e7e7ff')
|
||||
|
||||
ax.grid(True, which='major', color='white')
|
||||
|
||||
|
||||
ax2 = ax.twinx()
|
||||
|
||||
yticks = {
|
||||
landau_length: '$l_L$',
|
||||
gyro_radius_electrons: '$R_e$',
|
||||
gyro_radius_ions: '$R_i$',
|
||||
mfp_electrons_neutrals_center: '$\lambda_{e,c}$',
|
||||
mfp_electrons_neutrals_rw: '$\lambda_{e,rw}$',
|
||||
mfp_H3ions_neutrals_center: '$\lambda_{i,c}$',
|
||||
mfp_H3ions_neutrals_rw: '$\lambda_{i,rw}$',
|
||||
length_wgts: '$L$',
|
||||
diameter_wgts: '$D$'
|
||||
}
|
||||
|
||||
ax2.set_ylim((-9,4))
|
||||
ax2.set_yticks(np.log10(list(yticks.keys())))
|
||||
ax2.set_yticklabels(yticks.values())
|
||||
|
||||
|
||||
|
||||
plt.savefig(output_folder+"comparison_l.pdf",bbox_inches='tight')
|
||||
|
||||
plt.show()
|
||||
"""
|
||||
(width, height) = pltStd.set_size('thesis')
|
||||
fig, ax = plt.subplots(1, 1, figsize=(width, height*0.6))
|
||||
ax.plot(debyle_length2,densities, '-', label=r'$\lambda_D$',color=colors[0])
|
||||
ax.plot(inertial_length_electron, densities, '-.', color=colors[1],label=r'$l_{skin}$')
|
||||
ax.plot(mfp_electronic_interaction, densities,'--', label=r'$\lambda_{ee}$', color=colors[2])
|
||||
ax.plot(mean_distance_electrons, densities, ':', label=r'$a$', color=colors[3])
|
||||
|
||||
|
||||
ax.vlines(gyro_radius_electrons, density_min, density_max, linestyles=':',color=colors[6])
|
||||
ax.vlines(gyro_radius_ions, density_min, density_max, linestyles=':',color=colors[6])
|
||||
ax.vlines(landau_length, density_min, density_max, linestyles=':',color=colors[6])
|
||||
ax.vlines(mfp_electrons_neutrals_center, density_min, density_max, linestyles=':',color=colors[6])
|
||||
#ax.vlines(mfp_electrons_neutrals_rw, density_min, density_max, linestyles=':',color=colors[6])
|
||||
|
||||
|
||||
ax.set_yscale("log")
|
||||
ax.set_xscale("log")
|
||||
ax.set_ylim((1E3,5E6))
|
||||
ax.set_xlim((1E-9,1E4))
|
||||
ax.set_xlabel(r'Length [cm]')
|
||||
ax.set_ylabel(r'Electron density $n_e$ [cm$^{-3}$]')
|
||||
ax.legend(loc=(0.05,0.1))
|
||||
plt.grid(True)
|
||||
|
||||
|
||||
ax2 = ax.twiny()
|
||||
xticks = np.log10(np.array([\
|
||||
landau_length,
|
||||
gyro_radius_electrons,
|
||||
gyro_radius_ions,
|
||||
mfp_electrons_neutrals_center]))
|
||||
#mfp_electrons_neutrals_rw]))
|
||||
xtick_labels = [
|
||||
r'$l_L$',
|
||||
r'$R_{g,e}$',
|
||||
r'$R_{g,i}$',
|
||||
r'$\lambda_{center}$']
|
||||
#r'$\lambda_{rw}$']
|
||||
ax2.set_xticks(xticks)
|
||||
ax2.set_xlim((-9,4))
|
||||
ax2.set_xticklabels(xtick_labels)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#plt.savefig(output_folder+"comparison_l.pdf",bbox_inches='tight')
|
||||
plt.show()
|
||||
|
||||
plt.show()
|
||||
"""
|
||||
Reference in New Issue
Block a user