.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "gallery/analytical/03_binary_composition.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_gallery_analytical_03_binary_composition.py: Binary-mixture composition at fixed volume fraction =================================================== Vary the number fraction of small spheres while keeping both radii and total volume fraction fixed. Number fraction is not volume fraction: large spheres contribute more volume per particle. These curves are equilibrium Percus--Yevick references, not RSA configurations. .. GENERATED FROM PYTHON SOURCE LINES 10-35 .. image-sg:: /gallery/analytical/images/sphx_glr_03_binary_composition_001.png :alt: Effect of mixture composition :srcset: /gallery/analytical/images/sphx_glr_03_binary_composition_001.png :class: sphx-glr-single-img .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from PackLab import analytical, ureg radii = np.array([0.1, 0.2]) * ureg.micrometer distances = np.linspace(0, 1.5, 200) * ureg.micrometer figure, axis = plt.subplots() for small_fraction in (0.25, 0.5, 0.75): domain = analytical.PercusYevickDomain( size=100 * ureg.micrometer, radii=radii, volume_fraction=0.2, number_fractions=[small_fraction, 1 - small_fraction], ) result = analytical.PercusYevickSolver( densities=domain.particle_densities_per_radius, radii=domain.radii, wavenumber="auto", ).compute(distances) axis.plot(distances.magnitude, result.g[0, 1], label=f"small fraction = {small_fraction:.2f}") axis.set(xlabel="separation (µm)", ylabel=r"$g_{12}(r)$", title="Effect of mixture composition") axis.legend() axis.grid(alpha=0.2) figure.tight_layout() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.087 seconds) .. _sphx_glr_download_gallery_analytical_03_binary_composition.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: 03_binary_composition.ipynb <03_binary_composition.ipynb>` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: 03_binary_composition.py <03_binary_composition.py>` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: 03_binary_composition.zip <03_binary_composition.zip>` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_