.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/props/plot_w_by_w.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_props_plot_w_by_w.py: wn by w_center ============== For debugging the solver .. GENERATED FROM PYTHON SOURCE LINES 7-49 .. image-sg:: /auto_examples/props/images/sphx_glr_plot_w_by_w_001.png :alt: plot w by w :srcset: /auto_examples/props/images/sphx_glr_plot_w_by_w_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/docs/checkouts/readthedocs.org/user_builds/pttools/checkouts/main/pttools/bubble/integrate.py:180: ODEintWarning: Excess accuracy requested (tolerances too small). Run with full_output = 1 to get quantitative information. | .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from examples import utils from pttools.bubble import fluid from pttools.bubble.boundary import SolutionType from pttools.bubble.chapman_jouguet import v_chapman_jouguet from pttools.bubble.fluid_reference import ref # from pttools.models.bag import BagModel from pttools.models.const_cs import ConstCSModel model = ConstCSModel(css2=1/3 - 0.01, csb2=1/3 - 0.011, g_s=123, g_b=120, V_s=0.9) # model = BagModel(g_s=123, g_b=120, V_s=0.9) v_wall = 0.40454545454545454 alpha_n = 0.2534507678410117 vp_bag, vm_bag, vp_tilde_bag, vm_tilde_bag, wp_bag, wm_bag = ref().get(v_wall, alpha_n, SolutionType.SUB_DEF) wn = model.wn(alpha_n) wm_bag *= wn wp_bag *= wn w_center = np.linspace(0.9*wm_bag, 1.1*wm_bag) wn_est = np.empty_like(w_center) for i, w_center_i in enumerate(w_center): v_cj = v_chapman_jouguet(model, alpha_n=alpha_n, wn=wn) v, w, xi, vp, vm, vp_tilde, vm_tilde, xi_sh, vm_sh, vm_tilde_sh, wp, wn_estimate, wm_sh = \ fluid.sound_shell_deflagration(model, v_wall=v_wall, wn=wn, w_center=w_center_i, cs_n=model.css2, v_cj=v_cj, vp_guess=vp_bag, wp_guess=wp_bag) wn_est[i] = wn_estimate fig: plt.Figure = plt.figure() ax: plt.Axes = fig.add_subplot() ax.plot(w_center, wn_est) ax.axhline(wn) ax.set_xlabel("$w_{center}$") ax.set_ylabel("w_n") utils.save_and_show(fig, "w_by_w.png") .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.817 seconds) **Estimated memory usage:** 264 MB .. _sphx_glr_download_auto_examples_props_plot_w_by_w.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_w_by_w.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_w_by_w.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_w_by_w.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_