Poisson's equation in electrostatics governs the electric potential φ in the presence of a charge density p(x,y) and is given by the following:
where ∈o is the permittivity of empty space. Consider the figure below. We have two square charges (20 cm x 20 cm) of charge density +1 C/m2 and -1 C/m2 located 20 cm from the edges. Write a Python program to solve this equation on an 1x1 meter square box, where all four of the boundaries are kept at φ = 0. Note that this is a Boundary Value Problem PDE and the drawing below isn't drawn to scale. Setup your 2D grid with a spacing of a = 1cm between each point, set ∈o = 1, and continue the iteration until your solution for the electric potential changes by less than 10-4 V. You can use either the relaxation method, the overrelaxation method or the Gauss-Seidel method to solve this system. Note: This calculation might take your computer a couple of minutes depending on which method you choose and on your computer specs. On my mid-range, 3 year old laptop, this takes about 30 seconds or so.
Students succeed in their courses by connecting and communicating with an expert until they receive help on their questions
Consult our trusted tutors.