Saturday, November 9, 2019

A Bolt of Cloth

The past couple weeks here have been non-stop drizzling rain – not the nicest farewell I could have – but it reminded me of a post from another of my favorite blogs, Futility Closet.

Shortly after Benjamin Franklin created the first lightning rod, the idea caught on in Europe as a fashion accessory. There were umbrellas fitted with lightning rods (above), as well as hats, which trailed a wire for grounding. The information on these is a bit sparse, in particular whether they had ever been tested. This concerned me, since I saw some potential problems with the design, which I thought I'd explore today.

First, a quick explanation of how lightning rods work: During thunderstorms, charge collects in clouds. If enough charge builds up, it can overcome the resistance in the air, and create a channel down to the ground, where it discharges. This is lightning, which can carry lots of charge at high speed. Electricity takes the path of least resistance, and since humans and animals carry a lot of salty water, that makes us appealing routes to the ground. Tall buildings can also make good conductors, but since lightning carries so much energy, it can start fires. To protect ourselves, and our homes, we can make even better channels by topping buildings with a metal rod that connects directly to the Earth through a wire. Based on this, the lightning rod apparel doesn't seem unreasonable, but let's look at some issues.

Ground Current
For real lightning rods, the grounding wire is buried several feet deep to better distribute the charge, but that wouldn't be possible with a rod you carry with you. Instead, the wire just drags behind you, but that's no different from lightning striking the ground near you. Lightning carries a lot of charge, and it takes some space to dissipate, which can be just as dangerous as the initial strike. The National Weather Service webpage illustrates this with a charmingly-90s, yet still horrifying, animated GIF:

According to the Washington Post, ground current can be dangerous as far as 60 feet from the initial strike, so you'd need an awfully long tail on your umbrella/hat, not to mention the danger to anyone else who happens to be near the contact point.

Melting Wire
Since these are fashion accessories we're talking about, the Wikipedia article above mentions that the grounding wire was silver, but that could get expensive. One site I found lists the gauge for a grounding wire as 2 AWG, or about a quarter inch. There's also the problem that silver has a lower melting point than copper, 961.78 °C. That made me curious whether you'd be trading electrocution for being sprayed with molten silver.

The energy absorbed by the wire will be
where I is the current, 𝜌 is silver's resistivity, l is the length of the wire, A its area, and t is the duration of the strike. Using those values, along with a normal (rather than rope-sized) silver chain, and a height of 1.8 meters, I come up with 195 Joules, which is nowhere near enough to melt even a thin chain.

Magnetic Field
So at this point, you're still dead from the ground current, but your relatives will be able to salvage your silver chain. What about your smartphone? When current flows through a wire, it produces a magnetic field, according to

I couldn't find info for smartphones, but according to this site, credit cards could be damaged at a distance of 63 centimeters, and pacemakers at 25 meters! I'm not sure whether the short duration of the bolt would change these calculations, but it still doesn't seem like you or your electronics would be safe in a thunderstorm, even if you are wearing the height of 18th century fashion.

Big thanks to Futility Closet for pointing out this fleeting trend! I'm sure we would never use new technology in such a frivolous way, right?

Sunday, November 3, 2019

Riding a Charger

In high school, I got interested in electronics tinkering through the blog Hack-a-Day. I haven't done much myself for many years, but I still read the blog, and last week there was a post that seemed ripe for physics analysis:

The setup is that each player has a button they can press and release. While the button is pushed, a capacitor is charged by a voltage source, and when it's released, the capacitor switches to power a motor that drives the horse. You can see the full plans here, but this is a simplified version of the circuit:
Made using
In the state shown above, the voltage source (V) begins to charge the capacitor (C). At first, this would act like a short circuit, so we add a resistor (R) to limit the current flow. For this type of circuit, the charge on the capacitor is given by
The voltage over a capacitor is proportional to the charge stored in it, so as the capacitor charges up, it pushes back more and more on the voltage source, which slows the charge that's added. That leads to an asymptotic behavior:

When the button is released, the switch in the diagram above flips to the other side of the circuit, and the capacitor begins discharging through the motor. This acts like a resistor, but converts the charge flowing through it to motion, driving the horse. Once again, we have an asymptotic relationship, since as the charge flows out of the capacitor, it can't push as strongly:
Here, Q0 is the amount of charge we put on in the first step. This is similar to the plot above, but decaying to zero:

This made me curious if I could come up with the optimal strategy for getting the horse to the end as quickly as possible. That translates into the most charge in the least amount of time, or the maximum current. If we ignore the initial charge up, we can think of switching between some maximum and minimum charge:
The average current through the motor over one cycle is
where tC and tD are the charge and discharge times. The expressions for those are a bit ugly, so I won't write them out here. Rather than try to get the exact maximum current, we can try a variety of values for Qmin/max:
The best option appears to be keeping the capacitor at ~50% charge by rapidly flipping the switch between the two states. As with many games, the answer lies in hyperactivity!

Saturday, October 26, 2019

In France It's "Quantum Royale"

Earlier this week, Google announced it had achieved "quantum supremacy", so I thought I'd discuss a bit about what quantum computing is, and what Google managed to do.

In classical computers, like the one I'm writing this on, information is stored in bits, which have a value of either 0 or 1. These bits can be combined in different ways to perform calculations. The time it takes to do a calculation depends on the number of steps, which in turn depends on the number of bits.

Quantum computers have quantum bits, or qubits, which represent entangled particles. That means the states of different qubits can depend on each other, and they can (temporarily) take on values between 0 and 1, representing a superposition of the two. This can be exploited to perform calculations exponentially faster than a classical computer could.

One of the exemplary problems where quantum computers are useful is prime factorization. This is the problem of finding all the prime numbers that divide a given number, which you can imagine as a tree:
Factoring 24 into 3x2x2x2
Typically, this is done by trying each possible factor, until we find one that divides the number, and then repeating for the results. In essence, quantum computing lets us try all the possibilities at once, and only keep the ones that work. The actual algorithm is a bit more complicated, but we're just skimming the concept here.

Why should we care about factoring numbers? Current encryption algorithms are based on the product of two large primes. You share the product, which others can use to encrypt a message for you, but the only way to decrypt it is to use the individual factors, which you keep secret. With quantum computers though, anyone can factor the product you gave them, and read your messages.

Google published a paper in the prestigious journal Nature claiming to have reached "quantum supremacy" (the originator of the phrase now regrets choosing it). The trouble with quantum systems is that they're fragile – Any disturbance from outside the system will affect the states of the qubits, invalidating the calculation. This risk increases with the number of qubits, so the question becomes, can we maintain the integrity of a system with enough qubits to be useful?

Quantum supremacy refers to the point where we can build quantum computers with the necessary number of qubits to do calculations that are impossible on classical computers. Google claims to have reached that point, with their 53-qubit Sycamore computer. They solved a problem in 200 seconds that they say would take a classical computer 10,000 years. IBM disputes this calculation, claiming that the classical computer would only take a few days.

It remains to be seen who is right, but it's still cool to see a project with such world-changing potential coming into being.

Saturday, October 19, 2019

A Singular Family

This week, I got some great questions from my nephew Ezra, along with his parents Nate and Carrie. I gave them some quick answers off the top of my head, but I thought they deserved a more in-depth treatment as well.

Ezra: What does a gravity wave feel like [to a person]?
As a reminder, gravitational waves warp space as they pass. If a wave passed through the center of a hula-hoop, it might look like this:
Each image is a point in time. Adapted from my thesis.

Gravitational waves are incredibly weak, which is why we need 2.5 miles of detector to pick them up. They’re a squeezing and stretching of space, so if you could feel them, they’d be a combination of a hug (awww) and a medieval rack (ahhh!). Some of the early detectors were big pieces of tuned metal that scientists hoped would ring like a xylophone if the correct frequency passed by. Those were never sensitive enough though.

Nate: But aren't they weak because they're distant? What if you were closer to a pair of black holes approaching collision? Could you be close enough to feel the waves but far enough to not be inside?
Good point! We can take the first LIGO detection, GW150914, as an example. According to that paper, the distance was about 410 megaparsecs, and the peak strain was 10^-21. Strain is the fraction by which the wave changes distances, so a meter stick would be stretched and squeezed by 1/1000000000000000000000 meter! That's pretty tiny, but strain drops off as 1/distance, so we can get a bigger effect closer to the collision. We probably don't want to be inside the event horizon of the final black hole, which has a radius of
Plugging in the 62 solar masses from the paper, we get 183 km. Supposing a 6 ft person observed the collision from 200 km away then, their height would change by a little over 4.5 inches!

Carrie: Is a black hole a hole in space-time or a depression?
It's both! -ish. This is a difficult question to answer, since the whole point of a black hole is that we don't know what's going on inside it. The trouble is that when a star collapses into a black hole, it creates a singularity – a point of infinite density. That creates a lot of problems for General Relativity, since things falling into the singularity could wind up going faster than light, and other bad things that happen when you have an infinite quantity. Instead, we put an event horizon around the singularity at the point where light can no longer escape from it, which is usually where bad stuff starts. Wikipedia has some nice representations of a singularity with and without an event horizon (bad stuff not included):
Black hole, via Wikimedia Commons
Naked singularity, via Wikimedia Commons
Thanks for some great questions!

Saturday, October 12, 2019

Countertop Charybdis

Last weekend, I was making another batch of my friend Jean's dosa recipe, and I started thinking about the whirlpool in my blender:
Water, not batter, so it's easier to see

I was curious if I could figure out the shape of the well, and how it depended on the speed and ingredients.

The basic idea is that we have water molecules with some angular momentum, rising to some height h based on the distance from the center, r. If we ignore drag/viscosity, we can just set the rotational energy equal to the gravitational energy:
where ω is the angular velocity, and m is the mass. Solving for h gives
This has a parabolic cross-section, which is characteristic of a rotational vortex, according to Wikipedia.

Really though, there's some drag on the liquid: It's moving quickly in the center, where the blades are, but at the walls it has to slow down. I looked at the models for viscosity of liquids, and I was hopeful I could find a way to apply it here:
F is the force between one sheet of liquid and the next, 𝜇 is a constant that depends on the liquid, A is the area of the liquid, and v is its rotational speed. In our case we can write
I was hoping I could solve this, with an input velocity at the center, and an output velocity at the outside, but I'm not sure what to do with the time derivative. Looking at the photo up there, I'm inclined to say a parabola is good enough, unless one of you readers can suggest a way to solve this!

Saturday, October 5, 2019

Pump and Circumstance

My parents are in the process of installing a set of heat pumps in my childhood home, so they don't have to rely on the old wood stove, which requires buying, stacking, and splitting large quantities of lumber every year. I was interested to learn more about these real-world pumps, since physicists are introduced to the idea of heat pumps and heat engines in any intro thermodynamics class.

The idea with both these devices is that we have some working gas that we move to different levels of temperature (T), pressure (p), volume (V), and entropy (S). The reservoir where we keep this gas is attached to a piston/shaft. The piston controls the pressure and volume, and we can either turn the shaft to create a temperature difference (heat pump), or apply a temperature difference to make the shaft turn (heat engine).

Usually these different stages the pump goes through are shown on a p-V diagram, which shows the relationship between pressure and volume at each step. Here's a simple example:
The steps are

  1. At a low, constant pressure, expand the gas to a larger volume
  2. Keeping that volume fixed, increase the pressure to a high value
  3. Decrease the volume again, but at the new pressure
  4. Bring the pressure back to the start, at the original volume
The reason physicists like to represent this in terms of pressure and volume is that it's easy to find the energy:
This says that the energy produced by the system is equal to the area under each curve in the plot above. This is where the arrows come in: pointing to the right means the volume is increasing, and dV is positive, while to the left is negative. How does this relate to temperature though? If we're using an ideal gas (air is close), then these factors are related by
so in the plot above, the upper right corner will be the hottest, while the lower left will be the coolest. Since the arrows are to the left at the higher pressure, we put in more energy than we get out, and this is a heat pump that will make that temperature difference.

What's really interesting about heat pumps is their efficiency: The amount of energy you get out (through heating/cooling), divided by the energy you put in (turning the shaft). In the case of an old fashioned electric heater, you run current through a big piece of metal, which heats up, converting 100% of the input energy into heat. It seems odd that you could do better than 100%, but heat pumps manage it.

The key is that we use ambient energy, which doesn't count against our input. In my parents' case, the pump is taking energy from the cold outside, and moving it to the warm inside, so the efficiency is
where Q is the energy exchanged with each location.

When physicists talk about efficiency, we like to bring in the Carnot cycle, which is the theoretical maximum efficiency. The p-V diagram for this case is a bit funny looking:
For this type of pump, we can replace the energy in the efficiency equation with the indoor and outdoor temperatures, in Kelvin. According to Steve's last NOAA report in 2012, the lowest recorded temperature in Ashfield was 249 K. For an indoor temperature of 293 K (brisk for my taste, but I'm sure he would prefer cooler), the efficiency comes to 666%! Clearly these heat pumps are the work of the devil...

Saturday, September 28, 2019

Lean on Me

For some reason, my bus the past week has been especially full, forcing me to stand for most of my commute. I'm always surprised by how difficult it is to keep my balance going around curves, so I thought I'd try putting some hard numbers to the issue.

I've talked about the strange, non-inertial effects of being in a turning vehicle before, but this situation is much simpler. When the bus goes around a turn, it drags my feet along with a centripetal acceleration. Balance is all about keeping the total forces on you over your feet:
Here, ar is the centripetal acceleration of the bus, and g is the acceleration from gravity. Using geometry,
When something moves in a circle with radius r and velocity v, the centripetal acceleration is
Putting these together and solving for v gives
The turning radius for a standard city bus is about 21.5 feet, and the maximum angle a person can lean is around 15°. Putting these together gives a speed of just 9 mph! As a non-driver, I don't really have a feel for typical turning speeds, but the National Association of City Transportation Officials suggest a maximum of 15 mph, so our limit is well below this. Of course, when you're riding a bus you can lean into the curve, and hold on to the railings, neither of which we've accounted for here. Still, I feel a little justified in lurching around awkwardly during my commute.

Saturday, September 21, 2019

Harry Nyquist the Scientist (Harry! Harry! Harry!)

Ok, doesn't quite scan, so I guess he's not destined for TV stardom, but one of his ideas is at the core of this week's post. Last week, I was talking to my parents over Facetime and Steve, ever the stickler for visual quality, complained that my lights appeared to be flickering:

Looking at it from my end though, the light appeared fine. I realized that the LED bulb must be flickering (by design) at a rate higher than my eyes can perceive, but my laptop camera is recording below the Nyquist rate, causing the flickers to appear.

Before getting into that, let's talk about how LED bulbs work. LEDs require direct current (DC), while house power is alternating current (AC), so the first thing we need to do is convert between these two. Alternating current is a sinusoid, oscillating between positive and negative of a certain value:
There's an electrical component called a diode that only allows current to flow in one direction. In fact, that's the D in LED, but right now we're just talking about the regular kind of diode, not the Light Emitting ones. By arranging a few of those in a clever way, we can switch the negative part of that curve to positive:
Made with
On the left is the AC source, and on the right is a voltmeter. The diodes in the middle only allow current to flow in the direction of the arrow. The voltmeter's output looks something like this:
This isn't ideal though, since the voltage is going all the way down to zero. We need a way to smooth out this curve. We can do that by adding a capacitor, which stores and releases charge as the voltage changes:
Now the voltage looks something like this:
Still not perfect, but it's the best we can do with something simple. Those little bumps mean the LEDs will be flickering a tiny bit, but it's at twice the rate of the original AC input. In France, this is 2x50 times per second (Hz).

The camera on my laptop captures video at about 30 frames per second. According to Nyquist, to accurately record a signal, we need to take data at twice the rate that the data changes, but that would be 200 Hz, far above what my camera is capable of. We can see why this is necessary by considering a point moving in a counter-clockwise circle:
The dot completes a cycle every 8 steps. The image on the left is sampled every step, while the one on the right is sampled every 7 steps. The slower sample rate causes the dot to appear to be moving backwards. You've probably seen a similar effect in videos which include old TVs or computers that used CRT screens. The screen appears to blink because the camera captures the screen at different points in its refresh.

That leaves us with the question of why the light doesn't blink according to our eyes. That's addressed by the flicker fusion threshold, which comes from the spectacularly-named field of psychophysics. Our eyes aren't able to perceive changes in intensity above a certain rate, instead averaging things out. For most people, it's around 80 Hz, so the LEDs easily surpass that, but the captured video is nowhere close.

Thanks for a great question/complaint Steve!

Saturday, September 14, 2019


My office is built into the side of a hill, and several times while waiting for my bus, I've seen bicyclists rocketing down at tremendous speed. I was imagining they would burn through their brakes quickly, and wondered if there were a better way to limit your speed on a hill. Switchbacks used by hikers came to mind – Instead of taking a direct route up a mountain, trails wind back and forth, which reduces the slope. I was curious if a similar method could be used to slow down.

If we ignore air/rolling resistance, we can use conservation of energy to relate the drop in height to the total velocity gained:
For a road of slope m, we can set up a differential equation relating this total velocity to the individual forward, sideways, and vertical velocities:
Suppose we want to maintain a constant forward velocity, and so any extra gets put into the side-to-side motion. Then we can get the total forward travel just by multiplying the velocity by t, and we can write the sideways speed as
The trouble with this strategy is that as you go downhill, your total velocity is increasing, but your forward velocity is constant. That means proportionally, you'll be traveling far faster sideways than the direction you're planning to go. I picked a 30% slope and 10 m/s forward speed to plug into the equation above:
After only about 10 seconds, 90% of your speed is perpendicular to the direction you want to go! Now that doesn't mean you'll never get to your destination – That speed is fixed, remember. Because we ignored resistive forces, your total velocity keeps increasing. I suppose it may be better to stick with the brakes – Not only does this method still have you going at uncomfortably high velocities, you'll also take a lot longer to get where you're going.

Saturday, September 7, 2019


I missed posting last week because I was in Geneva visiting CERN! Marika was flying home via the city, and my brilliant mother-in-law suggested we take a tour of the facility. I thought I'd take this week to explain a bit about how the collider works.

The first CERN particle collider
CERN is the European Organization for Nuclear Research, but the umbrella of "nuclear research" extends farther than you may think. When researchers needed a way to share data between sites over the world, they developed a communication network between their computers that became the World Wide Web. We actually saw the very first web server, kept in a dimly lit room (its natural habitat), so I couldn't get a picture.

The main thing CERN is known for though is the Large Hadron Collider. I talked a bit about particle accelerators in my second-ever post on this blog, but that was just about getting particles up to a certain speed, not colliding them with other particles (aside from my brain).

The purpose of particle colliders is to create new particles by smashing together pairs of other particles. The key lies in what is probably the most famous equation in science:
This equation connects energy to mass, but energy comes in many forms. In this case, we give the initial particles kinetic energy by accelerating them. When they collide, that can be converted into mass energy to create higher mass particles.

The various particles in the Standard Model each have different masses, with the Higgs Boson being the heaviest. Heavier particles have more energy, which means we need faster initial particles to produce them. We can modify the equation above to include the velocity:
As the velocity, v, gets closer to the speed of light, c, the energy gets bigger and bigger. This is why you can never get up to light-speed: You'd need infinite energy. By accelerating lighter particles though, we can hope to create heavier ones.

While the Standard Model is now complete, there are other theories to go beyond it. The LHC is currently being upgraded to handle even higher energies in the hopes of confirming or refuting these theories. I loved seeing all the bits of science history they have there, and I encourage anyone passing through Geneva to go take a look!

Saturday, August 24, 2019

Strung Out

This is another idea from my list, and I have absolutely no memory of the source, aside from a casual interest in computer-generated sound and music: The Karplus-Strong algorithm. This is a technique for generating the sound of a plucked string, using entirely electronics, no actual strings required! Before we get into the algorithm though, we should go over some background:

What is sound?
Sound is a wave made up of pockets of higher- and lower-pressure air (or other substances). These pockets of pressure excite your eardrums in different ways that your brain interprets as sound. A musical note has a pitch, which is a specific frequency of high/low pressure changes.

How does a computer make sound?
A computer speaker uses magnets to change electricity into sound:
By Svjo - Own work, CC BY-SA 3.0, Link
The yellow coil is a wire that the computer can run current through. This creates a magnetic field, which moves the magnet (2) in the middle of the coil. The magnet is attached to a diaphragm (4) which compresses and expands the air in front of it to make sound waves.

What do we put into the speaker to get a note?
This is where the algorithm comes in. A pitch is a specific frequency, so as long as we repeat whatever we're putting into the speaker, we'll get some kind of note. If you remember your math classes, a sine wave might come to mind:
Unfortunately, as any Physics Lab instructor can tell you, pure sine tones aren't the most melodious to listen to:

Not surprisingly, it sounds a bit like a telephone tone, another form of computer-generated sound, designed to be heard by a computer.

Musical instruments sound different even when playing the same pitch because of the harmonics they include. There's a base frequency, like the sine wave above, but then there are many others that add color to the sound. This is where the Karplus-Strong algorithm comes in. We want a way to systematically create a range of frequencies associated with a single base frequency.

I don't want to get too deep into how the algorithm works – for that you can read the Wikipedia page I linked above, or take a look at the code I used to make these sounds. I will, however, try to summarize the concept.

We start with a list of values – mostly zeros, but we initialize things with some random noise at the beginning:
We then take the first value and output it. At the same time, we combine it with the second:
We put the combined value at the back, and move everything forward:
It's a simple method, but I was stunned by the quality of the sound I got out of it:

I also plotted some frames of the buffer to see what was going on:
You can see the burst of noise at the beginning, and then a damping sinusoidal wave.

I was curious what kinds of tones I could get by playing around with the filtering pattern. First I tried simply extending from 2 bins to 5:

Then I decided to go nuts and try a sinusoid filter:

The sound is even worse than the pure sine, but the waveform is really interesting:

It's a little difficult to see, but the initial noise manages to continue propagating through, as the sine pattern gradually asserts itself.

The thing I love most about Physics is how simple models can still give realistic results, and this is a perfect example. I wrote the code above in less than an hour, with no specialized knowledge about sound synthesis, yet the result sounds exactly like a plucked string. As always, I encourage the tech-minded among you to look at the code, and come up with some interesting sounds for yourself!