diff --git a/KYCW.ipynb b/KYCW.ipynb new file mode 100644 index 0000000..2181378 --- /dev/null +++ b/KYCW.ipynb @@ -0,0 +1,454 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "
\n", + " Jupyter Notebooks for Education - KYCW, December 2, 2019
\n", + " C. Hardebolle, CC BY-NC-SA 4.0 Int.

\n", + " How to use this notebook?
\n", + " This notebook is made of text cells and code cells. The code cells have to be executed to see the result of the program. To execute a cell, simply select it and click on the \"play\" button (⯈) in the tool bar just above the notebook, or type shift + enter. It is important to execute the code cells in their order of appearance in the notebook.\n", + "
" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Experimenting with the virtual lab\n", + "\n", + "The \"Suspended object\" 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": 1, + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "abdb887df5a44eb3a873f71c6f079cae", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "VBox(children=(Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Ba…" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n", + " " + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "from lib.suspendedobjects import *\n", + "SuspendedObjectsLab();" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "\n", + "\n", + "# Focus on the tension force \n", + "\n", + "The plot on the right shows how the value of the tension $\\vec{T}$ in the cable evolves depending on the angle $\\alpha$ that the cable makes with the horizon. \n", + "As you can see, the more the cable is taut, the higher the tension is. Actually, the tension increases very very fast when the cable approaches the horizon: what this curve represents is that the value of the tension tends towards $+\\infty$ when the angle $\\alpha$ approaches 0.\n", + "\n", + "High tension can have a devastating effect especially when the cable is not well adapted for its intended use (i.e. not strong enough) or when the cable is deteriorating with use. The following video illustrates what can happen when the tension exceeds the capacity of the cable. \n", + "Execute the cell below to see the video and watch the first minute (sound is not necessary). \n", + "Observe in particular what happens at time 0:53.\n", + "\n", + "As a conclusion, not only is it impossible to pull the cable taut completely horizontally but the cable might actually break and snap in the process of trying." + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": {}, + "outputs": [ + { + "data": { + "image/jpeg": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEABALDBoYFhsaGRoeHRsfIiUlICIiIionJSctLicxMC0nLS01PVBCNThLOS0tRWFFS1NWW1xbMkFlbWRYbFBZW1cBERISGRYZLRsbL1c2LTZXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dXV1dkV1dXV1dXV1ddV//AABEIAWgB4AMBIgACEQEDEQH/xAAbAAABBQEBAAAAAAAAAAAAAAAAAQIDBAUGB//EAEMQAAEDAQQGBgYJAwQDAQEAAAEAAhEDBBIhMQUTQVFhkSJScYGh0RQyQpKx4QYVFiNTYsHS8HKCojNDsvEXY8IHJP/EABgBAQEBAQEAAAAAAAAAAAAAAAABAgME/8QAIREBAQEBAQEAAwEBAQEBAAAAAAERAhIhEzFBA1FhIpH/2gAMAwEAAhEDEQA/APP0IQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEIQgEK59Wv3t5nyR9Wv3t5nyQU0K59XP3t5nySfV797eZ8kFRCt/V797eZ8knoD97eZ8kFVCtegv3t8fJJ6C/e3x8kFZCs+hO3t8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UdOHu63gPJGsd1vgub+3ts6lD3D+5L9v7Z1KHuO/cn4+v8Ah6jpNe7reAQKz+t4Bc39vrX+FZvcd+5J9vLV+DZvcd+5Px9L7jp213bxyTte7hyXLfb21fg2b3HfuS/b61fg2b3HfuT8fR7jqNefy+6l9Idw90+a5X7eWn8Cy+479yPt5afwLL7jv3J+Po9x1raziM28j5pwrP8Ay+6fNcefp3afwLL7jv3Jft3afwLL7j/3J+Po9x3NktTgcYg54HzVzSGj22mncqQRmMDIO8GV519vLT+BZvcf+9Sj/wDRLYP9qz+6/wDepf8AHpm9RZfZn0HOa5pABjHwTplY1s+l9orPvPpUMoIDXQe3pKm3T1Yeyw9oPmus4rnY6WEoujaub+0Nbq0+TvNH2hq9Slyd5q+KmOmaBvSgLmftHW6lPk7zSfaGt1afJ3mnimOqa3inls7YXJ/aOt1KfJ3mnD6SVh7FPk7zU8Ux1N3iUNB2FcsfpLW6lPk79yQfSSt1KfJ3mnimOtvneUEu3rk/tLX6tPk79yB9Ja/Vp8neaeKmOra89ZShx3rkR9KK/Upe679yX7U1+pS5O/cnirjDQhC7NBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIBCEIP/Z\n", + "text/html": [ + "\n", + " \n", + " " + ], + "text/plain": [ + "" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "from IPython.display import YouTubeVideo\n", + "YouTubeVideo('KIbd5zBek5s', 600, 337)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + " \n", + "\n", + "---\n", + "\n", + "# Doing physics with Python (optional)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "In the mini-lecture, we have seen that, in this situation, the tension in the cable is defined by:\n", + "\n", + "$\n", + "\\begin{align}\n", + "\\lvert\\vec{T}\\rvert = \\frac{\\frac{1}{2}.m.g}{sin(\\alpha)}\n", + "\\end{align}\n", + "$\n", + "\n", + "where $m$ is the mass of the suspended object, $\\alpha$ the angle that the cable makes with the horizon and $g$ the gravity of earth.\n", + "\n", + "Let's use Python to make calculations with this equation. \n", + "So for wet jeans of 3 $kg$ and an angle of 0.5$^\\circ = \\frac{\\pi}{360}$, the norm of the tension in the cable, expressed in Newtons, will be:" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": {}, + "outputs": [ + { + "data": { + "text/latex": [ + "$\\displaystyle \\lvert\\vec{T}\\rvert = $ 1686 $N $" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "gravity = 9.81 # gravity of the earth\n", + "jeans_mass = 3 # mass of the jeans\n", + "alpha = np.pi/360 # angle alpha\n", + "\n", + "# compute the tension using our equation\n", + "T = (.5 * jeans_mass * gravity) / np.sin(alpha)\n", + "\n", + "# pretty printing of the result\n", + "display(Math(r'$\\lvert\\vec{T}\\rvert = $'+' {:8.0f} $N $'.format(T)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "To get an idea of how big this value is, you can think about our jeans which weight 3 $kg$: the force exerted by earth gravity on the jeans is $\\lvert\\vec{F}\\rvert = $ 29 $N$ only!" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plotting the tension in the cable as a function of angle $\\alpha$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Expressing tension in 'kilogram-force'\n", + "\n", + "Actually, to have a better intuition about how big the tension is, people express it frequently in kilograms. The idea is to make a parallel with the force exerted by gravity i.e. the weight, $\\vec{F} = m.\\vec{g}$, and to compute which mass $m$ would create an equivalent force. \n", + "To get the value in 'kilogram-force' of a tension, you divide its value in Newtons by the value of gravity: \n", + "\n", + "$\n", + "\\begin{align}\n", + "T' = \\frac{T}{g}\n", + "\\end{align}\n", + "$" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Question 1** \n", + "Complete the code in the cell below to compute the value in 'kilogram-force' of the tension we have computed above. Then execute the cell to see the result." + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [ + { + "data": { + "text/latex": [ + "$\\displaystyle \\lvert\\vec{T}\\rvert = $ 0 kg$_F$" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "# TODO: complete the code line below (replace the \"0\" with the expression of the equation)\n", + "T_prime = 0\n", + "\n", + "# pretty printing of the result\n", + "display(Math(r'$\\lvert\\vec{T}\\rvert = $'+' {:8.0f} kg$_F$'.format(T_prime)))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "**Question 2** \n", + "Now let's see what happens with our piece of Python code when we say that the cable it taut completely horizontal, i.e. the angle $\\alpha$ = 0$^\\circ$. \n", + "In the cell where we have computed $T$ above, change the value of `alpha` to $0$ and re-execute the cell. \n", + "What happens? " + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "Type your answer here." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + " \n", + "\n", + "---\n", + "\n", + "*If you wonder how the virtual lab works, you can have a look at the code in [this python file](lib/suspendedobjects.py).*\n", + "\n", + "# Solution\n", + "\n", + "**Is it possible to pull the cable taut completely horizontally?** \n", + "To answer this question, we look for an expression relating the **mass of the counterweight $m_{cw}$** and the **angle $\\alpha$** that the cable makes with the horizon.\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" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### 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", + "Therefore, **the more we want the line to be close to the horizon, the bigger $m_{cw}$ we will need!**\n", + "\n", + "Mathematically speaking, the limit of the expression defining the mass of the counterweight when alpha tends to 0 is:\n", + "\n", + "$\\lim_{\\alpha\\to0}m_{cw} = \\lim_{\\alpha\\to0}\\frac{m_j}{2.sin(\\alpha)} = \\infty$\n", + "\n", + "So basically, we would need to put an **infinitely heavy counterweight** to make the angle null and that is why it is impossible to get the line taut so that it is absolutely straight (the cable would break before that! :-p)...\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + " \n", + "\n", + "### Numerical application\n", + "\n", + "Let's define a Python function that represents this equation. The function takes two input parameters:\n", + "- `jeans_mass`: mass of the suspended jeans\n", + "- `alpha`: angle that the clothesline makes with the horizon \n", + "\n", + "It returns the mass of the counterweight as computed with the equation above." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": {}, + "outputs": [], + "source": [ + "def counterweight_mass(jeans_mass, alpha):\n", + " return jeans_mass / (2 * np.sin(alpha))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "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": 7, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "57.30 kg\n" + ] + } + ], + "source": [ + "jeans_mass = 3\n", + "alpha = np.pi / 120\n", + "\n", + "# Let's call our function which computes the mass of the counterweight\n", + "mcw = counterweight_mass(jeans_mass, alpha)\n", + "\n", + "# And print the result\n", + "print('{:.02f} kg'.format(mcw))" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "You can check that you get a similar result with the virtual lab above.\n", + "\n", + "You can also check what happens when you put `alpha = 0`...\n", + "\n", + " " + ] + } + ], + "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 +} diff --git a/figs/jeans-solution.png b/figs/jeans-solution.png new file mode 100644 index 0000000..0499a36 Binary files /dev/null and b/figs/jeans-solution.png differ diff --git a/figs/tension-plot.png b/figs/tension-plot.png new file mode 100644 index 0000000..2bce964 Binary files /dev/null and b/figs/tension-plot.png differ diff --git a/lib/suspendedobjects.py b/lib/suspendedobjects.py new file mode 100644 index 0000000..2d9c7e2 --- /dev/null +++ b/lib/suspendedobjects.py @@ -0,0 +1,351 @@ +import numpy as np + +from ipywidgets import interact, interactive, fixed, interact_manual +from ipywidgets import HBox, VBox, Label, Layout +import ipywidgets as widgets + +from IPython.display import IFrame +from IPython.display import set_matplotlib_formats, display, Math, Markdown, Latex, HTML +set_matplotlib_formats('svg') + +# Enable interactive backend for matplotlib +from IPython import get_ipython +get_ipython().run_line_magic('matplotlib', 'widget') + +import matplotlib.pyplot as plt +import matplotlib.patches as pat +plt.style.use('seaborn-whitegrid') # global style for plotting + + +class SuspendedObjectsLab: + """ + 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. + """ + + def __init__(self, m_object = 3, distance = 5, height = 1, x_origin = 0, y_origin = 0): + ''' + Initiates and displays the virtual lab on suspended objects. + + :m_object: mass of the suspended object + :distance: horizontal distance between the two poles + :height: height of the poles (same height for both) + :x_origin: x coordinate of the bottom of the left pole (origin of the coordinate system) + :y_origin: y coordinate of the bottom of the left pole (origin of the coordinate system) + ''' + + ###--- Static parameters of the situation + self.m_object = m_object # mass of the wet object, in kg + + self.distance = distance # distance between the poles, in m + self.height = height # height of the poles, in m + + self.x_origin = x_origin # x coordinate of point of origin of the figure = x position of the left pole, in m + self.y_origin = y_origin # y coordinate of point of origin of the figure = y position of the lower point (ground), in m + + + + ###--- Then we define the elements of the ihm: + # parameters for sliders + self.m_counterweight_min = 0.0 + self.m_counterweight_max = 100.0 + self.m_counterweight = self.m_counterweight_min # initial mass of the counterweight (0 by default, no counterweight at the beginning) + + # IHM input elements + self.m_counterweight_label = Label('Mass of the counterweight ($kg$):', layout=Layout(margin='15px 5px 15px 0px')) + self.m_counterweight_widget = widgets.FloatSlider(min=self.m_counterweight_min,max=self.m_counterweight_max,step=0.5,value=self.m_counterweight, layout=Layout(margin='15px 0px')) + self.m_counterweight_input = HBox([self.m_counterweight_label, self.m_counterweight_widget]) + + # IHM output elements + self.quiz_output = widgets.Output() + + # Linking widgets to handlers + self.m_counterweight_widget.observe(self.m_counterweight_event_handler, names='value') + + + + ###--- Compute variables dependent with the counterweight selected by the user + alpha = self.get_angle(self.m_counterweight) + alpha_degrees = alpha*180/np.pi + alpha_text = r'$\alpha$ = {:.2f} $^\circ$'.format(alpha_degrees) + + coord_object = self.get_object_coords(alpha) + height_text = r'h = {:.2f} $m$'.format(coord_object[1]) + + + + ###--- Create the figure + plt.ioff() # deactivate interactive mode until we actually decide to show it + plt.clf() # clear any previously drawn figure + + # Create the figure and subplots in it + self.fig = plt.figure(num='Suspended Object Lab', constrained_layout=False, figsize=(10,4)) # hack for interactive backend: num is the title which appears above the canvas + gs = self.fig.add_gridspec(ncols=7, nrows=1, wspace=0.5, hspace=0, right=0.95, top=0.9, left=0.05, bottom=0.1) + ax1 = self.fig.add_subplot(gs[0, :3]) + ax2 = self.fig.add_subplot(gs[0, 3:5], sharey = ax1) + ax3 = self.fig.add_subplot(gs[0, 5:7], sharex = ax2) + + # Deactivate toolbar (hack for interactive backend) + # NOT WORKING + # self.fig.canvas.toolbar_visible = False + + # Deactivate coordinate formatter (hack for interactive backend) + ax1.format_coord = lambda x, y: '' + ax2.format_coord = lambda x, y: '' + ax3.format_coord = lambda x, y: '' + + # Adjust canvas size so that quiz below is visible (hack for interactive backend) + # NOT WORKING + # self.fig.set_size_inches([10,4], forward = True) + + ###--- First display the clothesline + ax1.set_title('Suspended object ({} kg)'.format(self.m_object)) + + # Fix graph to problem boundaries + ymargin = .06 + xmargin = .4 + ax1.set_ylim(bottom = self.y_origin - ymargin) # limit bottom of y axis to ground + ax1.set_ylim(top = self.y_origin + self.height + ymargin) # limit top of y axis to values just above height + + # Customize graph style so that it doesn't look like a graph + ax1.grid(False) # hide the grid + ax1.set_ylabel("Height ($m$)") # add a label on the y axis + ax1.get_xaxis().set_visible(False) # hide x axis + ax1.spines['top'].set_visible(False) # hide the frame + ax1.spines['bottom'].set_visible(False) + ax1.spines['right'].set_visible(False) + ax1.spines['left'].set_visible(False) + + # Draw the poles + x_pole1 = np.array([self.x_origin, self.x_origin]) + y_pole1 = np.array([self.y_origin, self.y_origin+self.height]) + ax1.plot(x_pole1, y_pole1, "k-", linewidth=7, zorder=1) + x_pole2 = np.array([self.x_origin+self.distance, self.x_origin+self.distance]) + y_pole2 = np.array([self.y_origin, self.y_origin+self.height]) + ax1.plot(x_pole2, y_pole2, "k-", linewidth=7, zorder=1) + + # Draw the ground + ax1.axhline(y=self.y_origin, color='black', linewidth=1, zorder=2) + ax1.add_patch(pat.Polygon([[self.x_origin-xmargin, self.y_origin], [self.x_origin+self.distance+xmargin, self.y_origin], [self.x_origin+self.distance+xmargin, self.y_origin-ymargin], [self.x_origin-xmargin, self.y_origin-ymargin]], closed=True, fill="white", facecolor="white", edgecolor="gray", hatch='///', linewidth=0.0, zorder=2)) + + # Draw the horizon line + ax1.axhline(y=self.y_origin+self.height, color='gray', linestyle='-.', linewidth=1, zorder=1) + + # -DYN- Draw the hanging cable + x = np.array([self.x_origin, coord_object[0], self.x_origin+self.distance]) + y = np.array([self.y_origin+self.height, coord_object[1], self.y_origin+self.height]) + self.cable, = ax1.plot(x, y, linewidth=2, linestyle = "-", color="black") + + # -DYN- Draw the angle between the hanging cable and horizonline + ellipse_radius = 0.2 + fig_ratio = self.height / self.distance + self.cable_angle = pat.Arc(xy = (self.x_origin, self.y_origin+self.height), width = ellipse_radius/fig_ratio, height = ellipse_radius, theta1 = -1*alpha_degrees, theta2 = 0, color="gray", linestyle='-.') + ax1.add_patch(self.cable_angle) + self.cable_angle_text = ax1.annotate(alpha_text, xy=(self.x_origin, self.y_origin+self.height), xytext=(30, -15), textcoords='offset points', bbox=dict(boxstyle="round", facecolor = "white", edgecolor = "white", alpha = 0.8)) + + # -DYN- Draw the point at which the object is suspended + self.cable_point = ax1.scatter(coord_object[0], coord_object[1], s=80, c="black", zorder=15) + self.cable_point_text = ax1.annotate(height_text, xy=(coord_object[0], coord_object[1]), xytext=(10, -10), textcoords='offset points', bbox=dict(boxstyle="round", facecolor = "white", edgecolor = "white", alpha = 0.8)) + + # -DYN- Draw the force vectors + # Parameters for drawing forces + self.gravity = 9.81 + self.force_scaling = .01 + + # Weight + Fy = self.m_object*self.gravity*self.force_scaling + self.cable_weight = ax1.quiver(coord_object[0], coord_object[1], 0, -Fy, color='blue', angles='xy', scale_units='xy', scale=1, zorder=12, width=0.007) + self.cable_weight_text = ax1.annotate(r'$\vec{F}$', xy=(coord_object[0], coord_object[1]), xytext=(10, -55), textcoords='offset points', color='blue') + + # Tension + Tx = ((self.m_object*self.gravity) / (2*np.tan(alpha)))*self.force_scaling + Ty = .5*self.m_object*self.gravity*self.force_scaling + self.cable_tension_right = ax1.quiver(coord_object[0], coord_object[1], Tx, Ty, color='red', angles='xy', scale_units='xy', scale=1, zorder=12, width=0.007, linewidth=1) + self.cable_tension_right_text = ax1.annotate(r'$\vec{T}$', xy=(coord_object[0], coord_object[1]), xytext=(40, 5), textcoords='offset points', color='red') + self.cable_tension_left = ax1.quiver(coord_object[0], coord_object[1], -Tx, Ty, color='red', angles='xy', scale_units='xy', scale=1, zorder=12, width=0.007, linewidth=1) + self.cable_tension_left_text = ax1.annotate(r'$\vec{T}$', xy=(coord_object[0], coord_object[1]), xytext=(-45, 5), textcoords='offset points', color='red') + self.cable_tension_sum = ax1.quiver(coord_object[0], coord_object[1], 0, Fy, color='red', angles='xy', scale_units='xy', scale=1, zorder=12, width=0.007, facecolor="none", edgecolor="red", hatch="/"*8, linewidth=0.0) + self.cable_tension_sum_text = ax1.annotate(r'$\vec{T_r}$', xy=(coord_object[0], coord_object[1]), xytext=(10, 45), textcoords='offset points', color='red') + + + ###--- Then display the angle and the height as functions from the mass of the counterweight + # Create all possible values of the mass of the counterweight + m_cw = np.linspace(self.m_counterweight_min, self.m_counterweight_max, 100) + + # Compute the angle (in degrees) and height for all these values + angle = [] + height = [] + for m in m_cw: + a = self.get_angle(m) + angle.append(a*180/np.pi) + + c = self.get_object_coords(a) + height.append(c[1]) + + # Display the functions on the graphs + ax2.set_title(r'Height ($m$)') + ax2.set_xlabel('Mass of the counterweight (kg)') + ax2.plot(m_cw, height, "green") + + ax3.set_title(r'Angle $\alpha$ ($^\circ$)') + ax3.set_xlabel('Mass of the counterweight (kg)') + ax3.plot(m_cw, angle, "green") + + + # Draw the horizon lines + ax2.axhline(y=self.y_origin+self.height, color='gray', linestyle='-.', linewidth=1, zorder=1) + ax3.axhline(y=self.y_origin, color='gray', linestyle='-.', linewidth=1, zorder=1) + + # -DYN- Add the current height from the counterweight selected by the user + self.graph_height_point = ax2.scatter(self.m_counterweight, coord_object[1], s=80, c="black", zorder=15) + self.graph_height_text = ax2.annotate(height_text, xy=(self.m_counterweight, coord_object[1]), xytext=(10, -10), textcoords='offset points', bbox=dict(boxstyle="round", facecolor = "white", edgecolor = "white", alpha = 0.8)) + + # -DYN- Add the current angle from the counterweight selected by the user + self.graph_angle_point = ax3.scatter(self.m_counterweight, alpha_degrees, s=80, c="black", zorder=15) + self.graph_angle_text = ax3.annotate(alpha_text, xy=(self.m_counterweight, alpha_degrees), xytext=(10, 5), textcoords='offset points', bbox=dict(boxstyle="round", facecolor = "white", edgecolor = "white", alpha = 0.8)) + + + + ###--- Add a quiz from Moodle + iframe_quiz = ''' + ''' + widget_quiz = widgets.HTML(value=iframe_quiz) + + + ###--- Display the whole interface + display(VBox([self.fig.canvas, self.m_counterweight_input, widget_quiz])) + + # Hack: hide the toolbar and the top and bottom part of figure using javascript and jquery + js = """ + """ + display(HTML(js)); + + + + # Event handlers + def m_counterweight_event_handler(self, change): + self.m_counterweight = change.new + self.update_lab() + + + # Utility functions + def get_angle(self, m_counterweight): + """ + Computes the angle that the cable makes with the horizon depending on the counterweight chosen: + - if the counterweight is sufficient: angle = arcsin(1/2 * m_object / m_counterweight) + - else (object on the ground): alpha = arctan(height / (distance / 2)) + + :m_counterweight: mass of the chosen counterweight + + :returns: angle that the cable makes with the horizon (in rad) + """ + # Default alpha value i.e. object is on the ground + alpha_default = np.arctan(self.height / (self.distance / 2)) + alpha = alpha_default + + # Let's check that there is actually a counterweight + if m_counterweight > 0: + + # Then we compute the ratio of masses + ratio = 0.5 * self.m_object / m_counterweight + + # Check that the ratio of masses is in the domain of validity of arcsin ([-1;1]) + if abs(ratio) < 1: + alpha = np.arcsin(ratio) + + return min(alpha_default, alpha) + + + def get_object_coords(self, angle): + """ + Computes the position of the object on the cable taking into account the angle determined by the counterweight and the dimensions of the hanging system. + By default: + - the object is supposed to be suspended exactly in the middle of the cable + - the object is on considered the ground for all values of the angle + + :angle: angle that the cable makes with the horizon + + :returns: coordinates of the point at which the object are hanged + """ + # the jean is midway between the poles + x_object = self.x_origin + 0.5 * self.distance + + # default y value: the jean is on the ground + y_object = self.y_origin + + # we check that the angle is comprised between horizontal (greater than 0) and vertical (smaller than pi/2) + if angle > 0 and angle < (np.pi / 2): + # we compute the delta between the horizon and the point given by the angle + delta = (0.5 * self.distance * np.tan(angle)) + # we check that the delta is smaller than the height of the poles (otherwise it just means the jean is on the ground) + if delta <= self.height: + y_object = self.y_origin + self.height - delta + + return [x_object, y_object] + + + # Update the visualisation + def update_lab(self): + # Compute new values with the counterweight selected by the user + alpha = self.get_angle(self.m_counterweight) + alpha_degrees = alpha*180/np.pi + alpha_text = r'$\alpha$ = {:.2f} $^\circ$'.format(alpha_degrees) + + coord_object = self.get_object_coords(alpha) + height_text = r'h = {:.2f} $m$'.format(coord_object[1]) + + ### Update the clothesline figure + # Update of the cable line + x = np.array([self.x_origin, coord_object[0], self.x_origin+self.distance]) + y = np.array([self.y_origin+self.height, coord_object[1], self.y_origin+self.height]) + self.cable.set_xdata(x) + self.cable.set_ydata(y) + + # Update of the point + self.cable_point.set_offsets(coord_object) + self.cable_point_text.set_text(height_text) + self.cable_point_text.xy = (coord_object[0], coord_object[1]) + + # Update of the angle + self.cable_angle.theta1 = -1*alpha_degrees + self.cable_angle_text.set_text(alpha_text) + + # Update the weight position (direction does not change) + self.cable_weight.set_offsets(coord_object) + self.cable_weight_text.xy = (coord_object[0], coord_object[1]) + + # Update the tension position and directions + Tx = ((self.m_object*self.gravity) / (2*np.tan(alpha)))*self.force_scaling + Ty = .5*self.m_object*self.gravity*self.force_scaling + self.cable_tension_right.set_offsets(coord_object) + self.cable_tension_right.set_UVC(Tx, Ty) + self.cable_tension_right_text.xy = (coord_object[0], coord_object[1]) + self.cable_tension_left.set_offsets(coord_object) + self.cable_tension_left.set_UVC(-Tx, Ty) + self.cable_tension_left_text.xy = (coord_object[0], coord_object[1]) + self.cable_tension_sum.set_offsets(coord_object) + self.cable_tension_sum_text.xy = (coord_object[0], coord_object[1]) + + + ### Update the other two graphs + # Update point of angle + self.graph_angle_point.set_offsets([self.m_counterweight, alpha_degrees]) + self.graph_angle_text.set_text(alpha_text) + self.graph_angle_text.xy = (self.m_counterweight, alpha_degrees) + + # Update point of height + self.graph_height_point.set_offsets([self.m_counterweight, coord_object[1]]) + self.graph_height_text.set_text(height_text) + self.graph_height_text.xy = (self.m_counterweight, coord_object[1]) + + + # Display graph + self.fig.canvas.draw_idle() + + + + + +# EOF