Starting from:

$35

Phys-Vpy- Homework 7 Solved

Computer Homework 7 Non-ideal Capacitor

A parallel-plate capacitor shown in the figure, has an infinite length in z-axis. The distance between the plates is 𝑑 = 1           mm, the width of both plates is 𝐿 = 4 mm, and the voltage is 100 Volt on the top plate and -100 Volt on the bottom. If we want to consider the edge effect of the non-ideal capacitor, we need to calculate numerically the total charge on each plate per meter length in z-axis in order to obtain the capacitance value per meter length in z-axis. 

From General Physics course, we already know that anywhere 𝐸)⃑ = −(!!"# π‘₯. +    π‘¦. +     𝑧̂). Now we choose an infinitesimal cube of volume 𝑑π‘₯𝑑𝑦𝑑𝑧. In the two faces perpendicular to the x-axis, we have the net electric flux for the two faces as

𝐸!(π‘₯ + 𝑑π‘₯)𝑑𝑦𝑑𝑧 − 𝐸!(π‘₯)𝑑𝑦𝑑𝑧 = +πœ•πœ•π‘₯𝐸! 𝑑π‘₯- 𝑑𝑦𝑑𝑧 = πœ•πœ•π‘₯𝐸! 𝑑𝑉. Similarly, the net flux for the two faces perpendicular to the y-axis is and the two faces to z-axis is ""%#" 𝑑𝑉. Therefore, the total flux around the cube is πœ™ = (""!## + ""$#! +

""%#")𝑑𝑉. If no charge is inside this cube, by Gauss’ Law, πœ™ = ’&$ = 0, meaning ""!## + ""$#! + ""%#" = 0. With

𝐸)⃑ !#                                                                                                                                                                                                     !$                                                                      !% Μ‚ 𝐸𝑧𝑧̂, it then becomes ""%!+% + ""%$+% + ""%%+% = 0, which is called a

Laplace’s Equation and is usually written as ∇,𝑉 = 0. The operator ∇, is called a Laplacian operator. Since in this problem, there is no charge variation along the z-axis, by symmetry 𝐸% = 0 and ""%%+% = 0 everywhere. We can reduce the 3-dimentional Laplace’s Equation to 2-dimensional, ""%!+% + ""%$+% = 0.

With the condition that at the position of the top and bottom plates 𝑉 = +100V and −100V respectively, we can try to solve this Laplacian problem by the numerical Laplacian solver. The simplest numerical Laplacian solver is illustrated as the following and starts from the Taylor’s expansion:

𝑉 !#                  ’!# ;                           𝑉 !$        ’!$ ;

𝑉 !#                                                                             ’!# ;  π‘‰.

We add the above four equations and will obtain

𝑉(π‘₯, 𝑦) = () [𝑉(π‘₯ + β„Ž, 𝑦) + 𝑉(π‘₯ − β„Ž, 𝑦) + 𝑉(π‘₯, 𝑦 + β„Ž) + 𝑉(π‘₯, 𝑦 − β„Ž)]         (*1)  because !!"#!! + !!"$!! = 0.

Therefore, the potential at each grid-point is simply the mean value of its nearest neighbors. To find the solution one must fix the values of the grid-points on the boundaries or on the positions according to the required conditions and then iterate the potentials until successive results agree each other to within the desired tolerance. This usually can be done with many enough iterations. 

  In the following program, (1) we use the finite-difference methods for the grid points on the region of interest and set the potential on the top and bottom plates to be ±100V, (2) we solve the 2-D Laplace’s equation at each grid-point, (3) by taking the gradient of the potential, we obtain the electric field on x-y plane, (4) by numerically integrating the Gauss surface we obtain the total charge on the capacitor, and (5) dividing the total charge by the voltage difference we obtain the capacitance. Your job is to complete the template code for (2), (4), and (5) and compare the value of (5) to the value of an ideal parallel-plate capacitor.  (Note: You can change this program easily to calculate the capacitance of a rectangular parallel-plate capacitor, i.e. the length in z is not infinite) 

from numpy import *

from vpython import *

epsilon = 8.854E-12 N = 101 h = 1E-2/(N-1) L, d= 4E-3,1E-3

V0 = 200

def solve_laplacian(u, u_cond, h, Niter=5000):     V = array(u)     for i in range(Niter):

            V[u_cond] = u[u_cond]

            V[1:-1, 1:-1] = 0                                                        # replace this 0 by your Laplacian Solver     return V

 

def get_field(V, h):     Ex, Ey = gradient(V)     Ex, Ey = -Ex/h, -Ey/h

    return Ex, Ey

u = zeros([N, N])

u[int(N/2)-int(L/h/2.0):int(N/2)+int(L/h/2.0), int(N/2) - int(d/h/2.0)] = -V0/2 u[int(N/2)-int(L/h/2.0):int(N/2)+int(L/h/2.0), int(N/2) + int(d/h/2.0)] = V0/2 u_cond = not_equal(u, 0)

V = solve_laplacian(u, u_cond, h)

scene = canvas(title='non-ideal capacitor', height=1000, width=1000, center = vec(N*h/2, N*h/2, 0)) scene.lights = []

scene.ambient=color.gray(0.99)

box(pos = vec(N*h/2 , N*h/2 - d/2 - h  , 0), length = L, height = h/5, width = h) box(pos = vec(N*h/2 , N*h/2 + d/2 - h  , 0), length = L, height = h/5, width = h) for i in range(N):     for j in range(N):

        point = box(pos=vec(i*h, j*h, 0), length = h, height= h, width = h/10, color=vec((V[i,j]+100)/200,(100-V[i,j])/200,0.0) )

Ex, Ey = get_field(V, h)

for i in range(0, N):     for j in range(0, N):

        ar = arrow(pos = vec( i*h, j*h, h/10), axis =vec (Ex[i,j]/2E9, Ey[i,j]/2E9, 0), shaftwidth = h/6.0, color=color.black)

#find Q, find C_nonideal = Q/(delta V)

#Compare C_nonideal to C_ideal

More products