Ejemplo n.º 1
0
def waveVector_deBroglie(momentum=1, units=SI):
    """ deBroglie wave vector

    arguments
    ---------
    momentum:   default = 1 [ mass velocity ], magnitude of momentum
    units:      default = SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('p hbar')
    par =   momentum, units['hbar']

    y   =   p / hbar
    return dic_result(var,par,y)
Ejemplo n.º 2
0
def probability_density(dic):
    """ probability density psi* psi
    requires psi function to have conjugate keyword argument

    arguments
    ---------
    dic:    returned dictionary from desired psi function

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   dic['var']
    par =   dic['par']
    y1  =   dic['y']
    y   =   y1.conjugate() * y
    return dic_result(var,par,y)
Ejemplo n.º 3
0
def wavelength_deBroglie(momentum=1, units=SI):
    """ deBroglie wavelength

    arguments
    ---------
    momentum:   default = 1 [ mass velocity ], magnitude of momentum
    units:      default = SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('h p')
    par =   units['h'], momentum

    y   =   h / p
    return dic_result(var,par,y)
Ejemplo n.º 4
0
def displacement_wein(temperature=1, units=SI):
    """ wavelength of blackbody peak energy density

    arguments
    ---------
    temperature:    default = 1 [K]
    units:          default = SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('h c k t')
    par = units['h'], units['c'], units['k'], temperature

    y   =   h * c / 4.9663 / k / t

    return dic_result(var,par,y)
Ejemplo n.º 5
0
def wavelength_compton_shift(angle=0, units=SI):
    """ shift in wavelength from compton scatter

    arguments
    ---------
    angle:  default = 0 [degree], scattering angle
    units:  default = SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('h m_e c theta')
    par =   units['h'], units['m_e'], units['c'], np.deg2rad(angle)

    y   =   h / (m_e * c) * ( 1 - sy.cos(theta) )

    return dic_result(var,par,y)
Ejemplo n.º 6
0
def frequency_threshold(workFunction=1, units=eV):
    """ threshold frequency of material

    arguments
    ---------
    workFunction:   default = 1 [ energy ]
    units:          default = eV

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('W h')
    par =   workFunction, units['h']

    y   =   W / h

    return dic_result(var,par,y)
Ejemplo n.º 7
0
def intensity_blackbody(efficiency=1,temperature=1, units=SI):
    """ power/area

    parameters
    ----------
    energy:         default = 1 [ energy ]
    temperature:    default = 1 [ K ]
    units:          default SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('e sigma t')
    par =   efficiency, units['sigma'], temperature

    y   =   e * sigma * t**4

    return dic_result(var,par,y)
Ejemplo n.º 8
0
def energy_scattered_electron(photonEnergy=1, units=eV):
    """ energy of scattered electron from compton scatter

    arguments
    ---------
    photonEnergy:   default = 1 [ energy ], energy of photon before interaction
    units:          default = SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('m_e c E')
    par =   units['m_e'], units['c'], photonEnergy

    m0  =   m_e * c**2
    y   =   m0 / ( (m0/E) + 2 )

    return dic_result(var,par,y)
Ejemplo n.º 9
0
def potential_stopping(frequency=1,workFunction=1, units=eV):
    """ stopping potential WRT frequency

    arguments
    ---------
    frequency:      default = 1 [ 1 / time ]
    workFunction:   default = 1 [ energy ]
    units:          default = eV

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('h e nu W')
    par =   units['h'], units['e'], frequency, workFunction

    y   =   (h/e) * nu - (W/e)

    return dic_result(var,par,y)
Ejemplo n.º 10
0
def KE_ejected_electron(frequency=1,workFunction=1, units=eV):
    """ kinetic energy of ejected photon

    arguments
    ---------
    frequency:      default = 1 [ 1 / time ]
    workFunction:   default = 1 [ energy ]
    units:          default = eV

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('h nu W')
    par =   units['h'], frequency, workFunction

    y   =   h*nu - W

    return dic_result(var,par,y)
Ejemplo n.º 11
0
def distribution_planck_nu(frequency=1,temperature=1, units=SI,printA=False):
    """ Planck energy density distribution WRT nu

    arguments
    ---------
    frequency:      default = 1 [ 1 / time ]
    temperature:    default = 1 [ K ]
    units:          default SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('pi nu h c k t')
    par =   np.pi, frequency, units['h'], units['c'], units['k'], temperature

    y   =   ( 8 * pi * nu**2 * h * nu ) / ( c**3 * (sy.exp(h*nu/k/t) - 1) )

    return dic_result(var,par,y)
Ejemplo n.º 12
0
def distribution_planck_lambda(wavelength=1,temperature=1, units=SI,printA=False):
    """ Planck energy density distribution WRT lambda

    arguments
    ---------
    wavelength:     default = 1 [ length ]
    temperature:    default = 1 [ K ]
    units:          default = SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('pi h c l k t')
    par =   np.pi, units['h'], units['c'], wavelength, units['k'], temperature

    y   =   ( 8 * pi * h * c ) / l**5 / ( sy.exp(h*c/l/k/t) - 1 )

    return dic_result(var,par,y)
Ejemplo n.º 13
0
def energy_bohr_orbital(atomicZ=Z1,mass_n=mn1,num=1,units=eV):
    """ find orbital energy of bohr-like atom

    arguments
    ---------
    atomicZ:    default = 1, atomic number
    mass_N:     default = eV['m_n'], mass of nucleus
    num:        default = 1, orbital number
    units:      default = eV

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('Z me mn R n')
    par =   atomicZ, units['m_e'], mass_n, units['Rydberg'], num

    y   =   - Z**2 / (1 + (me/mn)) * (R/n**2)
    return dic_result(var,par,y)
Ejemplo n.º 14
0
def distribution_rayleigh_jean(frequency=1,temperature=1, units=SI):
    """ Rayleigh Jean's energy density distribution

    arguments
    ---------
    frequency:      default = 1 [ 1 / time ]
    temperature:    default = 1 [ K ]
    units:          default SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('pi nu c k t')
    par =   np.pi, frequency, units['c'], units['k'], temperature

    y   =   ( 8 * pi * nu**2 * k * t ) / ( c**3 )

    return dic_result(var,par,y)
Ejemplo n.º 15
0
def energy_bohr_photon(atomicZ=Z1,mass_n=mn1,num1=1,num2=2,units=eV):
    """ energy of absorbed/emitted photon from bohr-like atom

    arguments
    ---------
    atomicZ:    default = 1, atomic number
    mass_N:     default = eV['m_n'], mass of nucleus
    num1:       default = 1, initial orbital number
    num2:       default = 2, final orbital number
    units:      default = eV

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('R Z me mn m n')
    par =   units['Rydberg'], atomicZ, units['m_e'], mass_n, num2, num1

    y   =   R * Z**2 / ( (me/mn) + 1) * ( 1/n**2 - 1/m**2 )
    return dic_result(var,par,y)
Ejemplo n.º 16
0
def radius_bohrlike(atomicZ=Z1,mass_n=mn1,num=1,units=eV):
    """ find radius of bohr-like atom

    arguments
    ---------
    atomicZ:    default = 1, atomic number
    mass_N:     default = eV['m_n'], mass of nucleus
    num:        default = 1, orbital number
    units:      default = eV

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('me mn a0 Z n')
    par =   units['m_e'], mass_n, units['a_0'], atomicZ, num

    y   =   (1 + me/mn) * (a0/Z) * n**2

    return dic_result(var,par,y)
Ejemplo n.º 17
0
def uncertainty_heisenberg(uncertainty=1,symb=deltap, units=SI):
    """ finds the uncertainty between two conjugate paired variables

    arguments
    ---------
    var:    default = dp, uncertainty of known conjugate variable
    units:  default = SI

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var1    =   sy.var(symb)
    var2    =   sy.var('hbar')
    var     =   var1,var2
    par     =   uncertainty,units['hbar']

    y   =   var2 / var1

    return dic_result(var,par,y)
Ejemplo n.º 18
0
def distribution_wein(a0=1,a1=1,frequency=1,temperature=1):
    """ Wien's energy density distribution

    arguments
    ---------
    a1:             default = 1, fitting parameter 1
    a2:             default = 1, fitting parameter 2
    frequency:      default = 1 [ 1 / time ]
    temperature:    default = 1 [K]

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('a:2 nu t')
    par =   a0, a1, frequency, temperature

    y   =   var[0] * nu**3 * sy.exp( - var[1]*nu/t)

    return dic_result(var,par,y)
Ejemplo n.º 19
0
def energy_photon_pair_production(k_electron=1,k_proton=1,k_nucleus=1,m_nucleus=1, units=eV):
    """

    arguments
    ---------
    k_electron: default = 1 [ energy ], kinetic energy of electron
    k_proton:   default = 1 [ energy ], kinetic energy of positron
    k_nucleus:  default = 1 [ energy ], kinetic energy of nucleus
    m_nucleus:  default = 1 [ mass ], mass of nucleus
    units:      default = eV

    returns
    -------
    dictionary: keys('var', 'par', 'y' , 'f' , 'result' )
    """

    var =   sy.var('m_e c k_e k_p k_n m_n ')
    par =   units['m_e'], units['c'], k_electron, k_proton, k_nucleus, m_nucleus

    y   =   (2 * m_e + m_n) * c**2 + k_e + k_p + k_n

    return dic_result(var,par,y)