.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gen_examples/free_bound/plot_bohme_kraus_relevance_of_bound_free.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_gen_examples_free_bound_plot_bohme_kraus_relevance_of_bound_free.py: Showcase of the relavance of including free-bound scattering ============================================================ It was suggested by :cite:`Bohme.2023` that the evaluation of some experiments need to consider free-bound conditions to fully understand the scattering spectrum. One of the seminal examples of the aforementioned paper is fitting the LCLS data from :cite:`Kraus.2018`. Here, we present the stated best-fit results, to show the relevance of these contributions for certain conditions. .. GENERATED FROM PYTHON SOURCE LINES 13-105 .. image-sg:: /gen_examples/free_bound/images/sphx_glr_plot_bohme_kraus_relevance_of_bound_free_001.svg :alt: plot bohme kraus relevance of bound free :srcset: /gen_examples/free_bound/images/sphx_glr_plot_bohme_kraus_relevance_of_bound_free_001.svg :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/jaxrts/jaxrts/doc/examples/free_bound/plot_bohme_kraus_relevance_of_bound_free.py:45: DeprecationWarning: `trapz` is deprecated. Use `trapezoid` instead, or one of the numerical integration functions in `scipy.integrate`. onp.trapz(PSF_I, (PSF_E / ureg.hbar).m_as(1 / ureg.second)) / ureg.second | .. code-block:: Python from pathlib import Path import jax.numpy as jnp import jpu.numpy as jnpu import matplotlib.pyplot as plt import numpy as onp import scienceplots # noqa: F401 import jaxrts from jaxrts.hnc_potentials import CoulombPotential from jaxrts.models import ( ArbitraryDegeneracyScreeningLength, ConstantIPD, DetailedBalance, OnePotentialHNCIonFeat, RPA, SchumacherImpulse, ) ureg = jaxrts.ureg try: current_folder = Path(__file__).parent except NameError: current_folder = Path.cwd() PSF_E, PSF_I = onp.genfromtxt( current_folder / "kraus2018/PSF.csv", unpack=True, delimiter="," ) PSF_E *= ureg.electron_volt PSF_I /= ( onp.trapz(PSF_I, (PSF_E / ureg.hbar).m_as(1 / ureg.second)) / ureg.second ) central_E = 5909 * ureg.electron_volt def PSF(omega): return jnpu.interp( omega, (PSF_E - central_E) / ureg.hbar, PSF_I, left=0, right=0 ) state = jaxrts.PlasmaState( ions=[jaxrts.Element("C")], Z_free=jnp.array([1.71]), mass_density=([2]) * ureg.gram / ureg.centimeter**3, T_e=jnp.array([21.7]) * ureg.electron_volt / ureg.k_B, # T_e=jnp.array([16.6]) * ureg.electron_volt / ureg.k_B, ) setup = jaxrts.setup.Setup( ureg("160°"), central_E, # Make this a little bitter, to avoid the edge effects of the convolution jnp.linspace(5450, 6100, 500) * ureg.electron_volt, PSF, ) state["electron-ion Potential"] = CoulombPotential() state["screening length"] = ArbitraryDegeneracyScreeningLength() state["ionic scattering"] = OnePotentialHNCIonFeat() state["ipd"] = ConstantIPD(jnp.array([-24]) * ureg.electron_volt) state["free-free scattering"] = RPA() state["bound-free scattering"] = SchumacherImpulse(r_k=1) state["free-bound scattering"] = DetailedBalance() probed = state.probe(setup) norm = jnpu.max(probed) plt.plot( (setup.measured_energy).m_as(ureg.electron_volt), (probed / norm).m_as(ureg.dimensionless), ) plt.plot( (setup.measured_energy).m_as(ureg.electron_volt), (state.evaluate("bound-free scattering", setup) / norm).m_as( ureg.dimensionless ), ) Data_E, Data_I = onp.genfromtxt( current_folder / "kraus2018/data.csv", unpack=True, delimiter="," ) plt.plot(Data_E, Data_I, ls="none", marker="o", alpha=0.5) plt.yscale("log") plt.xlabel("Energy [eV]") plt.ylabel("Scattering Intensity [a. u.]") plt.xlim(5550, 6000) plt.ylim(1e-3, 1.2) plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 12.338 seconds) .. _sphx_glr_download_gen_examples_free_bound_plot_bohme_kraus_relevance_of_bound_free.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_bohme_kraus_relevance_of_bound_free.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_bohme_kraus_relevance_of_bound_free.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_