Problem 2
(see Ex 9.6)
# Remove
import ema as em
import matplotlib.pyplot as plt
import numpy as np
%config InlineBackend.figure_format = 'svg' # used to make plots look nicer
from ema_examples.dynamics import E09_06
from ema.utilities.ipyutils import disp_sbs
from scipy.linalg import eig
= 1
L = 1
mass = 1/12
EI
= E09_06(L=L, m = mass, EI = EI)
mdl = plt.subplots()
fig, ax
em.plot_structure(mdl, ax) mdl.DOF
[[7, 8, 9], [1, 2, 3], [4, 5, 6]]
= em.Mass_matrix(mdl), em.K_matrix(mdl)
m, K 0,0] = 3.*mass
m[1,1] = 1.*mass
m[2:,2:] = 0*mass
m[ disp_sbs(m.f.df, K.f.df)
$u_{{1}}$ | $u_{{2}}$ | $u_{{3}}$ | $u_{{4}}$ | $u_{{5}}$ | $u_{{6}}$ | |
---|---|---|---|---|---|---|
$u_{{1}}$ | 3.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
$u_{{2}}$ | 0.0 | 1.0 | 0.0 | 0.0 | 0.0 | 0.0 |
$u_{{3}}$ | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
$u_{{4}}$ | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
$u_{{5}}$ | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
$u_{{6}}$ | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 | 0.0 |
$1$ | $2$ | $3$ | $4$ | $5$ | $6$ | |
---|---|---|---|---|---|---|
$P_{1}$ | 8334.333333 | 0.000000 | 0.500000 | -8333.333333 | 0.0 | 0.000000 |
$P_{2}$ | 0.000000 | 8334.333333 | 0.500000 | 0.000000 | -1.0 | 0.500000 |
$P_{3}$ | 0.500000 | 0.500000 | 0.666667 | 0.000000 | -0.5 | 0.166667 |
$P_{4}$ | -8333.333333 | 0.000000 | 0.000000 | 8333.333333 | 0.0 | 0.000000 |
$P_{5}$ | 0.000000 | -1.000000 | -0.500000 | 0.000000 | 1.0 | -0.500000 |
$P_{6}$ | 0.000000 | 0.500000 | 0.166667 | 0.000000 | -0.5 | 0.333333 |
# k, m = em.analysis.StaticCondensation(k.f, m.f, idxs=[3,4])
= em.analysis.kStaticCondensation(K.f, idxs=[3,4])
k # disp_sbs(k.df)
k
$4$ | $5$ | |
---|---|---|
$4$ | 0.571384 | 0.214267 |
$5$ | 0.214267 | 0.142849 |
= m[0:2,0:2]
m = eig(m, k)
freq2, Phi /0.57293852 Phi
array([[-1. , -0.75123369],
[-1.4305171 , 1.57544505]])
= Phi.T@m@Phi
M = Phi.T@k@Phi
K M
Structural_Vector([[ 1.65651710e+00, -1.11022302e-16],
[ 0.00000000e+00, 1.37050677e+00]])
a) Modal expansion of earthquake forces
\[\mathrm{p}_{\mathrm{eff}}(t)=-\mathrm{m} \iota \ddot{u}_{g}(t)\]
\[\mathbf{m} \iota=\sum_{n=1}^{N} \mathbf{s}_{n}=\sum_{n=1}^{N} \Gamma_{n} \mathbf{m} \phi_{n}\]
= N = 2
I = np.array([0, 1])
iota = np.array([sum(Phi.T[n,i]*sum(m[i,j]*iota[j] for j in range(I)) for i in range(I)) for n in range(N)])
Ln = Phi.T@m@iota
Ln Ln
Structural_Vector([-0.81959835, 0.90263316])
= np.array([Ln[n]/M[n,n] for n in range(N)])
gamma gamma
array([-0.49477204, 0.65861269])
= [gamma[n]*(m@Phi[:,n]) for n in range(N)]
sn sn
[Structural_Vector([0.85042189, 0.40551435]),
Structural_Vector([-0.85042189, 0.59448565])]