.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/const_cs/plot_model_comparison.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_const_cs_plot_model_comparison.py: Comparison of BagModel and ConstCSModel ======================================= .. GENERATED FROM PYTHON SOURCE LINES 5-31 .. image-sg:: /auto_examples/const_cs/images/sphx_glr_plot_model_comparison_001.png :alt: plot model comparison :srcset: /auto_examples/const_cs/images/sphx_glr_plot_model_comparison_001.png :class: sphx-glr-single-img .. code-block:: Python import numpy as np from examples import utils from pttools.analysis.plot_models import ModelsPlot from pttools import models def main(): model_bag = models.BagModel(a_s=1.1, a_b=1, V_s=1) # model_const_cs_like_bag = models.ConstCSModel(a_s=1.1, a_b=1, css2=1/3, csb2=1/3, V_s=1) model_thermo_bag = models.FullModel(thermo=models.ConstCSThermoModel(a_s=1.1, a_b=1, V_s=1, css2=1/3, csb2=1/3)) model_sm = models.FullModel(thermo=models.StandardModel(), allow_invalid=True) plot = ModelsPlot(temp=np.logspace(1, 2.5, 100)) plot.add(model_bag, phase=models.Phase.SYMMETRIC) plot.add(model_thermo_bag, phase=models.Phase.SYMMETRIC, ls="--") plot.add(model_sm, phase=models.Phase.SYMMETRIC, ls=":") plot.process() return plot if __name__ == "__main__": plot = main() utils.save_and_show(plot.fig, "model_comparison.png") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 3.584 seconds) **Estimated memory usage:** 280 MB .. _sphx_glr_download_auto_examples_const_cs_plot_model_comparison.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_model_comparison.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_model_comparison.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_model_comparison.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_