Pulse Offset Versus Magnetization
The plot was made from a little GAMMA program for looking at pulse
offset effects. One day I was playing around and wanted to see if
I could mimic the figure in the book "Experimental Pulse NMR" by
Fukushima and Roeder, page 56. I took a single spin, applied a pulse,
then monitored the xy-magnetization. This was done while looping over
different offsets and shoving the Mx & My values into a GAMMA vector.
At the end of the loop the vector was output for a plot. I used the
FrameMaker functions so I could color the line, add some annotation,
and size to my liking. Here's the complete GAMMA program that
made this plot, see if you can figure it out.
PulOffset1.cc
#include <gamma.h> // Include GAMMA itself
using std::cout;
main ()
{
int npts = 2048; // Number of plot points
row_vector Spiral(npts); // vector for data storage
spin_system sys(1); // A single spin system
double offset = 100.; // Initial offset @ 100 Hz
sys.-100.; // Larmor at 100 Hz also
gen_op H = Ho(sys); // Isotropic Hamiltonian
gen_op dnseq = sigma_eq(sys); // Equilibrium dens. mx.
gen_op detect = Fm(sys); // Detector to F-
complex z, norm; // Working complex numbers
gen_op dnsmx; // Working density operator
for(int i=0; i<npts; i++)
{
dnsmx = dnseq; // Equilibrium dens. mx.
dnsmx = Sypuls(sys,dnsmx,H,"1H", // 90 pulse on system (a proton) at
offset,1.0,90.0); // the offset value for 1 second
if(i == 0)
{ // For the 1st point, compute
norm = trace(detect, dnsmx); // Mo & use it for normalization
Spiral.put(complex1,i); // Set first point to 1.0
}
else
{ // For all other points, compute
z = trace(detect,dnsmx); // M, then normalize and store
Spiral.put(z/norm,i); // compute M
}
offset -= .02; // Increment offset by .02 Hz
}
FM_xyPlot("spiral.mif",Spiral); // Output vector to FM plot
}
GAMMA Pulse Profile Program
|
Another way to look at pulse offsets is to make a quick pulse
profile. Just take 20 or so single spin systems at different
offsets and plot their summed spectra for various pulse lengths.
We only need to vary the pulse amplitude soas to maintain a
90 pulse on resonance. The result is shown in the figure to
the left. For very short pulses the results should be that of
an ideal pulse (a pure spin rotation with no offset effects).
The GAMMA program that (when rerun for the pulse lengths shown)
made this plot is shown below. Again, this is the complete
program. I again used FrameMaker output so I could put all plots
together, color lines, add annotation, etc. You can opt for
output in MATLAB, Felix, Gnuplot, NMRi, etc.
|
PulOffset2.cc
#include <gamma.h>
using namespace std;
main ()
{
spin_system sys(1); // Initial spin system
double cshift = -550.; // Shift value to -550
sys.cshift; // Set this as spin's
gen_op dnseq = sigma_eq(sys); // System at equilibrium
gen_op H = Ho(sys); // Initial static H
gen_op detect = Fm(sys); // Detection operator
double tp; // Pulse length
cout << "\nPulse length (sec)? "; // Ask for pulse length
cin >> tp; // Read in the pulse length
gen_op dnsmx; // Working density operator
int npts = 2048; // Block size
double td = 0.0005; // Dwell time for FID
block_1D data1(npts), data(npts); // Working data blocks
for(int i=0; i<21; i++) // Loop over 21 offsets
{
cshift += 50.; // Increment 50 Hz
sys.cshift; // Set spin's in system
H = Ho(sys); // Recompute static Hamiltonian
dnsmx=Sypuls(sys,dnseq,H,"1H",100.,tp,90.); // 90y pulse, 100 Hz
FID(dnsmx, detect, H, td, npts, data); // Perform acquisition
data1 += data; // Add to previous acquisitions
}
exponential_multiply(data1, -20.0); // Apodize summed FID's
data1 = FFT(data1); // Fourier transform summed FID
FM_1D("sp.mif", data1, 13, 5, -1000, 1000); // Plot to FrameMaker
cout << "\n\n"; // Keep screen looking nice
}
Do not be fooled by the simplistic nature of this demo. Although GAMMA can be
used for fun and learning as was done here, it can also be used to look
at coupled relaxation, exotic pulse sequences, exchange effects,
powder averages, .... The idea for this page is just to show how easy it is
to get things done using the platform.
|