Pages

Showing posts with label Interactive. Show all posts
Showing posts with label Interactive. Show all posts

Sunday, June 30, 2024

Angle of the Dangle

Since last year, Steve has been confined to a wheelchair. He gets in and out of it with help from a device called a Hoyer Lift:

Hillrom

The straps at the head and legs have several different notches to adjust the length from the hoist attachments. Along with those adjustments, Steve can also lie higher or lower in the sling, and adjust the angle between his legs and torso. Given these options then, Sally asks: How do we adjust things to get Steve to be more/less upright?

This turns out to be a surprisingly complicated geometry problem. I started off by diagramming it this way:

a and b are the lengths of the two straps, L is Steve's height, h is how far down the pad he's positioned, and θ is the leg-torso angle. We can use the Law of Cosines to first find the width of the two triangles, w, and then the angle between the lift straps:

What we need to figure out from here is the coordinates of that lowest point, where the sling bends. To do that, I rotated the setup so that a lay on the x-axis, and worked out the geometry from there. If the point we want is at (x,y) in these coordinates, then we can write

Solving these 4 equations together produces pages of messy equations, so instead I decided to do it numerically. Since my goal was to make an interactive tool my parents could use, I'm working in JavaScript, so I had to make my own equation solver. I decided to use the bisection method, in which we find the point where a function crosses zero by bracketing it more and more finely. For some combinations of parameters the algorithm fails to find a solution, and the angles don't always look right, but I think it can give a feel for how these different choices factor into the final angle that the lift rests. You can see the code here, or just play with it below!

Saturday, April 6, 2024

Round Wave in a Square Hole

The little camper we've been living in for the past 6 months (!) has a shower in its bathroom, but the bathroom's size and design is similar to those you find on an airplane, so adding a shower doesn't leave much room for a person. Instead, I typically take showers in the campground's bath house, but that comes with its own quirks. Often the drains won't keep up with the shower's water input, and I'll get a standing pool in the stall. What caught my attention recently was the waves I made as I moved around, which bounced off the walls and recombined, creating interesting patterns. I realized I could adapt the simulation I originally made for waves on the ball drum to two dimensions and do some experimenting! Easier said than done it turned out, and it took me a bit to get things working properly, but I'm quite pleased with the result.

The key to the dynamics is an operator called the Laplacian, which measures the curvature around a point on an N-dimensional surface. For a 2D grid, we can calculate it as

In our case, f represents the height of the water at a given point, and h is the size of our grid points. This gives us the force on the water, so we integrate twice to get the new heights. When h would hit one of the walls, we use a similar tactic to my Roomba post, and use a mirror image of the wave. That gives us the interesting dynamics I was looking for.

Below you'll find my simulation of the waves – click or click-and-drag to disturb the water. There's no damping, but (since energy is conserved) the waves get weaker as they spread out, so you may need to draw more than a single point to see reflections from the walls. You might notice it's a bit pixelated – The integration is not very efficient, so to speed things up it's simulated on a small grid and scaled up. This was actually the cause of the delay in finishing, since it took me a couple tries to get the scaling to work. You can hit the reset button to clear your waves and go back to a calm blue ocean/public shower stall. Have fun!

Saturday, September 2, 2023

Mixed Signals

Recently for my research I've been working with digital signal filters, which are a way to change the frequencies that appear in a signal. Specifically, I've been using a Kaiser bandpass filter, which removes frequencies outside a given range. You might imagine that if we want a specific range of frequencies, we could just use a Fourier transform to set those points to zero. There's a problem with that though: In order for the transform to be precise, we need infinitely long data, so we can capture all frequencies. Since ours is finite, we will get spectral leakage, where the timespan of our data will introduce its own frequency to the spectrum. We can mitigate this by applying a window to the data, which tapers at the ends.

These filters are often displayed through their finite impulse response (FIR), which shows what the filter does to a single spike of signal. Below are responses for a square window, which corresponds to the sharp clipping I described above, and an example Kaiser window:

Notice that the square window has much more wiggling on the sides, while the Kaiser window damps out quickly. On the other hand, we do lose a little bit of power in the main lobe of the Kaiser – There are always tradeoffs in these situations.

Once we have the FIR for a filter, we can apply it to a signal with an operation called convolution:

You can picture this as sliding the filter across the signal and taking the sum of the product at each point – The Wikipedia article I linked has some nice animations. What I wanted to know was, how do the different settings for the Kaiser filter affect the result for the signals I'm working on? Below, you'll find a plot of a square pulse before and after filtering. The controls are the attenuation outside the band of desired frequencies, the width of desired frequencies, and the cutoff, which is related to how long the transition from the passed to the attenuated frequencies lasts.

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, April 23, 2023

A Rainbow of Random

Last week I was talking to Steve and Nate (my father and brother), and they mentioned using white noise generators to help with sleeping. That made me think of a meeting I was in earlier in the week where someone mentioned that LIGO and LISA typically have red noise contaminating the measurements. That made me wonder: What does red noise (or other colors of noise) sound like?

First off, we need to talk about what it means for noise to have a particular color. In the context of light, color tells use the frequency of light: red light has lower frequency than blue light, and white light is a mixture of all frequencies. We can apply the same principle to frequencies of sound: more low frequencies is redder, and more high frequencies is bluer. We figure out the "color" of a dataset by taking its Fourier transform, and looking at where the peak frequency lies. White noise has an equal amount of power in all frequencies.

That's the theory, but how do we go about generating different noise colors? White noise is easy: Given some sampling rate, we generate uniformly distributed random numbers. Because these numbers are uncorrelated, they don't favor any frequency, and give a flat spectrum. We can "redden" that noise by giving each sample some dependance on the previous. This page suggests mixing each sample with part of the previous:

where x is the series of samples, w a series of white samples, and r a tuning parameter between 0 and 1, with 0 giving white noise, and 1 giving constant values. For blue noise, we want to do the opposite: sequential values should be as different as possible. To do that we can follow the method here: For each blue point we want to generate, we get several white points and pick the one furthest from a previous sample.

We still haven't gotten to what these different noises sound like though. For that, we can use Javascript's AudioContext, and pipe these sequences of values through your speakers. Below, you'll find a slider to control the color of the noise – For red noise, it represents the r from above, and for blue noise it represents how many samples ago to avoid. That technique isn't quite right, so for values above zero (which is the white noise point) there isn't a continuous transition. In the window above the slider, you can see the Fourier transform of the sound, with the frequency going left to right. Maybe not the most soothing sounds, but I hope it can give you some insight into the sort of problems scientists have to deal with.

Sunday, July 17, 2022

Self-Jamming Cars

This week I wanted to try another Complex Systems-style simulation, this time based on something I had originally seen on Mythbusters, but others have tried with similar results: Traffic jams that appear out of nowhere simply due to drivers varying their speed. The system is fairly simple: Some number of cars drive on a circular track, trying to go as fast as possible while maintaining a safe stopping distance and obeying the speed limit. However, they may not all accelerate at the same speed, and can brake unexpectedly. These error factors result in some interesting effects, including waves of slow speed that travel backwards around the track.

To simplify things, I assumed the cars were either accelerating at maximum, or braking at maximum. They would decide based on the stopping distance from the car ahead of them:

where v is the car's velocity, and a_b is the braking acceleration. If the distance to the next car is less than this, we brake, otherwise we continue accelerating.

The controls you'll find below are the number of cars on the track, the maximum speed they'll go, the rate of acceleration, the rate of braking, the size of the variation in acceleration rate, and the rate at which that variation changes. This last factor is needed because if we change the acceleration error at every step, it tends to average out and have little effect. There's also a brake button that makes the red car slow while holding it down. As with many of these Complex Systems topics, I'm always surprised by the dynamics that emerge with just a few simple rules. Be sure to post a comment if you find something particularly weird!

Sunday, March 20, 2022

Sidebandits

This week was another LIGO-Virgo-KAGRA collaboration meeting, and since my work has focused on the detector itself, I tried to attend more of the sessions on instrumentation than I did in my data analysis days. One topic that stuck in my head was a technique for sensing the sizes of the various optical cavities used in the detectors, sidebands. By modulating the frequency of the main laser beam, we can effectively create frequencies on either side of the central one. This is the inverse of the effect I discussed way back in my PhD work.

"Modulation" simply means we're multiplying two sinusoids together, and we can apply a trigonometry identity to turn that into a sum:
This says that the frequency of the modulated signal is the sum and difference of the two frequencies that went into it. Often we add this modulated signal back to the carrier, z_1. Then we have three evenly spaced frequencies: f_1-f_2, f_1, and f_1+f_2, hence the name "sidebands". What's interesting is the variety of shapes you can get from this simple setup.

As a way to help me get my head around how everything interacts, I put together another doodad (two in a row!) which you can play with below. The top plot shows the timeseries of the signal, and the bottom plot shows the real part of the Fourier transform, a representation of the relative sizes frequency components. You can control whether we add the carrier to the modulated signal with the checkbox. I realize this is a somewhat obscure topic (and certainly not "everyday") but I hope it's fun to play with even if you're not as crazy as me!

Sunday, February 20, 2022

Snow Fugitive

A couple weeks ago I got a really interesting question/story from my friend Garrett, relating an experience entirely foreign to me here in Florida:
Last weekend we got a huge blizzard in MA. In Boston we tied the record for the most snowfall in a single 24h period (~24''). I have street parking and my car gets absolutely buried. Snow up to the windows on both sides. The next day I dig out and am driving my car. Everything is fine until I get on the highway. Once I am above ~50mph, my car starts to shake violently. I pull over, thinking I may have a flat tire. Nope. The tires are fine and no snow is in the wheel wells. So I drive again and it is still happening. So I come up with the following hypothesis: When my car was parked and getting snowed in, the snow built up more-so on the lower side of my wheels/rims. This gave my wheels an uneven moment of inertia. Below a certain speed the force and oscillation period of the unbalanced wheels was low. But above ~50mph my suspension could no longer compensate, and I began to feel the vibration (similar to an unbalanced washing machine).

My initial thought was that at a certain speed he was hitting the resonant frequency of the snow/wheel combination. As the wheel turns, it has to exert a centripetal force on the snow to keep it moving with the wheel. According to Newton, that means the snow is exerting a centrifugal force on the wheel, which will be given by

where m_s is the mass of the snow, v is the car's speed, R is the radius of the tire, and r is the direction from the wheel hub to the snow. This will be a sinusoidal force, with frequency proportional to the speed of the car. That appears to be consistent with Garrett's experience, where the vibration didn't start until he got to a certain speed.

To check that, we need to come up with a model of the car's suspension. I found this paper promising: It suggests a setup where the tire and the car suspension each act as a damped spring.

The ks are the spring constants, the cs are the damping coefficients, and the zs are the height from the road. We can write the forces on the wheel and body as
Each of these springs will exhibit resonance at a frequency we can calculate:
However, if we plug in some of the values used in the paper above, we get frequencies that correspond to about 1 mph or less! Garrett pointed out that I shouldn't be so surprised:
I think it makes sense that the resonance peak you identified is at such a low speed. I'm assuming that car manufacturers design the suspension to NOT resonate (due to unbalanced wheels) at typical driving speeds. Moreover, what I experienced did not feel like a resonance peak. I did not notice the vibration at all until I was above ~40mph or so, but from then on the vibrations increased with increasing speed. There was no point at which I felt the vibrations decrease as I increased speed. 
Taking another look at the equation for the snow's centrifugal force, we see it's proportional to v^2, so the faster the car is moving, the more the snow unbalances the wheel.

I put together a simulation of the system (using SSMs again, since I've been spending too much time around engineers) and we can see exactly this effect in both the average displacement of the car body:
and in the maximum displacement:
I had such a great time thinking about this and discussing with Garrett, I decided to put together another HTML5 doodad that you can play with below. I had to tweak the parameters a little, and there are still some significant transient effects, so you may get some crazy results just after changing the inputs, but they'll settle down after a few seconds. Thanks for the idea, Garrett!

Sunday, April 18, 2021

Stochastic & Fantastic

As I've mentioned before, I keep a list of potential topics that I choose from now and then, and this week I thought I'd look back at an article that caught my interest 2 years ago. Scientific American had a story about a beetle that looked for recently-burned forests using a process called stochastic resonance. The beetles use this process to sense heat from great distances, when normally those heat signals would fall below the background levels. Paradoxically, they do this by adding more noise to the signal. I was curious if I could model this type of effect, to get a better feel for how it works.

In its simplest form, we have 3 parameters for this system: The signal strength, the amount of noise added to that, and the threshold for detection. The principle is that even if the signal is smaller than the noise, we still have signal + noise > noise. That means if we can pick our threshold so that noise < threshold < noise + signal, we'll be able to pick up the signal.

Following an example used in the Wikipedia article above, I decided to use a black & white image as the target signal. I settled on one of the more iconic photos of a certain physicist. Below, you'll find the 3 controls I described. Try turning down the overall signal, then adjust the noise and threshold to pick out different features.

Sunday, March 7, 2021

Gone Fission

This week, Marika and I watched HBO's Chernobyl series. In spite of the depressing topic, and the at times gruesome imagery, we found it extremely interesting. I was (of course) most drawn to the explanation of how the reactor operated, and then failed. I've never studied nuclear physics in detail, but I had a rudimentary understanding of how reactors work:

  • Uranium atoms radiate particles which can hit other uranium and cause them to split
  • When uranium splits, it releases energy, which heats the fuel
  • The fuel is cooled by water, which drives a turbine to generate power
  • Control rods block the radiated particles, slowing down the reaction
The final episode of the series shows the trial of the technicians in charge of the plant, and a scientist gives an excellent explanation of how their decisions and flaws in the design caused the disaster. There are a number of interconnected systems that control the behavior of the reactor, including the control rods and the cooling water, but also buildup of gasses and the power output of the reactor when any of these properties change.

I was curious if I could create a rudimentary simulation of these systems to see if I could cut it as a Soviet reactor tech. I decided to base my model on a boiling water reactor, which seemed to be nearest to my previous understanding of how these plants work. A bit of searching turned up this document describing exactly the type of setup I was imagining, intended for training power station operators!

I wasn't interested in reimplementing a product developed by the International Atomic Energy Agency, but their description was a good starting point to identify the variables, and pare down the complexity. The elements I chose were: Reactor power output P, which increases or decreases as the control rods are removed or inserted; the heat transferred to the water ΔQ, which corresponds to the electric power produced by the plant; the volume of water surrounding the fuel V; the rate water is pumped into the reactor F; and the temperature of the fuel T. These are related by some differential equations. The heat transferred from the fuel to the water is proportional to the temperature of the fuel, and how much water is in contact with it:
That heat is taken out of the fuel, which cools it, while the nuclear reactions I described above are heating it:


The heat is also causing water to evaporate, but we're pumping water in to compensate:

I've played a bit loose with the units here – There should be conversion factors to go from energy to temperature, and energy to volume. I just wanted to get a feel for how these parameters interact, and I did! Below, you'll find another HTML5 simulation, where you can control how far the control rods are inserted, and how much feed water is entering the reactor. If the reactor gets too hot, it will meltdown, and you'll need to reset. I don't think it's very realistic, so aspiring nuclear technicians should not include this on their resume, but you can see some interesting behavior. Have fun!

Saturday, January 2, 2021

Out of My Element

Recently, a friend shared a meme about how COVID has made the idea of bowling particularly unappealing: Sticking your fingers into a ball handled by many people, which has also been rolling on the floor, then eating greasy food with those same fingers. After getting that image out of my head, I started thinking about the physics of bowling. In particular, I was interested in the curve that skilled bowlers are able to give to the ball:


Typically in physics, we make the assumption of "rolling without slipping," meaning that an object rotates at the correct speed for the contact between the two surfaces not to slide, i.e.

where v is the velocity along the floor and ω and r are the angular velocity and radius of the rotating object. If you're mathematically minded, you may notice this is the derivative of the relation between angle and arc length for circles. Bowling balls though have significant slip, as illustrated in this animation:

Wikipedia

When the player throws the ball, they give it some initial linear velocity and angular velocity, or spin. When the ball makes contact with the floor, friction begins pulling on the ball, which applies a torque. Since the ball is slipping, we need to know the relative velocity between the surface of the ball and the floor:
Note that the angular velocity is given according to the right-hand rule: If you point your thumb in the direction (ωxωy), your fingers curl in the direction of rotation. Using this, we can get the force and torque on the ball:

where μ is the coefficient of friction, m is the mass of the ball, g is the acceleration from gravity, and X is the cross product.

Saturday, December 5, 2020

A Breath of Fresh Vacuum

This past week was LISACon 8, a meeting of the LISA Consortium, similar to the LIGO meetings I've attended in the past. One of the presenters showed this daVinci-esque drawing of the LISA constellation:

ESA
A couple weeks ago, I talked about how I was working on a model of the rotation of the LISA satellites. Nominally, the satellites form an equilateral triangle, with 60° angles, but over the course of a year's orbit, those angles "breathe", getting wider and narrower as the spacecraft move along their orbits. That means that we need to change the angles the lasers point, so they can hit the distant sensors.

The laser beams are sent and received by Movable Optical Sub-Assemblies (MOSAs), the tubes in the picture above. We need to rotate those MOSAs to track the other satellites, but there's a problem: Angular momentum is conserved. Usually, we can count on the Earth to absorb extra angular momentum, but that's not possible in orbit. When we turn one of the MOSA, the spacecraft will turn under it. We can figure out how much using Newton's laws:

This says that the sum of the torques on each MOSA and the body of the spacecraft have to cancel out – "Every action has an equal and opposite reaction." We can use another of Newton's laws to express those torques in terms of the angular acceleration:
Here, the Is are the rotational inertia of the MOSAs and the spacecraft. The accelerations are measured in the inertial frame where all three bodies are rotating, but the MOSAs move within a range on the spacecraft, so we really want relative accelerations. We can get this by regrouping things:

We can make a bare-bones model by imagining two rods rotating in a solid disk to get I_M and I_S, then integrate to get the angles:
where m_S and m_M are the masses of the spacecraft and each MOSA, and φ1 and 2 are the angles of the MOSA relative to the spacecraft.

Saturday, July 18, 2020

Vroom!

This morning for breakfast, we got some pastries from a favorite bakery. On the way home, another car honked its horn as it passed, and the changing pitch reminded be of something I've often wanted to try: I wondered whether I could simulate the sound of a vehicle moving by an observer, by calculating the Doppler shift at each point.

The Doppler shifted frequency is given by
where v is the velocity of the vehicle, c the speed of sound, and f0 the original frequency. The dot product with r means we only take the part of the velocity that is along the line-of-sight between the vehicle and the observer. That dot product is what leads to the changing pitch: As the vehicle approaches the observer, the angle decreases, lowering the pitch.

Sunday, February 2, 2020

Slow, Sarcastic Clap

I mentioned looking forward to coming back to Cardio Drumming at the gym where Marika and I go, but sadly they no longer offer it. Instead, they offer something called Pound Fitness that we've been trying out, which involves using weighted drumsticks without the ball drums. It's got rhythm on my mind, and made me think of another idea I've wondered about for a while: When large groups clap along to music, why does it seem like there are so many who are off-beat?

I suppose the uncharitable answer is that they're bad at keeping time, but I wondered whether the relatively slow speed of sound had anything to do with it. If we imagine the beat as a pulse that leaves the stage at 343 m/s, each audience member will clap when that pulse reaches them. That starts a new beat-pulse that will be out of sync when it reaches other audience members.

The equation for the error is fairly simple:

where R is the distance from the stage to the audience members, c is the speed of sound, and 𝜃 is the angle between the audience members.

Sunday, December 8, 2019

Rum Pum Pum

[Title from a favorite book of my childhood.]

I've been thinking about all the great things I'll soon be doing in Michigan again, and I was reminded of something that's been on my list for a while. One of the classes offered at the gym Marika and I went to was Cardio Drumming. The "drums" used in these classes are yoga balls sitting on large plastic buckets, and I often wondered about how the vibrations from the drumsticks travel through the spherical balls.

This is an example of the wave equation, which applies to many systems where neighboring points (in this case, parts of the rubber surface) interact with each other. If we just consider a cross-section of the ball, we can use the 1-dimensional version of the equation:

What this says is that the rate of change of the height of the wave in time is related to how much the height is changing in space. I decided to implement a version of this in Python, but then I realized it would make a great HTML5 doodad!

The controls below let you change the properties of the ball and how you interact with it. Stiffness controls how much of each point's amplitude gets transferred to its neighbors (the c^2 above). Using 0 or 1 can cause some bad (but interesting) things to happen. Strike amplitude is how hard you hit the top of the drum every time you press Strike. Again, setting it too high may cause issues. The bucket provides a wall that the vibrations can bounce off of. If you suddenly increase the bucket size, you can trap waves inside. Damping makes the waves die off over time. Due to a bug somewhere, you have to press Reset when you first load this page, but things should work ok after that. Have fun!


Canvas not supported; please update your browser.

Stiffness

Strike Amplitude

Bucket Size

Damping

Friday, December 28, 2018

Wag the Dog, Part 2

Long ago, at almost the beginning of this blog, I wrote a post with an attempt at analyzing the goofy wagging behavior of my family's two dogs. I failed to come up with a satisfying answer then (in my defense, chemo) but my friend Chris pointed out that I would have had an easier time using Lagrangian mechanics.

Marika and I have a dog of our own now, Lorna, and she does the exact same vigorous wagging I described before. Marika even gave her the nickname "Stubby Wigglekins", due to her stubbornness with me, and her crazy wagging for Marika. I'm missing the two of them here in France, but with a bit of mathematical modeling, maybe I can get a temporary Lorna stand-in!

We'll consider the dog in three parts: body, butt, and tail. The two joints connecting these parts act like springs, applying a force to bring them straight. The magnitude of the force depends on how much they're bent:

Lagrangian mechanics are entirely equivalent to Newton's approach, but are often easier to work with in cases where energy is conserved. The technique involves first defining the difference between kinetic and potential energy in the system:
The advantage of Lagrangian mechanics is that we're allowed to parameterize the system in whatever terms we want, like the angle of the joints rather than their x/y coordinates. For each joint, we can use the usual results for a spring:

where I is the rotational inertia, 𝜅 is the strength of the spring, and the dot indicates a time derivative. Summing the results from the two joints and plugging in gives
Hamilton's principle says that the integral of this in time should be stationary in the parameters 𝜃1, 𝜃2, and their derivatives. Luckily, we don't actually need to do the integral, and can instead just plug into the general equations this leads to. For each 𝜃, we can write the equation
Applying this to the Lagrangian from earlier,

Much simpler than what I was doing last time, and all because we're working in terms of the angles, and not the x/y position! I decided to put together another HTML5 doodad to experiment with:

Canvas not supported; please update your browser.

Amplitude 1


Amplitude 2


Stiffness 1


Stiffness 2


Tail Length




Fun to play with, but no substitute for the original!


Friday, December 2, 2016

Resounding Success

Earlier this week, I was getting ready to do some baking, but noticed something strange when I set out my mixing bowl:
 
There appears to be some vibration in my apartment that the fork/bowl were picking up.  I shared the video on Facebook, and joked that perhaps a passing gravitational wave was responsible, but when I heard my nephew was interested, I decided to go a little more in-depth.

The reason the fork begins to rattle is that the vibration is near the fork's resonant frequency.  This is the frequency at which a system is best able to absorb energy.  This may sound complicated, but you already have experience with finding a resonant frequency if you've ever played on a swing-set.  The way you pump your legs, pushing forward and pulling pack, is exactly the type of motion I'm talking about.

As a physics student, I've had many opportunities to experiment with resonant frequencies in labs, and get a feel for how the different parameters interact.  I wasn't sure how helpful it would be to show you a few isolated examples, and I wondered how difficult it would be to design an interactive experiment in HTML5.  Thanks to the examples by Daniel Schroeder (who coincidentally wrote the thermal physics textbook I used a few years ago), I was able to put together a simple demo in a matter of hours!

Below, you'll find an animated pendulum with some sliders.  The pendulum has 3 forces acting on it: gravity, which is always pulling it toward its lowest point; a damping force, which slows the pendulum according to its current speed; and a sinusoidal driving force, which pushes and pulls the pendulum with a specific amplitude and frequency (think of the leg-pumping on the swing).

  Canvas not supported; please update your browser.

Damping


Driving Amp


Driving Freq



The units are set up such that the pendulum's natural frequency is 1.  With no damping, this is the same as the resonant frequency, but adding damping brings the resonant frequency down.  I found (0.2, 0.3, 0.9) to be a good set, but the whole point is to play around a bit.  Be sure to leave a comment if you find a particularly interesting setting!

I was amazed how simple it was to make this in HTML5, so I may do more of these in the future.  If you'd like to take a look, I've put a stand-alone version here, so you don't need to go digging through the page source.