Computing Fourier Integrals

Fast Fourier Transforms (or FFT's) are the first-stop for the numerical computation of Fourier transforms, but I recently learned that they are not well suited to evaluating the Fourier integral $latex \tilde{f}(\omega) = \int_{-\infty}^{\infty} f(t) e^{i\omega t} \,\textrm{d} t. $ This is stated explicitly in Numerical Recipes, and to borrow the words of a 1920's… Continue reading Computing Fourier Integrals

Gaussian Quadrature

Gaussian quadrature is a technique to evaluate integrals by summing a weighted integrand at a finite number of points. It can correctly evaluate some forms of integral to machine precision, rather than the approximations produced by techniques like the trapezium rule. When I first looked into using it, I found a huge number of explanations… Continue reading Gaussian Quadrature

2D Magnetostatics – cos(φ) Dipole Magnet

In this post I'll demonstrate how to find the magnetic field of steady currents with FEniCS. I'll start this with a simple example of a coaxial conductor with a uniform current, before moving onto the more interesting example of a cos(φ) magnet of the sort used in particle accelerators like the LHC. I'll include linear… Continue reading 2D Magnetostatics – cos(φ) Dipole Magnet

Conformal Mapping Example – The Eccentric Coax

1.0 - Introduction I recently had the chance to try out conformal mapping for boundary value problems. This allows a problem with complicated boundary conditions to be solved by transforming with a mapping function into a simpler problem. In some sense this method is a competitor to the 2D finite element techniques, since both are… Continue reading Conformal Mapping Example – The Eccentric Coax

Electrostatics with Non-Uniform Charge Densities

In a previous post I demonstrated how to simulate electrostatic problems with uniform charge densities within a region, this post will generalise that to include charge densities which depend on position. This could be useful to simulate something like a particle beam, which could never really be uniformly distributed. To demonstrate this a Gaussian charge… Continue reading Electrostatics with Non-Uniform Charge Densities

Assuming Symmetry with Boundary Conditions

Some of the examples so far have symmetries which, if properly exploited, could reduce the size of the simulated geometry, and an improved mesh density should provide a more accurate solution. Alternatively these techniques could be used to reduce the computational resources required to solve a problem. In this example I will re-visit the TEM… Continue reading Assuming Symmetry with Boundary Conditions

Electrostatics with Linear Dielectric Materials using FEniCS

Articles thus far relating to the topic of electrostatics, have made the simplification that all space within the problem was homogeneous and isotropic. In this post I will introduce a technique to include linear dielectrics of arbitrary shape, and thus to do away with this simplification. The technique itself is simple, and requires only that… Continue reading Electrostatics with Linear Dielectric Materials using FEniCS

Electrostatics with Charge Densities in FEniCS

Previous posts have found the electrostatic fields from the Laplace equation with the electric potentials specified on boundaries which are considered to be perfect conductors. In this post a uniform charge density will be specified and the resulting fields calculated. This will be done using a FEniCS subdomain, giving the charge distribution a hard edge,… Continue reading Electrostatics with Charge Densities in FEniCS

TEM Mode Analysis with FEniCS

Contents 1 - Introduction 2 - Geometry, Mesh and Boundaries 3 - Calculations and Results 3.1 - Electric Potential and Field 3.1.1 - Analytical Solution 3.1.2 - FEniCS Solution 3.1.3 - Comparison 3.2 - Magnetic Field 3.2.1 - Analytical Solution 3.2.2 - FEniCS Solution 3.2.3 - Comparison 3.3 - Current and Characteristic Impedance 3.3.1 -… Continue reading TEM Mode Analysis with FEniCS

3D Electrostatics using FEniCS

  FEniCS is an open source general purpose finite element solver. That means it incredibly general but also not as easy to start with as commercial finite element solvers; which are often tailored for specific applications. The purpose of the FEniCS electrostatics posts is to demonstrate how FEniCS can be used to solve electrostatics problems… Continue reading 3D Electrostatics using FEniCS