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
andmatplotlib
.
Write a python function that returns the potential at any point in space caused by four equal point charges forming a square. Make the sides of the square parallel to the \(x\) and \(y\) axes and on the \(z=0\) plane.
To do this you will need the expression for a the potential due to a single point charge \(V= \frac{k_Cq}{r}\) where \(r\) is the distance from the point charge. You will also need to use the fact that the total potential is the sum of the potentials due to each individual point charge.