.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "api/gallery/spectro/nmr/plot_01_nmr_multiplets.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_spectro_nmr_plot_01_nmr_multiplets.py: Spin-spin (J) coupling and the n+1 rule: ethanol's triplet/quartet and a doublet of triplets ============================================================================================= Indirect spin-spin coupling carried through the bonding electrons (Ramsey and Purcell, 1952) splits an NMR resonance into a multiplet. The splitting is :math:`J` Hz regardless of field strength. In the first-order limit, :math:`n` equivalent spin-1/2 neighbours give :math:`n+1` lines with Pascal's-triangle intensities. This example simulates ethanol's -CH3 triplet and -CH2- quartet, then a doublet of triplets from two inequivalent coupling partners with different :math:`J` values. .. GENERATED FROM PYTHON SOURCE LINES 16-29 .. code-block:: Python import matplotlib.pyplot as plt import numpy as np from chemistrykit.spectro.systems.nmr import first_order_multiplet, multi_coupling_multiplet from chemistrykit.spectro.visualizers.spectro_plots import plot_broadened_spectrum, plot_stick_spectrum freq_mhz = 400.0 ch3 = first_order_multiplet(chemical_shift_ppm=1.2, j_coupling_hz=7.0, n_neighbors=2, spectrometer_frequency_mhz=freq_mhz) # split by CH2's 2 H's -> triplet ch2 = first_order_multiplet(chemical_shift_ppm=3.7, j_coupling_hz=7.0, n_neighbors=3, spectrometer_frequency_mhz=freq_mhz) # split by CH3's 3 H's -> quartet print(f"CH3 triplet positions (ppm): {np.round(ch3.positions, 4)}, intensities: {ch3.intensities}") print(f"CH2 quartet positions (ppm): {np.round(ch2.positions, 4)}, intensities: {ch2.intensities}") .. rst-class:: sphx-glr-script-out .. code-block:: none CH3 triplet positions (ppm): [1.1825 1.2 1.2175], intensities: [1. 2. 1.] CH2 quartet positions (ppm): [3.6738 3.6912 3.7088 3.7262], intensities: [1. 3. 3. 1.] .. GENERATED FROM PYTHON SOURCE LINES 30-39 .. code-block:: Python fig, axes = plt.subplots(1, 2, figsize=(11, 4)) plot_stick_spectrum(ch3, ax=axes[0], color="steelblue") axes[0].set_title("Ethanol -CH3 (triplet)") axes[0].set_xlabel("chemical shift (ppm)") plot_stick_spectrum(ch2, ax=axes[1], color="crimson") axes[1].set_title("Ethanol -CH2- (quartet)") axes[1].set_xlabel("chemical shift (ppm)") fig.tight_layout() .. image-sg:: /api/gallery/spectro/nmr/images/sphx_glr_plot_01_nmr_multiplets_001.png :alt: Ethanol -CH3 (triplet), Ethanol -CH2- (quartet) :srcset: /api/gallery/spectro/nmr/images/sphx_glr_plot_01_nmr_multiplets_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 40-43 A genuine doublet of triplets: one neighbor with J1=12 Hz, two equivalent neighbors with J2=5 Hz -- 6 distinct lines, total relative intensity conserved at (1+1)*(1+2+1)=8: .. GENERATED FROM PYTHON SOURCE LINES 43-56 .. code-block:: Python dt = multi_coupling_multiplet(chemical_shift_ppm=5.5, couplings=[(12.0, 1), (5.0, 2)], spectrometer_frequency_mhz=freq_mhz) print(f"\nDoublet-of-triplets: {len(dt.positions)} lines, total intensity {np.sum(dt.intensities):.1f}") print(f"Positions (ppm): {np.round(dt.positions, 4)}") print(f"Intensities: {dt.intensities}") fig2, ax2 = plt.subplots(figsize=(7, 4)) x = np.linspace(dt.positions[0] - 0.02, dt.positions[-1] + 0.02, 3000) plot_broadened_spectrum(dt, x, ax=ax2, shape="lorentzian", fwhm=0.002, color="darkgreen") ax2.set_xlabel("chemical shift (ppm)") ax2.set_title("Doublet of triplets (J1=12 Hz, J2=5 Hz)") fig2.tight_layout() plt.show() .. image-sg:: /api/gallery/spectro/nmr/images/sphx_glr_plot_01_nmr_multiplets_002.png :alt: Doublet of triplets (J1=12 Hz, J2=5 Hz) :srcset: /api/gallery/spectro/nmr/images/sphx_glr_plot_01_nmr_multiplets_002.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Doublet-of-triplets: 6 lines, total intensity 8.0 Positions (ppm): [5.4725 5.485 5.4975 5.5025 5.515 5.5275] Intensities: [1. 2. 1. 1. 2. 1.] .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.096 seconds) .. _sphx_glr_download_api_gallery_spectro_nmr_plot_01_nmr_multiplets.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_01_nmr_multiplets.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_01_nmr_multiplets.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_01_nmr_multiplets.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_