EE 735 MSL Assignment-1 Discussion Gauss Law and Poisson’s Equation • Gauss's Law is one of Maxwell's equations and relates the electric flux through a closed surface to the charge enclosed within that surface. • Poisson's Equation arises from Gauss's Law when the electric field is expressed in terms of the electric potential Laplace’s Equation • Laplace's Equation is a special case of Poisson's Equation that applies in regions of space where there is no charge. • Since it is time-independent, so describes the steady-state behavior of a scalar function in space. π2 π2 π2 + + π=0 ππ₯ ππ¦ ππ§ Discretizing derivatives • Computers can only operate on discrete data. So, we need to convert our continuous differential equations into a discrete form. • Space can be discretized in x, y, and z directions by choosing an appropriate number of points. • We use the Taylor Series Expansion to discretize differentiation. 2 ′′ β π π₯ ′ π π₯ + β = π π₯ + βπ π₯ + +β― 2! 2 ′′ β π π₯ ′ π π₯ − β = π π₯ − βπ π₯ + +β― 2! Discretizing derivatives Forward Difference π π₯+β −π π₯ ′ ⇒π π₯ = − π β2 … β Backward Difference ππ+1,π − ππ,π πΈπ,π π₯ = − βπ₯π,π π π₯ −π π₯−β π₯ = − π β2 … β ππ,π − ππ−1,π πΈπ,π π₯ = − βπ₯π,π ⇒ π′ Central Difference π π₯+β −π π₯−β ′ ⇒π π₯ = − π β3 … 2β ππ+1,π − ππ−1,π πΈπ,π π₯ = − 2βπ₯π,π Discretizing the Laplace Equation ∇2 π = 0, ππ+1,π − ππ,π ππ,π − ππ−1,π − βπ₯π,π βπ₯π,π βπ₯π,π π2 π2 π2 + + ππ₯ ππ¦ ππ§ + π=0 ππ,π+1 − ππ,π ππ,π − ππ,π−1 − βπ¦π,π βπ¦π,π βπ¦π,π ππ+1,π − 2ππ,π + ππ−1,π ππ,π+1 − 2ππ,π + ππ,π−1 + =0 2 2 (βπ₯π,π ) (βπ¦π,π ) =0 Discretizing Laplace Equation • Assuming the grid spacing to be common in the x and y direction i.e. Δxi,j = Δyi,j • We obtain the equation: ππ,π = (ππ+1,π + ππ−1,π + ππ,π+1 + ππ,π−1 )/4 • So for our questions, we can consider the system as a mesh of points where the potential at each point is the average of the potential of its four nearest neighbours. ππ,π+1 ππ−1,π+1 ππ+1,π+1 βπ¦π,π ππ−1,π ππ,π ππ−1,π−1 ππ+1,π ππ,π−1 π π+1,π−1 βπ₯π,π Implementing Boundary Conditions • Boundary conditions are essential for solving partial differential equations (PDEs) numerically, as they define the behavior of the solution at the edges of the domain. Dirichlet Boundary Conditions Neumann Boundary Conditions Specifies the value of the function on the boundary. Used in defining potential at boundary of the box and metal plates. Specifies the value of the derivative (flux) of the function normal to the boundary. Used at interface of two dielectric mediums. ππ = a (a is a constant) π·π−1 − π·π = ππ ππ − ππ−1 ππ+1 − ππ ⇒ ππ−1 = ππ βπ₯π−1 βπ₯π Iterative Solution and Error Function • To find out the exact potential field, we will have to use the potential update equation: ππ,π = (ππ+1,π + ππ−1,π + ππ,π+1 + ππ,π−1 )/4 multiple times in a loop. • But how do we know when to stop? • Find out the error (difference) between the values of the potential before and after the current iteration of the update equation. If the error between the two is less than some tolerance value, then we can stop. • Use Root Mean Square Error (RMSE) or Mean Absolute Error (MAE) as the error functions. Estimating Electric field and Charge Density After estimating the Potential in the complete region. Next we need to estimate electric field and the charge distribution. This can be done using: πΈ = −π»V ππ ππ πΈ=− − ππ₯ ππ¦ ρ= ε × π». πΈ ρ= ε × ππΈπ₯ ππΈπ¦ + ππ₯ ππ¦ Implement the gradient and divergence calculations in Python using numpy function: np.gradient() Thank You