<-- Go back to artificial sweeps
Nearest neighbour sweep
Let the candidate solutions at frequency step \(k\) be indexed by \(s = 1, \dots, N_{\mathrm{seeds}}\), with modal amplitude vector \(\mathbf{A}_{k,s}\) and phase vector \(\boldsymbol{\phi}_{k,s}\). The distance in amplitude to the previously selected solution is defined as
where \(M\) is the number of response components and \(\varepsilon\) is a small constant introduced to avoid division by zero.
To account for phase wrapping, the phase mismatch is evaluated using a circular distance:
The corresponding normalized phase distance is
These two terms are combined into a total cost function
where \(w_{\phi}\) controls the relative importance of phase continuity and \(\lambda_{\mathrm{switch}}\) penalizes switching to a different seed than the one selected at the previous step. The indicator function is defined as
The selected solution at frequency step \(k\) is then
After selection, the reference state is updated according to
The sweep is initialized by selecting the medoid of the candidate amplitude vectors at the initial frequency step. In other words, the initial seed is chosen as the candidate whose average distance to all other candidates is minimal. Denoting the candidate amplitude vectors at \(k=0\) by \(\mathbf{A}_{0,s}\), this is written as
where \(d(\cdot,\cdot)\) is a distance measure between amplitude vectors. In the present work, the normalized root-mean-square distance is used:
This initialization selects a representative candidate among the available responses while ensuring that the starting point corresponds to an actually computed solution.
Overall, this procedure can be interpreted as a greedy continuation method in frequency space. By minimizing the local mismatch in amplitude and phase between consecutive frequency steps, and by discouraging unnecessary switching between seeds, Poscidyn reconstructs smooth response branches that closely resemble experimentally measured frequency sweeps. The package therefore provides an efficient and experimentally relevant tool for generating large datasets of nonlinear frequency responses for subsequent machine-learning-based parameter identification.