Examples
Jupyter notebooks in this section are executed when the documentation is built. Download a notebook from its page to run it yourself.
- Optimising an einzel lens finds the voltage, gap and aperture of an einzel lens with
beamtracer.optimization, against a scan and the thin-lens estimate. - Optimising a negative-ion beamlet searches the extraction voltage, the EG aperture and the PG-EG gap of an H⁻ beamlet for the smallest divergence, on a coarse mesh checked against the example’s.
- The duct traces the neutrals from the end of the traced region through the duct to the port with
beamtracer.beamline: the walls hit, the footprint at the port, the reionization in the duct gas, against the closed forms. - The grid turns a beamlet traced in 2D into 3D markers with
beamline.beamlet_markersand copies it over an aperture grid with its aiming (ApertureGrid): the footprints of a flat and a curved grid along the beamline. - The dump pushes the ions left after the neutralizer through the residual-ion dump onto its plates with
beamline.FieldRegion, and bends the ions reionized in the duct onto its walls in the stray field. - The calorimeter records the power map of a beamlet group on a calorimeter with
beamline.Calorimeterand infers the beam’s width and divergence from it as the experiments do, against the markers’ own divergence. - The beamline puts the pieces of
beamtracer.beamlinein a row, from an aimed group of beamlets through the dump and the duct to the port: where the power goes, the footprint at the port, and the neutral markers handed on to freeofcharge. - Scripts are complete Python scripts with their plots.
- Building the docs explains how to add an example and control its output.

Einzel lens optimisation
A first design optimisation with beamtracer.optimization: an einzel lens focusing a 30 keV proton beam onto a plane downstream. The optimisation core only calls an evaluation function, here a…

Negative-ion beamlet optimisation
The second problem of beamtracer.optimization, after the einzel lens: one round H^- beamlet extracted from a plasma, solved with BeamOptics and NegativeExtractionPlasma (the beamlet of the example…

Duct
Beyond the accelerator and the neutralizer no field acts on the neutrals: they fly on straight lines to the port. beamtracer.beamline.Duct intersects each line with the duct walls, given as…

Grid
BeamOptics traces one beamlet, in 2D: a round aperture in cylindrical (x, r) geometry, where each trajectory stands for a ring, or a slit in planar geometry. The beamline needs the whole beam in 3D.…

Dump
After the neutralizer the beam still carries ions: D^- that were not stripped and D^+ that were stripped twice. The residual-ion dump deflects them out of the beam onto its plates, biased against…

Calorimeter
In a test facility the beam ends on a calorimeter: a plate of tiles whose temperature rise gives the power on each. From the map the experiments infer the beam's width (a Gaussian fit of the…

Beamline
The pieces of beamtracer.beamline in a row, from the grid to the port: a group of aimed beamlets, the charge states the neutralizer leaves, the residual-ion dump, the duct with its gas and the stray…
Nothing matches.