Source code for irfpy.util.sputtering

''' A formulation of sputtering

.. codeauthor:: Yoshifumi Futaana

.. autosummary::
    
    ThompsonSigmund
'''
import numpy as np

[docs]class ThompsonSigmund: ''' Thompson-Sigmund energy spectrum. >>> ts0 = ThompsonSigmund(1, 0.5, 1.5, 1000., 1, 25) >>> print('%.3f' % ts0.ei) 147.929 .. todo:: Clarify the unit system. Energy looks eV. What about the energy spectrum? ''' def __init__(self, n0, y, ene_bind, ene_in, m1, m2): r''' Initialize the formulation. .. math:: F(E) = nC\frac{E}{(E+E_b)^3}\Bigl(1-\sqrt{\frac{E+E_b}{Ei'}}\Bigr) Note that C is a parameter including the yield. The unit of C is the energy. After several argebla, C is obtained from yield, Y, like .. math:: C = \frac{Y}{\frac{1}{2E_b}-\frac{4}{3\sqrt{EbEi'}}} :param n0: Density. :param y: Yeild. :param ene_bind: Binding energy, :math:`E_b` :param ene_in: Impinging beam energy, :math:`E_i` :param m1: Mass of impinging beam. Unitless. :param m2: Mass of target. Unitless. ''' self.n0 = float(n0) self.yld = float(y) self.eb = float(ene_bind) self.m1 = float(m1) self.m2 = float(m2) self.ei0 = float(ene_in) self.ei = self.ei0 * 4 * self.m1 * self.m2 / ((self.m1 + self.m2) ** 2) c1 = 1. / (2 * self.eb) c2 = 4. / (3 * np.sqrt(self.eb * self.ei)) self.c =self.yld / (c1 - c2) if self.c <= 0: raise ValueError('C becomes negative (%g)...' % self.c)
[docs] def f(self, e): ''' Return the energy distribution at certain e. ''' eeb = (e + self.eb) eeb3 = eeb ** 3 sqterm = np.sqrt(eeb / self.ei) fval = self.n0 * self.c * e / eeb3 * (1 - sqterm) return fval
import unittest import doctest
[docs]def doctests(): return unittest.TestSuite(( doctest.DocTestSuite(), ))
if __name__ == '__main__': unittest.main(defaultTest='doctests')