# Some manipulations on the two degree of freedom model


```python
from sympy import *
init_printing()

def symb(x, y = ''):
    return symbols('{0}_{1}'.format(x,y), type = float)
```

Displacement vector:


```python
x = Matrix([symb('u','g'), symb('u','r')])
display(x)
```


$\displaystyle \left[\begin{matrix}u_{g}\\u_{r}\end{matrix}\right]$


Inertia matrix:


```python
J_r, J_g, n = symbols('J_r J_g n', positive=True)
M = diag(J_r, J_g*n**2)
display(M)
```


$\displaystyle \left[\begin{matrix}J_{r} & 0\\0 & J_{g} n^{2}\end{matrix}\right]$


Stiffness matrix


```python
k = symbols('k', positive=True)
K = eye(2)
K[0, 1] = -1
K[1, 0] = -1
K = k*K
display(K)
```


$\displaystyle \left[\begin{matrix}k & - k\\- k & k\end{matrix}\right]$


## Characteristic polynomial


```python
lamda = symb('lambda')
omega = symb('omega')
A = Inverse(M)*K
cp = A.charpoly(lamda)
cp = factor(cp)
display(cp)
```

5f29ab4623d5b91f8f578755def3a42309df8af8
ipynb
Jupyter Notebook
notes/torsional_2DOF.ipynb
gfsReboucas/Drivetrain-python
90cc8a0b26fa6dd851a8ddaaf321f5ae9f5cf431
MIT
2020-10-17T13:43:01.000Z
2020-10-17T13:43:01.000Z
notes/torsional_2DOF.ipynb
gfsReboucas/Drivetrain-python
90cc8a0b26fa6dd851a8ddaaf321f5ae9f5cf431
MIT
notes/torsional_2DOF.ipynb
gfsReboucas/Drivetrain-python
90cc8a0b26fa6dd851a8ddaaf321f5ae9f5cf431
MIT
Qwen/Qwen-72B
1. YES
2. YES