Friday, December 27, 2013

Fourier Series

One of the most important mathematical techniques for a physicist is the Fourier series. I discussed Joseph Fourier, the inventor of this method, previously in this blog. In the 4th edition of Intermediate Physics for Medicine and Biology, Russ Hobbie and I discuss the Fourier series in Sections 11.4 and 11.5.

The classic example of a Fourier series is the representation of a periodic square wave: y(t) = 1 for t between 0 and T/2, and y(t) = -1 for t between T/2 and T, where T is the period. The Fourier series represents this function as a sum of sines and cosines, with frequencies of k/T, where k is an integer, k = 0, 1, 2, …. The square wave function y(t) is odd, so the contributions of the cosine functions vanish. The sine functions contribute for half the frequencies, those with odd values of k. The amplitude of each non-zero frequency is 4/πk (Eq. 11.34 in IPMB), so the very high frequency terms (large k) don’t contribute much.

Being able to calculate the Fourier series is nice, but much more important is being able to visualize it. When I teach my Medical Physics class (PHY 326), based on the last half of IPMB, I stress that students should “think before you calculate.” One ought to be able to predict qualitatively the Fourier coefficients by inspection. Being able to understand a mathematical calculation in pictures and in physical terms is crucially important for a physicist. The Wikipedia article about a square wave has a nice animation of the square wave being built up by adding more and more frequencies to the series. I always insist that students draw figures showing better and better approximations to a function as more terms are added, at least for the first three non-zero Fourier components. You can also find a nice discussion of the square wave at the Wolfram website. However, the best visualization of the Fourier series that I have seen was brought to my attention by one of the PHY 326 students, Melvin Kucway. He found this lovely site, which shows the different Fourier components as little spinning wheels attached to wheels attached to wheels, each with the correct radius and spinning frequency so that their sum traces out the square wave. Watch this animation carefully. Notice how the larger wheels rotate at a lower frequency, while the smaller wheels spin around at higher frequencies. This picture reminds me of the pre-Copernican view of the rotation of planets based on epicycles proposed by Ptolemy.

What is unique about the development of Fourier series in IPMB? Our approach, which I rarely, if ever, see elsewhere, is to derive the Fourier coefficients using a least-squares approach. This may not be the simplest or most elegant route to the coefficients, but in my opinion it is the most intuitive. Also, we emphasize the Fourier series written in terms of sines and cosines, rather than complex exponentials. Why? Understanding Fourier series on an intuitive level is hard enough with trigonometric functions; it becomes harder still when you add in complex numbers. I admit, the math appears in a more compact expression using complex exponentials, but for me it is more difficult to visualize.

If you want a nice introduction to Fourier series, click here or here (in the second site, scroll down to the bottom on the left). If you prefer listening to reading, click here for an MIT Open Courseware lecture about the Fourier series. The two subsequent lectures are also useful: see here and here. The last of these lectures examines the square wave specifically.

One of the fascinating things about the Fourier representation of the square wave is the Gibbs phenomenon. But, I have discussed that in the blog before, so I won’t repeat myself.

What is the Fourier series used for? In IPMB, the main application is in medical imaging. In particular, computed tomography (Chapter 12) and magnetic resonance imaging (Chapter 18) are both difficult to understand quantitatively without using Fourier methods.

As a new year’s resolution, I suggest you master the Fourier series, with a focus on understanding it on a graphical and intuitive level. What is my new year’s resolution for 2014? It is for Russ and I to finish and submit the 5th edition of IPMB to our publishers. With luck, you will be able to purchase a copy before the end of 2015.

Friday, December 20, 2013

The Last Question

Entropy and its role in the Second Law of Thermodynamics is one of the fundamental ideas of all science. One can think of entropy roughly as a measure of the disorder within a system. An interesting feature of entropy is that it is not conserved. Rather, it tends to increase over time (the system becomes more disordered). In the 4th edition of Intermediate Physics for Medicine and Biology, Russ Hobbie and I write
…under what conditions can the entropy of a system be made to decrease?

The answer is that the entropy of a system can be made to decrease if, and only if, it is in contact with one or more auxiliary systems that experience at least a compensating increase in entropy. Then the total entropy remains the same or increases. This is one form of the second law of thermodynamics. For a fascinating discussion of the second law, see Atkins (1994).
Nine Tomorrows A short story collection by Isaac Asimov containing The Last Question, superimposed on Intermediate Physics for Medicine and Biology.
Nine Tomorrows,
A short story collection by
Isaac Asimov containing
“The Last Question.”
The reference is to P. W. Atkins’ 1994 Scientific American book The 2nd Law: Energy, Chaos and Form. It is a great book written for a layman with little or no mathematics that clearly conveys the insights provided by the second law.

The very first course I ever taught, at Vanderbilt University in the fall of 1995, was an undergraduate thermodynamics class. When we talked about entropy, I had all my students read the short story “The Last Question” by Isaac Asimov. This marvelous tale speculates about what will happen to the universe as entropy slowly but steadily increases. Regular readers of this blog know that I am a big Asimov fan (for instance, see here), and The Last Question is one of his best stories. That is not just my opinion. Asimov himself said it was his favorite short story of all he had written. You can read it here, or listen to the Good Doctor himself read it below.

I Robot, by Isaac Asimov, superimposed on Intermediate Physics for Medicine and Biology.
I Robot, by Isaac Asimov.
For those wanting more Asimov short stories, I recommend “Nightfall”and “The Ugly Little Boy.” Also I, Robot is a collection of loosely related short stories based on the three laws of robotics (please, skip the 2004 film by the same name featuring Will Smith). One big Asimov fan posted reviews of all Asimov’s books. Enjoy.

Finally, let me share one more crucially important point. says you still have time to order IPMB and have it delivered by Christmas. If you plan on putting a copy of IPMB in each of your loved one's stockings (and who doesn’t?), you had better order soon!

Friday, December 13, 2013

Electricity and Magnetism

Electricity and Magnetism, 3rd Edition, by Edward Purcell and David Morin, superimposed on Intermediate Physics for Medicine and Biology.
Electricity and Magnetism, 3rd Edition,
by Edward Purcell and David Morin.
I have always enjoyed Edward Purcell’s textbook Electricity and Magnetism, which is Volume 2 of the Berkeley Physics Course. I love the book so much that I included it in My Ideal Bookshelf that I presented in this blog a few weeks ago. I own a copy of the first edition, with its orange cover that is now faded and falling apart. The second edition was published soon after I completed my undergraduate physics degree from the University of Kansas, so I have not used it much.

This year, a 3rd edition of the book was published, with coauthor David Morin (Purcell died in 1997 so he had no input on the 3rd edition). In the preface to the 3rd edition, Morin describes his goals:
For 50 years, physics students have enjoyed learning about electricity and magnetism through the first two editions of this book. The purpose of the present edition is to bring certain things up to date and to add new material, in the hopes that the trend will continue. The main changes from the second edition are (1) the conversion from Gaussian units to SI units, and (2) the addition of many solved problems and examples.
The use of SI units is interesting, because apparently Purcell resisted this change when preparing the 2nd edition. When I was an undergraduate around 1980, almost all introductory textbooks had switched to SI units, so I “grew up” with them. Therefore, I agree with Morin about the usefulness of this change. In the preface he writes
The first of these changes [to SI units] is due to the fact that the vast majority of courses on electricity and magnetism are now taught in SI units. The second edition fell out of print at one point, and it was hard to watch such a wonderful book fade away because it wasn’t compatible with the way the subject is presently taught. Of course, there are differing opinions as to which system of units is “better” for an introductory course. But this issue is moot, given the reality of these courses.
The other big change is a lot of new homework problems and worked examples. This resonates with me, because one big change that Russ Hobbie and I made to the 4th edition of Intermediate Physics for Medicine and Biology is many new homework problems. Morin offers some advice to the reader in his preface, which applies equally well to readers of IPMB. One reason we only distribute homework solutions to instructors rather than students is to encourage students to struggle with these problems on their own.
Some advice on using the solutions to the problems…If you are having trouble solving a problem, it is critical that you don’t look at the solution too soon. Brood over it for a while. If you do finally look at the solution, don’t just read it through. Instead, cover it up with a piece of paper and read one line at a time until you reach a hint to get you started. Then set the book aside and work things out for real. That’s the only way it will sink in. It’s quite astonishing how unhelpful it is simply to read a solution. You’d think it would do some good, but in fact it is completely ineffective in raising your understanding to the next level.
One unique feature of Electricity and Magnetism is that magnetism is introduced as a consequence of electricity and special relativity. In almost all other books, this relationship is omitted or presented as an advanced topic. It is an interesting approach, about which I have mixed feelings. Morin writes
The intertwined nature of electricity, magnetism, and relativity is discussed in detail in Chapter 5. Many students find this material highly illuminating, although some find it a bit difficult. (However, these two groups are by no means mutually exclusive!)
If I was teaching our undergraduate electricity and magnetism class next semester, would I use the 3rd edition of Electricity and Magnetism? I would certainly consider it. In my opinion, its main competition would be David Griffiths’ textbook Introduction of Electrodynamics. I used that book last time I taught electricity and magnetism, and it is also outstanding. It is not cited in IPMB, which makes me rather sad, as it is another one of those much-treasured books. Just the thought of reading first Purcell and then Griffiths, trying to decide which to use, sounds so fun that I am tempted to volunteer to teach electricity and magnetism again.

For those wanting to learn more about Morin’s new edition of Electricity and Magnetism, read the interview with him on the Physics Today website. You can find a review of the book here. Additional information is on the book's website.

Friday, December 6, 2013

A Simplified Approach for Simultaneous Measurements of Wavefront Velocity and Curvature in the Heart Using Activation Times

I am one of the coauthors on a paper published recently that analyzes how to determine properties of a cardiac wave front from measurements of wave front arrival times (Mazeh, Haines, Kay, and Roth, “A Simplified Approach for Simultaneous Measurement of Wavefront Velocity and Curvature in the Heart Using Activation Times,” Cardiovascular Engineering and Technology, Volume 4, Pages 520–534, 2013). The lead author, Nachaat Mazeh, is a former grad student of mine who obtained his PhD from Oakland University, and now works in the Beaumont Health System. David Haines is the Director of the Heart Rhythm Center at Beaumont, and is well known for his work on radiofrequency ablation of cardiac tissue. Matthew Kay is a professor of engineering at The George Washington University. In this paper, we obtain the wave front properties from measurement of four arrival times. The result is just simple enough to make into a new homework problem, typical in difficulty to those in the 4th edition of Intermediate Physics for Medicine and Biology.
Section 10.11

Problem 43 Suppose you measure the arrival time of an action potential wave front at four points (1-4) in a diamond pattern, each a distance b from the central point (red). Calculate the wave front speed, direction, and curvature from these four measurements.
A figure showing how to measure the speed, direction, and curvature of a cardiac wave front using four electrodes.

a) Assume the wave front is circular and propagates outward from the origin. Use the law of cosines to write r1, r2, r3, and r4 (the distance of each electrode to the origin) in terms of r0, b, and the angle θ.
b) Pull a factor of r0 outside of the square root in each of your four expressions from part a).
c) Assume r0 is much greater than b, and perform a Taylor expansion of each of the four expressions in terms of the small parameter ε = b/r0. Include terms that are constant, linear, and quadratic in ε.
d) Write the arrival time at each electrode (n=1, 2, 3, and 4) as tn=rn/v, where v is the wave speed.
e) Let Δtij=ti – tj. Find expressions for Δt13 and Δt24 in terms of b, θ, and v. Solve these expressions to determine v and θ in terms of Δt13, Δt24, and b.
f) Find expressions for Δt14 and Δt23 in terms of b, θ, and v. Now (and this is the most difficult step), find an expression for the radius of curvature, r0, in terms of b, Δt13, Δt24, Δt14, and Δt23.

There are several advantages and several disadvantages to the expressions you will derive. The advantages are that the calculations require only four measurements of arrival time, and they provide not only the speed and direction but also (somewhat unexpectedly--at least to me) the radius of curvature, r0. The radius of curvature is important for propagation, because highly curved wave fronts propagate more slowly than nearly flat wave fronts. The radius of curvature at the core of a spiral wave is highly curved, and this curvature influences properties of the spiral wave such as how fast it rotates. There are some important limitations. First, a close examination of your expression for the radius of curvature will reveal that the method gives an indeterminate expression for propagation at angles of θ = 45, 135, 225, and 315°. Second, the expressions contain the differences of activation times. In fact, the radius of curvature depends on the difference of a difference of activation times. If these activation times are all similar, then they need to be known precisely for the calculation of their differences to be accurate. The calculation assumes the wave front is circular, although really the wave front only needs to be circular locally, so this should not be too bad an approximation. The method also is based on the assumption that b is much less than r0.

Despite these limitations, I think the expressions should be useful for characterizing properties of wave fronts in the heart. It may be particularly useful for obtaining wave front speed, direction, and curvature in computer simulations, where the calculation is computed over a regular two-dimensional Cartesian grid and where noise in the activation times may not be a big concern.