Activity: Electric field for a waffle cone of charge

Computational Physics Lab II 2022
Students integrate numerically to find the electric field due to a cone of surface charge, and then visualize the result. This integral can be done in either spherical or cylindrical coordinates, giving students a chance to reason about which coordinate system would be more convenient.
  • Media
    • activity_media/waffle-cone.svg
Consider a cone of surface charge that is open at the top.
  1. Write down on paper three integrals for the three components of the electric field, \(E_x(\vec r)\), \(E_y(\vec r)\), and \(E_z(\vec r)\).
    It is very common for students to want to create one function that returns the entire vector. This can actually work well, but most often does not. It often results in code that is inordinately slow (as it computes all three components, and then throws two out). Students also tend tend to struggle as in practice it requires returning a tuple of values, which is a data structure that students don't know about. So please try hard to get students to write three separate functions! Students frequently have difficulties taking components of the electric field. A surprisingly common mistake is to just “take the \(x\) stuff”, resulting in something like \begin{align} E_x(x,y,z) &= k\sigma\int \frac{x-x'}{\Big((x-x')^2\Big)^{\frac32}}dA' \end{align} When I encounter this, I try to talk with students about the meaning of taking a component. It is either the thing in front of \(\hat x\), or \(E_x = \vec E\cdot \hat x\).
  2. Find the first non-zero term in a power series for the electric field far from the origin.
  3. Write three functions to compute these three components of the electric field at any point in space. Write another three functions to compute the three components of the electric field as predicted by the first nonzero term in the power series.
  4. Visualize \(\vec E\) on the three Cartesian axes. On the same plots, visualize your lowest-order prediction for the field at large differences.
  5. Visualize the electric field in at least two different ways. Here "different" means more than just changing the orientation or direction of a plot, it needs to be an entirely different way of visualizing the electric field.
Extra fun
See what happens if you make your cone entirely flat, so it becomes a disk. In particular, what does the electric field look like just above and below the disk? Use Gauss's Law to predict the electric field near the center of the disk, and add that value to the plot.
Visualizing fun
Try creating other visualizations for the electric field.
  • assignment Einstein condensation temperature

    assignment Homework

    Einstein condensation temperature
    Einstein condensation Density Thermal and Statistical Physics 2020

    Einstein condensation temperature Starting from the density of free particle orbitals per unit energy range \begin{align} \mathcal{D}(\varepsilon) = \frac{V}{4\pi^2}\left(\frac{2M}{\hbar^2}\right)^{\frac32}\varepsilon^{\frac12} \end{align} show that the lowest temperature at which the total number of atoms in excited states is equal to the total number of atoms is \begin{align} T_E &= \frac1{k_B} \frac{\hbar^2}{2M} \left( \frac{N}{V} \frac{4\pi^2}{\int_0^\infty\frac{\sqrt{\xi}}{e^\xi-1}d\xi} \right)^{\frac23} T_E &= \end{align} The infinite sum may be numerically evaluated to be 2.612. Note that the number derived by integrating over the density of states, since the density of states includes all the states except the ground state.

    Note: This problem is solved in the text itself. I intend to discuss Bose-Einstein condensation in class, but will not derive this result.

  • face Fermi and Bose gases

    face Lecture

    120 min.

    Fermi and Bose gases
    Thermal and Statistical Physics 2020

    Fermi level fermion boson Bose gas Bose-Einstein condensate ideal gas statistical mechanics phase transition

    These lecture notes from week 7 of Thermal and Statistical Physics apply the grand canonical ensemble to fermion and bosons ideal gasses. They include a few small group activities.
  • assignment Cube Charge

    assignment Homework

    Cube Charge
    charge density

    Integration Sequence

    Static Fields 2023 (6 years)
    1. Charge is distributed throughout the volume of a dielectric cube with charge density \(\rho=\beta z^2\), where \(z\) is the height from the bottom of the cube, and where each side of the cube has length \(L\). What is the total charge inside the cube? Do this problem in two ways as both a single integral and as a triple integral.
    2. On a different cube: Charge is distributed on the surface of a cube with charge density \(\sigma=\alpha z\) where \(z\) is the height from the bottom of the cube, and where each side of the cube has length \(L\). What is the total charge on the cube? Don't forget about the top and bottom of the cube.
  • assignment Icecream Mass

    assignment Homework

    Icecream Mass
    Static Fields 2023 (6 years)

    Use integration to find the total mass of the icecream in a packed cone (both the cone and the hemisphere of icecream on top).

  • assignment Cone Surface

    assignment Homework

    Cone Surface
    Static Fields 2023 (6 years)

    • Find \(dA\) on the surface of an (open) cone in both cylindrical and spherical coordinates. Hint: Be smart about how you coordinatize the cone.
    • Using integration, find the surface area of an (open) cone with height \(H\) and radius \(R\). Do this problem in both cylindrical and spherical coordinates.

  • group Flux through a Cone

    group Small Group Activity

    30 min.

    Flux through a Cone
    Static Fields 2021 (4 years)

    Integration Sequence

    Students calculate the flux from the vector field \(\vec{F} = C\, z\, \hat{z}\) through a right cone of height \(H\) and radius \(R\) .
  • assignment Electric Field and Charge

    assignment Homework

    Electric Field and Charge
    divergence charge density Maxwell's equations electric field Static Fields 2023 (4 years) Consider the electric field \begin{equation} \vec E(r,\theta,\phi) = \begin{cases} 0&\textrm{for } r<a\\ \frac{1}{4\pi\epsilon_0} \,\frac{Q}{b^3-a^3}\, \left( r-\frac{a^3}{r^2}\right)\, \hat r & \textrm{for } a<r<b\\ 0 & \textrm{for } r>b \\ \end{cases} \end{equation}
    1. Use step and/or delta functions to write this electric field as a single expression valid everywhere in space.
    2. Find a formula for the charge density that creates this electric field.
    3. Interpret your formula for the charge density, i.e. explain briefly in words where the charge is.
  • assignment One-dimensional gas

    assignment Homework

    One-dimensional gas
    Ideal gas Entropy Tempurature Thermal and Statistical Physics 2020 Consider an ideal gas of \(N\) particles, each of mass \(M\), confined to a one-dimensional line of length \(L\). The particles have spin zero (so you can ignore spin) and do not interact with one another. Find the entropy at temperature \(T\). You may assume that the temperature is high enough that \(k_B T\) is much greater than the ground state energy of one particle.
  • assignment Quantum concentration

    assignment Homework

    Quantum concentration
    bose-einstein gas statistical mechanics Thermal and Statistical Physics 2020 Consider one particle confined to a cube of side \(L\); the concentration in effect is \(n=L^{-3}\). Find the kinetic energy of the particle when in the ground state. There will be a value of the concentration for which this zero-point quantum kinetic energy is equal to the temperature \(kT\). (At this concentration the occupancy of the lowest orbital is of the order of unity; the lowest orbital always has a higher occupancy than any other orbital.) Show that the concentration \(n_0\) thus defined is equal to the quantum concentration \(n_Q\) defined by (63): \begin{equation} n_Q \equiv \left(\frac{MkT}{2\pi\hbar^2}\right)^{\frac32} \end{equation} within a factor of the order of unity.
  • assignment Entropy, energy, and enthalpy of van der Waals gas

    assignment Homework

    Entropy, energy, and enthalpy of van der Waals gas
    Van der Waals gas Enthalpy Entropy Thermal and Statistical Physics 2020

    In this entire problem, keep results to first order in the van der Waals correction terms \(a\) and $b.

    1. Show that the entropy of the van der Waals gas is \begin{align} S &= Nk\left\{\ln\left(\frac{n_Q(V-Nb)}{N}\right)+\frac52\right\} \end{align}

    2. Show that the energy is \begin{align} U &= \frac32 NkT - \frac{N^2a}{V} \end{align}

    3. Show that the enthalpy \(H\equiv U+pV\) is \begin{align} H(T,V) &= \frac52NkT + \frac{N^2bkT}{V} - 2\frac{N^2a}{V} \\ H(T,p) &= \frac52NkT + Nbp - \frac{2Nap}{kT} \end{align}

    Effects of High Altitude by Randall Munroe, at xkcd.


Learning Outcomes
  • ph366: 1) Write functions and entire programs in python
  • ph366: 2) Apply the python programming language to solve scientific problems
  • ph366: 3) Use the matplotlib and numpy packages
  • ph366: 4) Model the physical systems studied in the course