{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "a09370ca", "metadata": {}, "outputs": [], "source": [ "import sympy as smp" ] }, { "cell_type": "code", "execution_count": 2, "id": "fcd9ee5a", "metadata": {}, "outputs": [], "source": [ "m1, m2, v1i, v2i, v1f, v2f = smp.symbols(\"m_1 m_2 v_{1i} v_{2i} v_{1f} v_{2f}\", real=True)" ] }, { "cell_type": "markdown", "id": "0e449d85", "metadata": {}, "source": [ "Create an expression for the kinetic energy of a two body problem\n", "\n", "$v_{1i}$ is initial velocity of mass $m_1$ \n", "$v_{2i}$ is initial velocity of mass $m_2$ \n", "$v_{1f}$ is final velocity of mass $m_1$ \n", "$v_{2f}$ is final velocity of mass $m_2$\n", "\n", "I am also assuming that $m_2$ >> $m_1$" ] }, { "cell_type": "code", "execution_count": 3, "id": "8ec19eeb", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - \\frac{m_{1} v_{1f}^{2}}{2} + \\frac{m_{1} v_{1i}^{2}}{2} - \\frac{m_{2} v_{2f}^{2}}{2} + \\frac{m_{2} v_{2i}^{2}}{2} = 0$" ], "text/plain": [ "Eq(-m_1*v_{1f}**2/2 + m_1*v_{1i}**2/2 - m_2*v_{2f}**2/2 + m_2*v_{2i}**2/2, 0)" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eqn1a = m1*v1i**2/2 + m2*v2i**2/2 - m1*v1f**2/2 - m2*v2f**2/2\n", "smp.Eq(eqn1a,0)" ] }, { "cell_type": "markdown", "id": "a5d8f7cb", "metadata": {}, "source": [ "However the initial velocity $v_{2i}$, the wedge, is zero." ] }, { "cell_type": "code", "execution_count": 4, "id": "b58aa7e3", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - \\frac{m_{1} v_{1f}^{2}}{2} + \\frac{m_{1} v_{1i}^{2}}{2} - \\frac{m_{2} v_{2f}^{2}}{2} = 0$" ], "text/plain": [ "Eq(-m_1*v_{1f}**2/2 + m_1*v_{1i}**2/2 - m_2*v_{2f}**2/2, 0)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eqn1 = eqn1a.subs(v2i, 0)\n", "smp.Eq(eqn1,0)" ] }, { "cell_type": "markdown", "id": "d299a75c", "metadata": {}, "source": [ "Now create and expression for the momentum of the two body problem" ] }, { "cell_type": "code", "execution_count": 5, "id": "835f7764", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - m_{1} v_{1f} + m_{1} v_{1i} - m_{2} v_{2f} + m_{2} v_{2i} = 0$" ], "text/plain": [ "Eq(-m_1*v_{1f} + m_1*v_{1i} - m_2*v_{2f} + m_2*v_{2i}, 0)" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eq2a = m1*v1i + m2*v2i - m1*v1f - m2*v2f\n", "smp.Eq(eq2a,0)" ] }, { "cell_type": "markdown", "id": "4f1c7b08", "metadata": {}, "source": [ "Again the initial velocity $v_{2i}$, the wedge, is zero." ] }, { "cell_type": "code", "execution_count": 6, "id": "fb9d5a79", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - m_{1} v_{1f} + m_{1} v_{1i} - m_{2} v_{2f} = 0$" ], "text/plain": [ "Eq(-m_1*v_{1f} + m_1*v_{1i} - m_2*v_{2f}, 0)" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eqn2 = eq2a.subs(v2i, 0)\n", "smp.Eq(eqn2, 0)" ] }, { "cell_type": "markdown", "id": "0690d7dd", "metadata": {}, "source": [ "Make $v_{2f}$ the subject and substitute back in to equation 1" ] }, { "cell_type": "code", "execution_count": 7, "id": "649e6927", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle v_{2f} = - \\frac{m_{1} v_{1f} - m_{1} v_{1i}}{m_{2}}$" ], "text/plain": [ "Eq(v_{2f}, -(m_1*v_{1f} - m_1*v_{1i})/m_2)" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "v2fs = smp.solveset(eqn2, v2f).args[0]\n", "smp.Eq(v2f, v2fs)" ] }, { "cell_type": "code", "execution_count": 8, "id": "0b284c3e", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - \\frac{m_{1} v_{1f}^{2}}{2} + \\frac{m_{1} v_{1i}^{2}}{2} - \\frac{\\left(m_{1} v_{1f} - m_{1} v_{1i}\\right)^{2}}{2 m_{2}} = 0$" ], "text/plain": [ "Eq(-m_1*v_{1f}**2/2 + m_1*v_{1i}**2/2 - (m_1*v_{1f} - m_1*v_{1i})**2/(2*m_2), 0)" ] }, "execution_count": 8, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eq3a = eqn1.subs(v2f, v2fs)\n", "smp.Eq(eq3a, 0)" ] }, { "cell_type": "markdown", "id": "00e9be73", "metadata": {}, "source": [ "Now solve for $v_{1f}$" ] }, { "cell_type": "code", "execution_count": 9, "id": "8f601a39", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\left\\{v_{1i}, \\frac{m_{1} v_{1i} - m_{2} v_{1i}}{m_{1} + m_{2}}\\right\\}$" ], "text/plain": [ "{v_{1i}, (m_1*v_{1i} - m_2*v_{1i})/(m_1 + m_2)}" ] }, "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eq3b = smp.solveset(eq3a, v1f)\n", "eq3b" ] }, { "cell_type": "markdown", "id": "ee70d203", "metadata": {}, "source": [ "There are two answers two this quadratic equation but if m2 >> m1 (which is what I am assuming) then the second term is negative which will be shown explicitly below. Since mass must be positive that can only mean that the $v_{1i} $ is negative with respect to $ v_{1f} $ which looks like the solution we are looking for. " ] }, { "cell_type": "code", "execution_count": 10, "id": "47942641", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle \\frac{v_{1i} \\left(m_{1} - m_{2}\\right)}{m_{1} + m_{2}}$" ], "text/plain": [ "v_{1i}*(m_1 - m_2)/(m_1 + m_2)" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "eq3c = eq3b.args[1].factor()\n", "eq3c" ] }, { "cell_type": "markdown", "id": "cd233b73", "metadata": {}, "source": [ "Now take the limit as $ m_2 \\rightarrow \\infty $" ] }, { "cell_type": "code", "execution_count": 11, "id": "a2ec4275", "metadata": {}, "outputs": [ { "data": { "text/latex": [ "$\\displaystyle - v_{1i}$" ], "text/plain": [ "-v_{1i}" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "smp.limit(eq3c, m2, smp.oo)" ] }, { "cell_type": "markdown", "id": "5032584b", "metadata": {}, "source": [ "This proves that $ v_{1f} = -v_{1i} $ in the case for when $ m_2 $ is fixed." ] } ], "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.10" } }, "nbformat": 4, "nbformat_minor": 5 }