summaryrefslogtreecommitdiff
path: root/content/know/concept/harmonic-oscillator/index.pdc
blob: 5d97a24f5355c8ea84f1c642591014cb82436537 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
---
title: "Harmonic oscillator"
firstLetter: "H"
publishDate: 2021-06-02
categories:
- Physics
- Mathematics

date: 2021-03-09T20:35:14+01:00
draft: false
markup: pandoc
---

# Harmonic oscillator

A **harmonic oscillator** obeys
the simple 1D version of [Hooke's law](/know/concept/hookes-law/):
to displace the system away from its equilibrium,
the needed force $F_d(x)$ scales linearly with the displacement $x(t)$:

$$\begin{aligned}
    F_d(x) = k x
\end{aligned}$$

Where $k$ is a system-specific proportionality constant,
called the **spring constant**,
since a spring is a good example of a harmonic oscillator,
at least for small displacements.
Hooke's law is also often stated for
the restoring force $F_r(x)$ instead:

$$\begin{aligned}
    F_r(x) = - k x
\end{aligned}$$

Let a mass $m$ be attached to the end of the spring.
After displacing it, we let it go $F_d = 0$,
so Newton's second law for the restoring force $F_r$ demands that:

$$\begin{aligned}
    F_r = m x''
\end{aligned}$$

But $F_r = - k x$,
meaning $m x'' = - k x$,
leading to the following equation for $x(t)$:

$$\begin{aligned}
    \boxed{
        x'' + \omega_0^2 x = 0
    }
\end{aligned}$$

Where $\omega_0 \equiv \sqrt{k / m}$ is the **natural frequency** of the system.
This differential equation has the following general solution:

$$\begin{aligned}
    \boxed{
        x(t)
        = C_1 \sin\!(\omega_0 t) + C_2 \cos\!(\omega_0 t)
    }
\end{aligned}$$

Where $C_1$ and $C_2$ are constants determined by the initial conditions.
For example, for $x(0) = 1$ and $x'(0) = 0$, the solution becomes:

$$\begin{aligned}
    x(t) = \cos\!(\omega_0 t)
\end{aligned}$$

When using Lagrangian mechanics or Hamiltonian mechanics,
we need to know the potential energy $V(x)$
added to the system by a displacement to $x$.
This equals the work done by the displacement,
and is therefore given by:

$$\begin{aligned}
    V(x) = \int_0^x F_d(x) \:dx = \frac{1}{2} k x^2 = \frac{1}{2} m \omega_0^2 x^2
\end{aligned}$$


## Damped oscillation

If there is a **friction force** $F_f$ affecting the system,
then the oscillation amplitude will decrease,
or it might not oscillate at all.
We define $F_f$ using a **viscous damping coefficient** $c$:

$$\begin{aligned}
    F_f = - c x'
\end{aligned}$$

Both $F_r$ and $F_f$ are acting on the system,
so Newton's second law states that:

$$\begin{aligned}
    m x'' = - c x' - k x
\end{aligned}$$

This can be rewritten in the following conventional form
by defining the **damping coefficient** $\zeta \equiv c / (2 \sqrt{m k})$,
which determines the expected behaviour of the system:

$$\begin{aligned}
    \boxed{
        x'' + 2 \zeta \omega_0 x' + \omega_0^2 x = 0
    }
\end{aligned}$$

The general solution is found from the roots $u$ of the auxiliary quadratic equation:

$$\begin{aligned}
    u^2 + 2 \zeta \omega_0 u + \omega_0^2 = 0
\end{aligned}$$

The discriminant $D = 4 \zeta^2 \omega_0^2 - 4 \omega_0^2$
tells us that the behaviour changes substantially
depending on the damping coefficient $\zeta$,
with three possibilities: $\zeta < 1$ or $\zeta = 1$ or $\zeta > 1$.

If $\zeta < 1$, there is **underdamping**:
the system oscillates with exponentially decaying
amplitude and reduced frequency $\omega_1 \equiv \omega_0 \sqrt{1 - \zeta^2}$.
The general solution is:

$$\begin{aligned}
    \boxed{
        x(t)
        = \big( C_1 \sin\!(\omega_1 t) + C_2 \cos\!(\omega_1 t) \big) \exp\!(- \zeta \omega_0 t)
    }
\end{aligned}$$

If $\zeta = 1$, there is **critical damping**:
the system returns to its equilibrium point in minimum time.
The general solution is given by:

$$\begin{aligned}
    \boxed{
        x(t)
        = \big( C_1 + C_2 t \big) \exp\!(- \omega_0 t)
    }
\end{aligned}$$

If $\zeta > 1$, there is **overdamping**:
the system returns to equilibrium slowly.
The general solution is as follows,
where $\omega_1 \equiv \omega_0 \sqrt{\zeta^2 - 1}$:

$$\begin{aligned}
    \boxed{
        x(t)
        = \big( C_1 \exp\!(\omega_1 t) + C_2 \exp\!(- \omega_1 t) \big) \exp\!(- \zeta \omega_0 t)
    }
\end{aligned}$$


## Forced oscillation

In the differential equations given above,
the right-hand side has always been zero,
meaning that the oscillator is not affected by any external forces.
What if we put a function there?

$$\begin{aligned}
    x'' + 2 \zeta \omega_0 x' + \omega_0^2 x = f(t)
\end{aligned}$$

Obviously, there exist infinitely many $f(t)$ to choose from,
and each needs a separate analysis.
However, there is one type of $f(t)$ that deserves special mention,
namely sinusoids:

$$\begin{aligned}
    \boxed{
        x'' + 2 \zeta \omega_0 x' + \omega_0^2 x = \frac{F}{m} \cos\!(\omega t + \chi)
    }
\end{aligned}$$

Where $F$ is a constant force, $\chi$ is an arbitrary phase,
and the frequency $\omega$ is not necessarily $\omega_0$.
We solve this case for $x(t)$ in detail.
Consider the complex version of the equation:

$$\begin{aligned}
    X'' + 2 \zeta \omega_0 X' + \omega_0^2 X = \frac{F}{m} \exp\!\big(i (\omega t + \chi)\big)
\end{aligned}$$

Then $x(t) = \Re\{X(t)\}$.
Inserting the ansatz $X(t) = C \exp\!(i \omega t)$,
for some constant $C$:

$$\begin{aligned}
    - C \omega^2 + C 2 i \zeta \omega_0 \omega + C \omega_0^2 = \frac{F}{m} \exp\!(i \chi)
\end{aligned}$$

Where $\exp\!(i \omega t)$ has already been divided out.
We isolate this equation for $C$:

$$\begin{aligned}
    C
    = \frac{F}{m \big((\omega_0^2 - \omega^2) + 2 i \zeta \omega_0 \omega\big)} \exp\!(i \chi)
    = \frac{F \big((\omega_0^2 - \omega^2) - 2 i \zeta \omega_0 \omega\big)}
    {m \big((\omega_0^2 - \omega^2)^2 + 4 \zeta^2 \omega_0^2 \omega^2\big)}
    \exp\!(i \chi)
\end{aligned}$$

We would like to rewrite this in polar form $C = r \exp\!(i \theta)$,
which turns out to be as follows:

$$\begin{aligned}
    C
    &= \frac{F}{m \sqrt{(\omega_0^2 - \omega^2)^2 + 4 \zeta^2 \omega_0^2 \omega^2}}
    \exp\!\bigg(i \chi - i \arctan\!\Big(\frac{2 \zeta \omega_0 \omega}{\omega_0^2 - \omega^2}\Big)\bigg)
\end{aligned}$$

For brevity, let us define the **impedance** $Z$
and the **phase shift** $\phi$
in the following way:

$$\begin{aligned}
    Z
    \equiv \sqrt{(\omega_0^2 - \omega^2)^2 / \omega^2 + 4 \zeta^2 \omega_0^2}
    \qquad \quad
    \phi
    \equiv \arctan\!\Big(\frac{2 \zeta \omega_0 \omega}{\omega_0^2 - \omega^2}\Big)
\end{aligned}$$

Returning to the original ansatz $X(t) = C \exp\!(i \omega t)$,
we take its real part to find $x(t)$:

$$\begin{aligned}
    \boxed{
        x(t)
        = \frac{F}{m \omega Z} \sin\!(\omega t + \chi - \phi)
    }
\end{aligned}$$

Two things are noteworthy here.
Firstly, $f(t)$ and $x(t)$ are out of phase by $\phi$; there is some lag.
This is caused by damping, because if $\zeta = 0$, it disappears $\phi = 0$.

Secondly, the amplitude of $x(t)$ depends on $\omega$ and $\omega_0$.
This brings us to **resonance**,
where the amplitude can become extremely large.
Actually, resonance has two subtly different definitions,
depending on which one of $\omega$ and $\omega_0$ is a free parameter,
and which one is fixed.

If the natural $\omega_0$ is fixed and the driving $\omega$ is variable,
we find for which $\omega$ resonance occurs by minimizing the amplitude denominator $\omega Z$.
We thus find:

$$\begin{aligned}
    0
    = \dv{(\omega Z)}{\omega}
    = \frac{- 4 \omega_0^2 \omega + 4 \omega^3 + 8 \zeta^2 \omega_0^2 \omega}{2 \sqrt{(\omega_0^2 - \omega^2)^2 + 4 \zeta^2 \omega_0^2 \omega^2}}
    \quad \implies \quad
    \boxed{
        \omega = \omega_0 \sqrt{1 - 2 \zeta^2}
    }
\end{aligned}$$

Meaning the resonant $\omega$ is lower than $\omega_0$,
and resonance can only occur if $\zeta < 1 / \sqrt{2}$.

However, if the driving $\omega$ is fixed and the natural is $\omega_0$ is variable,
the problem is bit more subtle:
the damping coefficient $\zeta = c / (2 m \omega_0)$
depends on $\omega_0$.
This leads us to:

$$\begin{aligned}
    0
    = \dv{(\omega Z)}{\omega_0}
    = \frac{4 \omega_0^3 - 4 \omega^2 \omega_0}{2 \sqrt{(\omega_0^2 - \omega^2)^2 + c^2 \omega^2 / m^2}}
    \quad \implies \quad
    \boxed{
        \omega_0 = \omega
    }
\end{aligned}$$

Surprisingly, the damping does not affect $\omega_0$, if $\omega$ is given.
However, in both cases, the damping *does* matter for the eventual amplitude:
$c \to 0$ leads to $x \to \infty$,
and resonance disappears or becomes negligible for $c \to \infty$.



## References
1.  M.L. Boas,
    *Mathematical methods in the physical sciences*, 2nd edition,
    Wiley.