[email protected]

Embed Size (px)

Citation preview

  • ELEC2219: Electromagnetism for EEE Coursework Assignment 1: Solution of a Capacitor Problem using the Finite Differences Method and Tubes and Slices (TAS) Package Contributes 17.5% to overall mark (ELEC2219) Published: September 2015

    1. Objective

    In this assignment you will solve a capacitor problem using different computational techniques.

    You are expected to analyse the techniques based on their performance and to reach conclusions on

    applicability of the techniques for various applications.

    2. Assessment details

    The assignment contains three activities related to the same problem. You are asked to estimate the

    capacitance C per unit length of a long air-filled capacitor using three techniques: finite-difference

    solution using your own code, solution based on the Tubes and Slices method (TAS package) and

    Finite Element solution (available within TAS package). You also need to look at an electric field

    inside the capacitor.

    Each student must submit an individual report. The report text (font size 12pt) is limited to 2 pages

    (approximately 750 words) and a total of 5 pages including figures, tables and appendices. Content

    exceeding this limit will not be considered for marking. Your report should contain:

    representative plots or tables to demonstrate your results and to support your conclusions for

    items listed in the marking scheme attached as Appendix A

    analysis, comments and explanations of the observed results

    conclusions on advantages and disadvantages of different methods and techniques

    When marking the final report, credit will be particularly given for interesting comments and

    observations, especially if they demonstrate that a thorough investigation has been conducted and

    additional information through independent study has been acquired.

    2.1. The capacitor problem

    The schematic of the long air-filled capacitor is shown in Fig. 1. The origin has been placed at the

    centre of the middle plate so that use can be made of symmetry and the first quadrant only needs to

    be solved. The plane of symmetry, x = 0, is a flux line, so that V/x = 0. Also on y = 0, d/2

  • Figure 1.

    The capacitance per unit length

    / 2

    0 0 0

    4d

    QC q dx

    V V , (2)

    where q is the electric charge density on the lower plate. By Gauss' theorem

    0div E , (3)

    where is a volumetric charge density. Applying the theorem to the middle plate

    0 0yV

    q Ey

    , (4)

    and according to (2)

    / 2

    0 0 0

    4d

    C Vdx

    V y

    . (5)

    Please note that the factor 4 in the above equation already accounts for the presence of four

    identical parallel capacitors, as shown in Figure 1, while we only model one quadrant.

    Equation (5) is simple to implement but its accuracy may be affected by the high field gradient

    close to the edge of the electrode. Therefore, as an alternative, it might be advisable to select a

    Gauss integration surface away from this edge, where field variation is less rapid. One possibility is

    shown in Fig. 2 where the integration is performed half way in between the finite-difference nodes

    and the relevant gradients may then be estimated using a simple two-point formula. In this case the

    expression for the capacitance will take the form

    2/2/

    0

    2/

    000

    4hd h

    dyx

    Vdx

    y

    V

    V

    C

    (6)

    where h is the distance between the nodes of a regular grid. It is also possible to place the

    integration surface even farther away from the electrode with suitable modifications to equation (6).

    As the field variation becomes less rapid, and gradients smaller, the accuracy of the numerical

    differentiation increases. You are encouraged to experiment with both equations (5) and (6).

  • Figure 2.

    Both expressions (5) and (6) result from the same Gauss theorem (3), but numerically are likely to

    give somewhat different results. Obviously, if the grid were to be made very fine (very small h) the

    results would be much closer to each other.

    Finally, the capacitance can also be found from energy considerations, as

    2 2 2

    0 00 0

    section2 2 2 2

    capacitor

    V QVEnergy C dv length dA

    E E, V E grad . (7)

    2.2. Finite-difference solution

    You are expected to modify the codes provided in order to obtain the value of C/0 for the capacitor using successive over-relaxation (SOR) applied to the rectangular grid as shown in Fig. 3 and to

    give a comprehensive analysis of the simulation results.

    Figure 3.

    Theory. The SOR method is based on the earlier Gauss-Seidel method in which the grid of nodes is

    scanned repeatedly in a systematic manner applying equation (8) to each node in turn:

    , 1, , 1 , 1 1,1

    4i j i j i j i j i jV V V V V . (8)

    integration of V

    y

    integration of V

    x

  • A satisfactory scanning sequence is to commence at the node nearest to the origin (1,1) in Fig. 3.

    Because the boundary node (1,1) is already known it is possible to calculate V at (1,2) and scan by

    columns until the node (M1, N1) in the opposite corner is reached. During the scan (k+1) the finite-difference equation for node i,j is

    ( 1) ( 1) ( 1) ( ) ( ), 1, , 1 , 1 1,1

    4

    k k k k k

    i j i j i j i j i jV V V V V

    , (9)

    where the new values of V are used as soon as they are available. We now define the residual, or

    displacement, at node i,j as

    ( 1) ( 1) ( 1) ( ) ( ) ( ), 1, , 1 , 1 1, ,1

    4

    k k k k k k

    i j i j i j i j i j i jR V V V V V

    , (10)

    being the change that occurs in Vi,j during scan (k+1). The SOR scheme is then

    ( 1) ( ) ( 1), , ,k k k

    i j i j i jV V R , (11)

    where the original residual is increased by the relaxation factor which lies in the range 1 < 2. The value of the SOR acceleration (or relaxation) factor may be taken as = 1.0 to start with. If the optimum value 0 of can be found for a given problem, the SOR process will converge significantly faster than the Gauss-Seidel method. The test for the satisfactory convergence of an

    iterative method can be done by comparing the maximum value of Ri,j (found during each scan)

    against a small fraction of the maximum potential (V0 in this case) the so called convergence in

    continuum norm C . A suitable small fraction is 10-6

    . It is useful to print the residuals map so that

    you have a useful check on the behaviour of the solution. The maximum number of scans allowed

    should be set at 10*M*N. You can also look at the global error.

    At the boundary nodes, where V/n = 0 is specified, the fictitious outside nodal value of V is set equal to the inner value. For example, at a node i,j on the boundary x = 0 (Fig. 2), where i = 1,

    0, 2,j jV V (since i 1 = 0 ), (12)

    so that equation (8) becomes

    1, 2, , 1 , 11

    24

    j j i j i jV V V V . (13)

    Once the solution of equation (1) has been obtained, the capacitance may be found as a post-

    processing exercise. This can be done by numerical integrations of either (5), or (6), or (7) (or

    indeed all of them so that comparisons could be made). Take care with the numerical form of

    equation (5). Instead of the usual 2-point formula, you may use the more accurate 3-point

    approximation

    ,1 ,2 ,31

    3 42

    i i i

    VV V V

    y h

    , (14)

    for values of i at nodes on the lower plate (y = 0, 0 < x < d/2). Finally, you are advised to use either

    trapezoidal or Simpson's rule for the numerical integration of equation (5).

    You should experiment with different values of to find a near optimum value for each size of the mesh; you should be able to find in literature simple expressions for estimating the optimum value.

    Some algorithms allow for dynamic adjustment of as iterations progress. You should also use different values of the step (h) in x and y directions to investigate how the accuracy of the solution is affected by the refinement of the grid. A reasonable initial value of h would be 0.125, but smaller,

    as well as larger, values could also be used.

  • 2.3. Tubes and Slices (TAS)

    For the method of Tubes and Slices, as well as for obtaining the finite-element solution, you will be

    using the TAS program. The TAS software can be downloaded from the course web page available

    at: https://secure.ecs.soton.ac.uk/notes_my/elec2219/coursework/Assignment_1/ as a file

    TAS.EXE . The TAS software is a DOS operating system based program so it will not run directly

    under the Windows environment or other modern operating system (Mac OS, Linux, etc). To run

    TAS you will first need to install a DOS emulator. The DOSBox emulator is recommended and can

    be downloaded for free from http://www.dosbox.com/

    Before attempting your solutions you are advised to follow the TAS tutorial (Appendix 1 in the text book [1]), as well as the animated Example available from the Welcome screen of the TAS software.

    Experiment with the TAS package to obtain close bounds to the value C/o (remember you are doing this for one quadrant). In particular, try to reduce the error by moving the internal (and

    boundary) construction points. Notice how the solution improves when the tube and slice lines

    follow the expected correct solution more closely. Observe also the behaviour of the average of the

    two bounds and therefore comment on the overall accuracy of the method.

    Discuss how increasing the number of tubes and slices gives more degrees of freedom to achieve

    better accuracy, but at the same time complicates the graphical solution as there are more points and

    lines to control. Comment also on how the tubes and slices orthogonality (or lack of it) could be

    used as a criterion for reshaping both distributions in order to obtain a better solution.

    2.4. Finite-element solution

    Instruct TAS to go into finite-element mode, refine the mesh that has been carried over, and

    calculate C/o again. Experiment with different mesh shapes and densities to get a feel about what influences the accuracy of the method. Note that the finite-element solution in TAS is done twice in

    dual formulation and thus the overall error is always available and shown. Make a note of this error

    for various mesh sizes and shapes to establish a relationship between the accuracy (and computing

    times) and the level of mesh refinement. If possible, see how the quality of triangular elements (i.e. whether they are close to equilateral or not for example long and thin) affects the overall solution. Compare the field plots obtained from the finite-element module with your assumed

    distributions using the tubes and slices approach.

    3. What else you need to do

    To get the reference value for C you need to set up the model in TAS using your individual given

    dimensions for the capacitor. The error band can be significantly reduced by increasing the number

    of tubes and slices but mainly by improving their orthogonally.

    When working in the FEM mode of TAS, you need to analyse the effects of the number of nodes on

    the accuracy of the computations, as well as to indicate what the best shape for the elements is.

    You are given a skeleton FD code for you to build upon and improve. The algorithm is a very basic implementation of equations (9)-(13), a working version of the SOR method in its simplest

    possible form assuming zero initial values for potential. You are expected to enhance and extend the

    code to include a number of improvements, such as finding an optimum relaxation factor, exploring

    the effects of different mesh sizes, experimenting with termination criteria and incorporating the

    non-zero initial values for the potential, for example by making certain crude assumptions.

  • Performance studies should include an analysis of the dependence of the number of iterations and

    computational times as functions of the mesh size h. How do these values vary between =1 and optimum ? Plot the dependences in a log-log scale and comment on the observations. An approximate value of the optimum may be pre-calculated and you will need to do some literature searches to find different possibilities. In practice it is very important to understand what value of h

    is required to achieve the specified accuracy. How is the accuracy of the predictions related to

    termination criteria in the code? Consider the calculations of C as a post-processing operation and

    analyse the effectiveness of the different methods. Why do different approaches have different

    accuracy? Which termination criterion (local or global) is better for C calculations depending on the

    method? Contrast your observations with accuracy of electric field calculations near sharp edges (as

    a function of the mesh step h). Are you getting the same convergence rate as for the value of C?

    Explain your observations.

    Analyse the effects of the initial values of potential on the number of iterations and calculation

    times. You can introduce a linear interpolation between boundary values as the first step but also

    consider input from TAS and from simulations at larger mesh sizes h (so called multigrid approach).

    In conclusions, compare TAS, FD and FE techniques in terms of the accuracy and the time needed

    to achieve the solution. In your analysis consider the time required for coding.

    A detailed marking scheme is attached; this should give you an idea about what is expected in your

    report. You will note that critical analysis of results, thorough investigations, relevant observations

    and meaningful conclusions are essential to achieve a good mark. This coursework is open ended in a sense that any further investigation in addition to what has been suggested is very welcome.

    References [1] P. Hammond and J.K. Sykulski: Engineering Electromagnetism, Physical Processes and

    Computation, Oxford University Press, Oxford, 1994

    ISBN 0 19 856289 6 (Hbk), ISBN 0 19 856288 8 (Pbk)

    Deadline Please note that you are expected to complete your work in week 6 and hand in your report by 4pm

    on Thursday 5th November 2015. Any delay in handing in the report will incur a penalty in the

    form of reduced final mark (at a rate of 10% reduction for each working day of late submission, up

    to 5 working days, no submission is allowed after that; extension requests must be made in advance

    via the Faculty Student Administration). The report should be submitted for marking in the USMC

    Reception (First Floor Office). Please write clearly: ELEC2219: Electromagnetism for EEE TAS, as appropriate, and do not forget to put your name on the cover.

    Professor J.K. Sykulski

    Dr I. Golosnoy

    Dr. Mihai D. Rotaru

    September 2015

  • Appendix A: Marking scheme

    Assessment Criteria Outstanding Good Poor Absent

    Using TAS and FEM package:

    Set up the model in TAS

    Correct geometry, boundary conditions & initial

    mesh set up

    1

    0.5

    0

    Refinement of TAS model

    Changing number of tubes and slices,

    orthogonality

    1

    0.5

    0

    Set up FEM model

    Calculate capacitance by Finite Element method

    1

    0.5

    0

    FEM analysis

    Effects of mesh refinement and shape of the

    elements on accuracy

    1

    0.5

    0

    Code improvement:

    MATLAB code for finite differences

    improvements to find optimal iteration parameter

    and to introduce different initial values for

    potential

    3 2 1 0

    Performance studies and analysis: Finding optimum value for alpha at different

    values of mesh size h 1 0.5 0

    Analytically predicted value for optimal alpha

    and comparison with the one obtained

    experimentally

    1 0.5 0

    Comparison of iteration numbers for fixed =1 and for optimal at different mesh sizes h Conclusions on effectiveness of the technique

    1.5 1 0.5 0

    Analysis of computational time vs meshes size h

    and vs iteration number 1 0.5 0

    Further analysis and Performance

    improvements:

    Effects of post-processing on accuracy:

    Comparison of C value calculated by energy

    method, conservative div method and direct

    differentiation with integrations (trapezoidal,

    Simpson rules) for different h

    1.5

    1

    0.5

    0

    Accuracy of electric field calculations near sharp

    edges as a function of h 1 0.5 0

    Effects of initial value for potential on iteration

    numbers and calculation times (input from TAS

    and multigrid approach)

    1.5 1 0.5 0

    Observe and comment on the effects of

    convergence criteria on computational time vs

    mesh size h (global L1, max error point C)

    1 0.5 0

    Conclusions: General conclusions and comments on the FE,

    FD and TAS 1 0.5 0

    Total Mark

    out of 17.5