{ "cells": [ { "cell_type": "markdown", "metadata": { "toc": true }, "source": [ "

Table of Contents

\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Overview of Practice Activity\n", "\n", "\n", "\n", "```{figure} ./Figures/Problem2.png\n", "---\n", "height: 300\n", "width: 300\n", "name: 1\n", "---\n", "Door wall\n", "```\n", "\n", "\n", "The figure above shows a composite system made up of three slender rods; the total mass of this system is $M$. For this system, you are to derive the inertia matrix of the system about the point O; that is, determine all the 9 elements of $[{\\bf I}]^{S/O}$. Recall that:\n", "\n", "$[{\\bf I}]^{S/O} = \\begin{bmatrix}\n", "I^{S/O}_{xx} & I^{S/O}_{xy} & I^{S/O}_{xz} \\\\\n", "I^{S/O}_{yx} & I^{S/O}_{yy} & I^{S/O}_{yz} \\\\\n", "I^{S/O}_{zx} & I^{S/O}_{zy} & I^{S/O}_{zz}\n", "\\end{bmatrix} $\n", "\n", "where the diagonal elements are moment of inertia scalars and off-diagonal elements are product of inertia scalars.\n", "\n", "So, your task reduces to calculating each of these terms and assembling it in a matrix using sympy's `Matrix` feature.\n", "\n", "\n", "__IMPORTANT:__ You are to store your inertia matrix solution in the variable name `I_matrix_of_S_about_O`.\n", "\n", "__Hints:__\n", "1. $M$ will be useful to determine the mass of individual sections of the composite system.\n", "\n", "2. To support your calculations, you are provided the some information regarding the inertia scalars of a slender rod about its mass center ($G$ in the figure):\n", "\n", "```{figure} ./Figures/slender_rod_moi.png\n", "---\n", "height: 300\n", "width: 600\n", "name: 1\n", "---\n", "Door wall\n", "```\n", "\n", "The figure above essentially tells you that the moment of inertia scalar about G in a direction perpendicular to rigid rod's length is $\\frac{1}{12}$(mass of the rod)$\\cdot$(length of the rod)$^2$.\n", "\n", "Additionally, you are also told that, for this slender rigid rod in the figure: \n", "- the moment of inertia about G of along its length is zero.\n", "- the products of inertia about G in all directions are all zero." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Solution" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "from sympy import symbols, Matrix" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# Create symbols for mass and length\n", "M, b = symbols('M b')\n", "\n", "m_A = M/4 # mass of body A\n", "m_B = M/2 # mass of body B\n", "m_C = M/4 # mass of body Cma" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Evaluate inertia matrix of $A$ about $O$" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_A_about_A_star = Matrix([\n", " [m_A*(b**2)/12, 0, 0],\n", " [0, m_A*(b**2)/12, 0],\n", " [0, 0, 0]\n", "])\n", "I_matrix_of_A_about_A_star" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_A_star_about_O = Matrix([\n", " [m_A*(b**2 + (b/2)**2), 0, 0],\n", " [0, m_A*((b/2)**2 + 0**2), m_A*(b/2)*b],\n", " [0, m_A*(b/2)*b, m_A*(b)**2]\n", "])\n", "\n", "I_matrix_of_A_star_about_O" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_A_about_O = I_matrix_of_A_about_A_star + I_matrix_of_A_star_about_O\n", "I_matrix_of_A_about_O" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Evaluate inertia matrix of $B$ about $O$" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_B_about_B_star = Matrix([\n", " [m_B/12*(2*b)**2, 0, 0],\n", " [0, 0, 0],\n", " [0, 0, m_B/12*(2*b)**2]\n", "])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_B_star_about_O = Matrix([\n", " [0, 0, 0],\n", " [0, 0, 0],\n", " [0, 0, 0]\n", "])" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_B_about_O = I_matrix_of_B_about_B_star + I_matrix_of_B_star_about_O\n", "I_matrix_of_B_about_O" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Evaluate inertia matrix of $C$ about $O$" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_C_about_C_star = Matrix([\n", " [0, 0, 0],\n", " [0, m_C/12*(b)**2, 0],\n", " [0, 0, m_C/12*(b)**2]\n", "])\n", "\n", "I_matrix_of_C_about_C_star" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_C_star_about_O = Matrix([\n", " [m_C*(b)**2, m_C*(b/2)*(b), 0],\n", " [m_C*(b/2)*(b), m_C*(b/2)**2, 0],\n", " [0, 0, m_C*((b/2)**2 + (b)**2)]\n", "])\n", "\n", "I_matrix_of_C_star_about_O " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_C_about_O = I_matrix_of_C_about_C_star + I_matrix_of_C_star_about_O\n", "I_matrix_of_C_about_O" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Generate inertia matrix of system from composite theorem" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_S_about_O = I_matrix_of_A_about_O + I_matrix_of_B_about_O + I_matrix_of_C_about_O" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "I_matrix_of_S_about_O" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.13" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": true, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 4 }