pyyeti.ode.SolveUnc.fsolve

SolveUnc.fsolve(force, freq, incrb='dva', rf_disp_only=False)[source]

Solve frequency-domain modal equations of motion using uncoupled equations.

Parameters:
  • force (2d ndarray) – The force matrix; ndof x freq

  • freq (1d ndarray) – Frequency vector in Hz; solution will be computed at all frequencies in freq

  • incrb (string; optional) – Specifies how to handle rigid-body responses: can include “a”, “v”, and/or “d” to specify that the rigid-body response should be computed for acceleration, velocity, and/or displacement. For example, incrb="" means that no rigid-body responses are included, and incrb="va" (or incrb="av") means that the rigid-body response will be included for acceleration and velocity but not displacement. Letters can be included in any order.

    For backward compatibility to versions before 0.99.9, incrb can also be an integer 0, 1, or 2. This integer format is deprecated and will be removed in a future version:

    incrb

    description

    0

    same as “” (no rigid-body is included)

    1

    same as “av”

    2

    same as “dva” (all rigid-body responses included)

  • rf_disp_only (bool; optional) – This option specifies how to handle the velocity and acceleration terms for residual-flexibility modes. (The displacements for these modes is always computed statically.) If True, the velocities and accelerations are set to zero. If False, the default and generally recommended setting, they are computed from the normal frequency-domain relationships:

    velocity = i * omega * displacement
    acceleration = -omega ** 2 * displacement
    
Returns:

  • A SimpleNamespace with the members

  • d (2d ndarray) – Displacement; ndof x freq

  • v (2d ndarray) – Velocity; ndof x freq

  • a (2d ndarray) – Acceleration; ndof x freq

  • f (1d ndarray) – Frequency vector (same as the input freq)

Notes

The rigid-body and residual-flexibility modes are solved independently. The displacements for the residual-flexibility modes are solved statically, and the velocities and accelerations are determined according to rf_disp_only.

Rigid-body velocities and displacements are undefined where freq is zero. So, if those rigid-body responses are requested (with incrb), this routine just sets these responses to zero.

See also

FreqDirect

Raises:

NotImplementedError – When attribute cd_as_force is True, since off-diagonal damping as forces is not implemented for the frequency domain.

Examples

>>> from pyyeti import ode
>>> import numpy as np
>>> m = np.array([10., 30., 30., 30.])    # diag mass
>>> k = np.array([0., 6.e5, 6.e5, 6.e5])  # diag stiffness
>>> zeta = np.array([0., .05, 1., 2.])    # % damping
>>> b = 2.*zeta*np.sqrt(k/m)*m            # diag damping
>>> freq = np.arange(0, 35, .1)           # frequency
>>> f = 100*np.ones((4, freq.size))       # constant ffn
>>> ts = ode.SolveUnc(m, b, k)
>>> sol = ts.fsolve(f, freq)

Solve @ 25 Hz by hand for comparison:

>>> w = 2*np.pi*25
>>> i = np.argmin(abs(freq-25))
>>> H = -w**2*m + 1j*w*b + k
>>> disp = f[:, i] / H
>>> velo = 1j*w*disp
>>> acce = -w**2*disp
>>> np.allclose(disp, sol.d[:, i])
True
>>> np.allclose(velo, sol.v[:, i])
True
>>> np.allclose(acce, sol.a[:, i])
True

Plot the four accelerations:

>>> import matplotlib.pyplot as plt
>>> fig = plt.figure('Example', figsize=[8, 8], clear=True,
...                  layout='constrained')
>>> labels = ['Rigid-body', 'Underdamped',
...           'Critically Damped', 'Overdamped']
>>> for j, name in zip(range(4), labels):
...     _ = plt.subplot(4, 1, j+1)
...     _ = plt.plot(freq, abs(sol.a[j]))
...     _ = plt.title(name)
...     _ = plt.ylabel('Acceleration')
...     _ = plt.xlabel('Frequency (Hz)')
../../_images/pyyeti-ode-SolveUnc-fsolve-1.png