## 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
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.

• assignment Cube Charge

assignment Homework

##### Cube Charge
charge density

Integration Sequence

Static Fields 2022 (5 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. In a new physical situation: 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.
• face Fermi and Bose gases

face Lecture

120 min.

##### Fermi and Bose gases
Thermal and Statistical Physics 2020

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.
• keyboard Electrostatic potential of spherical shell

keyboard Computational Activity

120 min.

##### Electrostatic potential of spherical shell
Computational Physics Lab II 2022

Students solve numerically for the potential due to a spherical shell of charge. Although this potential is straightforward to compute using Gauss's Law, it serves as a nice example for numerically integrating in spherical coordinates because the correct answer is easy to recognize.
• assignment Gradient Practice

assignment Homework

Static Fields 2022 (3 years)

Find the gradient of each of the following functions:

1. \begin{equation} f(x,y,z)=e^{(x+y)}+x^2 y^3 \ln \frac{x}{z} \end{equation}
2. \begin{equation} \sigma(\theta,\phi)=\cos\theta \sin^2\phi \end{equation}
3. \begin{equation} \rho(s,\phi,z)=(s+3z)^2\cos\phi \end{equation}

• group Representations of the Infinite Square Well

group Small Group Activity

120 min.

##### Representations of the Infinite Square Well
Quantum Fundamentals 2022 (3 years)

Warm-Up

• assignment Icecream Mass

assignment Homework

##### Icecream Mass
Static Fields 2022 (5 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 2022 (5 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 2022 (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 Mass of a Slab

assignment Homework

##### Mass of a Slab
Static Fields 2022 (5 years)

Determine the total mass of each of the slabs below.

1. A square slab of side length $L$ with thickness $h$, resting on a table top at $z=0$, whose mass density is given by \begin{equation} \rho=A\pi\sin(\pi z/h). \end{equation}
2. A square slab of side length $L$ with thickness $h$, resting on a table top at $z=0$, whose mass density is given by \begin{equation} \rho = 2A \Big( \Theta(z)-\Theta(z-h) \Big) \end{equation}
3. An infinitesimally thin square sheet of side length $L$, resting on a table top at $z=0$, whose surface density is given by $\sigma=2Ah$.
4. An infinitesimally thin square sheet of side length $L$, resting on a table top at $z=0$, whose mass density is given by $\rho=2Ah\,\delta(z)$.
5. What are the dimensions of $A$?
6. Write several sentences comparing your answers to the different cases above.

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