コード例 #1
0
ファイル: mact_e.py プロジェクト: thibaultmerle/formato
def sigma_weak_seaton(x, ion, line, T):
    ''' Compute collision cross-section for weak coupling in the IPM formula (Seaton 1962)
        x: energy of colliding electron before collision [without dimension]
        ion: Ionization instance of State of Level class
	    line: radiative transtion instance of Line class
	    T: temperature [K]
    '''
    global cst
    
    r_i = orbital_radius(ion, line.lower)
    r_j = orbital_radius(ion, line.upper)
    #print(r_i, r_j)
    
    if r_i <= r_j:
        r = r_i
    else:
        r = r_j   
    
    de = cst / line.lbd
    x0  = de * Cst.Q / Cst.K / T
    #print(r, de, x0)
    b0 = beta0(x, x0, r, T)
    if x < x0:
        return 0.
    else:
        #return 8 * (13.6057*Cst.Q/Cst.K/T)**2 * line.f * (1/x0) * (1/(x+x0)) * phi(b0)
        return 8 * (13.6057*Cst.Q/Cst.K/T)**2 * line.f * (1/x0) * (1/(x)) * phi(b0)
コード例 #2
0
ファイル: mact_e.py プロジェクト: thibaultmerle/formato
def plot_ex(ion, line):
    ''' Plot the collisions cross-section with electrons
    '''
    global cst, iplot
    iplot += 1
    ofname = format(iplot, '0>4')+'_ex.pdf'
    T = 5000.
    x0  = cst / line.lbd * Cst.Q / Cst.K / T
    x_vec_log = pl.linspace(-3, 4, 100)
    x_vec = 10**x_vec_log
    q0 = [sigma_weak_seaton(i, ion, line, T) for i in x_vec]
    q1 = [sigma_strong_seaton(i, ion, line, T) for i in x_vec]
    q = [sigma_seaton(i, ion, line, T) for i in x_vec]
    ll = line.lower
    ul = line.upper
    #title='Na I: '+str(ll.cfg)+' '+str(ll.term)+' [g='+str(ll.g)+'] <=> '+str(ul.cfg)+' '+str(ul.term)+' [g='+str(ul.g)+'], Ro = '+format(orbital_radius(ion, line.lower), '4.2f')+' a$_0$, f = '+str(line.f)
    title = SPE+' '+DEG+': '+str(ll.cfg)+' '+str(ll.term)+' [g='+str(ll.g)+'] '+str(ul.cfg)+' '+str(ul.term)+' [g='+str(ul.g)+'] Ro = '+str(orbital_radius(ion, line.lower))+' f = '+str(line.f)
    pl.figure(figsize=(12, 6), dpi=100, facecolor='w', edgecolor='k')
    pl.plot(x_vec*Cst.K*T/Cst.Q, q0, 'k', lw=1, label='Weak coupling')
    pl.plot(x_vec*Cst.K*T/Cst.Q, q1, 'k', lw=2, label='Strong coupling')
    pl.plot(x_vec*Cst.K*T/Cst.Q, q, 'r+', label='IPM (Seaton 1962)')
    pl.semilogx()
    #pl.semilogy()
    pl.xlim([1e-2, 1e4])
    pl.xlabel('E [eV]')
    pl.ylabel('Cross-section [$\pi a_0^2$]')
    pl.legend(frameon=False, loc=0)
    pl.title(title)
    #bbox_inches='tight'
    pl.savefig(ofname, dpi=100, format='pdf', orientation='landscape', papertype='a4')
    pl.close()