Friday, February 10, 2012

The Helmholtz Resonator

I was taking first-year Engineering Physics when we had a lab where we were supposedly going to measure the speed of sound in air. I didn't understand it at the time, but this is a nasty trick they pull on you in school. There is a formula that has the speed of sound in it, and you measure a bunch of parameters and plug them into the formula and the result is you get the speed of sound. It's very wrong because you don't know what you're doing, but that's how they teach it.

This was a good example of the method. You blow across the top of a beer bottle and note the frequency. If you're a musician, you can do it by ear, assuming you know that A is 440 Hz. Well, you also have to know how the ratios go: if A above middle C is 440, the next A down is 220; the E in between would be 330. You get the idea. For accurate work, you're supposed to factor in the twelfth root of two, but we don't need to talk about that here. I think in the lab we had a microphone and we put the waveform into an oscilloscope, where we used the time calibration to work out the frequency.

How do you get the speed of sound from that? From a formula, of course. I looked up the Helmholtz Resonator on Wikipedia, and there's a pretty good article, including this formula:

You just blow across the beer bottle to get the frequency, then measure the length and cross-sectional area of the neck, divide by the volume, take the square root and there's the speed of sound. Simple. My only question is: how are you supposed to learn physics by doing all that?

The Wikipedia article is actually pretty good. They don't give you that formula right off the bat: they actually explain what is going on physically, which involves the pressure and density of air; then they show you how you can collapse that formula by expressing the speed of sound as a function of those two parameters. But that's really a math trick, and it hides the real physics. It's no way to teach students.

I might have only been in first year, but I wasn't going to plug numbers into a formula that someone else pulled out of thin air. I was going to figure out for myself how to calculate the frequency. That's when I came up with the idea of using the energy methods, which I talked about the other day in connection with the tides.

Here's how the physics works: it's your basic mass on a spring. You've got a plug of air in the neck, which we treat as being incompressible. That's the mass. Then you've got the volume of air inside the bottle, which is compressible to accomodate the motion of the plug. That's the spring. When you have a mass on a spring, there is kinetic and potential energy. At the moment of maximum displacement, all the energy is in the form of compressional energy in the spring. One-quarter cycle later, all that energy has been transferred into kinetic energy of the moving mass.

The thing that makes these calculations especially easy to follow is the fact that the frequency of the oscillation normally doesn't depend on the size of the oscillation. So we can take an arbitrary displacement, e.g. 1.0 mm, and work out all our energies on that basis. We just need to know the density of air and the compressibility.

The density of air is just 1.3 kg/m^3, as I'm sure you know right off the top of your head. (Really. You ought to.)  The compressibility is a little harder to justify. We know that the pressure of air is 100 kiloPascals, or 100 Newtons per square meter. What does this tell us, about the compressibility of the air inside a bottle? It's a little tricky, and here's how it works.

If you compress the air in the bottle by one percent, it's easy to believe the pressure should go up to 101 kPa.  (Actually, we're supposed to worry about something called the isothermal case versus the adiabatic case here, but let's not.) The work you have to do is (pressure)x(volume), but it's not the whole 100 kPa you're working against, it's only the difference of 1kPa, because you've still got 100 kPa atmospheric pressure behind you. So the energy to compress a 300ml beer bottle by 3ml is just (1kPa)x(3ml) which comes to 0.3 joules if you work your units correctly. (EDIT: That's a mistake. It should come to 3 millijoules. Sometimes we get things wrong.)  Actually, it's just half of that because you're not working against the whole 1kPa through the whole distance: the resistance starts off at zero and only builds as you compress it. That's why a lot of energy formulas start off with a factor of 1/2, as I discussed in my earlier article about E=mc^2.

Maybe you'd like to try the calculation yourself to see if we get the same answer. Here's a picture of a typical beer bottle:
The idea is to figure out how far the plug had to move to compress the volume by one percent. (It comes out to an absurdly large figure, but that's OK for purposes of calculation). Then figure out the weight of the plug, and how fast it has to travel to have that amount of kinetic energy. Then, relating the maximum speed and the distance it has to travel to complete a cycle, you ought to get a pretty good handle on the frequency.

Knock yourself out.

No comments: