You are on page 1of 3

EE6506 - Computational Electromagnetics, Spring 2016

Assignment 1: U shaped capacitor analysis using Finite


Difference Method
Amit Ghosh
EE14D013
Department of Electrical Engineering
Indian Institute of Technology Madras

Abstract The report is based on solving a static potential of


a U shaped capacitor using finite difference method. A study of
convergence for iteration is made for different grid density. It
also shows the time efficiency of simple for loop calculation
versus vectorization. Also it shows the relation of computation
time against accuracy.

Thus in general for any node (i,j) the value can be


approximately calculated as

Keywords- Finite difference method; Diritchlets boundary


conditons; convergence; iteration

(1.2)

I.

1 )

1 )

1)

UTILIZING FINITE DIFFERENCE METHOD

To find the potential distribution in a given region we apply


Laplaces equation. Then using the Finite Difference Method,
here specifically central difference is used to get the difference
form of Laplaces equation to obtain the potential at each point
as given below.

where C is a constant, which may or may not be 0


according to the given problem.
B. Solving for Potential
In Figure 2 we see that the boundaries of the Capacitor are
applied with Dirichlets Boundary condition having these
nodes as fixed nodes while other nodes are calculated using
theory stated before.Then we solve by Iterative method for a
particular accuracy and show the potential distribution graph
for a grid density of 30 nodes along x and along y. Next we
increase the grid density to 60x60 and 90x90 nodes keeping
the error threshold constant and the respective potential graphs
are shown in Figure 3 and Figure 4.

Figure 1. Potential calculation using Laplace equation


)
(

1)

(1.3)

A. Theory

The Dirichlets boundary condition states that for a node


present at boundary must satisfy the condition

INTRODUCTION

It is an introductory assignment based on finite difference


method where we were provided with a condition of a U
shaped capacitor which has 10V potential on top and all the
rest three sides grounded. The figure along with the boundary
condition is shown in Figure 1. The figure has fixed nodes at
the boundaries i.e. Diritchlets boundary conditions are applied
at the boundaries while for the rest we apply Laplace equation
to solve for the unknown potentials.
II.

)
Figure 2. Potential distribution for 30x30 grid
(1.1)

EE6506 - Computational Electromagnetics, Spring 2016


C. Solving for Electric Field
From the potential matrix (v_now) we perform a post
processing and get the gradient of the matrix to obtain the
electric field distribution which is shown in Figure 5. Since we
are interested in the Electrical field distribution and not their
absolute values so we normalize the electric field along x and
y (given in the code as exx & eyy) .

D. Convergence of iteration for different grid density


Here we analyze the relation of the grid density and the
number of iterations needed to achieve the threshold error. The
error threshold is kept constant to 0.01 and the number of grid
points or nodes is varied and the number of iterations is
counted.
Figure 3. Potential distribution for 60x60 grid

TABLE I.

CONVERGENCE OF ITERATION AGAINST GRID DENSITY

Grid

Iteration

30x30

144

60x60

227

90x90

248

120x120

250

150x150

250

E. For loop vs vectorization


Now we solve for the same given problem using
vectorization. Then we solve for different grid densities and
perform a comparative study of computation time using loop
and vectorization. The grid densities considered here are
30x30, 60x60 and 90x90 and the plot is shown in Figure 6a.
Figure 6b showing the same in logarithmic scale.
Figure 4. Potential distribution for 90x90 grid

Figure 5. Electric field distribution showing electric field lines

(a)

EE6506 - Computational Electromagnetics, Spring 2016


III.

CONCLUSION

We observe that as we increase the grid density the


interpolation of the potential graph is enhanced even though
requiring more computation time.
From the study of convergence of iteration for different
grid density we observe that for lower grid density i.e. for less
number of nodes the iterations needed to achieve the error is
less, while for higher grid density to achieve the same error
threshold much more iterations are needed. In other way for an
intermediate iteration value the error (the difference of the
present and previous value of potential) is more in higher grid
density than that of lower. On further increasing the grid
density we observe the iterations have saturated that particular
threshold. Thus to obtain a particular error threshold we cannot
consider individually the grid density and the iterations but
need to consider both.
(b)
Figure 6.Comparitive study of Computation time for loop method &
vectorization in (a) Linear scale and (b) log scale

F. Iteration vs accuracy
Now we study the iterations required against the accuracy
provided while keeping the grid density fixed at 30x30. Here
we vary the error in multiples of 10 from 10 -5 to 1 and
calculated the iterations required to meet that particular
accuracy. The error and the iterations required is plotted in
logarithmic scale as shown in Figure 7.

From the comparative study we observe that even if for low


grid density the computation time using loop method and
vectorization are insignificant but as the grid density increases,
the time efficiency using vectorization is enormous. However
we observe that as the grid density increases the time required
to converge to the required accuracy also increases.
Keeping the grid density fixed if we increase the accuracy
i.e. error must gradually decrease, so we can also say that
intuitively the iterations required to achieve that accuracy must
also increase. The conclusion is verified by the Figure 7
showing in log scale how the iterations increase as the error
value decreases.
ACKNOWLEDGEMENT
I would like to thank Dr. Ananth Krishnan for providing
valuable help in the study of convergence of the iteration used
in this report.
REFERENCES

Figure 7. Iteration vs accuracy plot

[1]

Iskander, M. F., et al., A New Course on Computational Methods in


Electromagnetics,IEEE Trans. Educ., Vol. 31, 1988, pp. 101115

[2]

Sadiku, M. N. O., Numerical Techniques in Electromagnetics, Boca


Raton, FL: CRC Press, 1992.

You might also like