Skip to main content
Chemistry LibreTexts

1: Boltzmann

  • Page ID
    206298
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

     

    from matplotlib import pyplot as plt
    import numpy as np
    k=0.695 #In wavenumbers/K. We can change it to other units if we want to use $\varepsilon$ in other units such as 1.38x10^-23 J/K
    Na=6.022045*10**23
    h=6.262e-34
    c=2.9979e10
    def q(eps,T):
      sum=0
      for i in range(0,len(eps)):
        sum+=np.exp(-eps[i]/k/T)
      return sum
    T=np.arange(1,1500,1)
    #@title Default title text
    upperlevelenergy =  500#@param {type:"integer"}
    eps1=[0,upperlevelenergy] #energy levels at 0 and 50 cm^-1
    plt.plot(T,q(eps1,T))
    plt.ylim(1,2)

      Code \(\PageIndex{1}\) (Python): 

      y=3
      print(y)

      1: Boltzmann is shared under a not declared license and was authored, remixed, and/or curated by LibreTexts.

      • Was this article helpful?