From IPM to BIF to e-Lens simulations - Recent advancements in simulation code development

Dominik Vilsmeier / GSI

3rd IPM Workshop

J-PARC, Tokai, Japan

September 18th 2018

 Second IPM Workshop

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

 pip install virtual-ipm

 Second IPM Workshop

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

 Second IPM Workshop

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Gas Jet

BIF

2 Beams

+ DC Beam (e-)

 BIF Monitor

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

🠖 Beam Induced
     Fluorescence
      Monitor

Vacuum gauge

N2 fluorescent gas

Beam

Viewport

Lens, Image-Intensifier, Camera

N2 gas jet

1) Excitation of gas by interaction with the beam

2) Register the corresponding light emission

 Selection of gas type

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

UV lines
        lines with life times below 10 ns

Yellow lines
      lines with life times about 20 ns

Blue lines
      lines with life times about 60 ns

F. Becker et al 2009 "Beam Induced Fluorescence Monitor & Imaging Spectrography of Different Working Gases" Proc. of DIPAC'09

\textrm{Ne}^{+}
Ne+\textrm{Ne}^{+}
\textrm{N}_{2}^{+}
N2+\textrm{N}_{2}^{+}
\textrm{Ne}
Ne\textrm{Ne}

\(Ar^+\) lines with about 15 ns (currently being investigated)

 Simulating BIF

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Particle generation

Ground state

Excitation rate is proportional to the number of beam particles

Particle detection

\begin{aligned} \tau &\propto \exp\left(-\lambda t\right) \\ \lambda^{-1} &\approx 60\,\textrm{ns} \end{aligned}
τexp(λt)λ160 ns\begin{aligned} \tau &\propto \exp\left(-\lambda t\right) \\ \lambda^{-1} &\approx 60\,\textrm{ns} \end{aligned}

Tracking is stopped stochastically based on decay probability

\left(\textrm{N}_{2}\right)^{*} / \left(\textrm{N}_{2}^{+}\right)^{*}
(N2)/(N2+)\left(\textrm{N}_{2}\right)^{*} / \left(\textrm{N}_{2}^{+}\right)^{*}

 N2 Gas jet

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Tilted gas sheet in order to capture both transverse dimensions

Projection of beam profile in the gas curtain plane
🠖 elliptical shape

x

y

z

y

Velocities are modeled according to Boltzmann distribution + additional jet component

 Electron lens (e-Lens)

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

x

y

z

y

p+

e-

  • Hollow e-lens configuration for removing the beam halo
  • Additional solenoid field along beam axis; 4T field strength in the center
  • In reality BIF measurement won't be at the center

R. Veness 2017 "Beam-Gas Curtain (BGC) profile monitor: Project Overview and Status" 7th HL-LHC Collaboration Meeting

\vec{B}
B\vec{B}

 Electric fields

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

\begin{aligned} & \textrm{\textbf{Gaussian bunch}} \\ & \frac{N\cdot e}{\epsilon_0}\frac{1}{\sqrt{2\pi}^3\sigma_z}\frac{1}{r}\left[ 1 - \exp\left(-\frac{r^2}{2\sigma^2}\right) \right] \end{aligned}
Gaussian bunchNeϵ012π3σz1r[1exp(r22σ2)]\begin{aligned} & \textrm{\textbf{Gaussian bunch}} \\ & \frac{N\cdot e}{\epsilon_0}\frac{1}{\sqrt{2\pi}^3\sigma_z}\frac{1}{r}\left[ 1 - \exp\left(-\frac{r^2}{2\sigma^2}\right) \right] \end{aligned}
\begin{aligned} & \textrm{\textbf{Hollow DC beam}} \\ & \frac{\rho_0}{2\epsilon_0} \frac{1}{r} \left( r^2 - R_1^2 \right) & R_1 \leq r \leq R_2 \\ & \frac{\rho_0}{2\epsilon_0} \frac{1}{r} \left( R_2^2 - R_1^2 \right) & R_2 < r \end{aligned}
Hollow DC beamρ02ϵ01r(r2R12)R1rR2ρ02ϵ01r(R22R12)R2&lt;r\begin{aligned} &amp; \textrm{\textbf{Hollow DC beam}} \\ &amp; \frac{\rho_0}{2\epsilon_0} \frac{1}{r} \left( r^2 - R_1^2 \right) &amp; R_1 \leq r \leq R_2 \\ &amp; \frac{\rho_0}{2\epsilon_0} \frac{1}{r} \left( R_2^2 - R_1^2 \right) &amp; R_2 &lt; r \end{aligned}
\rho_0 = \frac{I}{\pi \left( R_2^2 - R_1^2 \right) \beta c}
ρ0=Iπ(R22R12)βc\rho_0 = \frac{I}{\pi \left( R_2^2 - R_1^2 \right) \beta c}
\begin{aligned} & R_1 = 1.2\,\textrm{mm}, \;\; R_2 = 1.8\,\textrm{mm} \\ & I = 5\,\textrm{A}, \;\; \beta \approx 0.19 \end{aligned}
R1=1.2&ThinSpace;mm,&ThickSpace;&ThickSpace;R2=1.8&ThinSpace;mmI=5&ThinSpace;A,&ThickSpace;&ThickSpace;β0.19\begin{aligned} &amp; R_1 = 1.2\,\textrm{mm}, \;\; R_2 = 1.8\,\textrm{mm} \\ &amp; I = 5\,\textrm{A}, \;\; \beta \approx 0.19 \end{aligned}
\begin{aligned} & \sigma \approx 1.02\,\textrm{mm}, \;\; 4\sigma_z = 1.25\,\textrm{ns} \\ & N = 2.2\cdot 10^{11}\,\textrm{charges} \end{aligned}
σ1.02&ThinSpace;mm,&ThickSpace;&ThickSpace;4σz=1.25&ThinSpace;nsN=2.21011&ThinSpace;charges\begin{aligned} &amp; \sigma \approx 1.02\,\textrm{mm}, \;\; 4\sigma_z = 1.25\,\textrm{ns} \\ &amp; N = 2.2\cdot 10^{11}\,\textrm{charges} \end{aligned}

z-axis

z-axis

 Electric fields

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Though the average charge density seen by ions is dominated by e-beam the p-beam contributes significant spikes

Not to scale

e-Beam
10 keV CW @ 5 A
 

p-Beam
7 TeV             
@ 40 MHz

4\sigma_z = 1.25\,\textrm{ns}
4σz=1.25&ThinSpace;ns4\sigma_z = 1.25\,\textrm{ns}

e-Beam

p-Beam

 Trajectories

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

x\; [mm]
x&ThickSpace;[mm]x\; [mm]
y\; [mm]
y&ThickSpace;[mm]y\; [mm]

Ion trajectories for various starting points

\vec{B}
B\vec{B}

4T solenoid field along beam axis

Ion motion mainly driven by solenoid field an e-beam electric field

 Trajectories

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Zoom on trajectory @  starting point x = 1.2 mm

bunch center passing

p-Beam electric field becomes effective for small scale trajectories

Motion is still driven by other em-fields

 Trajectories

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

  • Trajectories simulated for 420 ns (decay time 60 ns)
     
  • Ions at greater starting position feel stronger e-field
     
  • Ions are attracted by e-field while performing circular motion due to solenoid field

 Trajectories

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Ion generated by the proton bunches close to their center are only influenced by the proton beam fields

Solenoid field still confines the movement but the e-field kick is much smaller

 e-Lens Results

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Results for Nitrogen

(\lambda^{-1} \approx 60\,\textrm{ns})
(λ160&ThinSpace;ns)(\lambda^{-1} \approx 60\,\textrm{ns})

 e-Lens Results

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Results for Neon

(\lambda^{-1} \approx 10\,\textrm{ns})
(λ110&ThinSpace;ns)(\lambda^{-1} \approx 10\,\textrm{ns})

Three-dimensional analytic bunch electric fields

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Original solution: P. Strehl, M. Dolinska, R.W. Müller (2000)

Initial implementation: M. Herty, P. Forck (2004)

Further development: S. Udrea, P. Forck (since 2015)

 Elliptical bunch shape

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Ellipsoid:

\frac{z^2}{a^2} + \frac{x^2}{b_1^2} + \frac{y^2}{b_2^2} = 1
z2a2+x2b12+y2b22=1\frac{z^2}{a^2} + \frac{x^2}{b_1^2} + \frac{y^2}{b_2^2} = 1

Spheroid:

\frac{z^2}{a^2} + \frac{x^2 + y^2}{b^2} = 1
z2a2+x2+y2b2=1\frac{z^2}{a^2} + \frac{x^2 + y^2}{b^2} = 1
b_1 = b_2 \equiv b
b1=b2bb_1 = b_2 \equiv b

Consider a > b (i.e. bunches are longer than wide)

Parabolic charge distribution

\frac{15N_q e}{8\pi a b^2}\cdot \left( 1 - \frac{x^2 + y^2}{b^2} - \frac{z^2}{a^2} \right)
15Nqe8πab2(1x2+y2b2z2a2)\frac{15N_q e}{8\pi a b^2}\cdot \left( 1 - \frac{x^2 + y^2}{b^2} - \frac{z^2}{a^2} \right)

RMS matched:

b = \sqrt{7}\sigma
b=7σb = \sqrt{7}\sigma

 Electric field expression

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

• Using confocal elliptical coordinates:

\begin{aligned} z(\xi, \eta) &= c\cdot\xi\cdot\eta \\ r(\xi, \eta) &= c\cdot\sqrt{(\xi^2 - 1)\cdot(1 - \eta^2)} \end{aligned}
z(ξ,η)=cξηr(ξ,η)=c(ξ21)(1η2)\begin{aligned} z(\xi, \eta) &amp;= c\cdot\xi\cdot\eta \\ r(\xi, \eta) &amp;= c\cdot\sqrt{(\xi^2 - 1)\cdot(1 - \eta^2)} \end{aligned}
c = \sqrt{a^2 - b^2}
c=a2b2c = \sqrt{a^2 - b^2}

• Transform Poisson equation:

\Delta \phi (\xi, \eta) = \frac{1}{c^2(\xi^2 - \eta^2)}\cdot\left[ \frac{\partial}{\partial\xi}(\xi^2 - 1)\frac{\partial \phi (\xi, \eta)}{\partial \xi} + \frac{\partial}{\partial\eta}(1 - \eta^2)\frac{\partial \phi (\xi, \eta)}{\partial\eta} \right]
Δϕ(ξ,η)=1c2(ξ2η2)[ξ(ξ21)ϕ(ξ,η)ξ+η(1η2)ϕ(ξ,η)η]\Delta \phi (\xi, \eta) = \frac{1}{c^2(\xi^2 - \eta^2)}\cdot\left[ \frac{\partial}{\partial\xi}(\xi^2 - 1)\frac{\partial \phi (\xi, \eta)}{\partial \xi} + \frac{\partial}{\partial\eta}(1 - \eta^2)\frac{\partial \phi (\xi, \eta)}{\partial\eta} \right]

• With the charge density:

\rho(\xi, \eta) = \rho_0\frac{a^2}{b^2}\left(1 - \frac{\xi^2}{\xi_0^2}\right)\left(1 - \frac{\eta^2}{\xi_0^2}\right)
ρ(ξ,η)=ρ0a2b2(1ξ2ξ02)(1η2ξ02)\rho(\xi, \eta) = \rho_0\frac{a^2}{b^2}\left(1 - \frac{\xi^2}{\xi_0^2}\right)\left(1 - \frac{\eta^2}{\xi_0^2}\right)
\xi_0 = \frac{a}{c}
ξ0=ac\xi_0 = \frac{a}{c}

 Electric field expression

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

\lvert \vec{E}_i(\xi, \eta) \rvert = \frac{1}{c\sqrt{\xi^2 - \eta^2}}\sqrt{(\xi^2 - 1)\cdot D_{i, \xi}(\xi, \eta)^2 + (1 - \eta^2)\cdot D_{i,\eta}(\xi, \eta)^2}
Ei(ξ,η)=1cξ2η2(ξ21)Di,ξ(ξ,η)2+(1η2)Di,η(ξ,η)2\lvert \vec{E}_i(\xi, \eta) \rvert = \frac{1}{c\sqrt{\xi^2 - \eta^2}}\sqrt{(\xi^2 - 1)\cdot D_{i, \xi}(\xi, \eta)^2 + (1 - \eta^2)\cdot D_{i,\eta}(\xi, \eta)^2}

Absolute field value inside the spheroid:

\begin{aligned} D_{i,\xi}(\xi,\eta) &= 2A\xi + 4B\xi^3 + 4C\xi^3\eta^4 + C_2 P'_2(\xi) P_2(\eta) + C_4 P'_4(\xi) P_4(\eta) \\ D_{i,\eta}(\xi,\eta) &= 2A\eta + 4B\eta^3 + 4C\xi^4\eta^3 + C_2 P_2(\xi) P'_2(\eta) + C_4 P_4(\xi) P'_4(\eta) \end{aligned}
Di,ξ(ξ,η)=2Aξ+4Bξ3+4Cξ3η4+C2P2(ξ)P2(η)+C4P4(ξ)P4(η)Di,η(ξ,η)=2Aη+4Bη3+4Cξ4η3+C2P2(ξ)P2(η)+C4P4(ξ)P4(η)\begin{aligned} D_{i,\xi}(\xi,\eta) &amp;= 2A\xi + 4B\xi^3 + 4C\xi^3\eta^4 + C_2 P&#x27;_2(\xi) P_2(\eta) + C_4 P&#x27;_4(\xi) P_4(\eta) \\ D_{i,\eta}(\xi,\eta) &amp;= 2A\eta + 4B\eta^3 + 4C\xi^4\eta^3 + C_2 P_2(\xi) P&#x27;_2(\eta) + C_4 P_4(\xi) P&#x27;_4(\eta) \end{aligned}

where

where

\begin{aligned} & A, B, C : \;\;\textrm{Constants} \\ & P_n(x) : \;\;\textrm{Legendre polynoms} \end{aligned}
A,B,C:&ThickSpace;&ThickSpace;ConstantsPn(x):&ThickSpace;&ThickSpace;Legendre polynoms\begin{aligned} &amp; A, B, C : \;\;\textrm{Constants} \\ &amp; P_n(x) : \;\;\textrm{Legendre polynoms} \end{aligned}

🠖 Polynomial expression of \(\xi, \eta\)

🠖 Similar for outside the spheroid but contains logarithmic terms

 Numerical (in-)stability

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

The given expression is analytically correct however its implementation can become numerically instable for very large "a/b" ratios (i.e. very long bunches)

🠖 Observed for example for LHC 6.5 TeV bunch configuration

For LHC case the "a/b" ratio is around        

5\cdot 10^6
51065\cdot 10^6

Computed with mpmath library (1000 dps fps precision)

\approx \times 8,000
×8,000\approx \times 8,000

comp. time

Similar problem for the longitudinal electric field

all stacked

Radial field

 Reformulation (inside bunch)

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

\begin{aligned} E_z = -\xi_0 \frac{K(Q, N)}{\epsilon_0 b^2}\left(\frac{z}{a}\right)\bigg[ & f_1(\xi_0) + f_2(\xi_0) \\ & + (f_2(\xi_0) + f_3(\xi_0))\xi_0^2\left(\frac{z}{a}\right)^2 \\ & + f_2(\xi_0)(\xi_0^2 - 1)\left(\frac{r}{b}\right)^2 \bigg] \end{aligned}
Ez=ξ0K(Q,N)ϵ0b2(za)[f1(ξ0)+f2(ξ0)+(f2(ξ0)+f3(ξ0))ξ02(za)2+f2(ξ0)(ξ021)(rb)2]\begin{aligned} E_z = -\xi_0 \frac{K(Q, N)}{\epsilon_0 b^2}\left(\frac{z}{a}\right)\bigg[ &amp; f_1(\xi_0) + f_2(\xi_0) \\ &amp; + (f_2(\xi_0) + f_3(\xi_0))\xi_0^2\left(\frac{z}{a}\right)^2 \\ &amp; + f_2(\xi_0)(\xi_0^2 - 1)\left(\frac{r}{b}\right)^2 \bigg] \end{aligned}

Electric field inside the bunch:

\begin{aligned} E_r = \frac{-K(Q, N)}{\epsilon_0 b^2}\left(\frac{r}{b}\right)\bigg[ & (g_1(\xi_0) + g_3(\xi_0))\sqrt{\xi_0^2 - 1} \\ & + (g_2(\xi_0) + g_3(\xi_0))\xi_0^2\sqrt{\xi_0^2 - 1}\left(\frac{z}{a}\right)^2 \\ & + g_3(\xi_0)\sqrt{\xi_0^2 - 1}^3\left(\frac{r}{b}\right)^2 \bigg] \end{aligned}
Er=K(Q,N)ϵ0b2(rb)[(g1(ξ0)+g3(ξ0))ξ021+(g2(ξ0)+g3(ξ0))ξ02ξ021(za)2+g3(ξ0)ξ0213(rb)2]\begin{aligned} E_r = \frac{-K(Q, N)}{\epsilon_0 b^2}\left(\frac{r}{b}\right)\bigg[ &amp; (g_1(\xi_0) + g_3(\xi_0))\sqrt{\xi_0^2 - 1} \\ &amp; + (g_2(\xi_0) + g_3(\xi_0))\xi_0^2\sqrt{\xi_0^2 - 1}\left(\frac{z}{a}\right)^2 \\ &amp; + g_3(\xi_0)\sqrt{\xi_0^2 - 1}^3\left(\frac{r}{b}\right)^2 \bigg] \end{aligned}

Polynomials of (r, z)
🠖 no transformation to elliptical coordinates


No "dangerous" a/b ratios

Concise formulation
🠖 faster computation
(+ saves a few hundred lines of code)

Radial field

Longitudinal field

 Comparison / Results

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Longitudinal field escalates already at smaller "a/b" ratios

old

new

New formulation provides numerically stable fields with less effort

 Reformulation (outside bunch)

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

The electric field outside the bunch can be similarly simplified (e.g. longitudinal field):

\begin{aligned} E_z = \frac{K(Q,N) (\xi_0^2 - 1)}{\epsilon_0 b^2}\eta \bigg[ & \frac{1}{4}(3 - 5\eta^2)\xi^2\left[\xi\ln\left(1 + \frac{2}{\xi - 1}\right) - 2\right] \\ & \frac{1}{4}(3\eta^2 - 1)\xi\ln\left(1 + \frac{2}{\xi - 1}\right) - \frac{2}{3}\eta^2 \bigg] \end{aligned}
Ez=K(Q,N)(ξ021)ϵ0b2η[14(35η2)ξ2[ξln(1+2ξ1)2]14(3η21)ξln(1+2ξ1)23η2]\begin{aligned} E_z = \frac{K(Q,N) (\xi_0^2 - 1)}{\epsilon_0 b^2}\eta \bigg[ &amp; \frac{1}{4}(3 - 5\eta^2)\xi^2\left[\xi\ln\left(1 + \frac{2}{\xi - 1}\right) - 2\right] \\ &amp; \frac{1}{4}(3\eta^2 - 1)\xi\ln\left(1 + \frac{2}{\xi - 1}\right) - \frac{2}{3}\eta^2 \bigg] \end{aligned}
\left[ \xi\ln\left(1 + \frac{2}{\xi - 1}\right) - 2 \right]
[ξln(1+2ξ1)2]\left[ \xi\ln\left(1 + \frac{2}{\xi - 1}\right) - 2 \right]

                               term indicates numerical (in)stability (compute via e.g. xlog1py from scipy.special)

Can be used as a "safeguard" (should be > 0)

Transformation to elliptical coordinates remains crucial but works for much larger "a/b" ratios (up to \(10^8\); further improvements are under investigation)

Realistic "a/b" ratios are \(\lessapprox10^{7}\)
(LHC @ 14 TeV has \(a/b \approx 10^{7}\))

 Reformulation (outside bunch)

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

Radial electric field outside the bunch

\begin{aligned} E_r = &\frac{K(Q,N)(\xi_0^2 - 1)}{\epsilon_0 b^2} \sqrt{(1 - \eta^2)(\xi^2 - 1)} \\ & \cdot \bigg\{\frac{1}{16}\left[ (15\eta^2 - 3)\xi^2 - (3\eta^2 + 1) \right]\ln\left(1 + \frac{2}{\xi-1}\right) \\ & + (3 - 15\eta^2)\frac{\xi}{8} + \frac{1 - \eta^2}{4}\frac{\xi}{\xi^2 - 1} \bigg\} \end{aligned}
Er=K(Q,N)(ξ021)ϵ0b2(1η2)(ξ21){116[(15η23)ξ2(3η2+1)]ln(1+2ξ1)+(315η2)ξ8+1η24ξξ21}\begin{aligned} E_r = &amp;\frac{K(Q,N)(\xi_0^2 - 1)}{\epsilon_0 b^2} \sqrt{(1 - \eta^2)(\xi^2 - 1)} \\ &amp; \cdot \bigg\{\frac{1}{16}\left[ (15\eta^2 - 3)\xi^2 - (3\eta^2 + 1) \right]\ln\left(1 + \frac{2}{\xi-1}\right) \\ &amp; + (3 - 15\eta^2)\frac{\xi}{8} + \frac{1 - \eta^2}{4}\frac{\xi}{\xi^2 - 1} \bigg\} \end{aligned}

Again the logarithmic term can be used as an instability "safeguard"

Only limited by accuracy of coordinate transformation (allowing for much larger "a/b" ratios which cover well beyond the realistic regime)

 Summary

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

  • New computational models for simulating BIF (+ gas jet)
  • Simulation of multiple beams simultaneously (e-Lens)
  • Additional models for different bunch shapes and corresponding electric fields (e.g. Hollow, Generalized Gaussian, Q-Gaussian)
  • Good progress on analytic electric field models (for parabolic ellipsoid shape)
    • Complete reformulation of electric fields inside and outside the bunch
    • Provides numerically stable results with less effort
    • Concise formulation results in increased performance

 Available at ...

3rd IPM Workshop, September 18th 2018, D. Vilsmeier

... the Python package index:

https://pypi.org/project/virtual-ipm/

... GitLab (source code + issue tracker):

https://gitlab.com/IPMsim/Virtual-IPM

... GitLab pages (documentation):

https://ipmsim.gitlab.io/Virtual-IPM/

From IPM to BIF to e-Lens simulations

By Dominik Vilsmeier

From IPM to BIF to e-Lens simulations

International workshop on non-invasive beam profile monitors for hadron machines and its related techniques: 3rd IPM workshop, Japan Proton Accelerator Research Complex (Tokai, Japan), September 18th 2018

  • 576