A package of utility routines used by the SciBmad project for the simulation of high energy accelerators and storage rings.
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)
.un_sinc(x, n)
- Calculaten
th derivative ofsin(x)/x
.un_cosc(x, n)
- Calculaten
th derivative of(1 - cos(x)) / x^2
.one_cos(x)
- Calculate1 - cos(x)
.
gen_pinknoise(beta, size, dt, f0)
- Random number generator that has a "pink noise spectrum.