.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gen_examples/free_bound/plot_free_bound_scattering.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_free_bound_scattering.py: Showcase the DetailedBalace free-bound scattering Model ======================================================= This plot is comparable to the target analzed by :cite:`Doppner.2023`, is this example is one of the dataset revisited by cite:`Bohme.2023`. However, we used simpler for the relevant scattering processes, just to show the usage of :py:class:`jaxrts.models.DetailedBalace`. .. GENERATED FROM PYTHON SOURCE LINES 10-73 .. image-sg:: /gen_examples/free_bound/images/sphx_glr_plot_free_bound_scattering_001.svg :alt: plot free bound scattering :srcset: /gen_examples/free_bound/images/sphx_glr_plot_free_bound_scattering_001.svg :class: sphx-glr-single-img .. code-block:: Python from functools import partial import jax.numpy as jnp import matplotlib.pyplot as plt import jaxrts ureg = jaxrts.units.ureg plt.style.use("science") setup = jaxrts.setup.Setup( ureg("120°"), energy=ureg("9keV"), measured_energy=jnp.linspace(8, 9.5, 300) * ureg.kiloelectron_volt, instrument=partial( jaxrts.instrument_function.instrument_gaussian, sigma=(30.0 * ureg.electron_volt) / ureg.hbar, ), ) state = jaxrts.PlasmaState( [jaxrts.Element("Be")], jnp.array([3.0]), jnp.array([9.3]) * ureg.gram / ureg.centimeter**3, jnp.array([119]) * ureg.electron_volt / ureg.k_B, jnp.array([119]) * ureg.electron_volt / ureg.k_B, ) state["ionic scattering"] = jaxrts.models.Gregori2003IonFeat() state["free-free scattering"] = jaxrts.models.RPA() state["bound-free scattering"] = jaxrts.models.SchumacherImpulse() state["free-bound scattering"] = jaxrts.models.DetailedBalance() plt.plot( setup.measured_energy.m_as(ureg.electron_volt), state.evaluate("free-free scattering", setup).m_as(ureg.second), label="free-free", linestyle="dashed", ) plt.plot( setup.measured_energy.m_as(ureg.electron_volt), state.evaluate("bound-free scattering", setup).m_as(ureg.second), label="bound-free", ) plt.plot( setup.measured_energy.m_as(ureg.electron_volt), state.evaluate("free-bound scattering", setup).m_as(ureg.second), label="free-bound", ) plt.plot( setup.measured_energy.m_as(ureg.electron_volt), state.probe(setup).m_as(ureg.second), lw=2, color="black", label="full", ) plt.xlabel("Energy [eV]") plt.ylabel("Scattering intensity") plt.legend() plt.tight_layout() plt.show() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 21.393 seconds) .. _sphx_glr_download_gen_examples_free_bound_plot_free_bound_scattering.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_free_bound_scattering.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_free_bound_scattering.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_