diff --git a/TeachingExamples/SuspendedObjects-exercise.ipynb b/TeachingExamples/SuspendedObjects-exercise.ipynb index 294133d..8d875b1 100644 --- a/TeachingExamples/SuspendedObjects-exercise.ipynb +++ b/TeachingExamples/SuspendedObjects-exercise.ipynb @@ -1,339 +1,244 @@ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
\n", "

Use case scenario
\n", " This notebook is made to be used by students as an assignment or exercise, in autonomy (at home or in an exercise session).

\n", "

Features
\n", " This notebook embeds auto-corrected quizzes to engage students with the virtual demonstration and uses different types of visualisations to help students understand the phenomena.
\n", " The example chosen is voluntarily simple so that anyone can understand what is illustrated and focus the pedagogical features of the example.

\n", "

More information on using notebooks for exercises or assignements.

\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Suspended objects\n", "\n", "We consider a clothesline made of two poles and a cable.\n", "The cable is fixed on one pole. A pulley on the other pole allows to attach a counterweight to pull the cable taut. \n", "\n", "\n", "\n", "## Exercise 1\n", "Execute the cell below to activate the interactive quiz and answer the question. \n", "If you don't see the question, make sure you are logged on [moodle](https://moodle.epfl.ch/enrol/index.php?id=15917) and registered on our [Noto Community moodle page](https://moodle.epfl.ch/enrol/index.php?id=15917).\n", "\n", "" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/html": [ - "\n", - " \n", - " " - ], - "text/plain": [ - "" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "from IPython.display import IFrame\n", "IFrame('https://moodle.epfl.ch/mod/hvp/embed.php?id=1028285', 500, 600)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 2\n", "\n", "The virtual lab below allows you to experiment with different counterweights to see how it affects the position of the object suspended on the clothesline. \n", "Execute the cell below to launch the virtual lab, then *answer the questions in the quiz below*." ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "application/vnd.jupyter.widget-view+json": { - "model_id": "60cb76d0d81041be8e26c7115a8888e4", - "version_major": 2, - "version_minor": 0 - }, - "text/plain": [ - "VBox(children=(Output(layout=Layout(margin='5px 10px')), HBox(children=(Label(value='Mass of the counterweight…" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "\n", - " \n", - " " - ], - "text/plain": [ - "" - ] - }, - "execution_count": 12, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "%matplotlib inline\n", "from lib.suspendedobjects import *\n", "SuspendedObjectsLab();\n", "IFrame('https://h5p.org/h5p/embed/584119', 1024, 350)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "*If you wonder how the virtual lab works and would like to see the code, [you can have a look at it at the end of this notebook](#How-does-the-virtual-lab-work%3F).*" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Exercise 3\n", "\n", "1. Give the expression of the **mass of the counterweight $m_{cw}$ as a function of the other parameters of the problem**.\n", "2. Application: what counterweight allows to suspend wet jeans ($m = 3 kg$) on the cable so that the cable is taut at an angle of $1.5^\\circ = \\frac{\\pi}{120}$ with the horizon?\n", "3. Why is it impossible to pull the cable taut completely horizontally?\n", "\n", " \n", "\n", "## Solution\n", "\n", "### Method\n", "\n", "Given that the system is in static equilibrium, the sum of external forces exerted on the system will be zero, so using Newton's second law should be easy. The force that the counterweight exerts on the system will involve the mass of the counterweight so we should be able to rewrite Newton's second law to get an expression of the form $m_{cw} = ...$.\n", "\n", "### Hypotheses and simplifications\n", "\n", "We make the following assumptions and simplifications:\n", "* the jeans are considered as positioned exactly mid-way between the poles so the tension is equal on both sides of the cable\n", "* we represent the jeans by the point at which they are suspended\n", "* the cable is considered as rigid (not bended), with a negligible mass\n", "* the pulley is considered as perfect, without mass nor friction\n", "* we consider the static equilibrium obtained after changing the weight, once the system is stabilized\n", "\n", "### Resolution\n", "\n", "First, let's draw a diagram and represent the different forces involved.\n", "\n", "\n", "The *forces applied on the jeans* are:\n", "* the weight: $\\vec F_j = m_j \\vec g$ \n", "* the force exerted by the cable on each side of the jeans: assuming the jeans are suspended at the exact center of the cable, then the tension applied on each of the two sides is is equally distributed $\\vec T$, which combine into a vertical resulting tension $\\vec T_r = 2.\\vec T$\n", "\n", "From Newton's second law in a static equilibrium we can write: $\\sum \\vec F_j = \\vec 0$ \n", "With the forces on the jeans we get: $\\vec F_j + \\vec T_r = 0$ \n", "Using the fact that the tension is equal on both sides of the jeans we get: $\\vec F_j + 2.\\vec T = 0$\n", "\n", "If we project on $x$ and $y$ axes, we get: \n", "$\\left\\{\\begin{matrix} F_{jx} + 2.T_x = 0 \\\\ F_{jy} + 2.T_y = 0\\end{matrix}\\right. $\n", "\n", "Since the weight does not have a component on the x axis, it simplifies into: \n", "$\\left\\{\\begin{matrix} T_x = 0 \\\\ F_{jy} + 2.T_y = 0\\end{matrix}\\right. $\n", "\n", "The component of the weight on the y axis is $F_{jy} = - m_j.g$, which gives us: \n", "$\\left\\{\\begin{matrix} T_x = 0 \\\\ - m_j.g + 2.T_y = 0\\end{matrix}\\right. $\n", "\n", "Using the angle $\\alpha$ we can get the tension $T_y$ expressed as a function of T since $sin(\\alpha) = \\frac{T_y}{T}$, therefore $T_y = T.sin(\\alpha)$\n", "\n", "By replacing $T_y$ by this expression in the above equation we get: \n", "$\\left\\{\\begin{matrix} T_x = 0 \\\\ - m_j.g + 2.T.sin(\\alpha) = 0\\end{matrix}\\right. $\n", "\n", "From there we can get $T$, and this is equation number $(1)$: \n", "$T = \\frac{m_j.g}{2.sin(\\alpha)}$\n", "\n", " \n", "\n", "We now want to make the mass of the counterweight appear in this expression. \n", "So we will now look at the forces applied on the *counterweight*.\n", "\n", " \n", "\n", "The forces applied on the *counterweight* are:\n", "* the weight: $\\vec F_{cw} = m_{cw} \\vec g$ \n", "* the force exerted by the line: a simple pulley simply changes the direction of the tension so the tension applied on the counterweight is therefore $\\vec T$\n", "\n", "From Newton's second law in a static equilibrium we can write: $\\sum \\vec F_{cw} = \\vec 0$ \n", "With the forces involved in our problem : $\\vec F_{cw} + \\vec T = \\vec 0$ \n", "\n", "All forces being vertical, there is no need to project on $x$ so we get: $- F_{cw} + T = 0$ \n", "We replace the weight by its detailed expression: $-m_{cw}.g + T = 0$ \n", "Now we can express $T$ as a function of the other parameters, which is equation number $(2)$: $T = m_{cw}.g$ \n", "\n", " \n", "\n", "Let's now summarize what we have so far with equations $(1)$ and $(2)$: \n", "\n", "$\\left\\{\\begin{matrix}T = \\frac{m_j.g}{2.sin(\\alpha)} \\\\ T = m_{cw}.g\\end{matrix}\\right. $\n", "\n", "These two equations combined give us:\n", "\n", "$\\frac{m_j.g}{2.sin(\\alpha)} = m_{cw}.g$\n", "\n", "This allow us to find the mass of the counterweight as a function of the *mass of the jeans* and of the *angle that the line makes with the horizon*: \n", "\n", "$\\boxed{m_{cw} = \\frac{m_j}{2.sin(\\alpha)}}$\n", "\n", "\n", " \n", "\n", "### Application\n", "\n", "For a pair of wet jeans of $3 kg$ and an angle of $1.5^\\circ = \\frac{\\pi}{120}$, we need to put a counterweight of:" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "57.30232502116567\n" - ] - } - ], + "outputs": [], "source": [ "mcw = 3 / (2 * np.sin(np.pi / 120))\n", "print(mcw)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "You can **check that you get a similar result** with the virtual lab above!\n", "\n", "\n", "### Conclusion\n", "\n", "For the line to be taut completely horizontal, $\\alpha$ has to be really small i.e. really close to zero. \n", "This means that $sin(\\alpha)$ will also be close to zero, which means in turn that $m_{cw}$ will be very big.\n", "Actually, **the more we want the line to be close to the horizon, the bigger $m_{cw}$ we will need!**\n", "In fact, it is impossible to get the line taut so that it is absolutely straight...\n", "\n", " " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ " \n", "\n", "---\n", "\n", "# How does the virtual lab work?\n", "\n", "If you wonder how the virtual lab works: \n", "* You can have a look at the code of the virtual lab by [opening this python file](lib/suspendedobjects.py).\n", "* You can see the documentation by executing the cell below:" ] }, { "cell_type": "code", - "execution_count": 14, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "\u001b[0;31mInit signature:\u001b[0m\n", - "\u001b[0mSuspendedObjectsLab\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\u001b[0m\n", - "\u001b[0;34m\u001b[0m \u001b[0mm_object\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", - "\u001b[0;34m\u001b[0m \u001b[0mdistance\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m5\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", - "\u001b[0;34m\u001b[0m \u001b[0mheight\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", - "\u001b[0;34m\u001b[0m \u001b[0mx_origin\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", - "\u001b[0;34m\u001b[0m \u001b[0my_origin\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\n", - "\u001b[0;34m\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", - "\u001b[0;31mDocstring:\u001b[0m This class embeds all the necessary code to create a virtual lab to study the static equilibrium of an object suspended on a clothesline with a counterweight.\n", - "\u001b[0;31mInit docstring:\u001b[0m\n", - "Initiates and displays the virtual lab on suspended objects.\n", - "\n", - ":m_object: mass of the suspended object\n", - ":distance: horizontal distance between the two poles\n", - ":height: height of the poles (same height for both)\n", - ":x_origin: x coordinate of the bottom of the left pole (origin of the coordinate system)\n", - ":y_origin: y coordinate of the bottom of the left pole (origin of the coordinate system)\n", - "\u001b[0;31mFile:\u001b[0m ~/git_Noto/noto-poc-notebooks/TeachingExamples/lib/suspendedobjects.py\n", - "\u001b[0;31mType:\u001b[0m type\n", - "\u001b[0;31mSubclasses:\u001b[0m \n" - ] - }, - "metadata": {}, - "output_type": "display_data" - } - ], + "outputs": [], "source": [ "SuspendedObjectsLab?" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.6.8" } }, "nbformat": 4, "nbformat_minor": 4 }