Gimme All Your Modal Damping

The GimmeMCK integrator is one of my more useful contributions to OpenSees. This integrator allows you to extract the individual mass, damping, and stiffness matrices, or some linear combination therein, in order to see what’s assembled in an OpenSees model or to bootstrap new functionality.

While getting the mass and stiffness matrices seems to work, GimmeMCK only worked for Rayleigh and viscous damping (you know, actual damper elements), but not modal damping. I initially thought the issue was how modal damping is computed, but it turns out a simple function, getCFactor(), was not defined in the GimmeMCK class. The fix was so easy I did a web edit on GitHub instead of a branch and pull request.

Before figuring out the issue was a simple fix, I wrote the Python script below to construct the modal damping matrix from eigenvectors, assuming only nodal mass. Try the script on your modal damping models and verify that you get the same result as ops.integrator('GimmeMCK',0,1,0).

import openseespy.opensees as ops
import numpy as np
# Define your model
modalDamping = [0.05,0.1,0.1] ;# Or whatever
Nmodes = len(modalDamping)
w2 = ops.eigen(Nmodes)
N = ops.systemSize()
C = np.zeros((N,N))
for n in range(Nmodes):
    zeta = modalDamping[n]
    wn = w2[n]**0.5
    phin = np.zeros(N)
    for nd in ops.getNodeTags():
        mass = ops.nodeMass(nd)
        for i,dof in enumerate(ops.nodeDOFs(nd)):
            if dof < 0:
            phin[dof] = mass[i]*ops.nodeEigenvector(nd,n+1)[i]
    C = C + 2*zeta*wn*np.outer(phin,phin)

5 thoughts on “Gimme All Your Modal Damping

  1. Hello Professor Michael Scott,
    With the application of ops.integrator(‘GimmeMCK’,0,1,0) I got an array of zeros, with the script showing if I got an array with non-zero values. I’m not sure what I’m doing wrong, I show you part of the code:
    import numpy as np
    from openseespy.opensees import *
    # three-storey frame model
    w2 = eigen(‘-fullGenLapack’,3)

    Ngdl = systemSize()
    C = printA(‘-ret’)
    C = np.array(C)
    C.shape = (Ngdl,Ngdl)


      1. Hello, I too am having the same issue when attempting to pull the damping matrix for modal damping. C is a matrix of zeros.

        I can run my script perfectly with Rayliegh damping, I am able to call the damping matrix – which is diagonally banded as expected. There seems to still be an issue with Modal Damping only.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.