Eigenvalue Results

[1]:
import matplotlib.pyplot as plt

import opstool as opst

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

[2]:
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")
../../_images/src_post_eigen_3_0.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.output/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.output/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.

[10]:
eigen_vectors
[10]:
<xarray.DataArray 'EigenVectors' (modeTags: 12, nodeTags: 1142, DOFs: 6)> Size: 658kB
array([[[ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
        [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
        [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
        ...,
        [ 1.07981083e-03,  9.27292559e-03, -3.66435964e-04,
         -1.77739556e-04, -4.31721252e-05, -3.11575264e-04],
        [ 1.07991104e-03,  8.79976197e-03, -3.04431533e-04,
         -1.64234538e-04, -3.66945737e-05, -3.09368757e-04],
        [ 1.08000705e-03,  8.33758746e-03, -2.60141811e-04,
         -1.50729521e-04, -1.98406712e-05, -2.97011818e-04]],

       [[ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
        [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
        [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
...
        [-2.94133959e-03,  7.42938051e-03,  3.11148438e-04,
          1.80769512e-04,  4.57818810e-05,  1.48669419e-03],
        [-2.96550489e-03,  9.68180534e-03,  2.89586286e-04,
          1.32113910e-04,  5.85139204e-07,  1.44730016e-03],
        [-2.98933733e-03,  1.17438432e-02,  2.55607140e-04,
          8.34583071e-05,  6.14985457e-05,  1.23949202e-03]],

       [[ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
        [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
        [ 0.00000000e+00,  0.00000000e+00,  0.00000000e+00,
          0.00000000e+00,  0.00000000e+00,  0.00000000e+00],
        ...,
        [ 1.71694310e-02,  5.02802809e-06, -1.85074911e-03,
          2.99551040e-07, -1.45472165e-04,  3.51280700e-06],
        [ 1.71918141e-02,  9.48324958e-06, -1.50178010e-03,
          7.66129710e-07, -3.16683294e-04,  1.79198467e-06],
        [ 1.72121710e-02,  8.78651197e-06, -8.84099200e-04,
          1.23270838e-06, -4.95656329e-04, -3.26268540e-06]]])
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:

[11]:
eigen_vectors.dims
[11]:
('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.

[12]:
eigen_vectors_sub = eigen_vectors.sel(modeTags=[1, 2, 3, 4, 5], nodeTags=[100, 200, 300], DOFs=["UX", "UY", "UZ"])
eigen_vectors_sub
[12]:
<xarray.DataArray 'EigenVectors' (modeTags: 5, nodeTags: 3, DOFs: 3)> Size: 360B
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]]])
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:

[13]:
eigen_vectors_sub.data
[13]:
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]]])