Skip to content

Control number of FFT modes in longitudinal space charge solver#107

Open
austin-hoover wants to merge 13 commits intoPyORBIT-Collaboration:mainfrom
austin-hoover:lsc
Open

Control number of FFT modes in longitudinal space charge solver#107
austin-hoover wants to merge 13 commits intoPyORBIT-Collaboration:mainfrom
austin-hoover:lsc

Conversation

@austin-hoover
Copy link
Contributor

This PR gives the option to restrict the number of modes used in longitudinal space charge kicks. From Chao, the formula for the energy gain from longitudinal impedance $Z_{0}^{\parallel}(\omega)$ is

$$ \Delta \mathcal{E} = -\frac{1}{2\pi} \int_{-\infty}^{\infty} d\omega | \rho(\omega) |^2 \text{Re} \left\{ Z_{0}^{\parallel} (\omega) \right\} . $$

From the FFT, the solver uses $N / 2$ frequencies/modes, where $N$ is the number of longitudinal bins.

double LSpaceChargeCalc::_kick(double angle)
{
// n=0 term has no impact (constant in phi)
// f(phi) = _FFTMagnitude(1) + sum (n = 2 -> N / 2) of
// [2 * _FFTMagnitude(i) * cos(phi * (n - 1) +
// _FFTPhase(n) + _chi(n))]
double kick = 0.;
double cosArg;
for(int n = 1; n < nBins / 2; n++)
{
cosArg = n * (angle + OrbitConst::PI) + _fftphase[n] + _chi[n];
kick += 2 * _fftmagnitude[n] * _z[n] * cos(cosArg);
}
return kick;
}

This PR lets the user restrict the number of modes used in the energy kick, acting as a low-pass filter.

@austin-hoover
Copy link
Contributor Author

Example with decreasing number of modes:

rotation_fft_modes.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant