loaded-string-simulator is a physics simulator that can simulate loaded strings and mass-spring coupled oscillators. It uses the GNU Scientific Library (GSL) for computation and gnuplot to generate plots.
This program was developed on Linux. It may work on MacOS, but probably will not work on Windows since commands are fed to gnuplot through a pipe.
Ensure GSL, libgsl-devel, and gnuplot are installed. If you want to generate gifs, install either ffmpeg or imagemagick and enable the appropriate option for GIFFLAGS in the makefile.
Then run
make
Change #define statements in plot.c to change the appearance of plots.
Setup simulation parameters, following the pattern in either examples/examplestringsetup.txt or examples/examplespringsetup.txt.
Then run
./simulate [OPTIONS] [FILE]
-p, --print
prints eigenfrequencies, eigenvectors, and mode amplitudes in terminal (default
option if no options specified)
-e, --eigenfrequencies
plots eigenfrequencies
-a, --amplitudes
plots mode amplitudes
-m, --modes
plots individual normal modes
-s, --simulate [TIME_SCALE]
animates the simulation at a speed TIME_SCALE x real speed. TIME_SCALE
defaults to 1.0 if unspecified
-g, --gif
only use following -s option. Saves animation as a .gif
This project is licensed under the GPLv3.