Coding: python particle to grid interpolation

[latexpage] In particle tracking simulations you often need to interpolate particles onto a grid in one or more dimensions. Recently I decided to write a linear particle-to-grid interpolation in one dimension in python.This is an educational introduction into interpolating particles onto a one-dimensional grid. Interpolation of particles onto a grid Particles are usually described by […]

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 […]

Tune / Resonance diagram

In Accelerator physics you often need a Tune diagram to display machine tunes. A quick Google search gave me no readily available Mathematica code for drawing one, so I came up with a Mathematica notebook that produces graphics similar to the following diagram: The Mathematica notebook and package I used to generate the diagram can […]