vlaplex/scripts_python/plotCumF.py
JGonzalez 8eab3b5610 I'm stupid and I deleted the previous repository...
So, code is working, this case reproduce a Diko's peak with Poisson
equation by changing the boundary conditions over time.
2024-09-26 17:58:45 +02:00

41 lines
1 KiB
Python

import readPhi
import readF
import matplotlib.pyplot as plt
import glob
import numpy as np
from scipy.constants import e, k
m_i = 1.9712e-25
paths = ['../quasiNeutral_fullAblation/','../Poisson_fullAblation/']
# paths = ['../quasiNeutral_partialAblation/','../Poisson_partialAblation/']
for path in paths:
filesCum_i = sorted(glob.glob(path+'time_*_fCum_i.csv'))
start = 0
end = len(filesCum_i)
every = 100
for fileCum_i in filesCum_i[start:end:every]:
time, x, v, f_i = readF.read(fileCum_i)
plt.plot(v**2*m_i*0.5/e, f_i[0]*e/m_i/v, label='{:.3f} ns'.format(time*1e9))
time, x, v, f_i = readF.read(filesCum_i[-1])
plt.plot(v**2*m_i*0.5/e, f_i[0]*e/m_i/v, label='{:.3f} ns'.format(time*1e9), color='k')
plt.yscale('log')
plt.ylim([1e18,1e24])
plt.ylabel('Sum f(e) / sqrt(e) (m^-3 eV^-1)')
plt.xscale('log')
plt.xlim([1e0,1e4])
plt.xlabel('e (eV)')
plt.legend()
plt.title('r = {:.1f} mm, time_max={:.1f} ns '.format(x[0]*1e3, time*1e9) + path)
plt.show()