Students write python programs to compute the potential due to a square of surface charge, and then to visualize the result. This activity can be used to introduce students to the process of integrating numerically.
Be aware that pairs may take an hour or more to simply write down the integral that they need to solve. When this happens, remember that it means that the students are getting valuable practice at a skill that is most necessary for them to learn as a physicist!
Issues on paper
- We want students to always write \(V(x,y,z)\) or \(V(\vec r)\) or similar on the left side of an equation like \(V=\int\cdots\). Ask students “\(V\) of what?” or “where is that potential?”
- Omitting an \(=\) so they don't have an equation. “That doesn't mean anything. It can't be true or false.”
- Many students will need to be told to write down the integral on paper first.
- We also want to proactively look for students using
scipy
quadrature (i.e. numerical integration) functions, and ask them to not use those functions, but instead to program the computation by hand.- When students are confused as to how to do an integral numerically, ask then what an integral really is, and after a few statements they may get to either Riemann sums or chopping and adding, and either way works well. One can also think of it as treating the sheet as if it were a whole bunch of point charges.
- Another common student challenge here is wanting to use the
range
function with non-integer inputs. You can point out this error, and ask what they might google to find a better function. Something like “python range non-integer” (orfloat
) works well.
On the same figures, plot the potential due to a point charge located at the center of your square, with the same charge as your square (in total). This potential should very closely match your computed potential at distances which are not all that far from your square.
Note that this is the first term in a power series expansion far from the origin. I just didn't bother forcing you to work it out yourself.
The most frequent bug is to omit the dx
in the integral, and this reveals itself when they do this comparison, but often students don't even notice. They think it agrees because both curves approach zero. So you need to actually look and inform them that there is a problem.
keyboard Computational Activity
120 min.
electrostatic potential python
Students write python programs to compute and visualize the potential due to four point charges. For students with minimal programming ability and no python experience, this activity can be a good introduction to writing code in python usingnumpy
and matplotlib
.
keyboard Computational Activity
120 min.
assignment Homework
Find the electrostatic potential at a point \(\vec{r}\) on the \(x\)-axis at a distance \(x\) from the center of the quadrupole.
A series of charges arranged in this way is called a linear quadrupole. Why?
assignment_ind Small White Board Question
10 min.
assignment Homework
Consider a collection of three charges arranged in a line along the \(z\)-axis: charges \(+Q\) at \(z=\pm D\) and charge \(-2Q\) at \(z=0\).
keyboard Computational Activity
120 min.
probability density particle in a box wave function quantum mechanics
Students compute probabilities and averages given a probability density in one dimension. This activity serves as a soft introduction to the particle in a box, introducing all the concepts that are needed.group Small Group Activity
120 min.
computer Mathematica Activity
30 min.
group Small Group Activity
30 min.
electrostatic potential charge linear charge density taylor series power series scalar field superposition symmetry distance formula
Students work in groups of three to use the superposition principle \[V(\vec{r}) =\frac{1}{4\pi\epsilon_0}\int\frac{\rho(\vec{r}^{\,\prime})}{\vert \vec{r}-\vec{r}^{\,\prime}\vert} \, d\tau^{\prime}\] to find an integral expression for the electrostatic potential, \(V(\vec{r})\), everywhere in space, due to a ring of charge.
In an optional extension, students find a series expansion for \(V(\vec{r})\) either on the axis or in the plane of the ring, for either small or large values of the relevant geometric variable. Add an extra half hour or more to the time estimate for the optional extension.
accessibility_new Kinesthetic
10 min.
density charge density mass density linear density uniform idealization
Students, pretending they are point charges, move around the room acting out various prompts from the instructor regarding charge densities, including linear \(\lambda\), surface \(\sigma\), and volume \(\rho\) charge densities, both uniform and non-uniform. The instructor demonstrates what it means to measure these quantities. In a remote setting, we have students manipulate 10 coins to model the prompts in this activity and the we demonstrate the answers with coins under a doc cam.