These exercises are not tied to a specific programming language. Example implementations are provided under the Code tab, but the Exercises can be implemented in whatever platform you wish to use (e.g., Excel, Python, MATLAB, etc.).
## Exercise 1: Derive the generalized eigenvalue equation for your coupled oscillators assuming sinusoidal motion
As you've learned, a set of $N$ coupled oscillators such as masses on $N + 1$ springs exhibit sinusoidal motion, but instead of have one sinusoid with one frequency, a set of $N$ coupled oscillators will exhibit sinusoidal motion with $N$ frequencies. Show that your system can be modeled by the eigenvalue equation $\left( K - \omega^2 M \right) \vec{A} = 0 $, where $M$ is your mass matrix of the form
$ M =
\begin{pmatrix}
m_1 & 0 & 0 & 0 & ... & 0 & 0 \\\
0 & m_2 & 0 & 0 & ... & 0 & 0 \\\
0 & 0 & m_3 & 0 & ... & 0 & 0 \\\
... & ... & ... & ... & ... & ... & ...\\\
0 & 0 & 0 & 0 & ... & m_{N-1} & 0 \\\
0 & 0 & 0 & 0 & ... & 0 & m_N
\end{pmatrix}
$ ,
$K$ is your spring constant matrix of the form
$ K =
\begin{pmatrix}
k_1 + k_2 & -k_2 & 0 & 0 & ... & 0 & 0 & 0 \\\
-k_2 & k_2 + k_3 & -k_3 & 0 & ... & 0 & 0 & 0\\\
0 & -k_3 & k_3 + k_4 & -k_4 & ... & 0 & 0 & 0\\\
... & ... & ... & ... & ... & ... & ...\\\
0 & 0 & 0 & 0 & ... & -k_{N-1} & k_{N-1} + k_N & -k_N \\\
0 & 0 & 0 & 0 & ... & 0 & -k_N & k_N + k_{N+1}
\end{pmatrix}
$ ,
$\omega^2$ are your eigenvalues with $\omega$ being the angular frequency of your oscillations, and $\vec{A}$ are the eigenvectors which give the relative amplitudes of each mass's motion for that frequency. Both of the matrices should be of dimension $N \times N$.
To do this, setup equations of motion for your system using Newton's 2nd Law for each mass, then assume that the solution for each equation of motion has the form $x_i(t) = A_i \sin \left( \omega t + \phi \right)$ where $\phi$ is a phase offset that we generally won't worry about. Once you've put the assumed solution into all of the equations, then organize them into matrix form.
## Exercise 2: Find the normal mode frequencies and amplitudes numerically
You have likely solved the general coupled oscillator problem for two masses and some special cases of the three mass version. The general version of the three mass problem where each mass and each spring can be different is in principle analytically solveable, but is an alegrabic nightmare. For anything above three masses, analytic solutions are not possible. Here we will turn to numerical methods to solve these systems.
Write code that does the following:
- Builds $M$ and $K$ matrices out of a list of $N$ masses and $N+1$ spring constants. If you are doing the experimental part of this exercise set then you will eventually use the masses and spring constants from your experiment. Make your code flexible enough that it can handle different values of $N$.
- Use a library to solve the generalized eigenvalue problem $\left( K - \omega^2 M \right) \vec{A} = 0 $ for $N$ values of $\omega^2$ and $\vec{A}$.
You should find that your solutions have the following properties:
- All values of $\omega^2$ are positive, so that all values of $\omega$ are real
- No repeat values for $\omega^2$
- All of the components of $\vec{A}$ should be real
Find a way to display the frequencies and amplitudes of your system's normal modes. One example of this would be the plot below. Explain in words what your display means.

## Exercise 3: Experimentally demonstrate the normal modes of at least three coupled oscillators
*Note to Instructors: This section will assume that the students are going to use three carts connected with springs on an inclined plane which are then given some initial perturbation and allowed to oscillate. Results will be analyzed using Fourier transforms. For a short discussion of some other options, see the Instructor Guide.*
Build a set of at least three coupled harmonic oscillators whose positions, velocities, and/or accelerations you can measure as a function of time. Your instructor will provide details on the available materials for your experiment, but your design should be able to:
- Couple at least three masses on springs
- Provide high-frequency (at least 10 per second) measurements of the positions, velocities, and/or accelerations of the masses
- Save the resulting data in a easy-to-read format
You will need to measure the masses of your objects and the spring constants for your springs. Be particularly careful about the spring constants, because if you get these wrong your experimental results won't agree with your theoretical results. You should also set your data collection so that the positions of each cart reads zero when they are all at their equilibrium positions. We will define coordinates for each of the carts such that $x_i = 0$ at equilibrium, where $i$ represents the number of the cart (cart 1, cart 2, etc.).
Once you have your setup, try moving one or more of your carts away from equilibrium and then letting them go. You should notice that all of your carts start moving, but the motion is complicated instead of being nicely sinusoidal like you would expect from a single harmonic oscillator. Try several different initial conditions and observe how the resulting motion is different each time.
Once you have a feel for the sorts of motion your system will undergo, try actually taking some data. Start collecting data just before you release the carts, and collect data for long enough that you see many local maxima and minima in the data. Take several trials where you pull the carts away from equilibrium in different ways. You can also try changing the masses of the carts or swapping out springs. Be sure to keep careful notes of which masses and spring constants do with which data. An example of the type of time series data you should see is displayed below.

In Exercise 2 you found the normal mode frequencies for your system of masses and springs. In order to show that the data you collected is actually just the sum of $N$ sinusoids with the normal mode frequencies you calculated, take a Fourier transform of your data. Your instructor will direct you to a library or code to do a Fast Fourier Transform (FFT). FFTs are one of the most important data analysis tools in modern physics and are used everywhere from signal processing to spectroscopy. When you take the FFT of your data you will map your data onto a series of sinusoids with a range of frequencies. The smallest frequency you have access to is determined by the duration of your time series and the highest frequency is determined by the rate at which you are taking data. The output of the FFT is often called a power spectrum, because it will give you the power (which is the absolute value of the amplitude squared) at each frequency. Describe in words what you expect the FFT to look like before you plot the power spectrum.
Create a plot of the power spectrum for each of the masses for which you have data. On the same plot mark vertical lines at the calculated normal mode frequencies you found in Exercise 2. You should find that you see $N$ peaks in your power spectrum, one at each normal mode frequency. Explain in words how this shows agreement between your mathematical model and your experimental system.