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

Table of Contents

\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Problem 2: Angular Momentum of System of Particles\n", "\n", "\n", "```{figure} ./Figures/Problem2.png\n", "---\n", "height: 300\n", "width: 500\n", "name: 1\n", "---\n", "```\n", "The system of four particles has the indicated masses, positions, velocities, and external forces as shown in the figure above. For now, you can ignore the forces; we will revisit this in the next week's activities.\n", "\n", "Your task is to compute the angular momentum of this system of particles about two points:\n", "1. the point O.\n", "2. the system's mass centre (so you will have to compute this). You can assume this point is called G.\n", "\n", "You may makes use of all the tools you have learned so far in SymPy to complete your work." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Solution Part 1: Angular Momentum of $S$ about $O$\n", "## The theory\n", "A system of particles $S$ is provided. You are asked to compute the angular momentum of S about O: ${\\bf H}^{S/O}$. In principle, this means computing the angular momentum of each particle and adding them up; this is also known as the composite theorem. This is given by:\n", "\n", "${\\bf H}^{S/O} = \\sum_{i=1}^4 {\\bf H}^{P_i/O}$\n", "\n", "or\n", "\n", "${\\bf H}^{S/O} = {\\bf H}^{P_1/O} + {\\bf H}^{P_2/O} + {\\bf H}^{P_3/O} + {\\bf H}^{P_4/O}$.\n", "\n", "We also have the definition for angular momentum of a generic particle $P_i$ about $O$ given by:\n", "\n", "${\\bf H}^{P_i/O} \\triangleq {\\bf r}^{OP_i} \\times m_{P_i} ^N{\\bf v}^{P_i}$\n", "\n", ", where:\n", "\n", "${\\bf r}^{OP_i}$ is the position vector from a point $O$ to $P_i$;\n", "\n", "$m_{P_i}$ is the mass of $P_i$; and\n", "\n", "$^N{\\bf v}^{P_i}$ is the velocity of $P_i$ with respect to a reference frame $N$.\n", "\n", "So, now, we can turn to the features of `sympy` to compute each of these angular momenta symbolically (as this problem does not assign numerical values to the mass, velocity, or position vectors). Then, we can use the composite theorem to compute the angular momentum of $S$.\n", "\n", "## Computing the solution" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from sympy import symbols, sin, cos\n", "from sympy.physics.mechanics import ReferenceFrame, Point, dynamicsymbols\n", "m, d, v = symbols('m d v')\n", "N = ReferenceFrame('N')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{P_1/O}$" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [], "source": [ "P1 = Point('P1')\n", "m_P1 = m # mass of P\n", "r_OP1 = 2*d*(N.x - N.y)\n", "P1.set_vel(N, v*(-N.x + N.y))\n", "N_v_P1 = P1.vel(N)\n", "linear_momentum_of_P1 = m_P1*N_v_P1\n", "angular_momentum_of_P1_about_O = r_OP1.cross(linear_momentum_of_P1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{P_2/O}$" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "P2 = Point('P2')\n", "m_P2 = 2*m # mass of P\n", "r_OP2 = d*N.z\n", "P2.set_vel(N, v*N.y)\n", "N_v_P2 = P2.vel(N)\n", "linear_momentum_of_P2 = m_P2*N_v_P2\n", "angular_momentum_of_P2_about_O = r_OP2.cross(linear_momentum_of_P2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{P_3/O}$" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "P3 = Point('P3')\n", "m_P3 = 3*m # mass of P\n", "r_OP3 = -2*d*N.x\n", "P3.set_vel(N, v*N.z)\n", "N_v_P3 = P3.vel(N)\n", "linear_momentum_of_P3 = m_P3*N_v_P3\n", "angular_momentum_of_P3_about_O = r_OP3.cross(linear_momentum_of_P3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{P_4/O}$" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "P4 = Point('P4')\n", "m_P4 = 4*m # mass of P\n", "r_OP4 = +d*N.y\n", "P4.set_vel(N, v*N.x)\n", "N_v_P4 = P4.vel(N)\n", "linear_momentum_of_P4 = m_P4 * N_v_P4\n", "angular_momentum_of_P4_about_O = r_OP4.cross(linear_momentum_of_P4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{S/O}$" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - 2 d m v\\mathbf{\\hat{n}_x} + 6 d m v\\mathbf{\\hat{n}_y} - 4 d m v\\mathbf{\\hat{n}_z}$" ], "text/plain": [ "- 2*d*m*v*N.x + 6*d*m*v*N.y - 4*d*m*v*N.z" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H_of_S_about_O = angular_momentum_of_P1_about_O + angular_momentum_of_P2_about_O + angular_momentum_of_P3_about_O + angular_momentum_of_P4_about_O\n", "H_of_S_about_O" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Solution Part 2: Angular Momentum of $S$ about $S^*$\n", "## The theory\n", "Here you are asked to compute the angular momentum of S about the system's mass centre (let's call it $S^*$): ${\\bf H}^{S/S^*}$. Once again, this can be done using the composite theorem:\n", "\n", "${\\bf H}^{S/S^*} = \\sum_{i=1}^4 {\\bf H}^{P_i/S^*}$,\n", "\n", "where,\n", "\n", "${\\bf H}^{P_i/S^*} \\triangleq {\\bf r}^{S{^*}P_i} \\times m_{P_i} ^N{\\bf v}^{P_i}$\n", "\n", "But, we haven't computed ${\\bf r}^{S{^*}P_i}$. This requires that we first know the location of the $S^*$ from $O$ using the definition of mass centres:\n", "\n", "${\\bf r}^{OS^*}= \\frac{m_{P_1}{\\bf r}^{OP_1} + m_{P_2}{\\bf r}^{OP_2} + m_{P_3}{\\bf r}^{OP_3} + m_{P_4}{\\bf r}^{OP_4}}{m_{P_1} + m_{P_2} + m_{P_3} + m_{P_4}}$.\n", "\n", "Then, we can compute ${\\bf r}^{S{^*}P_i}$ (which is needed in the computation of each particle's angular momentum for this section) as:\n", "\n", "${\\bf r}^{S{^*}P_i} = {\\bf r}^{OP_i}- {\\bf r}^{OS^*}$.\n", "\n", "Based on this theory, we now complete the computing task as shown below:.\n", "\n", "## Computing the solution" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - \\frac{2 d}{5}\\mathbf{\\hat{n}_x} + \\frac{d}{5}\\mathbf{\\hat{n}_y} + \\frac{d}{5}\\mathbf{\\hat{n}_z}$" ], "text/plain": [ "- 2*d/5*N.x + d/5*N.y + d/5*N.z" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "r_OSstar = (m_P1*r_OP1 + m_P2*r_OP2 + m_P3*r_OP3 + m_P4*r_OP4)/(m_P1 + m_P2 + m_P3 + m_P4)\n", "r_OSstar" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{P_1/S^*}$" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "r_SstarP1 = r_OP1 - r_OSstar\n", "angular_momentum_of_P1_about_Sstar = r_SstarP1.cross(linear_momentum_of_P1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{P_2/S^*}$" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "r_SstarP2 = r_OP2 - r_OSstar\n", "angular_momentum_of_P2_about_Sstar = r_SstarP2.cross(linear_momentum_of_P2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{P_3/S^*}$" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "r_SstarP3 = r_OP3 - r_OSstar\n", "angular_momentum_of_P3_about_Sstar = r_SstarP3.cross(linear_momentum_of_P3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{P_4/S^*}$" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "r_SstarP4 = r_OP4 - r_OSstar\n", "angular_momentum_of_P4_about_Sstar = r_SstarP4.cross(linear_momentum_of_P4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Computing ${\\bf H}^{S/S^*}$" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - 2 d m v\\mathbf{\\hat{n}_x} + \\frac{21 d m v}{5}\\mathbf{\\hat{n}_y} - \\frac{11 d m v}{5}\\mathbf{\\hat{n}_z}$" ], "text/plain": [ "- 2*d*m*v*N.x + 21*d*m*v/5*N.y - 11*d*m*v/5*N.z" ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "H_of_S_about_Sstar = angular_momentum_of_P1_about_Sstar + angular_momentum_of_P2_about_Sstar + angular_momentum_of_P3_about_Sstar + angular_momentum_of_P4_about_Sstar\n", "H_of_S_about_Sstar" ] } ], "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 }