.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/polymer/chain_growth/plot_03_mayo_lewis_copolymerization.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_api_gallery_polymer_chain_growth_plot_03_mayo_lewis_copolymerization.py: The Mayo-Lewis copolymer equation: composition vs. feed ========================================================== Mayo and Lewis (1944) showed that, if a growing radical's reactivity depends only on its terminal monomer unit, the instantaneous copolymer composition :math:`F_1` follows from the feed composition :math:`f_1` and two reactivity ratios (:func:`~chemistrykit.polymer.systems.copolymerization.mayo_lewis_copolymer_composition`). Their own test case, styrene / methyl methacrylate (:math:`r_1\approx0.52`, :math:`r_2\approx0.46`), crosses the diagonal at an azeotropic feed (:func:`~chemistrykit.polymer.systems.copolymerization.azeotropic_feed_composition`) where the copolymer has the same composition as the feed. .. GENERATED FROM PYTHON SOURCE LINES 17-38 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.polymer.systems.copolymerization import ( azeotropic_feed_composition, mayo_lewis_copolymer_composition, ) f1 = np.linspace(0.0, 1.0, 201) systems = { "ideal random (r1=r2=1)": (1.0, 1.0), "styrene / MMA (0.52, 0.46)": (0.52, 0.46), "alternating (r1=r2=0.01)": (0.01, 0.01), "blocky/drift (r1=5, r2=0.2)": (5.0, 0.2), } fstar = azeotropic_feed_composition(0.52, 0.46) print(f"Styrene/MMA azeotropic feed f1* = {fstar:.3f}, F1(f1*) = {float(mayo_lewis_copolymer_composition(fstar, 0.52, 0.46)):.3f}") for f in (0.1, 0.5, 0.9): print(f" f1 = {f}: F1 = {float(mayo_lewis_copolymer_composition(f, 0.52, 0.46)):.3f}") .. rst-class:: sphx-glr-script-out .. code-block:: none Styrene/MMA azeotropic feed f1* = 0.529, F1(f1*) = 0.529 f1 = 0.1: F1 = 0.171 f1 = 0.5: F1 = 0.510 f1 = 0.9: F1 = 0.844 .. GENERATED FROM PYTHON SOURCE LINES 39-50 .. code-block:: Python fig, ax = plt.subplots(figsize=(6, 5.5)) for label, (r1, r2) in systems.items(): ax.plot(f1, mayo_lewis_copolymer_composition(f1, r1, r2), label=label) ax.plot(f1, f1, "k:", lw=0.8) ax.plot(fstar, fstar, "ko", label="styrene/MMA azeotrope") ax.set_xlabel("feed mole fraction $f_1$") ax.set_ylabel("copolymer mole fraction $F_1$") ax.set_title("Mayo-Lewis copolymer equation") ax.legend(fontsize=8) plt.tight_layout() plt.show() .. image-sg:: /api/gallery/polymer/chain_growth/images/sphx_glr_plot_03_mayo_lewis_copolymerization_001.png :alt: Mayo-Lewis copolymer equation :srcset: /api/gallery/polymer/chain_growth/images/sphx_glr_plot_03_mayo_lewis_copolymerization_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.047 seconds) .. _sphx_glr_download_api_gallery_polymer_chain_growth_plot_03_mayo_lewis_copolymerization.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_03_mayo_lewis_copolymerization.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_03_mayo_lewis_copolymerization.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_03_mayo_lewis_copolymerization.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_