Eigenvalue Results

[25]:
import openseespy.opensees as ops
import opstool as opst
import matplotlib.pyplot as plt

We use the built-in arch bridge example and visualize it:

[22]:
opst.load_ops_examples("ArchBridge")

# plot
opst.vis.pyvista.set_plot_props(notebook=True)
fig = opst.vis.pyvista.plot_model()
fig.show(jupyter_backend="static")
OPSTOOL ::  Model data has been saved to _OPSTOOL_ODB/ModelData-None.nc!
../../_images/src_post_eigen_3_1.png

Eigenvalue analysis data saving

API: opstool.post.save_eigen_data()

The following is our automatic analysis and saving of the data for the first 12 modes:

[3]:
opst.post.save_eigen_data(odb_tag=1, mode_tag=12)
Using DomainModalProperties - Developed by: Massimo Petracca, Guido Camata, ASDEA Software Technology
OPSTOOL ::  Eigen data has been saved to _OPSTOOL_ODB/EigenData-1.nc!

Read the eigen data

API: opstool.post.get_eigen_data()

The following reads the saved data, noting that the odb_tag parameter is used to identify which result is being read

[4]:
model_props, eigen_vectors = opst.post.get_eigen_data(odb_tag=1)
OPSTOOL ::  Loading eigen data from _OPSTOOL_ODB/EigenData-1.nc ...

Eigen vectors

In structural dynamics, eigenvectors play a crucial role in understanding the behavior of structures under dynamic loads. They provide insights into how a structure deforms or vibrates at specific natural frequencies (eigenvalues). These vectors, often referred to as mode shapes, are fundamental in modal analysis and dynamic response studies.

[9]:
eigen_vectors
[9]:
<xarray.DataArray 'EigenVectors' (modeTags: 12, nodeTags: 1142, DOFs: 6)> Size: 658kB
[82224 values with dtype=float64]
Coordinates:
  * modeTags  (modeTags) int32 48B 1 2 3 4 5 6 7 8 9 10 11 12
  * nodeTags  (nodeTags) int32 5kB 1 2 3 4 5 6 ... 1300 1301 1302 1303 1304 1305
  * DOFs      (DOFs) <U2 48B 'UX' 'UY' 'UZ' 'RX' 'RY' 'RZ'

You can retrieve dimension names in xarray.DataArray using the dims attribute:

[10]:
eigen_vectors.dims
[10]:
('modeTags', 'nodeTags', 'DOFs')

The .sel method can be used to retrieve specific elements corresponding to a particular dimension. For example, the following code helps us index the eigenvector at specific mode tags, node tags, and degrees of freedom.

[18]:
eigen_vectors_sub = eigen_vectors.sel(
    modeTags=[1, 2, 3, 4, 5], nodeTags=[100, 200, 300], DOFs=["UX", "UY", "UZ"]
)
eigen_vectors_sub
[18]:
<xarray.DataArray 'EigenVectors' (modeTags: 5, nodeTags: 3, DOFs: 3)> Size: 360B
[45 values with dtype=float64]
Coordinates:
  * modeTags  (modeTags) int32 20B 1 2 3 4 5
  * nodeTags  (nodeTags) int32 12B 100 200 300
  * DOFs      (DOFs) <U2 24B 'UX' 'UY' 'UZ'

Retrieve its data:

[19]:
eigen_vectors_sub.data
[19]:
array([[[ 2.63070107e-05,  1.86729203e-02, -1.52279473e-03],
        [-2.18801193e-04,  2.27953721e-02,  1.61430297e-03],
        [-7.49425264e-04,  1.24680018e-02, -6.84216416e-04]],

       [[ 1.07430986e-02, -1.06591436e-08,  1.86506167e-02],
        [ 7.95070024e-03, -2.17134681e-07,  1.26818563e-02],
        [ 7.36071603e-03,  1.19360223e-07, -7.40619716e-03]],

       [[ 1.20462762e-03, -7.55738596e-03,  1.80162219e-03],
        [-1.36398139e-03, -6.54061212e-03, -1.15008967e-03],
        [ 1.03647160e-03,  2.41749630e-02, -2.06422175e-03]],

       [[ 5.90844295e-04,  9.57100011e-03,  1.01994926e-03],
        [-7.27628557e-04,  1.14606700e-02, -4.73067678e-04],
        [-2.31617124e-03, -2.16609879e-02,  2.24017969e-03]],

       [[-1.99630301e-03, -9.49229075e-07,  1.41933100e-02],
        [ 2.35318153e-05, -6.52638665e-07,  2.62522766e-02],
        [-3.22705290e-04, -3.92921381e-08, -8.33629307e-03]]])