Beamline
The equations of beamtracer.beamline, declared on the code that implements them and checked by the tests.
ApertureGrid
classsourceThe apertures of an accelerator grid, each emitting a copy of one beamlet.
- slopes
- rotation
- copy
- Assumes
- the cross-product matrix of the unit rotation axis (Rodrigues); the identity below a sine of
- every aperture carries the whole beamlet power; a flat grid has ; the mean of the beamlet's markers
beamlet_markers
functionsourceThe 3D markers of a beamlet traced in 2D, from its crossings of a plane.
- power
- states
- copies
- Assumes
- only the forward crossings of the plane, of one beam species if given; the charge the current counts, in e
- one marker per trajectory and state with a share, repeated
copiestimes
beamline_summary
functionsourceThe power balance of a beamline as a dataset.
- balance
- halo
- Assumes
- the balance is checked, a mismatch raises; the work of the fields (
RegionResult.work)
- the balance is checked, a mismatch raises; the work of the fields (
Calorimeter
classsourceA flat calorimeter of tiles in the plane x = position, facing the beam.
- map
- Assumes
- the markers drift on straight lines to the face (backwards for one already past it); those outside the face pass by
- tiles of equal area on the face extent, closed bounds
divergence_from_widths
functionsourceThe source width and the divergence from beam widths at several distances.
- widths
- Assumes
- linear least squares of on the columns , at least two distances; negative or clipped to 0
Duct
classsourceThe duct from the end of the traced region to the port.
- depth
- birth
- product
- walls
- Assumes
- neutrals on straight lines along ; a reionized neutral stops where it is born, transitions back to the neutral state are not followed
- along the slanted path; tabulated by the trapezoidal rule on 1025 nodes plus the profile points and inverted by linear interpolation
- the product is drawn with the weights as coded; would be the rate of each channel, the same for one target
- walls are simgeometry shapes (
simgeometry.crossings.crossings: analytic for boxes, spheres and slanted tubes, sampled otherwise); a marker starting inside a wall stops at once
- References
- simgeometry
crossings
- simgeometry
FieldRegion
classsourceMarkers through static electric and magnetic fields, to the walls or an exit plane.
- kick
- rotation
- update
- Order
- 2
- Assumes
- the fields at ; the leapfrog starts from the velocity pushed back half a step; neutrals move straight
- steps of path length =
step, each tested against the walls and the exit plane as a straight segment, so must be well below the radius of curvature - the rotation is exact for the angle and keeps without an electric field
- the order is in the step, for the position on the Larmor circle
- a marker keeps its particles per second, so its power follows its kinetic energy, with the last half-step velocity: the work of the electric field reaches the walls
- References
- J. P. Boris, Proc. Fourth Conf. Numerical Simulation of Plasmas, 3 (1970)
fit_footprint
functionsourceFit a 2D Gaussian (axes along y and z) to a calorimeter map.
- gaussian
- Assumes
- an unweighted least-squares fit (
scipy.optimize.curve_fit) on the tile centres, started from the map's power-weighted centre and widths and its maximum - no bounds and no fallback: a failed fit raises
- an unweighted least-squares fit (
gaussian_beam
functionsourceA round Gaussian beam along +x, starting in the plane x (m).
- sampling
- width
- Assumes
- a round beam along ; every marker carries
Markers
classsourceBeam markers in 3D.
- weight
- rms angle
- drift
- placed
- Assumes
- markers are streams of particles on straight lines (no field acts on them outside a
FieldRegion); weighted by the power placed: alongdirection, the part ofupnormal to it- the weight (particles per second) is what freeofcharge reads as a neutral beam
- markers are streams of particles on straight lines (no field acts on them outside a