Coupled Oscillators - matrix methods

What follows is parallel to section 11.2 of Taylor's textbook. However, I'm re-arranging his formalism so as to allow you to use the matrix functions in Sagemath or Octave more easily to solve coupled problems.

Some linear algebra...

Two column vectors are equal if each of their components are equal...just like our more familiar vectors. For example $$\begincv 1 \\ 7\endcv = \begincv 1 \\ 7\endcv $$ $$\begincv 1 \\ 7\endcv \neq \begincv 7 \\ 1\endcv $$ $$\begincv 1 \\ 7\endcv = \begincv 4-3 \\ 4+3\endcv $$

And we can use familiar vector notation, e.g. for two dimensional vectors: $$\myv a \equiv \begincv a_x \\a_y\endcv.$$ And if two vectors are equal: $$\myv a = \myv b \Rightarrow \begincv a_x \\a_y\endcv = \begincv b_x \\b_y\endcv.$$

Coupled oscillators

Coupled springs / masses

Our two (coupled) equations of motion were... $$\begin{align} m\ddot{x}_1 =& -(k_1+k_2)x_1 + k_2x_2. \nonumber\end{align}$$ $$\begin{align} m\ddot{x}_2 =&k_2x_1-(k_1+k_2)x_2. \nonumber\end{align}$$ Dividing both equations by $m$: $$\begin{align} \ddot{x}_1 =& -\frac{k_1+k_2}m x_1 + \frac{k_2}m x_2. \label{EOM1}\end{align}$$ $$\begin{align} \ddot{x}_2 =&\frac{k_2}m x_1-\frac{k_1+k_2}mx_2. \label{EOM2}\end{align}$$

We can write our 2 equations of motion, Eq \ref{EOM1} and Eq \ref{EOM2} as an equality between two column vectors: $$\begin{align} \begincv \ddot x_1\\ \ddot x_2 \endcv =& \begincv -\frac{k_1+k_2}m x_1 + \frac{k_2}m x_2 \\ \frac{k_2}m x_1-\frac{k_2+k_1}m x_2 \endcv \label{2c} \end{align}$$

More linear algebra: multiplication and matrices

Scalar multiplication works just like it does with regular vectors: $$5\cdot\begincv \frac25 \\ 2\endcv = \begincv 2\\10\endcv $$ You can multiply a 2 element row vector by a 2 element column vector. It works like the dot product: The dot product of two vectors is a single scalar number: $$\begincv 1 & 2\endcv\cdot\begincv 3\\5\endcv= 1\cdot 3+2\cdot5=13.$$

A new thing is that you can multiply a $2\times 2$ matrix by a 2-element column vector in a dot product'ish way. The dot product of the top (bottom) row of the matrix with the column vector is the top (bottom) element of a new column vector $$\begincv 1 & 2\\ 10 & 20\endcv\cdot\begincv 3\\5\endcv= \begincv 1\cdot3+2\cdot 5\\ 10\cdot3+20\cdot 5 \endcv= \begincv 13\\130\endcv.$$

[In case you need a refresher on or intro to matrix multiplication...]

The right hand side of our column vector Eq $\ref{c2}$ can be written as the product of a matrix with a column vector: $$\begin{align} \begincv -\frac{k_1+k_2}m x_1 + \frac{k_2}m x_2 \\ \frac{k_2}m x_1-\frac{k_2+k_1}m x_2 \endcv =& \begincv -\frac{k_1+k_2}m & \frac{k_2}m \\ \frac{k_2}m & -\frac{k_2+k_1}m \endcv \begincv x_1\\x_2 \endcv = \mym{W}\myv x \end{align}$$ where $\myv{x}$ is a two-element column vector $\myv{x} \equiv \begincv x_1\\x_2 \endcv , $

and $\mym W$ is a $2 \times 2$ matrix: $\mym{W} \equiv \begincv -\frac{k_1+k_2}m & +\frac{k_2}m \\ +\frac{k_2}m & -\frac{k_2+k_1}m \endcv $.

Look for pure oscillation solutions

The video suggests that there are some solutions such that $x_1(t)$ and $x_2(t)$ are moving as simple harmonic oscillators, and both have the *same* frequency.

That is... $$x_1(t) = A_1\cos(\omega t+\delta_1);\ \ x_2(t) = A_2\cos(\omega t+\delta_2),$$

Now, following Taylor, we'll think of $x_1$ as the real part of the complex function $$z_1(t)=A_1e^{i(\omega t+\delta_1)}=(A_1e^{i\delta_1})e^{i\omega t}\equiv a_1e^{i\omega t},$$ where $A_1$ is a real scalar constant and $a_1=A_1e^{i\delta}$ is an imaginary constant, defined such that $|a_1|=A_1$. Similarly, we'll define $z_2(t)=a_2e^{i\omega t}$. And this implies: $$\ddot z_1 = -\omega^2z_1;\ \ \ddot z_2 = -\omega^2z_2 $$ or $$ \begincv \ddot z_1 \\ \ddot z_2\endcv = -\omega^2\begincv z_1 \\z_2\endcv\\ $$ Plugging this in to our equation of motion, and using our matrix $\mym W$ we're looking to solve this (matrix) equation: $$\begineq \mym{W}\myv z =& -\omega^2\myv z\\ \mym{W} \begincv a_1e^{i\omega t}\\a_2e^{i\omega t}\endcv =&-\omega^2\begincv a_1e^{i\omega t}\\a_2e^{i\omega t}\endcv\\ e^{i\omega t} \mym W \begincv a_1\\a_2\endcv =&-\omega^2e^{i\omega t}\begincv a_1\\a_2\endcv\\ \mym W \myv a =&-\omega^2\myv a\\ \endeq $$

This has the form of an eigenvalue equation, $\mym M\myv v=\lambda\myv v$.

There is a trivial, but uninteresting solution $\myv a=\begincv 0\\0\endcv$.

We'll use a Very Important Result from linear algebra to find the more interesting solution: There is one or more non-trivial solutions if the determinant of this matrix vanishes: $$\det\left(\mym{M}-\lambda\mathbb{1}\right)=0.$$ $\mathbb{1}$ is the identity matrix, which for $2\times 2$ matrices is: $$\mathbb{1}\equiv \begincv 1 & 0\\0 &1\endcv.$$ This equation is called the Characteristic Equation. The useful thing about it is that we can solve it for the scalar $\lambda$ without having to worry about the unknown $\myv v$! Once we have $\lambda$, we'll use that to find $\myv v$.

The values of $\lambda$ which solve the characteristic equation are called eigenvalues of the matrix, or in our context of coupled oscillators, our scalar is $-\omega^2$ and we call $\omega$ a normal frequency. Let's do it!

Coupled oscillators

Our eigenvalue equation is $\mym W \myv a =-\omega^2\myv a$ so we must solve $\det(\mym W+\omega^2\mathbb{1})=0$: $$\det \begincv -\frac{k_1+k_2}m +\omega^2 & \frac{k_2}m \\ \frac{k_2}m & -\frac{k_2+k_1}m +\omega^2 \endcv =\left(-\frac{k_1+k_2}m +\omega^2\right)^2-\left(\frac{k_2}m\right)^2 =0. $$ This is the "characteristic polynomial" for this matrix.

The 2 quantities inside $\big(...\big)^2$ must have the same magnitudes. There are (at least) 2 possibilities: given by $$-\frac{k_1+k_2}m +\omega^2 = \pm \frac{k_2}m.$$

First solution: $-\frac{k_1+k_2}m +\omega^2 = \color{blue}-\frac{k_2}m$

This implies $$\begineq\omega^2=\frac{k_1+k_2}m - \frac{k_2}m=\frac{k_1}m; \Rightarrow \color{#933}\omega_s=\sqrt{\frac{k_1}m}\endeq$$ We recognize this solution as our "slow" frequency, $\omega_s$.

Plugging this value of $\omega$ into $\mym W\myv a=-\omega_s^2\myv a$: $$\begineq \begincv -\frac{k_1+k_2}m & \frac{k_2}m \\ \frac{k_2}m & -\frac{k_2+k_1}m \endcv \begincv a_1\\a_2\endcv =-\frac{k_1}m\begincv a_1\\a_2\endcv \endeq $$ It looks like we can multiply both equations by $m$ leaving a simpler equation: $$\begineq \begincv -k_1-k_2 & k_2 \\ k_2 & -k_2-k_1 \endcv \begincv a_1\\a_2\endcv =-k_1\begincv a_1\\a_2\endcv \endeq $$ Carrying out the matrix multiplication gives us two equations. The first one: The dot product of the top row with $\myv a$ is $-k_1a_1$: $$\begineq (-k_1-k_2)a_1+k_2a_2=& -k_1a_1\\ -k_2a_1+k_2a_2=& 0\\ \color{#933}\Rightarrow a_1=a_2. \endeq$$ The second equation is $$\begineq k_2a_1 +(-k_1-k_2)a_2=&-k_1a_2\\ k_2a_1 -k_2a_2=&0\\ \color{#933}\Rightarrow a_1=a_2. \endeq$$ No new information in the second equation! But, $a_1=a_2$ implies that $A_1=A_2$ and $\delta_1=\delta_2$. So the two carts have the same amplitude and the same phase. This is our symmetric normal mode:

A general feature of these eigenvalue problems is that you only find the relative amplitudes/phases of the two carts in a normal mode. There is still freedom for the initial conditions to set the absolute amplitudes/phases.

Second solution: $-\frac{k_1+k_2}m +\omega^2 = \color{blue}+ \frac{k_2}m$

This implies $$\begineq\omega^2=\frac{k_1+k_2}m + \frac{k_2}m=\frac{k_1+2k_2}m; \Rightarrow \color{#933}\omega_f =\sqrt{\frac{k_1+2k_2}m}.\endeq$$ We recognize this solution as our "fast" frequency, $\omega_f$.

Plugging this value of $\omega$ into $\mym W\myv a=-\omega_f^2\myv a$, and multiplying both sides by $m$: $$\begineq \begincv -k_1-k_2 & k_2 \\ k_2 & -k_2-k_1 \endcv \begincv a_1\\a_2\endcv =(-k_1-2k_2)\begincv a_1\\a_2\endcv \endeq $$ Carrying out the matrix multiplication gives us two equations. The first one: The dot product of the top row with $\myv a$ is $(-k_1-2k_2)a_1$: $$\begineq (-k_1-k_2)a_1+k_2a_2=& (-k_1-2k_2)a_1\\ k_2a_2=& -k_2a_1\\ \color{#933}\Rightarrow a_1=-a_2. \endeq$$ As before, the second equation gives us no new information, but reaffirms $a_1=-a_2$, which implies that $A_1=-A_2$ and $\delta_1=\delta_2$. Or, if you prefer, $A_1=A_2$ and $\delta_1=\delta_2+\pi$. Either way, the two carts have the same amplitude but are exactly out of phase by 180${}^\circ$. This is our anti-symmetric normal mode:

Solving eigenvalue problems in CoCalc

Once you have the equations of motion arranged in matrix form, the calculation of the normal frequencies and normal modes can be carried out in CoCalc. Using the Sagemath kernel, 4 lines of codes are needed to calculate all of those frequencies and amplitude ratios:

The values returned by eigenvector_right() are the solutions to $\mym W \myv a=\lambda\myv a$, but our problem was $\mym W \myv a = -\omega^2\myv a$.

  • The first eigenvalue is $\lambda=-(k_1+2k_2)/m$. So $\omega=\sqrt{-\lambda}=\sqrt{k_1+2k_2}$.
  • The eigenvector for that first eigenvalue is $\begincv 1\\-1\endcv$. That is, $a_1$ and $a_2$ are in the ratio 1 to -1.
  • The multiplicity of the first eigenvalue is 1.
Follow the same pattern for the second mode.

Multiplicity?

It can happen that there are multiple eigenvectors with the same eigenvalue.

For example, if the multiplicity were 2, then 2 eigenvectors are returned, which together define a plane. Any vector in that plane (that is, any linear combination of the two eigenvectors) is a solution to the eigenvalue equation.

When the identity matrix, $\mathbb{1}$, multiplies any vector, you get the same vector. So all vectors are eigenvectors of the identity matrix.

Therefore, any multiple of the identity matrix in two dimensions should have a multiplicity of 2, and sure enough...

Problem in class

  • Find the solution (CoCalc)
  • How to verify? (and left vs right...)
  • How to imagine?

Identical springs and masses

Consider a simpler-to-calculate case:

  • $m_1=m_2=m$
  • $k_1=k_2=k_1=k$,
Then, we need to find the determinant of this matrix: $$\begineq \mym W \equiv \mym{K}-\omega^2\mym{M} =& \begincv 2k& -k \\ -k& 2k \endcv -\omega^2\begincv m&0 \\ 0&m \endcv \\ =& \begincv 2k-\omega^2m& -k \\ -k& 2k-\omega^2m \endcv \endeq$$

Now, find the eigenfrequencies:

  • Find $\det \mym W$.
  • Write out the characteristic equation, $\det \mym W = 0$ and solve the polynomial equation for $\omega$.

There are potentialy as many eigenvalues as there are elements in the column vector.

First normal mode

To find $\myv a$, substitute (the smaller) $\omega$ back into the equation of motion, and then look for possible components of $\myv a$.

With $\omega_1^2 = k/m$: $$\mym W = \mym{K} -\omega^2\mym M=\begincv k&-k \\ -k&k \endcv.$$

The eigenvector equation (eq of motion) with $\myv{a}$ is: $$0=(\mym{K}-\omega^2\mym M)\myv{a}=\begincv k&-k \\ -k&k \endcv \myv{a}.$$

Which is the same as these two equations $$\begin{array}{}ka_1-ka_2 = 0 \\ -ka_1+ka_2=0\end{array}$$

which are the same relation. Either one implies that $a_1 = a_2$

A general feature of the solution to eigenvalue problems is that you only find the ratios of the components of the eigenvectors, not the absolute values. Thinking of the solution as a vector, this means that you only know the direction of the solution, and you are free to multiply the direction by any scalar.

Ultimately you use initial conditions to set the scalar.

Since $\myv a$ is a vector of complex numbers, we have two free parameters. Let's write the this solution as $a_1=a_2 = Ae^{-i\delta}$ the same solution for both: $$\myv{x}(t) = Re\left[\myv{z}(t)\right] = Re\left[\begincv Ae^{-i\delta} \\ Ae^{-i\delta} \endcv e^{i\omega_1t}\right] =\begincv 1\\1\endcv Re\left[ Ae^{-i\delta} e^{i\omega_1t}\right] .$$

The real part can be written $$\begin{array}{} x_1(t) = A\cos(\omega_1t-\delta) \\ x_2(t) = A\cos(\omega_1t-\delta)\end{array}$$

This is the first normal mode. (Though we might just as well call it an eigenvector of the system).

The two particles swing back and forth with a constant separation between them.

Second normal mode

Now, take the second $\omega$ you found, and find the corresponding solution $\myv x(t)$.








This is the second normal mode.

The two particles swing exactly opposite each other at a higher frequency $\omega_2 > \omega_1$.

A general solution

The equation we've been working at solving, $\mym{M}\ddot{\myv{x}} = -\mym{K}\myv{x}$ is actually two differential equations of 2nd order each, so we'd expect the most general solution to have 4 constants of integration.

Since each of the just-found normal modes are solutions with two constants each, and they're linearly independent from each other, we could write the most general solution as a linear combination of the two normal modes: $$\myv{x}(t) = A_1\begincv 1 \\ 1 \endcv \cos(\omega_1t - \delta_1) + A_2\begincv 1 \\ -1 \endcv \cos(\omega_2t - \delta_2)$$

E.g. for $A_1=1$, $A_2=0.2873$, $\delta_1=0$, $\delta_2=0.455$, $x_1(t)$

$x_2(t)$

Weak coupling

In the system below, the spring connecting the two particles is much weaker than the other springs.

Without the central spring, this system would consist of two independent spring systems, each oscillating with angular frequency $\omega=(k/m)^{1/2}$. How "close" to the independent situation are the solutions for this system?

Looking back at equation (5), our spring matrix is... $\mym{K}=\begincv k+k_2& -k_2 \\ -k_2&k_2+k \endcv .$

And we're interested in the determinant of $\mym{K} - \omega^2 M = \begincv k+k_2-m\omega^2& -k_2 \\ -k_2&k_2+k-m\omega^2 \endcv .$

The determinant of this is $$\begineq 0=&\det[...]=(k-m\omega^2+k_2)^2-k_2^2=\\ =&(k-m\omega^2)^2 +2k_2(k-m\omega^2)\\ =&(k-m\omega^2)(k-m\omega^2+2k_2)\endeq $$

So the eigenvalues are $$\omega_1 = \sqrt{k/m}\text{ and }\omega_2=\sqrt{(k+2k_2)/m}.$$

The first mode--parallel motion--is exactly the same as in the previous case.

The second mode is qualitatively the same as well--the particles move opposite to each other.

Since $k_2 \ll k$, $\omega_2$ is very close to $\omega_1$. If we call $\omega_0$ the average of $\omega_1$ and $\omega_2$, then the two eigenvalues can be written in terms of their (very small) difference $\omega_2-\omega_1=2\epsilon$ as: $\omega_1= \omega_0-\epsilon$ and $\omega_2=\omega_0+\epsilon.$

The general solution will be a linear combination of the two eigenmodes... $$\begineq \myv{z}(t) =& C_1\begincv 1 \\ 1 \endcv e^{i(\omega_0-\epsilon)t} + C_2\begincv 1 \\ -1 \endcv e^{i(\omega_0+\epsilon)t}\\ =&\left[{C_1\begincv 1 \\ 1 \endcv e^{-i\epsilon t}+C_2\begincv 1 \\ -1 \endcv e^{+i\epsilon t}}\right]e^{i\omega_0t}.\endeq $$

Say, for example, that the amplitudes of both are the same... $C_1=C_2=A/2$, this becomes... $$\myv{z}(t)=\frac{A}{2}\begincv e^{-i\epsilon t}+e^{i\epsilon t} \\ e^{-i\epsilon t}-e^{i\epsilon t} \endcv e^{i\omega_0t}=A\begincv \cos(\epsilon t) \\ -i\sin(\epsilon t) \endcv e^{i\omega_0t}$$

Taking the real part, our two positions are: $$\begin{array}{}x_1(t)=A\cos(\epsilon t) \cos(\omega_ot) \\ x_1(t)=A\sin(\epsilon t) \sin(\omega_0t) \end{array}$$

Since $\epsilon \ll \omega_0$, this consists of a slow part, and a faster part.

Homework

Chapter 11: problems 2, 3, 5, 7