Skip to content

eigenWavespeed

ColtonKawamura edited this page Sep 16, 2026 · 1 revision

plotEigenWavespeed (file: eigenWavespeed.m)

Plots the group/phase wave speed c_n = omega_n / k_n of each damped eigenmode as a function of its frequency omega_n. For every (pressure, damping) combination in the data it: extracts the modes with positive imaginary part, finds each mode's dominant wavenumber k_n by 2D-FFTing the x-component of the eigenvector (interpolated onto a regular grid), then plots c_n vs omega_n on log-log axes. Marker color encodes pressure, marker size encodes damping.

Note 1: The function is declared as plotEigenWavespeed inside the file eigenWavespeed.m. MATLAB requires the function name to match the filename, so the file must be renamed to plotEigenWavespeed.m (or the declaration changed) before it can be called.

Note 2: This function depends on helpers from the parent project GranMA (filterData, plotEigenmode, normVarColor) — make sure that repo is on the MATLAB path.

Default Syntax

plotData = load("path/to/2D_damped_eigenstuff_....mat");  % outData struct from processEigenModesDampedPara
pressureList = [0.01 0.05 0.1];   % double vector, pressures in the data
dampingList = [0.001 0.01 0.03];  % double vector, dampings in the data
plotEigenWavespeed(plotData, pressureList, dampingList)

This plots c_n vs omega_n for all requested (pressure, damping) combinations in one figure. Scalar lists are fine — a single pressure or a single damping produces one curve (blue, fixed marker size).

Arguments

Arg Type Meaning
plotData struct outData struct (cells eigenVectors/eigenValues, columns pressure/damping/positions/radii/Lx/Ly/springConstant)
pressureList double vector Pressures to plot, must match values present in plotData.pressure
dampingList double vector Dampings to plot, must match values present in plotData.damping

Example

outData = load('data/junkyard/2D_damped_eigenstuff_N400_20by20_K100_M1.mat').outData;

% Full sweep: 3 pressures x 3 dampings
plotEigenWavespeed(outData, [0.01 0.05 0.1], [0.001 0.01 0.03]);

% Single pressure, several dampings
plotEigenWavespeed(outData, 0.1, [0.001 0.01 0.03]);

% A couple of selected (P, gamma) pairs only
plotEigenWavespeed(outData, [0.01 0.1], [0.001 0.03]);

The FFT wavenumber estimate uses a fixed 0.1 grid spacing (hardcoded in the function), so the reported k_n is a low-resolution estimate of the mode's dominant wavevector.

Clone this wiki locally