Linear Dynamic Time-History Analysis
InĀ [1]:
Copied!
import gmspy as gm
import numpy as np
import time
import gmspy as gm
import numpy as np
import time
Below is the ground motion data built into gmspy, you can also document the PEER database through loadPEER, or you can read the data from text using numpy.loadtxt.
InĀ [2]:
Copied!
ts, acc = gm.load_gm_examples("Kocaeli")
dt = ts[1] - ts[0]
# You can also use other acc data
ts, acc = gm.load_gm_examples("Kocaeli")
dt = ts[1] - ts[0]
# You can also use other acc data
InĀ [3]:
Copied!
start_time = time.time()
start_time = time.time()
InĀ [4]:
Copied!
T = 1 # period in seconds
omega = np.pi * 2 / T # frequency
u, v, d = gm.lida(dt, acc, omega=omega, damp_ratio=0.05, plot=True)
T = 1 # period in seconds
omega = np.pi * 2 / T # frequency
u, v, d = gm.lida(dt, acc, omega=omega, damp_ratio=0.05, plot=True)
InĀ [5]:
Copied!
end_time = time.time()
print(f"Execution time: {end_time - start_time:.2f} seconds")
end_time = time.time()
print(f"Execution time: {end_time - start_time:.2f} seconds")
Execution time: 1.16 seconds