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

Table of Contents

\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Problem 3: Kinetic Energy of Rigid Body\n", "\n", "\n", "\n", "```{figure} ./Figures/Problem3.png\n", "---\n", "height: 300\n", "width: 300\n", "name: 1\n", "---\n", "```\n", "The bent plate has a mass of 70 kg per square meter of surface area and re-volves about the z-axis at the rate 􏱕30 rad/s. \n", "\n", "__Previously__: You computed the angular momentum of the plate about point O.\n", "\n", "__This activity__: You are to compute the kinetic energy T of the plate.\n", "\n", "Neglect the mass of the hub and the thickness of the plate compared with its surface dimensions." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Previously: Angular Momentum Solution\n", "### The theory\n", "The figure above shows a bent plate comprising two rigid bodies, $A$ and $B$. Since $A$ and $B$ are rigidly attached to each other, you can even say that the plate is one body which we refer to as S from hereon.\n", "\n", "You are asked to compute the angular momentum of this bent plate, S, about O: ${\\bf H}^{S/O}$. Note that $O$ is a point fixed both in $S$ and $N$.\n", "\n", "\n", "So, we can compute ${\\bf H}^{S/O}$ from equation 10.5 in the file titled \"10 momentum: linear and angular\", which gives the angular momentum of an arbitrary body $B$ about a point $Q$ fixed in $B$. We repeat this equation below:\n", "\n", "$ {\\bf H}^{B/Q} = {\\bf r}^* \\times m ^N{\\bf v}^Q + [{\\bf I}]^{B/Q} {^N}\\omega^B$\n", "\n", ", where\n", "\n", "$[{\\bf I}]^{B/Q}$ is the inertia matrix of $B$ about $Q$. In the assigned problem, the point $O$ is analogous to $Q$ and $S$ is analogous to $B$.\n", "\n", "So for this particular problem, we can recast the above equation as:\n", "$ {\\bf H}^{S/O} = {\\bf r}^* \\times m ^N{\\bf v}^O + [{\\bf I}]^{S/O} {^N}\\omega^S$\n", "\n", "Notice from the figure that $O$ is also fixed in $N$. So, we get $^N{\\bf v}^O = 0$ in the preceding equation which then reduces to:\n", "\n", "$ {\\bf H}^{B/Q} = [{\\bf I}]^{S/O} {^N}\\omega^S$.\n", "\n", "This is a manageable problem.\n", "So, now, we have to do two things:\n", "1. __Compute $[{\\bf I}]^{S/O}$__: This can be done by first using composite theorem as $S$ is made of two rectangular plates $A$ and $B$. Then, we use parallel axis theorem on each plate.\n", "2. __Evaluate $ {^N}\\omega^S$__: This is trivial as we are already told that the bent plate is rotating at $30$ $rad/s$. The direction of rotation is also indicated in the figure from which we deduce:\n", "\n", "${^N}\\omega^S = 30 \\hat{{\\bf n}_z}$.\n", "\n", "So, now, we can turn to the features of `sympy` to compute ${\\bf H}^{S/O}$ as shown below." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from sympy import symbols, sin, cos, Matrix\n", "from sympy.physics.mechanics import ReferenceFrame, Point, dynamicsymbols" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Initial setup\n", "As the density of the plate is given and area of the sections A and B are given, we can easily compute the masses of A and B, respectively. The masses are stored in variables named `m_A` and `m_b`." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "m_A = 70*(.125)*(.1) # in kg\n", "m_B = 70*(.075)*(.15) # in kg" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The figures tells us the dimensions of the plates $A$ and $B$ in $mm$. However, we must use SI units in all our calculations so I convert each dimension into $m$. I store these dimensions in the variables as described below:\n", "1. `l_A` is the length of plate A;\n", "2. `b_A` is the width of plate A;\n", "3. `l_B` is the length of plate B; and\n", "1. `b_B` is the width of plate A." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "l_A = .125 # length of plate A in m\n", "b_A = .1 # width of A in m\n", "l_B = 0.075 # length of B in m\n", "b_B = .15 # width of B in m" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Then, we create two reference frames $S$ and $N$ to store the angular velocity dedcued above. This angular velocity of S in N is stored in `N_omega_S`." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle 30\\mathbf{\\hat{n}_z}$" ], "text/plain": [ "30*N.z" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "N = ReferenceFrame('N')\n", "S = ReferenceFrame('S')\n", "S.set_ang_vel(N, 30*N.z)\n", "N_omega_S = S.ang_vel_in(N)\n", "N_omega_S" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now, `N_omega_S` is a vector in its component-form but it needs to be multiplied with an inertia matrix to compute angular momentum. So we will store it as a column vector. `sympy` allows us to convert `N_omega_S` to such a form by using the `.to_matrix` form. This is shown below:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0\\\\0\\\\30\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0],\n", "[ 0],\n", "[30]])" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "N_omega_S.to_matrix(N)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "As you can see, we provide the frame `N` as to `.to_matrix` because `N_omega_S` is express in $N$. As we need this matrix form of `N_omega_S` for later computations, we store it as shown below in the variable name `N_omega_S_columnVector`:" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "N_omega_S_columnVector = N_omega_S.to_matrix(N)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Evaluate inertia matrix of $A$ about $O$" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "O = Point('O')\n", "#\n", "Astar = Point('Astar')\n", "Astar.set_pos(O, l_A/2*N.y + b_A/2*N.z)\n", "r_OAstar = Astar.pos_from(O)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0.00186848958333333 & 0 & 0\\\\0 & 0.000729166666666667 & 0\\\\0 & 0 & 0.00113932291666667\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[0.00186848958333333, 0, 0],\n", "[ 0, 0.000729166666666667, 0],\n", "[ 0, 0, 0.00113932291666667]])" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Ixx_A_about_Astar = m_A * (l_A**2 + b_A**2)/12\n", "Iyy_A_about_Astar = m_A * (b_A**2)/12\n", "Izz_A_about_Astar = m_A * (l_A**2)/12\n", "\n", "I_matrix_of_A_about_A_star = Matrix([\n", " [Ixx_A_about_Astar, 0, 0],\n", " [0, Iyy_A_about_Astar, 0],\n", " [0, 0, Izz_A_about_Astar]\n", "])\n", "I_matrix_of_A_about_A_star" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "Ixx_Astar_about_O = m_A * (r_OAstar.cross(N.x)).dot(r_OAstar.cross(N.x))\n", "Iyy_Astar_about_O = m_A * (r_OAstar.cross(N.y)).dot(r_OAstar.cross(N.y))\n", "Izz_Astar_about_O = m_A * (r_OAstar.cross(N.z)).dot(r_OAstar.cross(N.z))\n", "Ixy_Astar_about_O = m_A * (r_OAstar.cross(N.x)).dot(r_OAstar.cross(N.y))\n", "Iyz_Astar_about_O = m_A * (r_OAstar.cross(N.y)).dot(r_OAstar.cross(N.z))\n", "Izx_Astar_about_O = m_A * (r_OAstar.cross(N.z)).dot(r_OAstar.cross(N.x))\n", "\n", "I_matrix_of_A_star_about_O = Matrix([\n", " [Ixx_Astar_about_O, Ixy_Astar_about_O, Izx_Astar_about_O],\n", " [Ixy_Astar_about_O, Iyy_Astar_about_O, Iyz_Astar_about_O],\n", " [Izx_Astar_about_O, Iyz_Astar_about_O, Izz_Astar_about_O]\n", "])" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0.00747395833333333 & 0 & 0\\\\0 & 0.00291666666666667 & -0.002734375\\\\0 & -0.002734375 & 0.00455729166666667\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[0.00747395833333333, 0, 0],\n", "[ 0, 0.00291666666666667, -0.002734375],\n", "[ 0, -0.002734375, 0.00455729166666667]])" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Parallel Axis theorem for A and B\n", "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": 11, "metadata": {}, "outputs": [], "source": [ "#\n", "Bstar = Point('Bstar')\n", "Bstar.set_pos(O, l_B/2*N.x + l_A*N.y + b_B/2 * N.z)\n", "r_OBstar = Bstar.pos_from(O)\n", "\n", "Ixx_B_about_Bstar = m_B * (b_B**2)/12\n", "Iyy_B_about_Bstar = m_B * (l_B**2 + b_B**2)/12\n", "Izz_B_about_Bstar = m_B * (l_B**2)/12\n", "\n", "I_matrix_of_B_about_B_star = Matrix([\n", " [Ixx_B_about_Bstar, 0, 0],\n", " [0, Iyy_B_about_Bstar, 0],\n", " [0, 0, Izz_B_about_Bstar]\n", "])" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "Ixx_Bstar_about_O = m_B * (r_OBstar.cross(N.x)).dot(r_OBstar.cross(N.x))\n", "Iyy_Bstar_about_O = m_B * (r_OBstar.cross(N.y)).dot(r_OBstar.cross(N.y))\n", "Izz_Bstar_about_O = m_B * (r_OBstar.cross(N.z)).dot(r_OBstar.cross(N.z))\n", "Ixy_Bstar_about_O = m_B * (r_OBstar.cross(N.x)).dot(r_OBstar.cross(N.y))\n", "Iyz_Bstar_about_O = m_B * (r_OBstar.cross(N.y)).dot(r_OBstar.cross(N.z))\n", "Izx_Bstar_about_O = m_B * (r_OBstar.cross(N.z)).dot(r_OBstar.cross(N.x))\n", "\n", "I_matrix_of_B_star_about_O = Matrix([\n", " [Ixx_Bstar_about_O, Ixy_Bstar_about_O, Izx_Bstar_about_O],\n", " [Ixy_Bstar_about_O, Iyy_Bstar_about_O, Iyz_Bstar_about_O],\n", " [Izx_Bstar_about_O, Iyz_Bstar_about_O, Izz_Bstar_about_O]\n", "])" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0.0182109375 & -0.00369140625 & -0.00221484375\\\\-0.00369140625 & 0.0073828125 & -0.0073828125\\\\-0.00221484375 & -0.0073828125 & 0.01378125\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[ 0.0182109375, -0.00369140625, -0.00221484375],\n", "[-0.00369140625, 0.0073828125, -0.0073828125],\n", "[-0.00221484375, -0.0073828125, 0.01378125]])" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Parallel Axis theorem for A and B\n", "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": [ "### Composite Theorem for system's inertia about O" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}0.0256848958333333 & -0.00369140625 & -0.00221484375\\\\-0.00369140625 & 0.0102994791666667 & -0.0101171875\\\\-0.00221484375 & -0.0101171875 & 0.0183385416666667\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[0.0256848958333333, -0.00369140625, -0.00221484375],\n", "[ -0.00369140625, 0.0102994791666667, -0.0101171875],\n", "[ -0.00221484375, -0.0101171875, 0.0183385416666667]])" ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "I_matrix_of_S_about_O = I_matrix_of_A_about_O + I_matrix_of_B_about_O\n", "I_matrix_of_S_about_O" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Compute ${\\bf H}^{S/O}$" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "H_of_S_about_O = I_matrix_of_S_about_O * N_omega_S_columnVector" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left[\\begin{matrix}-0.0664453125\\\\-0.303515625\\\\0.55015625\\end{matrix}\\right]$" ], "text/plain": [ "Matrix([\n", "[-0.0664453125],\n", "[ -0.303515625],\n", "[ 0.55015625]])" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H_of_S_about_O" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle 0.6317805981291$" ], "text/plain": [ "0.631780598129100" ] }, "execution_count": 28, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H_of_S_about_O_vector = (-0.0664453125)*N.x + (-0.303515625)*N.y + (0.5501)*N.z\n", "H_of_S_about_O_vector" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Key point\n", "How do we know which unit vectors to use to express ${\\bf H}^{S/O}$ in its component form?\n", "\n", "Recall that:\n", "1. $^N \\omega^B$ was derived in the $N$ frame.\n", "\n", "2. The inertia scalars were also computed using unit vectors attached to the $N$ frame.\n", "\n", "So, ${\\bf H}^{S/O}$ must be expressed in the $N$ frame." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# This activity: compute the kinetic energy" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "KineticEnergy_of_S = 1/2 * N_omega_S_columnVector.transpose() * H_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.11" }, "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 }