<jupyter_start><jupyter_text>Some manipulations on the two degree of freedom model<jupyter_code>from sympy import *
init_printing()

def symb(x, y = ''):
    return symbols('{0}_{1}'.format(x,y), type = float)<jupyter_output><empty_output><jupyter_text>Displacement vector:<jupyter_code>x = Matrix([symb('u','g'), symb('u','r')])
display(x)<jupyter_output><empty_output><jupyter_text>Inertia matrix:<jupyter_code>J_r, J_g, n = symbols('J_r J_g n', positive=True)
M = diag(J_r, J_g*n**2)
display(M)<jupyter_output><empty_output><jupyter_text>Stiffness matrix<jupyter_code>k = symbols('k', positive=True)
K = eye(2)
K[0, 1] = -1
K[1, 0] = -1
K = k*K
display(K)<jupyter_output><empty_output><jupyter_text>Characteristic polynomial<jupyter_code>lamda = symb('lambda')
omega = symb('omega')
A = Inverse(M)*K
cp = A.charpoly(lamda)
cp = factor(cp)
display(cp)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1755379388448471, 'fraction_numerical': 0.011325028312570781, 'mean_word_length': 9.4, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '453369', 'license': 'MIT', 'n_tokens_mistral': 383, 'n_tokens_neox': 369, 'n_words': 59, 'path': 'notes/torsional_2DOF.ipynb', 'repo_name': 'gfsReboucas/Drivetrain-python', 'size': '883'}