Just made a short post about how to simulate electrostatic nonuniform charge density distributions with FEniCS; that is spatially varying charge density distributions. This could be useful for simulating things like particle beams which are commonly assumed to have Gaussian (or similar) distributions. This is a small extension of a previous post about how to simulate uniform charge density distributions.


However, my script is now *very* linux only 😅

I needed to perform a numerical integral of a function I knew very little about. I tried to get decent resolution by having small slices in my integration.

Python was pretty slow to perform the integration, so I thought I'd have a look at writing it in c++. I haven't used c++ for ages, but eventually I got it working.

I then needed to plot the result of my integration against measured data, so I wanted access to my c++ functions in python, where I do my plotting.

Finally got my c++ functions imported into python using PyBind11 and I must say, it works amazingly well, I think it's well documented and the examples were great. Vectorising my functions so that I can run them for a whole numpy array of values was genuinely super-easy. I'm very impressed! Thanks to all the devs =]

WordPress.com offers a pretty good service, but its limiting in terms of access to WordPress features and puts pretty intrusive advertisements on my blog. I was thinking of moving to a different WordPress host.

I got magnetostatic simulations working yesterday, so I made a cos(theta) style dipole magnet with an iron yoke. The fields looked sensible although I didnt check the amplitudes, for the post I'll see if I can recreate the LHC dipoles!

My latest post is about using boundary conditions to assume symmetry in a finite element electrostatics problem.

To demonstrate Neumann boundaries I solve the Laplace equation for a coaxial geometry using 1/4 of the cross section. I then find the fields of a differential pair transmission line using half the cross section and a Dirichlet boundary.

This is all done with FEniCS, the open source finite element solver.


Finally finished my post on electrostatics with linear dielectrics using the open source finite element solver FEniCS. It's surprisingly easy!

, , , ,


Here's the electric potential and field overlaid for a uniform cylindrical charge distribution created using FEniCS, an opensource finite element solver. Although this is a simple analytical problem, this technique can be used for much more complicated geometries.

Next up: linear dielectrics, I've tested in both 2D and 3D and I'm ready to write it up =] surprisingly easy!

New post: electrostatic problems with charge densities in FEniCS. A domain is specified within the mesh to have a uniform charge density, the fields both inside and outside the region are then solved. The finite element solution is then compared with the analytical result. All materials available as a repo. wp.me/p8Kvfs-cX

ComPhys boosted

After a couple of months without a new post I've started writing about simulating charge distributions, rather than just boundary value problems. I'll explain how can calculate the electrostatic fields of arbitrarily shaped charge densities, which are specified with mesh subdomains. These will have hard edges for now but I want to look into having more general charge distributions.

I've also run 3D simulations for calculating capacitances between arbitrarily shaped conductors and 2D linear dielectrics. I need to do some more testing & comparison with other FEA tools/ analytical methods before I publish any posts. Seems to be going well though!

ComPhys boosted
ComPhys boosted

I was reading the help files of a well-known commercial microwave FEA package and it suggested calculating characteristic impedance from the power and voltage rather than finding the current directly.

This way doesn't require surface normals or line integrals which my previous methods did, so it's probably better (easier to do anyway). I've added this into my TEM mode post - comphysblog.wordpress.com/2018

Just made a bow tie, surprisingly easy. Actually putting it on is another matter.

@aparrish always happy to try and help with maths :)

Small update to the TEM mode analysis with example.

I've added in a calculation for the mutual capacitance and self-inductance per unit length of the transmission line.


I've just finished my new post: TEM mode analysis with an finite element differential equation solver. comphysblog.wordpress.com/2018

In this post I calculate the electric and magnetic fields on a coaxial cable, characteristic impedance of the line, the Poynting vector, the conductor and dielectric loss, an estimated loss coefficient, Q-factor and s-parameter for a given length of cable.

Coax has been a useful example for comparisons with analytical results but the methods are very general. TEM modes of systems with different geometries can also be analysed with the exact same techniques!

Very happy to hear any comments, corrections or suggestions.

Show more
Qoto Mastodon

QOTO: Question Others to Teach Ourselves. A STEM-oriented instance.

No hate, No censorship. Be kind, be respectful

We federate with all servers: we don't block any servers.