Overview of the mdof package#

ace1607132494dc2a45df74e63242e3b

The mdof package is designed to provide a convenient interface for computing dynamic analyses of structural vibrations.

Installation#

If you’d like to install mdof in your own environment to work with it locally, install mdof from pypi. In your environment manager (e.g., Anaconda),

pip install mdof

Import#

In Python, import the package.

[1]:
import mdof

Investigate Structural Vibrations#

Load an the input motion, output motion, and time vector for a mystery structural system.

b5d9bbc462de4b6ba48d431cd569cf08

[2]:
import numpy as np
input_motion = np.loadtxt("uploads/input_motion.txt")
output_motion = np.loadtxt("uploads/output_motion.txt")
times = np.loadtxt("uploads/times.txt")
[3]:
from mdof.utilities.printing import plot_io
plot_io(input_motion, output_motion, times)
../_images/examples_00_Overview_12_0.png

Inverse Eigenanalysis with mdof.eigid()#

f20c5bb4bdba44b5aa1dc381ae78c5fc

[4]:
eigvals, eigvecs = mdof.eigid(input_motion, output_motion, order=2)
100%|█████████▉| 4700/4701 [00:00<00:00, 77332.86it/s]
[5]:
print(f"{eigvals=}\n {eigvecs=}")
eigvals=array([0.98491199+0.16330168j, 0.98491199-0.16330168j])
 eigvecs=array([[ 0.71332805+0.j        ,  0.71332805-0.j        ],
       [-0.00497201+0.70081265j, -0.00497201-0.70081265j]])

State Space Realization with mdof.sysid()#

fa03b568180a48d7ad39fe27ea6aee4d

[6]:
A,B,C,D = mdof.sysid(input_motion, output_motion, order=2)
100%|█████████▉| 4700/4701 [00:00<00:00, 87358.87it/s]
[7]:
print(f"{A=} \n{B=} \n{C=} \n{D=}")
A=array([[ 0.98607055,  0.16621799],
       [-0.16044462,  0.98375342]])
B=array([[-0.1743355 ],
       [-0.10978558]])
C=array([[-0.05126065,  0.08870003]])
D=array([[-0.09489982]])

Spectra with power_transfer() and spectrum_modes()#

[10]:
from mdof.transform import power_transfer
periods, amplitudes = power_transfer(input_motion, output_motion, step=times[1]-times[0], period_band=(0,5))
[11]:
from mdof.modal import spectrum_modes
peak_period, peak_amplitude = spectrum_modes(periods, amplitudes)
print(f"{peak_period=}")
peak_period=array([1.14503817])
[12]:
from mdof.utilities.printing import plot_transfer
plot_transfer(np.array([periods,amplitudes]), plotly=True)

Stablization Diagram with stabilization()#

[13]:
from mdof.macro import stabilization
stabilization(input_motion, output_motion, dt=times[1]-times[0], orders=(2,20,2), plotly=True)
100%|█████████▉| 4700/4701 [00:00<00:00, 75231.28it/s]
100%|█████████▉| 4700/4701 [00:00<00:00, 44698.87it/s]
100%|█████████▉| 4700/4701 [00:00<00:00, 23447.11it/s]
100%|█████████▉| 4700/4701 [00:00<00:00, 16371.82it/s]
100%|█████████▉| 4700/4701 [00:00<00:00, 9064.47it/s]
100%|█████████▉| 4700/4701 [00:00<00:00, 8680.56it/s]
100%|█████████▉| 4700/4701 [00:00<00:00, 4853.57it/s]
100%|█████████▉| 4700/4701 [00:01<00:00, 3895.88it/s]
100%|█████████▉| 4700/4701 [00:01<00:00, 3513.59it/s]