Pan flute physics We are trying to create a custom pan flute. With some searching, we found a formula relating the length of a closed cylinder with the frequency at which it resonates, namely L = c / 4f, with c being the speed of sound. Based on this, we calculated that a cylinder to produce 880 Hz, or A5, would need to be about 97.4 mm long. But, having printed such a cylinder with a 3D printer, when blown, it produces a frequency of about 840 Hz. We have checked and re-checked the dimensions, and the plastic does not appear to be porous at all. Why are we getting a different frequency than predicted by the theory?
 A: EDIT: I feel that some of the comments might have missed the point of this answer: I'm not necessarily claiming that the reason for the error is because of the speed of sound, but rather that a 5% error is not unreasonable without more information on the experimental setup.
Nevertheless, I feel that my answer is not incorrect (though I'll admit that my original estimate of $\Delta c \approx 20$m/s might have been a little overzealous), so I have changed it to (I feel) a more reasonable $5$m/s.

Well, I'm not expert at this, but it sounds like a pretty decent result, given the conditions! It's an error of under 5%, which -- at least in the undergraduate labs I've worked in -- is pretty acceptable.
The key is to ask yourself how certain you are of the final frequency, and I'm not even talking about the theoretical result, which itself might need to be adjusted depending on the level of accuracy you require. Assuming your formula holds: $$f = \frac{c}{4 L},$$
these quantities are not defined to infinite precision, and they have their own uncertainties which propagate into the frequency. A standard result from error analysis shows that the relative uncertainty you can expect in the frequency is more or less: $$\frac{\Delta f}{f} = \sqrt{\left(\frac{\Delta c}{c}\right)^2  + \left(\frac{\Delta L}{L}\right)^2}$$
Now, $c$ the speed of sound is not necessarily a constant (it changes with the temperature and pressure, for example). Wikipedia deals with this in some detail, and it seems like the speed could vary from around 340 m/s (at 15$^\circ$C) to around 350 m/s (at 30$^\circ$C), and this isn't taking into account the effect of pressure. So let's take $\Delta c \approx 5$m/s. Similarly, the measurement of your length will have some uncertainty, which I assume will be of the order of a millimetre or so (I could be wrong, I have very little experience with the precision of 3D printers). In this case,
$$\frac{\Delta f}{f} = \sqrt{\left(\frac{5}{340}\right)^2  + \left(\frac{1}{97.4}\right)^2} \approx 0.02.$$
In other words, using these uncertainties, you'd get a relative error of roughly 6%, which seems to line up quite nicely with the value that you have. So when you say that you calculated that such a cylinder should produce 880 Hz, it would be more appropriate to say that your calculation would give a frequency of 880 $\pm$ 20 Hz, and your answer does fall quite close to that range, depending on how certain you are of your estimate of "about" 840 Hz.
Since the majority of the error comes from the uncertainty in $c$, it should be possible to do better if you have a better estimate for it, but I do remember it being notoriously difficult to settle on.

EDIT:
All of this being said, I have indicated above that the theoretical formula the OP used may be inadequate, and it looks like alephzero's answer could be correct, but without more details about your apparatus, I can't be sure.
However, taking it at face value, if the formula is indeed: $$f = \frac{c}{4(L + 0.6 D)},$$ then in order to obtain a frequency of 840 Hz given a length of 97.4 mm, one would require $D \approx 8$mm, which might well be the case. Nevertheless: this just means that we have one more term to add to our error analysis! Now, again, I am not sure of the precision to which you know $D$, but if it's up to 1mm, then you can show that
$$\frac{\Delta f}{f} = \sqrt{\left(\frac{\Delta c}{c}\right)^2 + \frac{(\Delta L)^2 + (0.6 \Delta D)^2}{(L + 0.6 D)^2}} \approx 0.02,$$
which again seems to indicate that a 2% error is pretty much the best you can do.
A: Your formula ignored the "end correction" to the length of the pipe. The standing wave in the air does not end exactly at the end of the pipe, but at a distance approximately 0.6D outside it, where D is the pipe diameter.
If your pipe diameter was about 7mm, that would explain the difference between 880Hz and 840Hz.
Note that the "exact" length correction will also depend on the change to the air flow pattern around the pipe caused by your face, when you are blowing the instrument, so you will always have to make some minor adjustments by trial and error.
See https://en.wikipedia.org/wiki/End_correction.
