# 2 DOF System



The dynamical system in figure is composed of two massless, uniform beams
supporting a dimensionless body of mass $m$.

With $\omega_0^2=(EJ)/(mL^3)$ determine the system's eigenvalues
$\omega_i^2=\lambda_i^2\,\omega_0^2$ and the mass normalized eigenvectors.

The system is subjected to a horizontal motion $u_\mathcal{B}= u_\mathcal{B}(t)$,
determine the mass displacements 
$\boldsymbol x_\mathcal{B} = \boldsymbol r\,u_\mathcal{B}$ and write the modal equations of dynamic equilibrium as
$$\ddot q_i + \lambda_i^2\omega_0^2\,q_i = \alpha_i\,\ddot u_\mathcal{B}$$
determining the numerical values of the $\alpha_i$.
## Structural matrices

The flexibility is computed using the Principle of Virtual Displacements, the stiffness is computed by inversion and the mass matrix is the unit matrix multiplied by $m$, $\ \boldsymbol M=m\,\boldsymbol I$.




```python
l = [1, 1, 1, 2, 1]
m = [[p( 2/3, 0), p(-1/3, 1), p(1, 0), p(2/3, 0), p(4/3, 0)],
     [p(-2/3, 0), p(-2/3, 0), p(0, 0), p(1/3, 0), p(2/3, 0)]]

F = array([[vw(emme, chi, l) for emme in m] for chi in m])
K = inv(F)
M = eye(2)

dl(dmat(r'\boldsymbol{F}=\frac{1}{27}\frac{L^3}{EJ}', F*27, r','))
dl(dmat(r'\boldsymbol{K}=\frac{1}{53}\frac{EJ}{L^3}', K*53, r','))
dl(dmat(r'\boldsymbol{M}=m', M,'.', fmt='%d'))
```


\begin{align}\boldsymbol{F}=\frac{1}{27}\frac{L^3}{EJ}\begin{bmatrix}+80&+13\\+13&+20\end{bmatrix},\end{align}



\begin{align}\boldsymbol{K}=\frac{1}{53}\frac{EJ}{L^3}\begin{bmatrix}+20&-13\\-13&+80\end{bmatrix},\end{align}



\begin{align}\boldsymbol{M}=m\begin{bmatrix}1&0\\0&1\end{bmatrix}.\end{align}


## The eigenvalues problem


```python
wn2, Psi = eigh(K, M) ; Psi[:,0] *= -1
Lambda2 = diag(wn2)

dl(dmat(r'\boldsymbol{\Lambda^2}=', Lambda2, r'.'))
dl(dmat(r'\boldsymbol{\Psi}=', Psi,  r'.'))
```


\begin{align}\boldsymbol{\Lambda^2}=\begin{bmatrix}+0.326499&+0\\+0&+1.56029\end{bmatrix}.\end{align}



\begin{align}\boldsymbol{\Psi}=\begin{bmatrix}+0.979172&-0.203032\\+0.203032&+0.979172\end{bmatrix}.\end{align}


## Mass Displacements and Inertial Forces

We downgrade the  hinge in $\mathcal B$ to permit a unit horizontal displacement and observe that the centre of instantaneous rotation for the lower beam is at the intersection of the vertical in $\mathcal B$ and the line connecting $\mathcal A$ and $\mathcal C$.



The angle of rotation of the lower beam is $\theta_2=1/3L$, anti-clockwise and the angle of rotation of the upper beam (that rotates about the hinge in $\mathcal A$) is equal but clockwise, due to the continuity of displacements in the internal hinge $\mathcal C$.

Knowing the angle of rotation of the upper beam, the mass displacements are
$$ x_1 = 2L\frac{1}{3L}=\frac{2}{3}\quad
\text{ and }\quad x_2=L\frac{1}{3L}=\frac{1}{3}.$$

We can eventually write
$$ \boldsymbol x_\text{tot} = \boldsymbol x + \begin{Bmatrix}
   2/3\\1/3 \end{Bmatrix}\,u_\mathcal{B}$$

and the inertial force can be written as

$$\boldsymbol f_\text{I} =
\boldsymbol M \, \ddot{\boldsymbol x}_\text{tot} =
\boldsymbol M \, \ddot{\boldsymbol x} +
\boldsymbol M \, \begin{Bmatrix}2/3\\1/3\end{Bmatrix}\,\ddot u_\mathcal{B}
$$

## The Modal Equations of Motion

The equation of motion, in structural coordinates, is

$$
\boldsymbol M \, \ddot{\boldsymbol x} +
\boldsymbol K \, \boldsymbol x = 
- \boldsymbol M \, \begin{Bmatrix}2/3\\1/3\end{Bmatrix}\,\ddot u_\mathcal{B}
$$

or, because $\boldsymbol M = m\, \boldsymbol I$,

$$
\boldsymbol M \, \ddot{\boldsymbol x} +
\boldsymbol K \, \boldsymbol x = 
- m\, \begin{Bmatrix}2/3\\1/3\end{Bmatrix}\,\ddot u_\mathcal{B}
$$

Using the modal expansion, $\boldsymbol x = \boldsymbol\Psi\, \boldsymbol q$ and premultiplying  term by term by $\boldsymbol\Psi^T$ we have, because the eigenvectors are normalized w/r to the mass matrix,

$$
m\,\boldsymbol I \, \ddot{\boldsymbol q} + m\omega_0^2\,
\boldsymbol \Lambda^2 \, \boldsymbol q = 
- m\,\boldsymbol\Psi^T\, \begin{Bmatrix}2/3\\1/3\end{Bmatrix}\,\ddot u_\mathcal{B}.
$$



```python
r = array((2/3, 1/3))
a = -Psi.T@r
print('The modal equations of motion are')

for i, (ai, l2i) in enumerate(zip(a, wn2), 1):
    dl(r'$$\ddot q_{%d} %+.6f\,\omega_0^2\,q_{%d} = %+.6f\,\ddot u_\mathcal{B}$$' %
        (i, l2i, i, ai))
```

    The modal equations of motion are



$$\ddot q_{1} +0.326499\,\omega_0^2\,q_{1} = -0.720459\,\ddot u_\mathcal{B}$$



$$\ddot q_{2} +1.560294\,\omega_0^2\,q_{2} = -0.191036\,\ddot u_\mathcal{B}$$


## Initialization


```python
from numpy import array, diag, eye, poly1d
from scipy.linalg import eigh, inv

from IPython.display import Latex, HTML
display(HTML(open('01.css').read()))

def p(*l): return poly1d(l)

def vw(M, Χ, L):
    return sum(p(l)-p(0) for (m, χ, l) in zip(M, Χ, L) for p in ((m*χ).integ(),))

def dmat(pre, mat, post, mattype='b', fmt='%+.6g'):
    s = r'\begin{align}' + pre + r'\begin{%smatrix}'%mattype
    s += r'\\'.join('&'.join(fmt%val for val in row) for row in mat)
    s += r'\end{%smatrix}'%mattype + post + r'\end{align}'
    return s

def dl(ls): 
    display(Latex(ls))
    return None
```


<style>

@font-face {
    font-family: 'Charis SIL';
    src: url('fonts/CharisSILEur-R.woff') format('woff');
}
@font-face {
    font-family: 'Architects Daughter';
    font-style: normal;
    src: url(https://fonts.gstatic.com/s/architectsdaughter/v6/RXTgOOQ9AAtaVOHxx0IUBM3t7GjCYufj5TXV5VnA2p8.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215, U+E0FF, U+EFFD, U+F000;
}
.prompt{display: None;}
div.cell{margin: auto;width:720px;}

code{font-family: Consolas}

div #notebook { /* centre the content */
    background: #fdfffa;
    margin: auto;
    padding: 0em;
    padding-top: 1em;
}
div #notebook_container {width: 700px!important;}
#notebook li { /* More space between bullet points */
    margin-top:0.2em;
}

div.text_cell_render{
    font-family: "Charis SIL", Cambria,  serif;
    line-height: 150%;
    font-size: 140%;
}
.CodeMirror{
    width: 700px!important;
    font-family: Consolas,monospace;
    font-size: 100%;
    background-color:#fefffc!important;
}

.output_area {
    font-family: Consolas,monospace;font-size: 100%;
    background-color:#ffffff!important;
    margin-top:0.8em;
}

div.output_latex{overflow:hidden}

h1 {
    font-family: 'Architects Daughter', serif;
    font-size:   32pt!important;
    text-align:  center;
    text-shadow: 4px 4px 4px #aaa;
    padding-bottom: 32pt;
}

.warning{color: rgb( 240, 20, 20 )}
</style>



911ef8a52fbe3e66b5c50c22dcab41d1aa1ec47f
ipynb
Jupyter Notebook
dati_2017/wt05/2DOF.ipynb
shishitao/boffi_dynamics
365f16d047fb2dbfc21a2874790f8bef563e0947
MIT
dati_2017/wt05/2DOF.ipynb
shishitao/boffi_dynamics
365f16d047fb2dbfc21a2874790f8bef563e0947
MIT
dati_2017/wt05/2DOF.ipynb
shishitao/boffi_dynamics
365f16d047fb2dbfc21a2874790f8bef563e0947
MIT
2019-06-23T12:32:39.000Z
2021-08-15T18:33:55.000Z
Qwen/Qwen-72B
1. YES
2. YES