.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/1D_simulation(crystalline)/plot_3_quad_csa.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_examples_1D_simulation(crystalline)_plot_3_quad_csa.py: Non-coincidental Quad and CSA, ¹⁷O (I=5/2) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ¹⁷O (I=5/2) quadrupolar static spectrum simulation. .. GENERATED FROM PYTHON SOURCE LINES 9-18 The following example illustrates the simulation of NMR spectra arising from non-coincidental quadrupolar and shielding tensors. The tensor parameter values for the simulation are obtained from Yamada `et al.` [#f1]_, for the :math:`^{17}\text{O}` site in benzanilide. .. warning:: The Euler angles representation used by Yamada `et al` is different from the representation used in mrsimulator. The resulting simulation might not resemble the published spectrum. .. GENERATED FROM PYTHON SOURCE LINES 18-27 .. code-block:: Python import numpy as np import matplotlib.pyplot as plt from mrsimulator import Simulator, SpinSystem, Site from mrsimulator.method.lib import BlochDecayCTSpectrum from mrsimulator.spin_system.tensors import SymmetricTensor from mrsimulator.method import SpectralDimension .. GENERATED FROM PYTHON SOURCE LINES 29-30 Create the spin system. .. GENERATED FROM PYTHON SOURCE LINES 30-44 .. code-block:: Python site = Site( isotope="17O", isotropic_chemical_shift=320, # in ppm shielding_symmetric=SymmetricTensor(zeta=376.667, eta=0.345), quadrupolar=SymmetricTensor( Cq=8.97e6, # in Hz eta=0.15, alpha=5 * np.pi / 180, beta=np.pi / 2, gamma=70 * np.pi / 180, ), ) spin_system = SpinSystem(sites=[site]) .. GENERATED FROM PYTHON SOURCE LINES 45-46 Create a central transition selective Bloch decay spectrum method. .. GENERATED FROM PYTHON SOURCE LINES 46-61 .. code-block:: Python method = BlochDecayCTSpectrum( channels=["17O"], magnetic_flux_density=11.74, # in T rotor_frequency=0, # in Hz rotor_angle=0, # in rads spectral_dimensions=[ SpectralDimension( count=1024, spectral_width=1e5, # in Hz reference_offset=22500, # in Hz label=r"$^{17}$O resonances", ) ], ) .. GENERATED FROM PYTHON SOURCE LINES 62-63 Create the Simulator object and add method and spin system objects. .. GENERATED FROM PYTHON SOURCE LINES 63-79 .. code-block:: Python sim = Simulator(spin_systems=[spin_system], methods=[method]) # Since the spin system have non-zero Euler angles, set the integration_volume to # hemisphere. sim.config.integration_volume = "hemisphere" sim.run() # The plot of the simulation before signal processing. plt.figure(figsize=(4.25, 3.0)) ax = plt.subplot(projection="csdm") ax.plot(sim.methods[0].simulation.real, color="black", linewidth=1) ax.invert_xaxis() plt.tight_layout() plt.show() .. image-sg:: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_3_quad_csa_001.png :alt: plot 3 quad csa :srcset: /examples/1D_simulation(crystalline)/images/sphx_glr_plot_3_quad_csa_001.png :class: sphx-glr-single-img .. GENERATED FROM PYTHON SOURCE LINES 80-84 .. [#f1] Yamada, K., Dong, S., Wu, G., Solid-State 17O NMR Investigation of the Carbonyl Oxygen Electric-Field-Gradient Tensor and Chemical Shielding Tensor in Amides, J. Am. Chem. Soc. 2000, **122**, 11602-11609. `DOI: 10.1021/ja0008315 `_ .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.295 seconds) .. _sphx_glr_download_examples_1D_simulation(crystalline)_plot_3_quad_csa.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_3_quad_csa.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_3_quad_csa.py ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_