pyyeti.ode.modeselect

pyyeti.ode.modeselect(name, fs, force, freq, Trcv, labelrcv, mfreq, factor=0.6666666666666666, helpmsg=True, ylog=False, auto=None, idlabel='')[source]

Select modes based on mode participation in graphically chosen responses.

Parameters:
  • name (string) – Name of analysis; for example the flight event name; it is used for plot title

  • fs (class) – An instance of SolveUnc or FreqDirect (or similar … must have .fsolve method)

  • force (2d array_like) – Forcing function in frequency domain; # cols = len(freq)

  • freq (1d array_like) – Frequency vector in Hz where solution is requested

  • Trcv (2d array_like) – Data recovery matrix to the desired DOF

  • labelrcv (list/tuple (can be string if Trcv has 1 row)) – List/tuple of labels; one for each row in Trcv; used for legend. May be a string if Trcv has only 1 row.

  • mfreq (array_like) – Vector of modal frequencies (Hz)

  • factor (scalar; optional) – From 0 to 1 for setting the criteria for choosing secondary modes: if mode participation of secondary mode(s) >= factor * max_participation, include it.

  • helpmsg (bool; optional) – If True, print brief message explaining the mouse buttons before plotting anything

  • ylog (bool; optional) – If True, y-axis will be log

  • auto (integer or None; optional) –

    • If None, operate interactively.

    • If an integer, it specifies a row in Trcv row (0-offset) that this routine will automatically (non-interactively) use to select modes. It will select the peak of the specified response and, based on mode participation, return the results. In other words, it acts as if you picked the peak of the specified curve and then hit ‘t’. For example, to choose the 12th row of Trcv, set auto to 11.

  • idlabel (string; optional) – If not ‘’, it will be used in the figure name. This allows multiple getmodepart()’s to be run with the same model, each using its own FRF and MP windows. The figure names will be:

    'FRF - '+idlabel
    'MP - '+idlabel
    
Returns:

  • modes (list) – List of selected mode numbers; 0-offset

  • freqs (1d ndarray) – Vector of frequencies in Hz corresponding to modes.

  • resp (2d ndarray) – The complex frequency responses of the accelerations recovered through Trcv; rows(Trcv) x len(freq)

Notes

This routine is an interface to getmodepart(). See that routine for more information.

This routine can be very useful in selecting modes for damping or just identifying modes. For example, to identify axial modes, excite the structure axially and choose axial DOFs for recovery at the top, bottom, and somewhere in-between.

Examples

>>> import numpy as np
>>> import matplotlib.pyplot as plt
>>> from pyyeti.ode import SolveUnc, modeselect
>>> import scipy.linalg as la
>>> rng = np.random.default_rng()
>>> K = 40*rng.normal(size=(5, 5))
>>> K = K @ K.T       # positive definite K matrix, M is identity
>>> M = None
>>> w2, phi = la.eigh(K)
>>> mfreq = np.sqrt(w2)/2/np.pi
>>> zetain = np.array([ .02, .02, .05, .02, .05 ])
>>> Z = np.diag(2*zetain*np.sqrt(w2))
>>> freq = np.arange(0.1, 15.05, .1)
>>> f = phi[4:].T @ np.ones((1, len(freq)))  # force of DOF 5
>>> Trcv = phi[[0, 2, 4]]                    # recover DOF 1, 3, 5
>>> labels = ['5 to 1', '5 to 3', '5 to 5']
>>> fs = SolveUnc(M, Z, w2)
>>> mfr = modeselect('Demo', fs, f, freq,
...                  Trcv, labels, mfreq)
>>> print('modes =', mfr[0])
>>> print('freqs =', mfr[1])