femlabpy.damping#
Damping-matrix builders for structural dynamics.
Workflow role#
This module converts modal targets into an explicit damping matrix after the
mass and stiffness matrices are available. It is usually read together with
femlabpy.modal and femlabpy.dynamics because those modules supply the
frequencies, mode shapes, and time integrators that consume the damping model.
Public entry points#
rayleigh_coefficientsfits the two proportional damping constants from two target frequencies and damping ratios.rayleigh_dampingassembles the physical damping matrix fromMandK.modal_dampingbuilds a dense damping matrix from explicit modal targets for reduced or teaching-scale problems.
Functions#
|
Construct a dense Caughey damping matrix from explicit modal damping ratios. |
|
Compute Rayleigh damping mass and stiffness proportional multipliers. |
|
Build the Rayleigh (proportional) damping matrix C = alpha*M + beta*K. |
Function Reference#
- femlabpy.damping.modal_damping(M, omega, phi, zeta)[source]#
Construct a dense Caughey damping matrix from explicit modal damping ratios.
Unlike Rayleigh damping which only fits two points, modal damping allows you to specify the exact critical damping ratio for an arbitrary number of individual modes. The resulting matrix will preserve the classical normal modes of the system.
- Parameters:
- Mndarray, shape (ndof, ndof)
Global mass matrix (dense).
- omegaarray_like, shape (n_modes,)
Natural circular frequencies (rad/s) for each mode.
- phindarray, shape (ndof, n_modes)
Mass-normalized mode shape matrix (eigenvectors). Must satisfy phi^T @ M @ phi = I.
- zetaarray_like, shape (n_modes,)
Target critical damping ratios for each individual mode.
- Returns:
- Cndarray, shape (ndof, ndof)
The explicit dense damping matrix.
- femlabpy.damping.rayleigh_coefficients(omega1: float, omega2: float, zeta1: float, zeta2: float) tuple[float, float][source]#
Compute Rayleigh damping mass and stiffness proportional multipliers.
Rayleigh damping constructs the damping matrix as a linear combination of the mass and stiffness matrices,
C = alpha * M + beta * K.This function computes the coefficients alpha and beta such that the specified modal damping ratios (zeta1, zeta2) are achieved at the given circular natural frequencies (omega1, omega2).
- Parameters:
- omega1, omega2float
Two target circular natural frequencies (rad/s). If you have frequencies in Hz, multiply by 2*pi before passing them to this function.
- zeta1, zeta2float
Desired critical damping ratios at those frequencies (e.g., 0.05 for 5%).
- Returns:
- alphafloat
Mass-proportional coefficient (s^-1).
- betafloat
Stiffness-proportional coefficient (s).
Examples
>>> # Compute coefficients for 5% damping at 10 rad/s and 50 rad/s >>> alpha, beta = rayleigh_coefficients(10.0, 50.0, 0.05, 0.05)
- femlabpy.damping.rayleigh_damping(M, K, alpha: float, beta: float)[source]#
Build the Rayleigh (proportional) damping matrix C = alpha*M + beta*K.
This formulation creates a classical damping matrix that preserves the normal modes of the undamped system. Because it is a linear combination of the mass and stiffness matrices, the resulting damping matrix C will automatically inherit their sparsity patterns, making it highly efficient for implicit time-history analysis using direct solvers.
- Parameters:
- Mndarray or scipy.sparse matrix, shape (ndof, ndof)
Global mass matrix of the structure.
- Kndarray or scipy.sparse matrix, shape (ndof, ndof)
Global stiffness matrix of the structure.
- alphafloat
Mass-proportional damping multiplier (s^-1). Controls damping at low frequencies.
- betafloat
Stiffness-proportional damping multiplier (s). Controls numerical damping at high frequencies.
- Returns:
- Cndarray or scipy.sparse.lil_matrix, shape (ndof, ndof)
The explicit global damping matrix. If either M or K is sparse, the returned C will be a sparse LIL matrix suitable for assembly or conversion to CSR/CSC formats.
Examples
>>> alpha, beta = rayleigh_coefficients(10.0, 50.0, 0.05, 0.05) >>> C = rayleigh_damping(M, K, alpha, beta)