So resonance requires three things:
- An oscillator—a system which has some inertia and some restoring force, usually able to contain energy with some sort of characteristic frequency of stable oscillations.
- A driving force—an oscillation at a fixed frequency that is adding energy into the system.
- Dissipation—a drag force like friction that is removing energy from the system.
Given these three features, the amount of energy that ends up in the system can be wildly different depending on the comparison between some derived frequency, and the driving force. This happens because the oscillations superimpose.
An example - a slinky
A really great example, if you can find one, is a Slinky. You can hold one end from your hand and let the other end hang free into open space. It is an oscillator, friction with the air and heating due to internal deformation and eventually self-collision provides the dissipation. You can drive it by moving your hand up and down 1cm, to see how big of an oscillation you can create on the free-hanging edge.
You can drive it with very fast small vibrations, moving your hand up and down as fast as possible that 1cm, and you will see that the bottom of the slinky shakes noisily but mostly stays in the same place. Each pulse takes a certain time to travel down the slinky and then come back to you, you are firing many small pulses into the slinky before any of them come back.
You can on the other hand drive it with vibrations that are as slow as possible, moving your hand up and down the 1cm over the course of many seconds or even a minute. You will notice that the bottom edge of the slinky mostly just follows the top motion of your hand. The pulse is so big that it consumes the entire slinky at once.
But somewhere in the middle between these two, the pulse that you have “put out” is in some sense “coming back” at just the right time so that your next pulse adds directly on to that next one. When you find this frequency, this little motion of only 1cm starts to build up with each motion: at first it is 1cm, then it is 2cm, then it is 3cm, until soon the slinky is moving up by 50cm or more, crashing into itself as it comes higher. And that is what resonance looks like: a tiny driving force stores a tremendous energy in the system.
Another example: a swingset
Have you ever swung on a swingset? This is actually the exact same thing!
If you just stop swinging on a swingset, you will oscillate back and forth and air drag and the friction of the chains will eventually bring you to a halt. Most people intentionally stop before this by increasing their dissipation—they put their feet on the ground.
But what people almost never try is to use the swing off-resonance. Go ahead and try it some time, try to go back-and-forth faster than you normally would. You should find that the reason you never do this is that you never get anywhere. Same if you go too slow, the swing does not recognize it. But as you get closer to the right frequency of shifting backwards and forwards, you start to push the swing forwards while it is going forwards, and pushing it backwards while it is going backwards. And that is huge.
The reason that it is huge comes down to something called the work-energy theorem. This says that the power—kinetic energy per unit time—added to a system depends on a vector “dot product” between the force and the velocity, $$P = F~v~\cos\theta$$ where $\theta$ is the angle between the force and the velocity. If you push in the same direction as velocity, then $\cos\theta = 1$ and you add kinetic energy to the system. If you push against velocity, then $\cos\theta = -1$ and you remove it.
So the energy in the swingset at different human-movement-frequencies depends on two things:
- Dissipation means energy is leaving the system; usually the more energy there is in the system, the more is the flow out of it.
- Driving means that the human is putting energy into or out of the system; it only enters the system if the force can be reinforcing the oscillations in the swing. If you are close to the resonance frequency then you will be pushing it forward while it goes forward, and pulling it back when it comes back, so you will add energy both directions.
Because dissipation increases as you hold more energy, these come to a certain balance point called an equilibrium. These situations are very common in physics; another example would be if there is a clog in a drain, then if you run the faucet at a constant slow rate, the sink will fill up until the pressure at the bottom pushes as much water out of the clog as is flowing in from the top. Actually many high-profile physicists seem to have the same story, that their first bewilderment in physics involved water going downhill, where they childishly thought they could just stop it by placing an object in its way, only to be very surprised when the water started accumulating behind that obstacle until it could flow over or around it and continue on its merry way downstream. Equilibrium!
In a simple differential equation seen with complex numbers
Now if you are in a great technical high school, you might know a bit more technical things like derivatives and complex numbers. Let me guess that maybe you are and give you a slightly more mathematical view of these sorts of systems.
The absolute easiest place to see these balances in a real equation is in a differential equation that contains the basics of linear drag, harmonic response, and forcing, $$\ddot x(t) + 2 \lambda \dot x(t) + \Omega^2 x(t) = e^{is t}.$$ The first term is if you like an acceleration for a unit mass; it is a second time derivative of some function $x(t)$. The third term complements it with a restoring force, and if those two terms were all, the system would oscillate like $\cos(\Omega t)$ or so. The term between them adds the drag force, at the level that bacteria and other small things experience, an $|F| \propto |v|$ drag—us big creatures in air actually typically see an $|F| \propto |v|^2$ drag, but this one is easier to solve.
Finally we have the forcing term, which I am writing as the complex oscillation $e^{ist}$ for variable $s$. There is nothing in theory wrong with using real numbers and $\cos(st)$ if you are not comfortable with these yet, but one does have to then do a lot of work with sines and cosines to get the same basic answers and as one becomes more and more of a physicist one gets more and more lazy.
Given this equation, it is clear that a particular solution $x(t) = A e^{is t}$ will work, but only if $A$ is a very particular complex number: $$
A (-s^2) e^{ist} + 2 i \lambda s e^{ist} + \Omega^2 e^{ist} = e^{ist}\\
A = \frac{1}{-s^2 + 2 i \lambda s + \Omega^2}.$$(This is only one solution out of many, but the general solution just adds some terms that exponentially decay to zero due to this loss term $\lambda$ so that this $A e^{is t}$ term is the only long-lived term. Search for “overdamping” to see the details of these decays worked out.)
The squared magnitude of the resulting wave usually has something to do with the energy stored in the resonator and it depends on the frequency of the resonator as $$|A|^2 = \frac1{(\Omega^2 - s^2)^2 + 4 \lambda^2 s^2}$$This attains its maximum at a very particular frequency, $s^2 = \Omega^2 - 2 \lambda^2$ or so. In other words it's not quite the resonant frequency of the oscillator $\Omega$ but it is close by, shifted by the loss parameter $\lambda^2/\Omega$ or so away.