A package of utility routines for the simulation of high energy accelerators and storage rings.
AcceleratorSimUtils
is part of the SciBmad project.
calc_E_kinetic(...)
- Calculate kinetic energy.calc_γ(...)
- Calculate relativistic gamma factor.calc_E_tot(...)
- Calculate total energy.calc_pc(...)
- Calculate momentum * c.calc_β(...)
- Calculate velocity/c.calc_1β(...)
- Calculate1 - β
.calc_changed_energy(...)
- Calculate the new energy and momentum given initial momentum and energy change.
modulo2(x, amp)
- Calculatex + 2 * n * amp
where the output is in the range[-amp, amp)
.one_cos(x)
- Calculate1 - cos(x)
to machine precision forx
near zero.sqrt_one(x)
- Calculatesqrt(1+x) - 1
to machine precision.un_sinc(x, n)
- Calculaten
th derivative ofsin(x)/x
to machine precision.un_cosc(x, n)
- Calculaten
th derivative of(1 - cos(x)) / x^2
to machine precision.
gen_pinknoise(beta, size, dt, f0)
- Random number generator that has a "pink noise spectrum.