The EDDIE theory
Nuclear Magnetic Resonance is an experimental technique that makes use of magnetic fields and radiofrequency pulses to probe the response of the intrinsic magnetic moment (spin) of atomic nuclei. NMR is a complex and wide branch of experimental physics, and I can't talk about all, or even a significant fraction, of it here. If you want to learn more about NMR in general, you can try the two cardinal texts on the topic, "The principles of Nuclear Magnetism" by A. Abragam (very hard) or "Principles of Magnetic Resonance" by C.P. Slichter (quite hard). If you want to go for a simple approach which leaves out all of the most complex quantum mechanics stuff, you may want to try the excellent "Understanding NMR spectroscopy", by J. Keeler, which has the remarkable property of being not only easy to understand and very down-to-earth, but also free to download on top of that! You can find it here. Finally, for an excellent view on some of the more advanced solid-state NMR techniques, a very good book is "Principles of Nuclear Magnetic Resonance in one and two dimensions", by R.R. Ernst, G. Bodenhausen and A. Wokaun. On the other hand, since all this great and acknowledgeable people has already written mountains on pages on NMR and its misteries, in this page I will just lay down in the simplest way possible the essential elements required to understand the purpose and way of working of EDDIE, and why you could want and try using it.
The program is command-line only for now (so you need to run it from your system's console), but it's very simple and fast to use. The details about how to make it work can be found in the user manual, available in the "Downloads" section. Here instead you will find information about dipole-dipole interaction and the theory developed by M. Pieruccini and me which is at the core of EDDIE.
NMR in a nutshell
As I said earlier, NMR works by applying a static magnetic field to a sample and then sending radiofrequency pulses to it in order to induce quantum transitions on its atomic nuclei. Subatomic particles have a property called "spin", which is an intrinsic angular and magnetic moment. This allows them to behave as small compasses: in an external magnetic field, they will align with it. Some atomic nuclei, being basically bunches of protons and neutrons stuck together, have this property as well: amongst the most notable ones are hydrogen, deuterium, nitrogen, and some isotopes of carbon (13C), oxygen (17O), as well as many other elements. Unfortunately, not all elements possess a non zero spin, and thus not all elements (or isotopes thereof) can be observed by NMR. However, if they do possess a spin, applying a strong enough magnetic field (in NMR we usually range from 1 to 10 Teslas, but both lower and higher fields can be used in special circumstances), they behave exactly a described before: they align their spins with the field. When this happens in an NMR experiment we will say that their magnetization lies along the Z axis.
Having the spins of a sample aligned along the Z axis doesn't make for very interesting experiments. When they do, all that happens is that the Z-component of their spin, a.k.a. its magnetic quantum number, is constant and in an equilibrium condition. The spin however is not COMPLETELY aligned with the magnetic field: that would let us know everything about it, and that's against Heisenberg's indetermination principle. What actually happens is that there is some kind of - unknowable and unmeasurable - X-Y axis component as well. We can't see it. All we know is that it precesses around the static magnetic field, at a speed called the Larmor frequency and determined by a property of atomic nuclei called the gyromagnetic ratio multiplied by the static magnetic field applied. You can find a table of some major values for the gyromagnetic ratio here.
Figure 1 - A spin's movement (red arrow) precessing around the z axis
So how can we observe any signal at all? Well, in NMR experiments the sample is wrapped into a coil of conductive wire, aligned along either the X or Y axis (it's arbitrary, really. The important thing is that it has to form a 90° angle with the static magnetic field). This means that it's possible to measure X or Y magnetization by measuring their induction on the coil - since a magnetic field rotating inside a coil generates an electric potential, and measuring electric quantities is extremely easy. In the equilibrium state, however, we already saw that the spins do not have an X or Y observable component. This is where the radiofrequency (RF) pulses come into play. Using a resonant pulse - an E.M. wave with the same frequency as the Larmor frequency of the observed nucleus - of proper length, it is possible to bring the main magnetization in the X-Y plane, and make it observable. From a classical point of view, this corresponds to making the spin magnetization precess around the magnetic part of the electromagnetic wave for a quarter turn, until it ends up in the horizontal plane (for example, imagine rotating it around Y in Figure 1). From a quantum-mechanical point of view, we are actually inducing transitions between the Zeeman energy levels of the spins. Either way, the result is the same: the magnetization is ready to be observed, but is into a precarious condition, and "wants" to go back to equilibrium. This causes it to disappear over time. The way this disappearance, or relaxation, takes place tells us many things about what is going on nearby the nuclei we are observing.
Dipole-dipole interaction
In principle, any spin in a magnetic field is meant to rotate around it with its Larmor frequency. For example, for an hydrogen atom in a 1 Tesla magnetic field, this frequency will be around 42 MHz. The measurement coil is linked to a spectrometer which deconvolves the signal - basically, it's not too different from tuning an AM radio - and shows us its intensity. So, for a constant 42 MHz signal, all that we should observe is a straight line. However, of course, reality is much more complex than that (luckily, since straight lines are seldom interesting). Many effects contribute to giving a different shape to the observed signal, which eventually fades away and decays as the spins try to go back to equilibrium. This signal is called for this reason a Free Induction Decay, or FID. In this paragraph I will focus on one of these effects, namely the dipole-dipole interaction. From here afterwards the discussion is bound to become a little more technical, so bear with me and, if you're not interested in the equations, just skip quickly through them.
Dipole-dipole interaction is the interaction that arises when two NMR active nuclei are close enough for them to directly interact with each other. This happens because a spin is a magnetic dipole and thus generates a magnetic field itself; in this way, a nearby spin will not experience the basic static magnetic field, let's call that B, but the static magnetic field plus a (positive or negative) contribution from its neighbour, so that the total field is B'=B+dB. This will cause its signal to be slightly off from the theoretical frequency, usually of something around 100 kHz. The Hamiltonian term describing this interaction rigorously is:
Equation 1 - The dipolar Hamiltonian
with the gammas being the gyromagnetic rations of the two nuclei involved, the I are the spins and r represents the distance between the nuclei. When this equation is fleshed out and the terms of order higher than the first are cut out (which is perfectly OK for most purposes), and if we solve it for the case of a basic NMR experiment where the spins have been brought in the X-Y plane, turns out that the observed FID will go like:
Equation 2 - The dipolar FID
All the terms coming before t represent the effect of the magnetic field of one spin on the other one, that is, the frequency shift caused by dB. The entirety of the constant term has been grouped under the name b for shortness. As for the new term, theta is the angle formed between the line connecting the two nuclei and the Z axis (see Figure 2).
Figure 2 - The angle "theta" controlling the intensity of dipolar interaction
In this way, the intensity of the dipolar interaction is controlled by the geometry of the system. Now, in a solid sample of organic material, for example, there can be a very high concentration of hydrogen atoms, all close enough to interact with each other. In the hypothesis that these atoms are perfectly still, that is, at a very low temperature, each of them will contribute with its own signal to the overall FID. But each pair will contribute with its own theta, and this will create a lot of cosine waves with different frequencies that will ultimately cancel each other out. The consequent dipolar decay is visible in Figure 3.
Figure 3 - The FID signal for an average of variously oriented dipoles
Now, here we are simplifying things, since in reality if there are huge densities of active spins each of them will interact with many others, and not only one. This can smoother the shape seen in Figure 3, but it tends to stay very similar at short times (that is the first huge peak, and possibly the first valley). Another thing is: atoms DO NOT stay still. They almost never do, and surely they don't at everyday temperatures. And if they move, then the angle theta will vary while the signal unfolds. The FID can then be expressed only with an integral:
Equation 3 - Dipolar FID in presence of motions
because now theta has become time dependent. Unfortunately, this dependency is a completely random one: we do not expect atoms to move with a precise path in this case, but rather to wiggle around as they are hit by other atoms. Its effect is to average the value of the interaction constant - and since the average of the term in square parentheses over the whole solid angle is zero, if the motions are fast enough the dipolar interaction basically disappears (this is also the principle on which is based Magic Angle Spinning, one of the most famous NMR techniques to avoid nuisances caused by dipolar interaction). Keep in mind that "fast enough" in this context means fast comparatively to the time scale over which the signal evolves. The entire signal represented in Figure 3 lasts less than 1 millisecond: so the motions have to be fast compared to that.
The shape in Figure 3 comes from an average performed over Equation 2, and there are analytical expressions to describe it properly, both approximated and exact. On the other hand, when the molecular motions become really fast, the FID tends to simply become an exponential, and describing it is easy as well. In the middle grounds, however, there is no exact formulation available. A theory often used is the one from P.G. Anderson and P.R. Weiss [Rev. Modern Physics 25 (1953), 269-276], but it is an approximated theory and it relies on the assumption of gaussian distribution of the dipolar fields for lack of better knowledge. The EDDIE model was born in an attempt to overcome this difficulty, at least for a specific kind of situation.
EDDIE theory
The EDDIE model was developed by M. Pieruccini with my contribution [Jour. Mag. Res. 223 (2012), 138-147] with the purpose of finding an analytical solution for the integral in Equation 3. The idea was to apply this solution to the specific case of segmental relaxation in polymers. Therefore, the motion we wanted to describe was mostly a rotational one. In the end, the model we chose was a simple diffusional one. In practice:
1) we considered an ensemble of spins interacting only in pairs as seen in Figure 2,
2) with a constant distance r between them and
3) with a theta angle that varies following a process of isotropic rotational diffusion of the spin pairs, that is, a random walk on the solid angle, with diffusivity D.
This is not entirely realistic for most systems, but, as shown in our article, we have reason to think it is good enough. What the model actually does is solving out the integral in Equation 3 by carrying out an average over all possible paths for a spin pair in this diffusional motion. The full solution is given in the paper; I did not contribute to it, in fact, so I can't say much about the mathematical details myself. The final solution comes in the form of a Fourier anti-transform, which can be calculated by making use of a complex analysis theorem known as the residue theorem (residue theorem on Wikipedia). This allows us to reduce the integral to a sum of "residues" of a function W calculated in its poles, that is, its singularities. The expression of the FID thus becomes:
with R a normalization factor (basically, FID(t) for t=0), the omegas representing the poles, and the sum carried out over a number of poles n.
The function W is written as a continuous fraction:
where the various coefficients are:
The poles of the W correspond to the zeros of its denominator. Since this denominator can be expressed as a continuous fraction, with k even and going to infinity, it becomes a polynomial of infinite degree and thus has infinite poles. In order to compute the FID function, like EDDIE does, one has to truncate this process at a certain point.
It is important to understand because poles are, together with coupling constant b and diffusivity D, the third parameter needed to define a FID function with EDDIE. Since the function we need to integrate to build an ideal FID has infinite poles, all that EDDIE is able to calculate is an approximation. Luckily, this is good enough. In fact, EDDIE can calculate FIDs with up to 30 poles; the possibility to use more than this many has been disabled because it tends to produce errors in the output. The importance of having an high number of poles decreases as D increases. At D=0, a high number of poles guarantees that the FID will be exact for a longer time. For example, 25 poles are usually more than enough to deal with a FID signal of 100 microseconds or so. When motions are faster, the number of poles becomes less important, and ultimately 10 poles or so are more than enough to deal with most signals.
Besides this, the FID calculated by EDDIE is defined by the coupling strength b and the diffusivity D, as said above. Both the parameters are expressed in kHz: the first one is a physical parameter of the system, related to the spins involved in the signal, their distance and the kind of chemical species, while the second is, of course, what we want to find out, that is, the speed of molecular motions in our system. What really controls the shape of the FID is the adimensional ratio between these two, D/b. If you want to play around a little with the system and see what actually happens, you can use the applet below. It features a 25 poles calculated FID and the slider allows you to change D/b over a wide range of values (in fact, it works on a logarithmic scale, so you can explore entire orders of magnitude), so that you can see dynamically how the motions going faster and faster will change the shape of the signal.
(Please note that there might be a little bug which makes the applet not plot anything the first time you see it... just move the slider and it'll plot and work right)
EDDIE is able to perform two tasks. One is simulation of the FID signal so calculated (similarly to the Java applet seen above, though with more control over the various parameters and with a textual output that needs to be plotted separately); this is quite straightforward. The other task is fitting of experimental data with the new function. Since there is no analytical form for the function, the fitting can only be performed through the use of a simplex algorithm. In fact, the program uses an original implementation of the "global bounded Nelder-Mead" search algorithm found in the work of M.A. Luersen, R. Le Riche and F. Guyon [Struct. Multidisc. Optim., DOI 10.1007/s00158-003-0320-9], which tries different classic simplex searches in order to cover the most part of a limited domain and be sure to find the correct solution. For this reason, before any fitting in EDDIE one has to indicate his guesses about the minimum and maximum expected values for b and D. The poles, instead, are found thanks to a Jenkins-Traub root finding algorithm; in this case the code was written by Henrik Vestermark.
For anyone who wants to learn more about the solution for the NMR FID used in EDDIE, its derivation and its testing on simulated and experimental data, read S. Sturniolo and M. Pieruccini's paper:
http://www.sciencedirect.com/science/article/pii/S1090780712002583
For the original paper from Luersen, Le Riche and Guyon about the simplex method used for the fitting, you can download it from the author's page:
http://www.emse.fr/~leriche/publications.html
You can find Henrik Vestermark's code at his page:
http://www.hvks.com/Numerical/ports.html
And finally, if you're interested into trying EDDIE yourself, head towards the Downloads section!