Exercise 2: Partial Differential Equations

Similar documents
Exercise 3: Random Numbers and Monte Carlo

7 Mathematical Methods 7.6 Insulation (10 units)

Non-linear least squares

Lecture 7. Capacitors and Electric Field Energy. Last lecture review: Electrostatic potential

Introduction to Heat and Mass Transfer. Week 9

Numerical Solution Techniques in Mechanical and Aerospace Engineering

STA 4273H: Statistical Machine Learning

DOING PHYSICS WITH MATLAB. ELECTRIC FIELD AND ELECTRIC POTENTIAL: POISSON S and LAPLACES S EQUATIONS

Lecture 13: Electromagnetic Theory Professor D. K. Ghosh, Physics Department, I.I.T., Bombay. Poisson s and Laplace s Equations

Introduction to Computational Fluid Dynamics

August 7, 2007 NUMERICAL SOLUTION OF LAPLACE'S EQUATION

Solution Methods. Steady convection-diffusion equation. Lecture 05

Electrostatics: Electrostatic Devices

Numerical methods for the Navier- Stokes equations

Solving PDEs with Multigrid Methods p.1

CS 542G: The Poisson Problem, Finite Differences

Lecture 18 Classical Iterative Methods

Elements of Vector Calculus : Scalar Field & its Gradient

Computational Techniques Prof. Sreenivas Jayanthi. Department of Chemical Engineering Indian institute of Technology, Madras

Potential from a distribution of charges = 1

1 Finite difference example: 1D implicit heat equation

Solution of System of Linear Equations & Eigen Values and Eigen Vectors

Introduction to Heat and Mass Transfer. Week 7

Introduction to Heat and Mass Transfer. Week 8

Open Problems in Mixed Models

Chapter 5 HIGH ACCURACY CUBIC SPLINE APPROXIMATION FOR TWO DIMENSIONAL QUASI-LINEAR ELLIPTIC BOUNDARY VALUE PROBLEMS

Department of Mathematics California State University, Los Angeles Master s Degree Comprehensive Examination in. NUMERICAL ANALYSIS Spring 2015

YEAR 10 PROGRAM TERM 1 TERM 2 TERM 3 TERM 4

free space (vacuum) permittivity [ F/m]

Measurement of electric potential fields

Discretization of Convection Diffusion type equation

Next topics: Solving systems of linear equations

Chapter 7. Three Dimensional Modelling of Buoyancy-Driven Displacement Ventilation: Point Source

Lab 1: Numerical Solution of Laplace s Equation

Review of matrices. Let m, n IN. A rectangle of numbers written like A =

Course Notes: Week 1

ECE539 - Advanced Theory of Semiconductors and Semiconductor Devices. Numerical Methods and Simulation / Umberto Ravaioli

MASSACHUSETTS INSTITUTE OF TECHNOLOGY DEPARTMENT OF MECHANICAL ENGINEERING CAMBRIDGE, MASSACHUSETTS NUMERICAL FLUID MECHANICS FALL 2011

Numerical Solution for Two Dimensional Laplace Equation with Dirichlet Boundary Conditions

Classification of partial differential equations and their solution characteristics

Gross Motion Planning

Unit-1 Electrostatics-1

Computer Aided Design of Thermal Systems (ME648)

ME Computational Fluid Mechanics Lecture 5

Optimization Tutorial 1. Basic Gradient Descent

Technology Computer Aided Design (TCAD) Laboratory. Lecture 2, A simulation primer

Numerical Linear Algebra Primer. Ryan Tibshirani Convex Optimization

Stabilization and Acceleration of Algebraic Multigrid Method

Iterative Solvers. Lab 6. Iterative Methods

Partial Differential Equations

Experiment 2 Electric Field Mapping

PHYSICS ASSIGNMENT ES/CE/MAG. Class XII

End-of-Chapter Exercises

7. A capacitor has been charged by a D C source. What are the magnitude of conduction and displacement current, when it is fully charged?

6. Iterative Methods for Linear Systems. The stepwise approach to the solution...

1.5 Phase Line and Bifurcation Diagrams

Electric Field Mapping

A marks are for accuracy and are not given unless the relevant M mark has been given (M0 A1 is impossible!).

UNIT I ELECTROSTATIC FIELDS

9.1 Preconditioned Krylov Subspace Methods

Lightning Phenomenology Notes Note 23 8 Jan Lightning Responses on a Finite Cylindrical Enclosure

The Conjugate Gradient Method

Additive Manufacturing Module 8

The Electric Field of a Finite Line of Charge The Electric Field of a Finite Line of

9/10/2018. An Infinite Line of Charge. The electric field of a thin, uniformly charged rod may be written:

Cambridge International Advanced Level 9231 Further Mathematics November 2010 Principal Examiner Report for Teachers

The Solution of Linear Systems AX = B

Chapter 24. Electric Potential

PDE Solvers for Fluid Flow

Lecture 13: Solution to Poission Equation, Numerical Integration, and Wave Equation 1. REVIEW: Poisson s Equation Solution

COURSE Iterative methods for solving linear systems

Partial Differential Equations

Iterative Methods for Solving A x = b

Numerical Linear Algebra Primer. Ryan Tibshirani Convex Optimization /36-725

Today s class. Linear Algebraic Equations LU Decomposition. Numerical Methods, Fall 2011 Lecture 8. Prof. Jinbo Bi CSE, UConn

IYGB Mathematical Methods 1

Chapter 3 Three Dimensional Finite Difference Modeling

Basic Aspects of Discretization

Physics (

IYGB Mathematical Methods 1

Electric fields in matter

Solving a non-linear partial differential equation for the simulation of tumour oxygenation

Module 2: Reflecting on One s Problems

FINITE VOLUME METHOD: BASIC PRINCIPLES AND EXAMPLES

Consider a point P on the line joining the two charges, as shown in the given figure.

Computation Fluid Dynamics

Sparse Linear Systems. Iterative Methods for Sparse Linear Systems. Motivation for Studying Sparse Linear Systems. Partial Differential Equations

Solution Methods. Steady State Diffusion Equation. Lecture 04

Physics 2019 v1.2. IA1 sample assessment instrument. Data test (10%) August Assessment objectives

Second Order Iterative Techniques for Boundary Value Problems and Fredholm Integral Equations

Exact and Approximate Numbers:

Introduction. Finite and Spectral Element Methods Using MATLAB. Second Edition. C. Pozrikidis. University of Massachusetts Amherst, USA

Lecture 18 Capacitance and Conductance

Matrix inversion and linear equations

Iterative Methods for Ax=b

Algebraic Multigrid as Solvers and as Preconditioner

Self-Concordant Barrier Functions for Convex Optimization

EAD 115. Numerical Solution of Engineering and Scientific Problems. David M. Rocke Department of Applied Science

Electric Potential. Capacitors (Chapters 28, 29)

NUMERICAL COMPUTATION IN SCIENCE AND ENGINEERING

Transcription:

Exercise : Partial Differential Equations J F Ider Chitham Astrophysics Group, HH Wills Physics Laboratory, University of Bristol, Tyndall Avenue, Bristol BS8 TL Accepted March Received March ; in original form March ABSTRACT Partial differential equations can be implemented to solve a vast range of physical problems abundant in many engineering and scientific fields of study Analytical solutions are often difficult to calculate due to their continuous nature, this makes computational analysis via simulations of continuous physical systems a useful and efficient alternative INTRODUCTION The general form of Poission s equation: Φ(r) = σ(r), is an example of a second order partial differential equation relating a generic potential Φ(r) to a source function σ(r) Poission s equation lies at the foundation of potential theory and is imperative to concepts such as electromagnetism, Newtonian gravity and fluid dynamics due to the accurate representation of the respective potentials When σ(r) = Poission s equation reduces to Laplace s equation If the system under consideration is discrete rather than continuous, it becomes extremely useful to approximate derivatives in partial differential equations as finite differences during numerical analysis For example in electrostatics this concept allows the discretizization of Laplace s equation in two dimensions to be expressed in the form of () This can be solved in the computational plane via projection onto a square (n + ) (n + ) grid with the i,j grid points providing the (x, y) co-ordinates of each point in physical space with respective grid spacings of x and y ( V (x, y) = x + y ) V (x, y) = () By considering the Taylor Series expansion of V (x i, y j) = V i,j about an i,j grid point and evaluating the four adjacent nodes, a first order finite difference approximation for the internal points () can be found providing < i < n and < j < n V i+,j V i,j + V i,j x + Vi,j+ Vi,j + Vi,j y = () For methods of finite difference to be effective well defined boundary conditions must be appropriately imposed on the system Dirichlet and Von Neumann boundary conditions specify the value of V and the normal component ˆn V at the boundary respectively In electrostatics this corresponds to specifying the potential and the normal component of the electric field E = V [] RELAXATION Large linear systems used to model partial differential equations can be solved via iterative methods which implement methods of relaxation This allows the discrete modification of the components of an initially approximated solution to progressively resemble its genuine form with each relaxation step (modification) until convergence is reached The Jacobi method is the simplest of the considered iterative techniques and can be used to solve Laplace s equation in two dimensions by rearranging () to construct a discrete form of the Laplacian operator () [] This effectively averages over neighbouring grid points, allowing iterative alteration to the value at each grid point as the old solution V i,j is continually replaced by a refined estimate V i,j V i,j = [Vi+,j + Vi,j + Vi,j+ + Vi,j )] () An alternative to the Jacobi method is the Gauss-Seidel iteration, the only contrasting feature is that the improved estimate V i,j is returned to the solution immediately after completion, rather than postponing its use until the subsequent iteration This leads to a slight variation in computational performance and efficiency COMPUTATIONAL ANALYSIS Convergence Criterion The process of solution refinement () can continue indefinitely so it is necessary to implement an appropriate convergence criterion X, which specifies the maximum percentage difference a value at a particular grid point can change by between successive iterations When the solution no longer satisfies this condition the iterative process ceases as convergence is deemed sufficient To compare the performance of the iterative algorithms at solving Laplace s equation the initial grid system was set to be symmetrically square ( ) with boundary conditions of V and all other elements at V, X was varied logarithmically and the relative progress compared at each interval as shown in Figure The optimal convergence criterion for iterative techniques emerged as X = %, achieving the maximum degree of convergence in the least time (for this specific system configuration) This was taken as the maximum order of X for adequate convergence hereafter (for the remaining duration of the investigation) as solutions at this level of precision are almost identical regardless of iterative method The contrasting iterative technique of each algorithm is subtly depicted via the isocontours of Figure Jacobi contours are centred as the grid is discretely refined after each iteration over the whole system Gauss-Seidel contours on the other hand become

J F Ider Chitham increasingly off centre as X (see X = {, }) as the algorithm continually refines grid elements starting from the origin resulting in the greater degree of convergence in this vicinity Visual comparisons are consistent with computational time evaluation over a more extensive range of X as shown in Figure The relative degree of convergence is similar for X & however the Gauss-Seidel algorithm is far more efficient when X This can be explained intuitively via algorithm memory requirements; Jacobi iterations bear an additional computational expense of storing Vi,j however this is not necessary for Gauss-Seidel iterations which allows solutions to tend to converge relatively quicker Grid Density Solutions are also sensitive to grid point number density ρn variation, as this determines the effective resolution of the solution due to an increasing resemblance with a continuous system as grid density tends to infinity This was investigated by incrementally changing the number of grid points in the x and y direction n, as the dimensions and spacing of the system and convergence criterion were constrained to ( ), x = y = m, and X = % respectively Grid density scales linearly with the number of grid points n, and the number of iterations N required to reduce the overall error by a factor of P for Laplace s equation in two dimensions is given by ()[] X and therefore P are the same for both methods so the rate of change of iterations as a function of grid density for Jacobi is expected to be approximately twice that of Gauss-Seidel (), this can be seen in Figure with an actual relative gradient ratio of 6 despite the poor goodness of fit This inaccuracy is explained by the breaks down of the relationship at low densities (and very small X), this limiting sensitivity is highlighted by apparent curve at densities P n / for Jacobi N () P n / for Gauss-Seidel The form of computational time differs from the number of iterations because the interaction between grid points must also be considered as well the number of points iterated over, this complicates the rate of variation as shown in Figure via an approximate quadratic form NB All graphical fit analysis is summarised in Table PHYSICS PROBLEMS Parallel Plate Capacitor A one dimensional, finitely extending parallel plate capacitor is located within the structure of the grid and the potential V and electric field, E must be evaluated at every point within and around its proximity The grid dimensions were specified to be much greater than that of the capacitor ( ) >> (a d) to give physical justification to the simplified approximation of the Dirchlet boundary conditions at the edges of the grid, Vbc = (in reality V as the distance from the centre of the capacitor, r ) Potential and field configurations were determined by solving Laplace s equation via relaxation as mentioned in and however due to its superior computational performance the Gauss-Seidel iteration was designated as primary method of solution Electric field vectors E = V can be approximated at each grid point in terms of their x and y components via discrete differentiation () using methods of finite differences analogous to those X = % X = % V (V) 7 7 V (V) X = % 7 7 V (V) 7 7 V (V) 7 7 7 V (V) 7 7 7 7 X = % X = % V (V) 7 X = % V (V) 7 X=% X = % 7 V (V) X=% X = % V (V) 7 7 V (V) 7 Figure Converged solutions for a system with initial potential approximations of V and boundary conditions of V for both Jacobi (left) and Gauss-Seidel (right) iterative methods with X = {,,,, }% discussed in, and justified by the relatively small grid spacings x and y Vi+,j Vi,j Vi,j Vi+,j Exij = lim x x x () Vi,j+ Vi,j Vi,j Vi,j+ Eyij = lim y y y Although lacking multi-dimensional sophistication, it is clear the electric field configuration resembles that of reality It is expected that as a : d increases the field configuration should approach 7

Exercise : Partial Differential Equations Log (Time(ms)) - Jacobi Gauss-Seidel - -8-6 - - 6 8 Log (X) Figure Logarithmic evaluation of computational time as a function of the convergence criterion, X for both Jacobi (red) and Gauss-Seidel (blue) iterative methods Iterations 8 7 6 Jacobi Gauss-Seidel 6 7 8 9 Grid Density (m - ) Figure Number of iterations as a function of the grid density with linear fit for both Jacobi (red) and Gauss-Seidel (blue) iterative methods Computational Time (ms) Jacobi Gauss-Seidel 6 7 8 9 Grid Density (m - ) Figure Computational time as a function of the grid density with quadratic fit for both Jacobi (red) and Gauss-Seidel (blue) iterative methods V (V) - - 7 V (V) - - 7 a : d = 7 a : d = 7 Figure Electric potential, V as a function of grid position for capacitor dimension ratios; a: d = {, } the infinite plane solution between parallel plates and zero elsewhere (6) This is first demonstrated in Figure via an increasingly constant rate of change of potential between the plates at larger a:d and supported by the increasing uniformity of the respective vector field configuration of Figure 6 Electric field lines are expected to resemble the perpendicular bisectors of equipotentials, this relation is illustrated via the sample of isocontours and corresponding vector plots in Figures & 6 respectively, further supporting the validity of the solutions lim E a:d { V/d between plates otherwise - - - - The deviation from the theoretical infinite plane solution, E = V/d was investigated as a function of the capacitor dimensional ratio a : d in terms of a percentage difference, E/E as shown in Figure 7 NB E represents the difference between the mean electric field magnitude (between parallel plates) and the respective infinite plane value (7) E = E N (6) N E ij (7) The origin of deviation can be explained by a fringing field effect around the periphery (between the sides of the capacitor) The degree of fringing becomes increasingly significant as the distance between the electrodes is no longer negligible relative to the lateral dimensions of the capacitor, resulting in an increased effective capacitance Fringing fields are always present as long as the system is finite and should be accounted for quantitatively when modelling the electrostatic forces via Maxwell s equations The percentage difference between computational and infinite plane solution shown in Figure 7 drops off as (a : d) (see Table for detailed fit analysis) with a deviation of only 6% achievable at a relatively small dimensional ratio of a : d = The asymptotic appearance of Figure 7 suggests an accurate relation over this small range, however extrapolation reveals that the infinite plane solution is reached prematurely (ie at a : d < ) ij

J F Ider Chitham a : d = 9 8 7 6 6 7 8 9 8 6 8 6 E Magnitude (Vm - ) E / E (%) 6 8 a : d 9 8 7 6 a : d = 6 7 8 9 Figure 6 Electric vector field, E as a function of grid position for capacitor dimension ratios; a: d = {, } as indicated via a small but negative asymptotic intercept, C = ( 68 ± )% Combining this feature with the small reduced χ of implies an overestimated error in the variance, suggesting a more precise fit is only attainable if a larger dataset is compiled with evaluation over a greater range of dimensional ratios Despite the quantity and crudeness of approximations the combination of Figures -7 provide good confirmation of a strong resemblance between expectations and computational solutions Heat Diffusion A m iron rod initially at room temperature is thrust into a C furnace The time evolution of the thermal distribution as a function of position along the rod, T (x, t) must be determined given that the rod can be approximated as one dimensional and heat losses along the length of the poker are assumed to be negligible The diffusion of heat is best described by the heat equation (8) as it models how the temperature distribution evolves with time as heat spreads through space The thermal diffusivity, α characterises the rod s ability to conduct thermal energy relative to storing it and is deduced via its relationship with thermal conductivity, specific heat and mass density, α = κ/cρ Two physical situations were investigated comparatively; (i) There is no heat loss from the far end of the poker (ii) The far end of the rod is immersed in a block of ice ( C) 6 E Magnitude (Vm - ) Figure 7 Percentage difference, E/E between computational and infite plane solutions of mean electric field magnitude (between parrallel plates) as a function of the capacitor dimensional ratio, a : d of the form A (a : d) B + C (red) α T (x, t) = T (x, t) t The heat equation can be solved in a similar way to Poission s equation and minor modifications to the one dimensional equivalent of the finite difference relation () yield a stable implicit relation (9) which can rearranged and manipulated to solve for T (x, t) T i T i t = α [ T x i T i + T i+ ] (9) conveniently reduces to the matrix equation () with γ = α t/ x This was solved via Lower-Upper triangular decomposition by implementing appropriate GNU library functions + γ γ γ + γ γ γ + γ γ γ + γ T i T i T i+ = T i T i T i+ () The time taken for the system to tend toward steady state thermal conduction was the subject of preliminary investigation This describes the time taken for thermal convergence, at which a constant temperature gradient is achieved as the temperature at every discrete point along the rod remains constant, while varying linearly in space along the original direction of heat transfer [] These times were found to be O s and O s for situations (i) and (ii) respectively as shown in Figure 8 The order of magnitude discrepancy can be accounted for by the presence of the ice reducing the mean thermal energy within the rod allowing quicker convergence Despite the similarities at early times, the steady state distribution for (i) is a horizontal line at T (x) = C and a diagonal line of the form T (x) = ( x + ) C for (ii) as the final element is always fixed by the temperature of the ice Alteration of the source code allowed time to be varied incrementally with the approximate steady state times determined from Figure 8 set as maximal values This created near continuous, three dimensional thermal distributions, T (x, t) as shown in Figures 9 & (8) (9)

Exercise : Partial Differential Equations Table Summary of graphical fit analysis Figure Fit Form A B C Reduced χ (Jacobi) Bρ n + C - 6877 ± 8667 6 ± 9668 (Gauss-Seidel) Bρ n + C - ± 98 77 ± 89 6 (Jacobi) Aρ n + C 69 ± - 687 ± 6 7 (Gauss-Seidel) Aρ n + C 7 ± 96-7 ± 77 777 7 A (a/d) B + C 6 ± 9 666 ± 88 68 ± 8 777 T(x,t) ( C) 8 8 6 t = s t = s t = s t = s t = s 6 8 6 t = s t = s t = s t = s t = s Figure 8 Preliminary temperature distribution as a function of position along the rod, T (x, t) at a variety of elapsed times for each physical situation; no heat loss from the far end of the poker (above) and the far end of the poker is immersed in a block of ice at C (below) 7 T(x,t) ( C) 7 8 6 Figure 9 Temperature distribution T (x, t) for each physical situation; no heat loss from the far end of the poker (above) and the far end of the poker is immersed in a block of ice at C (below) This paper has been typeset from a TEX/ L A TEX file prepared by the author ACKNOWLEDGEMENTS I thank my collaborators for assistance and C Lucas for guidance throughout the duration of the course This work made extensive use of GNU s GSL library REFERENCES () Trefethen, LN, Bau III, D, Numerical Linear Algebra, Society for Industrial and Applied Mathematics, 997, 8, () Press, WH, et al, Numerical Recipes in C (The Art of Scientific Computing), rd edn Cambridge Univ Press, Cambridge, 7 ()Blundell, S, Blundell, K, Concepts In Thermal Physics, nd edn Oxford Univ Press, Oxford 6

6 J F Ider Chitham T(x,t) 8 6 8 6 7 T(x,t) 8 6 8 6 7 Figure Three dimensional temperature distribution T (x, t) for each physical situation; no heat loss from the far end of the poker (above) and the far end of the poker is immersed in a block of ice at C (below)