Platform independent, crude timing of code

I work a lot on MacOS where I write code that I want to use on linux later. Unfortunately some of the normal timing functions are missing on MacOS. I don’t quite remember which. So I have some crude platform independent code for timing c++ code. I am aware it does not really count the […]

Basseti-Earskine field calculation

Yesterday I needed code to calculate the electric fields of an elliptical two-dimensional Gaussian charge distribution. I decided to implement it in c++ using libcerf for the error function. I used the formula from the Accelerator Physics Handbook. Beware 1: using Mathematica your results will be noisy because when you create the w-of-z error function […]