.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/plasma/acceleration/plot_01_wakefield_acceleration.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_api_gallery_plasma_acceleration_plot_01_wakefield_acceleration.py: Plasma wakefield acceleration: a test charge surfing a traveling wave ================================================================================= Toshiki Tajima and John Dawson (1979) proposed firing an intense, short laser pulse into a plasma to excite a large-amplitude plasma wave in its wake, then injecting electrons to "surf" that wake's electric field. Because a plasma wave's field is not limited by material breakdown the way a copper accelerating cavity's is, the resulting accelerating gradient can exceed conventional radio-frequency accelerators' by three to four orders of magnitude -- the proposal that launched the field of laser and beam-driven plasma wakefield acceleration. Rather than deriving the wake self-consistently from a driver beam or laser pulse, this example *prescribes* it directly as a rigid traveling longitudinal electric-field wave of peak amplitude :math:`E_0`, wavenumber :math:`k`, and phase velocity :math:`v_{ph}`, .. math:: E_z(x, t) = E_0\cos\!\big[k(x - v_{ph}t)\big], and injects a single test charge of charge :math:`q` and mass :math:`m` into it, integrating the Lorentz force with no magnetic field, .. math:: m\dot{\mathbf{v}} = q\,\mathbf{E}, \qquad \mathbf{E}=(E_z(x,t), 0, 0), via :func:`~physicskit.plasma.single_particle.boris_push`. A particle riding within one quarter-wavelength of the field's zero-crossing near :math:`v\approx v_{ph}` (the accelerating "bucket") feels a sign-definite field and gains kinetic energy at the expense of the externally prescribed, infinite-energy-reservoir wave. :func:`~physicskit.plasma.acceleration.wakefield_e_field` evaluates :math:`E_z(x,t)` directly, and :func:`~physicskit.plasma.acceleration.simulate_wakefield_acceleration` injects the test charge into it with the same energy-conserving :func:`~physicskit.plasma.single_particle.boris_push` used for gyro-orbits elsewhere in this package. .. GENERATED FROM PYTHON SOURCE LINES 45-50 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np import physicskit as pk .. GENERATED FROM PYTHON SOURCE LINES 51-56 A test electron launched near the wake's own phase velocity ------------------------------------------------------------------------ Riding the accelerating quarter-wave ("the bucket") for as long as it stays trapped there, the particle gains kinetic energy at the expense of the (externally prescribed) wave. .. GENERATED FROM PYTHON SOURCE LINES 56-69 .. code-block:: Python result = pk.plasma.simulate_wakefield_acceleration(x0=0.0, v0=0.9, q=1.0, m=1.0, E0=0.05, k=1.0, v_phase=1.0, dt=0.01, steps=4000) t, ke = result["t"], result["kinetic_energy"] fig, ax = plt.subplots(figsize=(6, 4)) ax.plot(t, ke) ax.set_xlabel("t") ax.set_ylabel("kinetic energy") ax.set_title("Wakefield acceleration: energy gain while surfing the wake") fig.tight_layout() plt.show() .. image-sg:: /api/gallery/plasma/acceleration/images/sphx_glr_plot_01_wakefield_acceleration_001.png :alt: Wakefield acceleration: energy gain while surfing the wake :srcset: /api/gallery/plasma/acceleration/images/sphx_glr_plot_01_wakefield_acceleration_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 70-80 Trapping in phase space: co-moving position vs. velocity ------------------------------------------------------------------------ The energy trace above is a shadow of a richer, two-dimensional trapping picture. Reusing the same (x, v) history already returned by :func:`~physicskit.plasma.acceleration.simulate_wakefield_acceleration`, plotting velocity against position *in the wake's own co-moving phase* :math:`k(x - v_{ph}t)` shows the particle orbiting a fixed point near :math:`v\approx v_{ph}` instead of drifting through phase indefinitely -- the phase-space signature of a particle trapped in the accelerating bucket rather than merely accelerated once and released. .. GENERATED FROM PYTHON SOURCE LINES 80-96 .. code-block:: Python x, v = result["x"], result["v"] phase = np.mod(1.0 * (x - 1.0 * t) + np.pi, 2 * np.pi) - np.pi fig, ax = plt.subplots(figsize=(6, 4)) sc = ax.scatter(phase, v, c=t, cmap="viridis", s=4) fig.colorbar(sc, ax=ax, label="t") ax.axvline(0.0, color="gray", linestyle="--", linewidth=0.8, label="field zero-crossing") ax.set_xlabel(r"wake phase $k(x-v_{ph}t)$") ax.set_ylabel("v") ax.set_title("Trapped orbit in the wake's co-moving phase space") ax.legend() fig.tight_layout() plt.show() .. image-sg:: /api/gallery/plasma/acceleration/images/sphx_glr_plot_01_wakefield_acceleration_002.png :alt: Trapped orbit in the wake's co-moving phase space :srcset: /api/gallery/plasma/acceleration/images/sphx_glr_plot_01_wakefield_acceleration_002.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 97-99 Animating the particle surfing the wake --------------------------------------------- .. GENERATED FROM PYTHON SOURCE LINES 99-102 .. code-block:: Python anim = pk.plasma.animate_wakefield_acceleration(x0=0.0, v0=0.9, q=1.0, m=1.0, E0=0.05, k=1.0, v_phase=1.0, dt=0.01, steps=4000, frame_stride=40) plt.show() .. container:: sphx-glr-animation .. raw:: html .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 6.319 seconds) .. _sphx_glr_download_api_gallery_plasma_acceleration_plot_01_wakefield_acceleration.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_wakefield_acceleration.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_wakefield_acceleration.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_wakefield_acceleration.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_