closest_resonance

superfreq.closest_resonance(freqs, max_int=12)[source]

Find the closest resonant vector for the given set of fundamental frequencies.

Parameters:

freqs : array_like

The fundamental frequencies.

max_int : int (optional)

The integer vectors considered will go from -max_int to max_int in each dimension.

Returns:

intvec : numpy.ndarray

The integer vector of the closest resonance.

dist : float

The distance to the closest resonance, e.g., if \(\boldsymbol{n}\) is the resonant integer vector, this is just \(\boldsymbol{n} \cdot \boldsymbol{\Omega}\).