Homework #2#
1. Solid or Gas Earth?#
In class, we defined the quantity:
as a measure of the importance of the Coulomb energy to the thermal energy. If \(\Gamma \gg 1\), then we are a solid. We got the separation between nuclei from the number density and the temperature from the Virial theorem and got:
Now for the earth, we can take \(A\) and \(Z\) to just be for iron
A = 56
Z = 26
For the constants, we’ll use a library, unyt
to get them along with the units
import unyt
e = unyt.qe.in_cgs()
m_u = (1.0 * unyt.amu).in_cgs()
G = unyt.G.in_cgs()
M = unyt.Mearth.in_cgs()
Notice that these all have units
m_u
unyt_quantity(1.66053892e-24, 'g')
e
unyt_quantity(-4.80320467e-10, 'statC')
gamma = (Z * e)**2 / ((A * m_u)**(4./3.) * G * M**(2./3.))
gamma
unyt_quantity(167.13713567, '(dimensionless)')
So this tells us that gamma is dimensionless!
Now, really that we need to be careful with Coulomb’s law and units. In CGS, the energy is:
but in SI, it is:
Let’s redo that calculation but using SI units:
e = unyt.qe
m_u = 1 *unyt.amu
G = unyt.G
M = unyt.Mearth
gamma = (Z * e)**2 / ((A * m_u)**(4./3.) * G * M**(2./3.))
gamma
unyt_quantity(2.20215509e-17, 'C**2*s**2/(amu**(1/3)*kg**(2/3)*m**3)')
Notice that the units don’t work now! Let’s add in the \(1/(4\pi \epsilon_0)\)
import math
eps0 = unyt.eps_0
gamma = (Z * e)**2 / ((A * m_u)**(4./3.) * G * M**(2./3.)) / (4 * math.pi * eps0)
gamma
unyt_quantity(167.13713567, '(dimensionless)')
2. Ideal gas#
from sympy import init_session
init_session(use_latex="mathjax")
IPython console for SymPy 1.13.3 (Python 3.11.10-64-bit) (ground types: python)
These commands were executed:
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> init_printing()
Documentation can be found at https://docs.sympy.org/1.13.3/
ni, m, k, T = symbols("n_I m k_B T", real=True, positive=True)
p, v = symbols("p v", real=True)
n_I = symbols("n_I", real=True)
g = symbols("g", real=True, positive=True)
h = symbols("h", real=True, positive=True)
E_0 = symbols("E_0", real=True)
mu = symbols("mu", real=True)
a. Finding Maxwell#
We start with
n = 4 * pi * p**2 * g / h**3 * exp(mu/(k*T)) * exp(-E_0/(k*T)) * exp(-p**2/(2*m*k*T))
n
now let’s integrate over p
n_I_int = integrate(n, (p, 0, oo))
n_I_int
This is equal to \(n_I\). We want to substitute this back into \(n(p)\). Let’s solve for \(g\) in terms of \(n_I\) and then use that as a way to substitute this back.
g_solve = solve(Eq(n_I_int, n_I), g)[0]
g_solve
n = simplify(n.subs(g, g_solve, strict=False))
n
Now we see that we have the normal Maxwell-Boltzmann distribution.
b. Ideal gas pressure#
The pressure integral is simply:
with \(v = p / m\).
P = integrate(Rational(1, 3) * n * p**2 / m, (p, 0, oo))
P
We see that we get the familiar ideal gas law!
c. Energy#
The energy is:
with \(E(p) = p^2 / (2m)\)
rhoe = integrate(n * p**2 / (2 *m), (p, 0, oo))
rhoe
So we see that this is \(3/2 P\).