Pages

Sunday, October 13, 2024

Zooming On My Cycle

I started my job with the University of Florida in April 2020, right as the COVID work-from-home policies were starting up. As a result, all my meetings are conducted over Zoom. Now and then I get a little bored with the subject at hand (but only very rarely!) and I start thinking about the layout of the meeting participants on my screen:

I try to move my mouse from each window to an adjacent one, visiting each once and returning to the start. This type of problem is the subject of graph theory, which assesses the attributes of nodes (the windows in this case), which are connected by edges (whether two windows are adjacent). The quality we're looking for is called a Hamiltonian cycle. My various meetings have different numbers of participants, and I've been fascinated by whether a given arrangement contains one or more of these cycles.

It turns out this problem is in a category called NP-complete, which is broadly defined as problems that are hard to find solutions for, but easy to check if a given answer works. In this case, given a path through the windows, it's easy to check we visit each once and end at the start, but the only way to find those is to check every possible path. As long as the number of nodes is small, this isn't too taxing, but the complexity scales quickly as we add more people.

Luckily, Zoom only puts 25 people on the screen at a time, and will break the group into pages if there are more. That means I can make a script to test every case! I used the package NetworkX to handle the connections between nodes, which let me generate paths to check. The animation below pages through different numbers of meeting participants, and gives the number of unique cycles at the top.

I find it really interesting how the number of cycles relates to the number of nodes: Even ignoring the drops to zero, the numbers aren't strictly increasing. I'm also surprised by the high numbers of cycles for the bigger groups – I usually only find 1 or 2 before I manage to refocus on the meeting!

Sunday, October 6, 2024

Touched By His Noodly Appendage

[Click here if you've yet to welcome the Flying Spaghetti Monster into your heart and stomach!]

Near out house, there a several car dealerships, which have the requisite flailing noodle men out front:


via GIPHY

I was curious whether I could make a simple model of this system that still showed the interesting dynamics. The way I imagined it was a series of joints stacked on top of each other with fixed length, but able to bend left or right. Gravity will bend each joint according to the distribution of mass above it, and the puffs of air will straighten each joint as it passes through.

Since I'm using only 20 nodes, at first I tried to make the pressure changes move between them smoothly, but I couldn't find a good way to do that without adding a bunch more complexity to the simulation, so instead I just had the pressure move to the next node on each step. The air comes in periodic bursts, which I modeled as a square wave, which turns on and off at some frequency. When I tried this model, I got a bit too much flailing, and my noodle person was spinning crazily around the anchor point, so I realized I needed drag.

There are two typical models for drag, both proportional to the object's velocity, but one linear and the other quadratic. I tried the linear case initially, but that wasn't strong enough, so I switched to the quadratic. I makes sense that we would be in the high-drag case, since this is flimsy plastic sheeting pushing against air.

If you'd like to make plans before opening your own dealership, you can find my code here, or you can sit back and watch some joyous flailing from your own home:

Saturday, September 21, 2024

Looking Radiant

In France we had the fancy induction cooktop, and the camper had gas burners, but now we're back in Michigan with the good old resistive coils I've used most of my life. One thing that's always struck me about these stoves is that then when turned on high, the coils glow red. This is due to black-body radiation, which is the spectrum of light emitted by objects depending on their temperature. For an ideal black-body, the color and brightness will be entirely dependent on the temperature. I wondered whether I could use this to find the temperature the stove heats to:

The Wikipedia page for black-body radiation has a nice chart of the overall color for different temperatures:

Wikipedia

We can get the RGB values of those colors and compare to those from the stove picture:

The solid lines represent the values from the chart, while the dotted lines are samples I took from the image. The red and green aren't bad, but you can see my samples have way too much blue for a true black-body. Ideally, a black-body shouldn't reflect any light, absorbing it all instead. This brought to mind Vantablack, but I'm not sure how that would stand up to high temperatures, and it seems like a dangerous world to get into.

To resolve the discrepancy in color distribution, let's try looking at the overall brightness by taking the root sum squared for the above:

For 3 out of the 5 samples, we get a crossing at around 1600°F. I couldn't find a definitive source for maximum stovetop temperatures, but I found a Reddit post that suggests the range 1470°F to 1652°F, agreeing nicely with my measurements!

The neat thing about black-body radiation is how universal it is: When a welder heats metal to the same brightness as the Sun, it's because they're the same temperature, and the whole universe is still glowing from the heat of the Big Bang!