コード例 #1
0
ファイル: space_charge.py プロジェクト: AndKyr/GETELEC
    def __init__(self,
                 Voltage=100,
                 Distance=10,
                 geo="plane",
                 Npoints=1024,
                 emitter=None,
                 Radius=1.):
        if (emitter == None):
            print("SpaceCharge class created with default emitter")
            self.emitter = gt.emission_create()
        else:
            self.emitter = emitter

        self.voltage = float(Voltage)
        self.distance = float(Distance)
        self.geometry = geo
        self.radius = float(Radius)

        if (self.geometry == "plane"):
            self.system = planar
            self.system_u = planar_u
            self.Radius = 1.
            self.beta = 1. / self.distance
        elif (self.geometry == "cylinder"):
            self.system = cylindrical
            self.beta = 1. / (self.radius *
                              np.log(1 + self.distance / self.radius))
        elif (self.geometry == "sphere"):
            self.system = spherical
            self.system_u = spherical_u
            self.beta = (self.radius + self.distance) / (self.radius *
                                                         self.distance)
        else:
            print(
                "Error: Wrong geometry. Should be either, plane, cylinder or sphere"
            )

        self.Np = Npoints
コード例 #2
0
F = np.linspace(1,12)
Jfn = np.copy(F)
Jgtf = np.copy(F)
Jfull = np.copy(F)
Jrld= np.copy(F)

fig = plt.figure()
ax = fig.gca()
ax.grid()

T = [600,3200]
colors = plt.rcParams['axes.prop_cycle'].by_key()['color']

for j in range(len(T)):
    this = gt.emission_create(W = 4.5, R = 5000., Temp = T[j])

    for i in range(len(F)):
        this.F = F[i]
        this.approx = 2
        this.cur_dens()
        Jfull[i] = this.Jem
        
        this.approx = -1
        this.cur_dens()
        Jfn[i] = this.Jem
        
        this.approx = 0
        this.cur_dens()
        Jgtf[i] = this.Jem
        
コード例 #3
0
ファイル: spectraplot.py プロジェクト: AndKyr/GETELEC
mb.rcParams["xtick.labelsize"] = font
mb.rcParams["ytick.labelsize"] = font
mb.rcParams["legend.fontsize"] = font
mb.rcParams["lines.linewidth"] = 2.5
fsize = (16,10)

cMaphot = mb.colors.ListedColormap(['white', 'red'])
cMapcold = mb.colors.ListedColormap(['white', 'blue'])
cMap = plt.cm.plasma
# cMap = plt.cm.copper

plotG = False

T = 300.

this = gt.emission_create(R = 5000., gamma = 30)
sfile = "output/spectra.csv"

colors = plt.rcParams['axes.prop_cycle'].by_key()['color']


if (plotG):
    ax2 = ax.twinx()
    ax2.set_yscale("log")


fig = plt.figure(figsize=fsize)
fig.tight_layout()

fig2 = plt.figure(figsize=fsize)
fig2.tight_layout()
コード例 #4
0
mb.rcParams["xtick.labelsize"] = font
mb.rcParams["ytick.labelsize"] = font
mb.rcParams["legend.fontsize"] = font
mb.rcParams["lines.linewidth"] = 2.5
fsize = (18, 10)

Npoints = 256

Temps = [1.e-2, 300, 800, 1500]

Xfn = np.linspace(0.12, 0.35, 256)
F = 1. / Xfn

Jem = np.copy(F)

this = gt.emission_create(W=4.5, R=5000., approx=2)

fig1 = plt.figure(figsize=fsize)
ax1 = fig1.gca()

ax1.set_xlabel(r"$1/F$ [m GV$^{-1}$]")
ax1.set_ylabel(r"$J$ [A nm$^{-2}$]")

colors = plt.rcParams['axes.prop_cycle'].by_key()['color']

for i in range(len(Temps)):
    this.Temp = Temps[i]
    if (this.Temp < 10.):
        this.approx = -1
    else:
        this.approx = 2
コード例 #5
0
ファイル: random_emitters.py プロジェクト: AndKyr/GETELEC
areas = np.pi * radii**2
betas = abs(heights / radii)

Vexp, Iexp = np.loadtxt("IV_Yaroslava.txt", unpack=True)
Iexp *= 1.e-6
Efarexp = Vexp / 60000

Xfnfar = np.linspace(7, 15, 32)

Efar = 1. / Xfnfar
Itot = np.copy(Efarexp)

print "minF = %f, maxF = %f" % (min(Efarexp) * min(betas),
                                max(Efarexp) * max(betas))

this = gt.emission_create(W=4.1, R=100., gamma=1.1, Temp=300., approx=-1)

for i in range(len(Efarexp)):
    Itot[i] = 0.
    for j in range(len(betas)):
        this.F = betas[j] * Efarexp[i]
        this.R = radii[j]
        this.cur_dens()
        Itot[i] += this.Jem * areas[j]

plt.hist(betas)
plt.show()

xdata = 1. / Efarexp
ydata = np.log(Itot)
コード例 #6
0
    # ax = fig.gca()
    # ax2 = ax.twinx()

    for j in range(len(Ez)):
        Ns[j] = Nsupply(Ez[j], kBoltz * T[k])
    ax.semilogy(Ez,
                Ns,
                c=colors[0],
                ls='--',
                label=r'$L(E_z)$, T = %d K' % T[k])

    # ax2.tick_params(axis='y', labelcolor='red')
    # ax2.ticklabel_format(axis='y', style='sci')
    # ax2.set_ylabel(r'$10^4 \times N(E_z)$ [A nm$^{-2}$ eV$^{-1}$]', color = 'red')

    this = gt.emission_create(R=5000.)
    this.approx = 2
    ax2.set_xlabel(r"$E_z-E_F$ [eV]")
    ax.set_ylabel(r"$D(E_z), L(E_z) $")
    ax2.set_ylabel(r"$j(E_z) / j_{max}$")

    kk = 0

    this.F = F[k]

    this.Temp = T[k]
    this.cur_dens()
    E, JE, J, Nj, G = np.loadtxt(sfile, delimiter=',', unpack=True)
    ax.semilogy(E,
                1. / (1. + np.exp(G)),
                c=colors[0],
コード例 #7
0
ファイル: GTFplot.py プロジェクト: AndKyr/GETELEC
Npoints = 128
Jmin = 1.e-26
Fticks = np.array([1., 2., 3., 5., 8.])

T = 2000.

R = [4., 8., 1000.]

F = np.logspace(np.log10(1.), np.log10(9.), 64)

Jem = np.copy(F)
# Jrld = np.copy(Jem)
# Jfn = np.copy(Jem)
Jgtf = np.copy(Jem)

this = gt.emission_create(gamma=30)

colors = plt.rcParams['axes.prop_cycle'].by_key()['color']
this.Temp = T
fig = plt.figure(figsize=fsize)
ax = fig.gca()

for i in range(len(R)):
    this.R = R[i]
    if (R[i] > 500):
        lbl = r'SN barrier (R = $\infty$)'
    else:
        lbl = r'$R = $%g nm' % R[i]
    for j in range(len(F)):

        this.F = F[j]
コード例 #8
0
ファイル: pythontest.py プロジェクト: AndKyr/GETELEC
#! /usr/bin/python

import numpy as np
import sys
import os
import matplotlib.pyplot as plt
import matplotlib



mainpath,filename = os.path.split(os.path.realpath(__file__))
emissionpath,mainfolder = os.path.split(mainpath)
pythonpath = emissionpath + '/python'
sys.path.append(pythonpath)

import getelec_mod as gt

x = np.linspace(0.,3.,32)
V = 5*x - 0.1 * x**2

this = gt.emission_create(xr = x, Vr = V, mode = -10)
this.print_C_data()
this.print_data(True)