tmdsimpy.utils.harmonic.harmonic_stiffness¶
- tmdsimpy.utils.harmonic.harmonic_stiffness(M, C, K, w, h, calc_grad=True, only_C=False)¶
Returns the harmonic stiffness and its frequency derivative.
- Parameters:
- M(N,N) numpy.ndarray
Mass Matrix
- C(N,N) numpy.ndarray
Damping Matrix
- K(N,N) numpy.ndarray
Stiffness Matrix
- wfloat
Frequency (fundamental/harmonic 1)
- h(H,) numpy.ndarray, sorted
List of harmonics, zeroth harmonic must be first if included (best practice for it to be sorted order).
- calc_grad: bool, optional
If True, both outputs are calculated. If False, only E is calculated and returned. Returned values are always included in a tuple. The default is True.
- only_Cbool, optional
Flag to indicate that M and K should both be assumed to be zero. M and K are completely ignored in this case and do not need to be passed in with correct shapes or values. The default is False.
- Returns:
- E(N*Nhc, N*Nhc) numpy.ndarray
Square stiffness matrix corresponding to linear properties at every harmonic. Ordered as all dofs for each of harmonic component and then the next component. If only_C=True, then only the damping properties are applied. Always returned as the first entry of a tuple.
- dEdw(N*Nhc, N*Nhc) numpy.ndarray
Derivative of each entry of E with respect to scalar frequency w. Not returned if calc_grad=False.
Notes
The number of harmonic components is Nhc = tmdsimpy.utils.harmonic.Nhc(h)
The only_C flag is used for EPMC gradient calculations to improve efficiency by eliminating unnecessary operations.