Quanta Magazine

Eigen Value Problem For Coupled Oscillators. Simulation in C++ ImGui

Markus Buchholz
5 min readMay 22, 2023

--

The study of oscillator systems is crucial in understanding the dynamic behavior of various physical systems. In this article, we focus on an oscillator system consisting of two masses connected by three springs. I discussed these phenomena in my previous article.
The current goal is to analyze the system’s natural frequencies and corresponding mode shapes using eigenvalue analysis. This analysis provides valuable insights into the system’s behavior and allows for the prediction of its response to different initial conditions.

By solving the eigenvalue problem, we obtain the natural frequencies and corresponding mode shapes of the oscillator system (with two masses and three springs). The eigenvalues represent the frequencies at which the system naturally oscillates, while the eigenvectors correspond to the patterns of motion exhibited by the masses. The analysis of eigenvalues and eigenvectors allows us to understand the system’s behavior, identify dominant modes, and assess stability.

For a system with two masses and three springs, there will be two eigenvectors (one for each mass), and each eigenvector will correspond to a specific oscillatory mode with a unique frequency. The frequencies associated with the eigenvectors will depend on the spring stiffness K and mass distribution of the system.

The source code in C++ you will find on my Github.

We will try to solve the eigenvalue problem for the system when the two masses in the oscillator system are different. In this case, computing the eigenvectors will provide us with the initial displacements of the masses that correspond to the same frequency mode. This means that for each eigenvalue, there will be a corresponding eigenvector that represents a specific mode of oscillation with a particular frequency.

The eigenvectors (I used the Eigen C++ library) provide information about the relative displacements between the masses in each oscillatory mode. The magnitudes and signs of the components of the eigenvector indicate the amplitudes and phase relationships of the displacements.

In the case of different masses, the eigenvectors will capture the specific combination of displacements for each mass that results in the desired frequency mode. The eigenvector associated with a particular mode will have different values for each mass, reflecting their respective contributions to the oscillation.

Later, by applying the initial displacements provided by the eigenvectors, we will initiate the oscillation of the system at the desired frequency mode (one for the whole system) The masses will then move in accordance with their respective displacements and the dynamics of the system, exhibiting the same frequency as indicated by the eigenvalue associated with that mode.

Again, it’s important to note that the eigenvalues represent the frequencies of the oscillatory modes, while the eigenvectors represent the associated displacements.

First, I solve the eigenvalue problem in the simulation. The output generated from this analysis is then used as input for solving differential equations through the Runge Kutta method (I explained this method here).

Consider an oscillator consisting of two masses, m1 and m2, connected by three springs with spring constants k1, k2, and k3.

Let x1(t) and x2(t) be the displacements of m1 and m2 from their respective equilibrium positions as functions of time t.

Coupled oscillator (by author)

The equation of motion for m1 can be written as:

similarly, the equation of motion for m2 is given by:

We can rewrite the above equations in matrix form as:

Introducing the column vector x = [x1, x2].T and the matrix M and K as:

The equation can be written in a more compact form as:

To find the eigenvalues and eigenvectors of the system, we assume a solution of the form

where A is a constant vector. Substituting this into the equation, we get:

Canceling,

we obtain the eigenvalue problem,

Solving this eigenvalue problem will give us the eigenvalues λ and corresponding eigenvectors A.

I the above equation using the Eigen C++ library (see my code source), but first I divided matrix K by M,

I have generated a plot displaying the displacement results for m1 and m2. If the initial positions satisfy the eigenvectors, the system will oscillate with a specific frequency.

Mass displacement (by author)

For initial values of m1 = 58.0 and m2 = -81.0, we get

Mass displacement (by author)

If the starting position is not the same as the one that was originally calculated, the system exhibits chaotic behavior. Initial values of m1 = 8.0 and m2 = -108.0,

Mass displacement (by author)
Mass displacement (by author)

Thank you for reading.

--

--