.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/giese/giese_testing.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_auto_examples_giese_giese_testing.py: Giese testing ============= Test comparison with Giese code and data .. GENERATED FROM PYTHON SOURCE LINES 7-36 .. image-sg:: /auto_examples/giese/images/sphx_glr_giese_testing_001.png :alt: giese testing :srcset: /auto_examples/giese/images/sphx_glr_giese_testing_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none [0.05846558 0.14369864 0.22752788 0.31087347 0.39397903 0.47694308 0.55981466 0.64262152 0.72538079 0.80810373 0.89079812 0.97346954 1.05612212 1.138759 1.22138261 1.30399488 1.38659735 1.46919128 1.55177771 1.6343575 1.71693138 1.79949997 1.88206379 1.96462331 2.04717892 2.12973095 2.21227973 2.2948255 2.37736851 2.45990898] | .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from pttools.models import ConstCSModel from examples.utils import save_and_show model = ConstCSModel(css2=1/3, csb2=1/4, a_s=5, a_b=1, V_s=1) atbs = np.linspace(0.01, 3, 30) alpha_ns = np.zeros_like(atbs) for i, alpha_theta_bar_n in enumerate(atbs): try: alpha_ns[i] = model.alpha_n_from_alpha_theta_bar_n(alpha_theta_bar_n=alpha_theta_bar_n) except RuntimeError: pass print(alpha_ns) fig = plt.figure() ax = fig.add_subplot() ax.plot(atbs[alpha_ns < atbs], alpha_ns[alpha_ns < atbs]) ax.plot(atbs[alpha_ns >= atbs], alpha_ns[alpha_ns >= atbs], color="red") ax.set_xlabel(r"$\alpha_{\bar{\theta}_n}$") ax.set_ylabel(r"$\alpha_n$") ax.grid() if __name__ == "__main__": save_and_show(fig, "giese_testing.png") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.603 seconds) **Estimated memory usage:** 265 MB .. _sphx_glr_download_auto_examples_giese_giese_testing.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: giese_testing.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: giese_testing.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: giese_testing.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_