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
L = 1
mass = 1
EI = 1/12

mdl = E09_06(L=L, m = mass, EI = EI)
fig, ax = plt.subplots()
em.plot_structure(mdl, ax)
mdl.DOF
[[7, 8, 9], [1, 2, 3], [4, 5, 6]]
svg
m, K = em.Mass_matrix(mdl), em.K_matrix(mdl)
m[0,0] = 3.*mass
m[1,1] = 1.*mass
m[2:,2:] = 0*mass
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])
k = em.analysis.kStaticCondensation(K.f, idxs=[3,4])
# disp_sbs(k.df)
k
$4$ $5$
$4$ 0.571384 0.214267
$5$ 0.214267 0.142849
m = m[0:2,0:2]
freq2, Phi = eig(m, k)
Phi/0.57293852
array([[-1.        , -0.75123369],
       [-1.4305171 ,  1.57544505]])
M = Phi.T@m@Phi
K = Phi.T@k@Phi
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}\]

I = N = 2
iota = np.array([0, 1])
Ln = 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
Structural_Vector([-0.81959835,  0.90263316])
gamma = np.array([Ln[n]/M[n,n] for n in range(N)])
gamma
array([-0.49477204,  0.65861269])
sn = [gamma[n]*(m@Phi[:,n]) for n in range(N)]
sn
[Structural_Vector([0.85042189, 0.40551435]),
 Structural_Vector([-0.85042189,  0.59448565])]