Problem 3

Question

Consider the following simple model of an electronic capacitor, consisting of two flat metal plates enclosed in a square metal box: For simplicity let us model the system in two dimensions. Using any of the methods we have studied, write a program to calculate the electrostatic potential in the box on a grid of \(100 \times 100\) points, where the walls of the box are at voltage zero and the two plates (which are of negligible thickness) are at voltages \(\pm 1 \mathrm{~V}\) as shown. Have your program calculate the value of the potential at each grid point to a precision of \(10^{-6}\) voits and then make a density plot of the result. Hint: Notice that the capacitor plates are at fixed woltnge, not fixed charge, so this problem differs from the problem with the two charges in Exercise 9.1. In effect, the capacitor plates are part of the boundary condition in this case: they behave the same way as the walls of the box, with potentials that are fixed at a certain value and cannot change.

Step-by-Step Solution

Verified
Answer
Iteratively update grid points using boundary values until the potential changes by less than \(10^{-6}\) volts, then plot the result.
1Step 1: Define the Problem
Understand that we need to calculate the electrostatic potential on a grid of 100x100 points with boundary conditions. The walls of the box are at 0V, and two plates inside the box are at voltages \( \pm 1 \mathrm{V}\).
2Step 2: Discretize the Grid
Create a 2D array representing the grid. Initialize the boundaries of the grid to 0V and set the appropriate grid points for the plates to +1V and -1V.
3Step 3: Apply Boundary Conditions
Set the boundary conditions based on the problem statement. Ensure the walls of the box are zero volts and plates have voltages \( \pm 1 \mathrm{V}\). These values cannot change during the computations.
4Step 4: Initialize the Potential Grid
Initialize the potential at all other grid points to zero or some initial guess.
5Step 5: Iterative Relaxation Method
Use an iterative method such as the Jacobi method, Gauss-Seidel method, or Successive Over-Relaxation (SOR) method. Update the potential at each non-boundary grid point as the average of its four neighboring points until the solution converges to a precision of \(10^{-6}\) volts.
6Step 6: Check for Convergence
At each iteration, calculate the maximum change in potential. If this change is less than \(10^{-6}\) volts, the solution has converged.
7Step 7: Output the Result
Store and output the final potential values at each grid point.
8Step 8: Create a Density Plot
Use a plotting tool or library (e.g., Matplotlib in Python) to generate a density plot of the electrostatic potential.

Key Concepts

Discretization in Computational PhysicsBoundary Conditions in ElectrostaticsIterative Relaxation Methods
Discretization in Computational Physics
In computational physics, discretization is the process of transforming continuous models and equations into discrete counterparts. This involves creating a grid or mesh that breaks down a continuous area into smaller, discrete parts. In our exercise, we use a grid of \(100 \times 100\) points to represent the two-dimensional space inside the box. This grid allows us to approximate the continuous variation of the electrostatic potential by considering the potential at each discrete point. The smaller the grid spacing, the more accurate our approximation, but it also increases computational complexity.
Boundary Conditions in Electrostatics
Boundary conditions are crucial when solving electrostatic problems. They define the behavior of the potential at the edges of the region and sometimes within it. For our capacitor model, we have two types of boundary conditions:
  • **Fixed potential (Dirichlet boundary conditions):** The walls of the box are set to \(0 \text{V}\) and cannot change.
  • **Fixed potential on plates:** The capacitor plates are set to \(+1 \text{V} \text{ and } \text{-1 \text{V}}\). These are part of our boundary conditions within the box.
These boundary conditions are applied in the grid initialization stage and remain unchanged during the iterative solving process. Correctly setting them ensures that the physical scenario we’re modeling (capacitor in a box) is accurately represented.
Iterative Relaxation Methods
To find the electrostatic potential at each grid point, we employ iterative relaxation methods. These techniques work by repeatedly updating the potential at each point based on the average of its neighbors until the solution converges. Common methods include:
  • **Jacobi Method:** Updates the potential at each point using the old values of its neighbors.
  • **Gauss-Seidel Method:** Updates each point using the most recent values, which accelerates convergence.
  • **Successive Over-Relaxation (SOR):** A variant of Gauss-Seidel that introduces a relaxation factor to further speed up convergence.
During each iteration, we check the maximum change in potential across the grid. Convergence is achieved when this change falls below a specified threshold (\(10^{-6} \text{ V})\). Proper implementation of these methods ensures accurate and efficient solutions to the electrostatic potential problem.