Pendulum with Fourier analysis

This program can be used to carry out a Fourier analysis of linear and non-linear oscillations of a mathematical pendulum. This simulation, designed for didactic purposes, makes it possible, for example, to analyze the width of the peak in the spectrum as a function of the damping or, in the non-linear case, to examine the higher harmonics in the spectrum of the thread pendulum as a function of the deflection. The pendulum can also be driven with a periodic function so that the natural frequency of the pendulum and the exciting frequency can be observed in the spectrum.


Operation

After starting the program, the parameters of the pendulum are entered at the top left. Below this, a tick can be placed if the differential equation is to be linearized sin(phi) = phi. The parameters for displaying the functions are entered in the right-hand column. After pressing the "Calculate" button, the function phi(t) is calculated in advance for a relatively long period of time and the Fourier transform (FFT) is also calculated. Both functions are displayed in the desired interval. If the parameters for the display are changed, the "Redraw" button must be pressed to redraw the functions. If a parameter of the pendulum is changed, the "Calculate" button must be pressed again to calculate the functions with new parameters.


Numerical realization

The differential equation is calculated using Runge Kutta 4th order. The step size depends on the parameters of the pendulum. The Fourier transform is calculated using a fast Fourier transform to 2^16 sampling points.

Pendulum with damped oscillation with function Phi(t) and its Fourier transform