## Tuesday, September 25, 2012

### Solving The Raindrop Problem

Have you ever noticed that when you're driving during a rainstorm, the number of raindrops hitting your windshield seems to increase along with your speed? I first noticed it soon after I started driving, and ever since then I've intended to sit down and work out a formula to explain it. (Living in Hilo and having it rain frequently while driving up and down from Mauna Kea has tended to keep “the Raindrop Problem” as I've come to call it fresh in my mind.)

I've toyed with it on occasion, but never definitively solved it, so I finally decided to sit down and work it out rigorously. So, without further ado I shall put my years of mathematical training to the test and attempt to figure out just how the amount of rain hitting your windshield changes as a function of your speed, while simultaneously trying to explain it in terms you can follow. Ideally, I'd like to get a graph out of it.

We start out in the grand tradition of physicist everywhere by considering a very simple, idealized case. Let us assume that for our purposes, the density of raindrops is uniform everywhere that we are considering. On a small enough spatio-temporal scale this is not a bad assumption. Furthermore, assume that the raindrops are falling straight down, with no gusts of wind or other forces acting on them other than gravity and air resistance. Again, a fairly plausible scenario, especially for a lot of the rain we get in Hilo, which often comes without any accompanying wind. A steady or gusty wind such that the raindrops had a set non-zero horizontal velocity or acceleration could also be taken into account, but is more complicated than I'd like to get into right now.

Let's begin by assuming the simplest possible case. Imagine a sheet of glass of width w and height h laying horizontally under a steady, uniform rain with evenly distributed raindrops falling at uniform velocity r (for “raindrop”. I'm saving v for later). Now, we want to know how many raindrops will hit the glass in a time interval $$\Delta t$$ (pronounced "delta-t", if you don't know).

If we know that the raindrops are falling at speed r, then we can multiply by the time interval $$\Delta t$$ to figure out how far they fall during that interval. Thus, any raindrop within a distance  $$d=||r||\cdot\Delta t$$ above the glass will hit it within time interval $$\Delta t$$. (The double vertical bars around the ‘r’ serve to remind us that it is technically a vector quantity and indicate that we want the length [or magnitude] of the vector in this equation.)

Intuitively, this gives us a rectangular box of volume $$V=d\times h\times w$$ over the sheet of glass within which raindrops will be able to hit the glass in time interval $$\Delta t$$. Less intuitively but more rigorously this can be achieved by a double integration of the raindrop fall distance   $$d=||r||\cdot\Delta t$$ over the sheet of glass:
$V=\int_{0}^{h}\int_{0}^{w}||\overrightarrow{r}||\cdot\Delta t\ dx\,dy$
You may refer to the image below to help keep all these symbols and concepts straight:

At this point we've nearly solved the problem of how many raindrops will hit the sheet of glass in time interval $$\Delta t$$, which for our purposes will be 1 second. We just need to know the numerical density N of raindrops per unit volume times the volume where raindrops will be able to hit the glass. Putting everything we have so far into a formula, we have
\begin{align}n&=N\cdot V\\ &=N\cdot h\cdot w\cdot ||r||\cdot\Delta t\end{align}
This is all well and good, but there are two additional factors we must take into account to better approximate a car's windshield. Those factors are the angle of the windshield, and the fact that we are interested in a moving windshield.

We will now consider each effect independently, before adding them together to get a full picture of the situation.

Let's start by introducing a non-zero angle of repose to the glass sheet. Refer to the picture below to see what I mean (I've added a coordinate system for future reference):

Now, the basic problem remains the same: figuring out the volume marked by the blue parallelograms and the glass sheet. This figure is known in geometry as a parallelepiped (PARR-uh-lel-EH-pi-ped), and has the following formula for its volume (from vector calculus)
$V=|\overrightarrow{a}\cdot(\overrightarrow{b}\times \overrightarrow{c})|$
where a, b, and c are the vectors that make up three of the sides that meet at a vertex and the $$\times$$ sign and dot have special meanings because these are vectors. (I'm not being super consistent about notating all my vectors all the time due to the constraints of working in a blog post, but I'll try to keep it clear when the distinction is important.)

“But wait a minute,” you may be thinking to yourself at this point. “Wouldn't it be easier in this case, in order to find the volume, to simply multiply the height h by a factor of $$\cos(\theta)$$ to account for the diminished surface area as seen from above (where $$\theta$$ runs between $$0^\circ$$ for a flat sheet and $$90^\circ$$ for a vertical one), and then multiply by d and w?”

Indeed it would, astute reader. In this case, such a formula would be simpler. In fact, the formula for the volume would be simply $$V=w\cdot\cos(\theta)\cdot h\cdot||r||\cdot\Delta t$$.

However, the second effect we will be considering is the velocity of a moving car and attached windshield, and since I foresee vector addition on the horizon I think it would be prudent to begin incorporating vectors into the picture now.

That brings us to considering the velocity of the car (and by extension windshield) intself. Let's assume that the car is moving with a constant horizontal velocity in the positive x-direction at velocity v, as per the picture below.

The nice thing about using vectors to find the volume of the parallelepiped is that it's very easy to find the length of one of the blue lines (what we were calling d before) in the above picture: it's simply the sum of the vectors r and v. Let's call it g (for no particular reason), and we can define it as
$\overrightarrow{g}=\overrightarrow{v}+\overrightarrow{r}$
We can break vectors into their component parts along each axis, and in this case we have $$g_x=||\overrightarrow{v}||$$ (since the x-component of g is coming from the velocity of the car), $$g_z=||\overrightarrow{r}||$$ (since the z-component is coming from the velocity of the rain), and $$g_y=0$$ (since we are assuming the rain is falling straight down and the car is traveling only in the x-direction).

Using the volume formula for a parallelepiped from before, the volume can be found by
$V=|\overrightarrow{g}\cdot(\overrightarrow{h}\times\overrightarrow{w})|$
as long as we can find a vector for g, h, and w. Once we have, the volume is given by the absolute value of the determinant of a $$3\times3$$ matrix like so:
\begin{align}V&=\begin{Vmatrix}g_x &g_y &g_z\\ h_x &h_y &h_z\\ w_x &w_y &w_z\end{Vmatrix}\\ &=|g_x\begin{vmatrix}h_y &h_z\\w_y &w_z\end{vmatrix}-g_y\begin{vmatrix}h_x &h_z\\w_x &w_z\end{vmatrix}+g_z\begin{vmatrix}h_x &h_y\\w_x &w_y\end{vmatrix}|\\ &=|g_x(h_yw_z-h_zw_y)-g_y(h_xw_z-h_zw_x)+g_z(h_xw_y-h_yw_x)|\end{align}
At this point it's an easy matter of plugging in the appropriate numbers to get the volume, after which we can use $$n=N\cdot V$$ to get the number of raindrops. And to make it even better, a little reflection shows that we can simplify this symbolic equation even further.

We already know that $$g_y=0$$ from above, and we can remove several other quantities upon analysis. Remember, the vector w runs only in the y-direction, so $$w_x=w_z=0$$. Similarly, g and h run only the x- and z-directions, so $$g_y=h_y=0$$. Upon dropping all the zero terms, the equation simplifies nicely into
$V=|g_zh_xw_y-g_xh_zw_y|$
We can now replace the vector components with the original quantities they stand for to remind ourselves what everything is.
\begin{align}g_z&=||\overrightarrow{r}||\\ h_x&=-\cos(\theta)||\overrightarrow{h}||\\ w_y&=||\overrightarrow{w}||\\ g_x&=||\overrightarrow{v}||\\ h_z&=\sin(\theta)||\overrightarrow{h}||\end{align}
($$h_x$$ is equal to negative $$\cos(\theta)$$ because I'm taking all vectors to start at the origin, and the windshield extends slightly backwards into the negative x-axis.)

Thus, for the final volume equation we have
$V=|\big(||\overrightarrow{r}||\cdot -\cos(\theta)||\overrightarrow{h}||\cdot ||\overrightarrow{w}||\big)-\big(||\overrightarrow{v}||\cdot \sin(\theta)||\overrightarrow{h}||\cdot ||\overrightarrow{w}||\big)|$
At this point we are nearly ready to begin making graphs. Since we are assuming that h, w, $$\theta$$, and r are all constant, we are left with an equation in v, which lends itself well to plotting.

We just need to put numbers to all our variables. Let's assume that our hypothetical windshield has a width of $$w=2$$ meters and a height of $$h=0.5$$ meters, giving it a surface area of $$0.5\times2=1$$ m$$^2$$. A little searching on the Internet finds that a “typical” raindrop has a terminal velocity of $$r=9$$ meters per second. One source I found suggested a value of about $$780$$ cubic millimeters of water per cubic meter of atmosphere for the density of rain. Raindrops may have diameters anywhere between 0.5 and 5 millimeters (any larger and it breaks up on the way down, any smaller and it's technically not rain, but drizzle) so the volume of an “average” raindrop of diameter 3 millimeters is
$V=\frac{2}{3}\cdot\tau\cdot(1.5\,\text{mm})^3=14.14\,\text{mm}^3$
Thus, on average, a cubic meter of atmosphere contains $$780\,\text{mm}^3\div14.14\,\text{mm}^3\approx55$$ raindrops. So $$N=55$$ for our example here.

Plugging all of this into a Python script I wrote, I was able to use the matplotlib graphing package to generate the graph below with multiple plots for different windshield angles.

The results are, perhaps, not too surprising, but still interesting (and make a rather pretty graph). The number of raindrops appears to increase linearly with speed, with steeper windshield angles (like those found in trucks or large vans) having a higher rate of increase than lower angles (like those found more in cars). The limiting cases of $$0^\circ$$ and $$90^\circ$$ are illustrative; a flat surface (like on the roof of vehicles) would have no change whatsoever with changing speed, while a vertical surface would start out with no raindrops hitting it (as expected), but would eventually have the most raindrops hitting it if you could go fast enough (45 meters per second is about 100 mph, so it would have to be pretty fast, but you can see that even by about 75 mph it has surpassed nearly all other angle inclinations but the $$75^\circ$$ one.) I'd estimate that most cars have windshield angles around $$45^\circ\pm15^\circ$$, which is best represented by the cyan line on the graph.

So, now you know (or at least have a good idea) why you need to run the windshield wipers at faster speeds when going faster. And it only took three semesters of calculus to do! (Granted, I could have done it algebraically for this simple case, but why pass up the chance to do some exciting vector calculus?) It might be interesting for a follow-up post to consider time of travel, and how many raindrops you would actually encounter at different speeds for a given trip length. Anyway, a hui hou!