Pages

Saturday, May 27, 2023

Adversarial Ambulation

When crossing the street, I typically work on the assumption that drivers at minimum are unaware of me, and possibly seeking to hit me. I've often wondered whether crossing perpendicular to the road is the best strategy, or whether angling my path away from an oncoming car would be better. If we imagine crossing a road of width w, while a car approaches starting y0 up the road, we can write the distance squared (to avoid taking a square root) as

where t is the time since entering the road, the vs are the respective velocities of the pedestrian and the car, and θ is the angle from perpendicular for the path. We want to find the angle that gives us the greatest distance (or distance squared) when the car is at its closest point in time. To find that, first we find the time of the closest approach:

Now, we could plug this into the first equation, and try to maximize over θ, but things are already getting ugly, so instead, let's plug in some values and plot it. For a 20 ft wide road, with a car starting 100 ft away and driving at 30 mph, we can plot the closest approach for different angles and walking speeds:

At high enough speeds, it is worthwhile to angle yourself away from the car, but unless you want to book it, straight across is probably best. You may notice the slowest speed in blue puts you farther than the next highest in orange – This is because it's so slow, the car passes before you get significantly into the road. Definitely avoid that orange speed though – That kink at around 38° is a distance of 0 ft, otherwise known as being run over!

Sunday, May 21, 2023

Stained Steel

This week I was taking a frying pan out of our dish rack, and it caught the sun, showing a surprising array of colors:

I wondered where these might be coming from, so I started reading about the makeup of stainless steel. I knew it was an alloy of iron and another metal – I thought maybe aluminum or tin, but it turns out it's chromium. The chromium reacts with oxygen from the air to form chromium (III) oxide, which protects the iron from forming iron oxide, or rust. If this layer gets damaged, a new one quickly forms. Heat makes the reactions involved happen more easily, so I wondered whether the color differences were due to greater heat in the center of the pan creating a buildup of the chromium.

I was able to find a paper analyzing the compositions that lead to different colors:

Figure 8

Using macOS's color meter, I was able to read the RGB values of the samples given. I plotted those to see if there were any obvious trends:

The blue seemed relatively linear, so I decided to use that as a link between my photo of the pan, and the composition data. I took the average of concentric circles outward from the center of the pan:

There does appear to be a downward trend in the chromium and oxygen fractions, which would be consistent with the heating idea, but there's an awful lot of noise, and the upturn at the edge. Part of the problem may be that lighting can have a big effect on color perception (I'm reminded of the dress from several years ago). The colors on our pan don't seem to match well to the scale used in the paper. In any case though, it was interesting to learn more about stainless steel, and know the colors are a sign it's working, not degrading!

Sunday, May 14, 2023

Speakhard

I recently came across the term password entropy, and I was curious how it related to the thermodynamic type of entropy I'm used to as a physicist. When choosing a password, we want to create something that's hard to guess. That means there should be as many possibilities as we can manage. That's why accounts frequently require you to include upper- and lower-case letters, numbers, and symbols. By increasing the variety of characters, there are more possible passwords you could make. To characterize the number of choices, people sometimes define the "bits of entropy" as

where M is the number of possible passwords. The term "bits" is meant in the computational context: either a 0 or 1, with 8 bits making a byte, and kilobyte/megabyte further scaling by 1024 each.

This is essentially the same, up to a constant factor, as the type of entropy used in thermodynamics, where instead of character combinations, we have microstates of a system (see the post I linked above for more details). It turns out we can connect these concepts through a thought experiment called Maxwell's Demon: Imagine we have a box filled with gas and divided into two sections, with a door between them that can be opened and closed. If the gas in one side of the box is warmer than the other, we can extract energy from the box using a heat engine. Once the two sides are the same temperature though, we can no longer perform work using them. However, temperature gives the average energy of the gas molecules: Some will be moving faster, and some slower. Suppose we had a device (or a demon, if our research grant covers soul exchanges) that could detect when a slow molecule approached the door from the left, or a fast molecule came from the right, and could quickly open and close the door to let that molecule through. Then we could make the two halves different temperatures again, decreasing the entropy and allowing more work to be extracted!

The sticking point though is how this demon decides whether to open the door or not. As we saw above, information carries entropy of its own, and the knowledge of whether the door should be opened for a particle cancels out the decrease in entropy caused by the temperature difference. There are some interesting details on that in the Wikipedia article, but there was another aspect of password choices that I wanted to explore, related to this xkcd comic. Generally, increasing the length of the password, or the types of characters allowed in the password will increase the entropy, but requiring certain character types can make the entropy go down. Below you'll find a little JavaScript tool to calculate the entropy for different requirements.

Sunday, May 7, 2023

Till Birnam Wood Remove to Dunsinane

Until their recent switch to heat pumps, my parents heated their house primarily with a wood stove. For my whole life, my mother Sally has been responsible for splitting the logs they bought to a suitable size. Even at 71 years old, she continues to perform this task for the occasional fire they still enjoy. In preparation for installing more solar cells, they recently had part of the woods around the house cleared, and Sally has been splitting it. During that process, she asked me: How much does split wood dry over time? How much difference does the surface area of the pieces make? (Pieces split from wider diameter vs smaller diameter)

Here's a picture she took showing some different splits:

We want all the pieces to have roughly the same mass, but depending on the diameter of the log, this will mean different thicknesses of wedges. Intuitively, a thicker wedge will take longer to dry, since the water has farther to travel through the wood. I wasn't sure how I could model this, since there are so many factors that come into it, like the surrounding air temperature and humidity, not to mention the spread of the water inside the logs. Luckily, the USDA came to my rescue with an extensive document on drying lumber!

They compared the moisture level in pieces of lumber, varying the location in the US, thickness, type of wood, and date of stacking. Unfortunately, the way they present the data does not help to answer Sally's question: They show separate plots for each thickness, but we want to see how a changing thickness affects the drying time. To replot the data in a way to answer that, we first need to get the actual values. Normally, I'd take a couple points by eye, but I wanted to get more samples than I would have patience to do manually. I figured someone out there must have developed a tool for reading data from plots, and indeed they had! Using that, I got the data for the samples taken in Worcester, MA for Northern Red Oak, then did some interpolation and rearranging to get a plot of the drying times for wood stacked around September:

Where is gets really interesting is when we look at how this curve changes depending on the stacking date:

Interestingly, if you stack during the Fall, the times are fairly linear in thickness, but if you were stacking it now, there's a sharp climb for larger thicknesses. It's amazing to have mom who both asks questions like this, and has the stamina and will to test my findings – Thank you, Sally, for all the years of keeping me warm and thinking, and here's to many more!