{ "metadata": { "name": "", "signature": "sha256:7e1dc3d25d48ec2ab2e25d99d695040ec757bf56643bd635d7bab0a05c465e8f" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "import pylab as pl\n", "from IPython.html.widgets import interact" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this post, we're going to tackle the following problem: \n", "\n", "> Given a sequence of bricks, what is the best way to stack them on top of each other so as to cover the greatest possible horizontal distance?\n", "\n", "By \"stack them on top of each other\", we mean two things:\n", "\n", "- the bricks lie on top of each other (no glue or any kind of support)\n", "- they're stable (gravity doesn't make the construction collapse)\n", "\n", "This problem has some similarity with the Jenga game (see picture below), where players remove blocks of woods from an initially stable pyramid, until it collapses. The collapse happening to Jenga towers is essentially due to gravity: removing one block changes the static properties of the structure and destroys it." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.display import Image\n", "Image(url=\"http://kristinruffin.files.wordpress.com/2014/03/jenga-falling-for-web.jpg\")" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "" ], "metadata": {}, "output_type": "pyout", "prompt_number": 2, "text": [ "" ] } ], "prompt_number": 2 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Other examples of this sort of stacking exist. As an example we can cite the [Nubian vault technique](http://en.wikipedia.org/wiki/Nubian_vault), whose key advantage Wikipedia says is the ability to be built \"without any support or shuttering\"." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This post is comprised of several sections. We first describe our model and data representation of this problem in Python. We then move on to write some graphic functions before designing the meat of this post: the \"stacking algorithm\". Finally, we examine applications of our code." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Modelling assumptions" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this post, we'll work with \"bricks\" that we will stack. Our modelling assumptions are as follows:\n", "\n", "- a brick of width $w$ and height $h$ is modelled as tuple $(w, h)$\n", "- a sequence of bricks to be stacked in a given order (the first on bottom, the last on top) is modelled as a list of bricks as defined above" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Next, we're going to write a simple function that generates regular sequences of bricks, much like with Jenga, which will be used in the examples to follow. The function takes as arguments:\n", "\n", "- the width and height of the brick sequence to be generated\n", "- the number of bricks to generate" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def generate_brick_sequence(width, height, n):\n", " return [(width, height) for i in range(n)]" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 3 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Below, we test the output on an example case, generating a sequence of five bricks with width 3 and height 4:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "generate_brick_sequence(3, 4, 5)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 4, "text": [ "[(3, 4), (3, 4), (3, 4), (3, 4), (3, 4)]" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "To continue, we will do two things, that will in time be translated to two functions.\n", "\n", "- a way of plotting brick sequences \n", "- a way to compute how to stack the bricks in a stable way for maximum range given a sequence of bricks as input\n", "\n", "Among these two things, the first is easy. And fun. So we're starting with that." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Plotting brick sequences" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Below, we write a function that plots bricks using Rectangles, a functionality already provided by matplotlib. \n", "\n", "The way it works is the following. We take inputs made of:\n", "\n", "- a brick sequence\n", "- the horizontal shifts to apply to each brick\n", "\n", "And then we loop and draw each brick on top of each other, starting with the first one at the bottom and applying the horizontal shift given as an input. To make this function generic, we keep track of the total height, so as to stack bricks exactly above each other." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from matplotlib.patches import Rectangle\n", "\n", "def plot_brick_sequence(brick_sequence, shifts):\n", " ax = pl.gca()\n", " total_height = 0.\n", " for brick, shift in zip(brick_sequence, shifts):\n", " ax.add_patch(Rectangle((shift, total_height), brick[0], brick[1]))\n", " total_height += brick[1]" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 5 }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can immediately try our function on an exemple sequence (that I just made up: the stacking is NOT physcally acceptable)." ] }, { "cell_type": "code", "collapsed": false, "input": [ "bricks = [(1, 2), (2, 3), (3, 4)]\n", "shifts = [0, 0.5, 2]\n", "plot_brick_sequence(bricks, shifts)\n", "pl.xlim(0, 10)\n", "pl.ylim(0, 10)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 6, "text": [ "(0, 10)" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAEACAYAAABF+UbAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAACpBJREFUeJzt3V+MZXdBwPHv2C3Y2v8vW5Ami0swmphKY0wlmI5YEjSI\nPpgoIdrU4BMJRSO2feo+ogmpJoYHITRthGqshlCjBGq46QMJQWmh9A+VVQOF0BIKtPAiyvhw7nan\nsLQzZ2bn3t/O55Pc3D9zzr2/PZn5zpnfPXdPAQAAAAAAAAAAAOzaB6onq4e2PXZF9fHq8epj1WUr\nGBcA1Y+9yNfvqN74A4/d0hTxV1f/urwPwJo61vP3xB+rji5vX7m8D8AKvNie+JkcbZpiaXl99AWW\nBeAsmhPx7baWFwBW4MiMdZ5smkb5WvWy6qkzLXT8+PGtkydP7mFoAIfSyepVO114zp74R6oblrdv\nqD58xlGcPNnW1pbL1la33XbbysewLhfbwrawLV74Uh3fTZBfLOJ3V5+sfrr6cnVj9e7qDU2HGL5+\neR+AFXix6ZS3/IjHr9/vgQCwe3t9Y5Md2NzcXPUQ1oZtcZptcZptMd/GWXzureX8DgA7tLGxUbto\nsz1xgIGJOMDARBxgYCIOMDARBxiYiAMMTMQBBibiAAMTcYCBiTjAwEQcYGAiDjAwEQcYmIgDDEzE\nAQYm4gADm3O2e3bpkkuu6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\nT7MtTrMtTrMt5psb8Z+svrzt/hPLxwA4QHMjvrWvowBglo2Z611bnWiaE6+6tfp+9WfblvlidXz2\nyAAOp5PVq872ixxZvtCx6iXVg3ljE2Aov1Z9oWmP+9YVjwUAACgfBDrlquoT1cPV56t3rHY4K3de\n9UB176oHsmKXVfdUj1aPNL3HdFjd2vTz8VD1oeqlqx3OgfpA9WTTv/2UK6qPV49XH2v6Xjlw5zVN\nsRyrzu9wz5dfWf388vZFTdNPh3VbVP1x9cHqI6seyIrdWf3B8vaR6tIVjmWVjlX/2elw/111w8pG\nc/B+uXpNz4/4n1d/urx9c/Xugx5U1S9VH912/5blhfpw9aurHsSKvKK6r/qVDvee+KVN4WLa6/xC\ndXnTL7N7q+tXOqKDd6znR/yx6ujy9pXL+y/obPwHWD4IdGbHmn7rfmrF41iV26t3NR2Kepi9svp6\ndUf1mep91YUrHdHqPF29p/pS9dXqW02/6A+zo01TLC2vj77AstXZibgPAv2wi5rmQG+qvrPisazC\nm6qnmubD53424VxxpLqmeu/y+rsd3r9Uj1fvbNrBeXnTz8lbVzmgNbPVDnp6NiL+laY39E65qmlv\n/LA6v/qH6m+aplMOo9dWb67+q7q7en1110pHtDpPLC+fXt6/pynmh9EvVJ+svlH9b/WPTd8rh9mT\nTdMoVS9r2vk5cD4IdNpGU6xuX/VA1sh1He458ar7q1cvb5/o+Z90Pkyubjpq64Kmn5U7q7evdEQH\n71g//MbmqSP6bmlFb2yWDwKd8rqmOeAHm6YSHuj0f1VwWF2Xo1OubtoT/2zT3udhPTqlpiMxTh1i\neGfTX66Hxd1N7wX8T9P7iDc2vdl7Xys+xBAAAAAAAAAAAAAAAACY4f8BD8B+2QnD09cAAAAASUVO\nRK5CYII=\n", "text": [ "" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now on to the hard part: the \"stacking algorithm\"." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Writing a function that computes the stacking" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "How does one write such a stacking function? Answer: this situation is described by static mechanics. \n", "\n", "Let's assume we have two blocks: a \"top\" and a \"bottom\" block. The horizontal shift for the top block is $x_i$. The forces that apply to the top block are:\n", "\n", "- gravity, which is proportional to its mass $m_i$\n", "- the reaction force due to the bottom block (a contact pressure)\n", "\n", "In our model, we will assume that the blocks are rigid and thus replace the contact pressure by a point force located at the right most point of the bottom block. This is illustrated by the figure below." ] }, { "cell_type": "code", "collapsed": false, "input": [ "from IPython.display import SVG\n", "SVG(filename='files/forces.svg')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 7, "svg": [ "" ], "text": [ "" ] } ], "prompt_number": 7 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Under these hypotheses, equilibrium has a simple expression:\n", "\n", "- if the center of gravity is located to the left of the pressure force, i.e. the edge of the bottom block, the structure is in a stable state\n", "- if the center of gravity is located to the right of the pressure force, i.e. the edge of the bottom block, the structure is in an unstable state and will collapse\n", "\n", "This is illustrated by the figure below:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "SVG(filename='files/forces_equilibrium.svg')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 8, "svg": [ "" ], "text": [ "" ] } ], "prompt_number": 8 }, { "cell_type": "markdown", "metadata": {}, "source": [ "So the algorithm is the following:\n", "\n", "- we loop over the bricks to stack in a reverse order, starting with the last brick which goes on top\n", "- we calculate the maximum shift we can apply to the brick at the bottom given the top brick and its mass\n", "- we define a new top brick that consists of the previous top brick plus the previous bottom brick but positioned on top of each other\n", "- we apply the same procedure as above to our new top and bottom bricks\n", "\n", "To follow this algorithm, we will need to compute the position of the new center of gravity obtained by assembling bricks together. This is coded below:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def compute_horizontal_center_of_mass(brick_sequence, shifts):\n", " compute_mass = lambda b: b[0] * b[1]\n", " sum_xi_mi = sum([(shifts[i] + brick_sequence[i][0]/2.) * compute_mass(brick_sequence[i]) for i in range(len(brick_sequence))])\n", " sum_mi = sum([compute_mass(brick_sequence[i]) for i in range(len(brick_sequence))])\n", " return sum_xi_mi / sum_mi " ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 9 }, { "cell_type": "markdown", "metadata": {}, "source": [ "And finally, the algorithm:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def compute_brick_shifts(brick_sequence):\n", " shifts = []\n", " reverse_brick_sequence = brick_sequence[::-1]\n", " for index, brick in enumerate(reverse_brick_sequence):\n", " if index == 0:\n", " shifts.append(0.)\n", " else:\n", " previous_center_of_mass = compute_horizontal_center_of_mass(reverse_brick_sequence[:index], shifts)\n", " shifts.append(previous_center_of_mass - brick[0])\n", " min_shift = min(shifts)\n", " return [s - min_shift for s in shifts[::-1]]" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 10 }, { "cell_type": "markdown", "metadata": {}, "source": [ "To test our algorithm, we're going to examine a couple of solutions obtained when stacking rectangular bricks on top of each other. First, we're doing this with an interactive plot:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def plot_nbricks(l, n):\n", " bricks = generate_brick_sequence(l, 1, n)\n", " plot_brick_sequence(bricks, compute_brick_shifts(bricks))\n", " pl.xlim(0, n)\n", " pl.ylim(0, n)\n", " pl.grid(True)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 11 }, { "cell_type": "code", "collapsed": false, "input": [ "interact(plot_nbricks,\n", " l=(0.1, 4, 0.1),\n", " n=(2, 20))" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 12, "text": [ "" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAWwAAAD7CAYAAABOi672AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAD69JREFUeJzt3W+MZXddx/H3dLfobna2s/tki9LkkiYoJrC3jTGVtOkV\nS6JNqYlPlKBwS/ARhuLfd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vzIE1G/zLN9rc7aDa4PkoPduuTJEmSJEmSJEmSJEmSJEmSJEmSsvt/7v4nlpeDDSwAAAAASUVO\nRK5CYII=\n", "text": [ "" ] } ], "prompt_number": 12 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Let's check the solution for 10, 20 and 40 bricks of 2:1 aspect ratios:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "pl.figure(figsize=(10, 4))\n", "format_plot = lambda : pl.xlim(0, 8) and pl.ylim(0, 40) and pl.grid(True);\n", "\n", "pl.subplot(131)\n", "plot_nbricks(2, 4)\n", "format_plot()\n", "\n", "pl.subplot(132)\n", "plot_nbricks(2, 13)\n", "format_plot()\n", "\n", "pl.subplot(133)\n", "plot_nbricks(2, 40)\n", "format_plot()" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAk4AAAEACAYAAABF4/l0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAHoRJREFUeJzt3V9sbddd4PGvE99Mchu7vlal/GkrnWpGtIyocKqCEKXE\nCekoqSAUHhAdEHH584Ta0hFMUiSUAg9NI7X4YTR9GJpROsMURIGqARXSFntoqQhQcpo0acmU6dU0\ntLm0JO11JhG6Vz087O17vB1ve5+z1z57rb2+H2nL3uce//Kz9/rFy2f9zl4gSZIkSZIkSZIkSZIk\nSZIkSZIkSZIkSZI0l8uBh4EHyvN14OPAE8CDwFpPeUl9sSakKmtCWbis4fPeDjwOTMrzuygK4juA\nT5bnUk6sCanKmpBKLwM+AdzE9C+JLwLXlJ9fW55LubAmpCprQjrg94EbgBuZFsQzB/596dC5NHTW\nhFRlTSgbJy3V/TDwTxTr1ks1z5kwfWlWGjprQqqyJpSV5RP+/fuB24E3AlcCq8D/AM5RvPT6FHAd\nRdG8wPXXXz/56le/GixZqaV/AP5dyxjWhIbEmpCqQtTEJQdfgr0XuLP8/C7gnpqvmYR09913B43X\nRUxzjDPeZ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BHgN9vGeffAr9E\n8T++6ymu+U+1jDkra8KaCMGa6Ic1YU1UdDFx+keqa40vp/hrIjangD8A/ifwkcCxvwX8CfDaFjG+\nH7idYq35Q8DNwAfbp8bXyo9fB/6I4iXzeT1ZHn9Tnn+YojBCuA34LEWebbwW+AzwzxQvEf8hxc92\nkawJayIEa2LxrAlrYiG6uuHZiHBNf0sUg+u3AsUDeAnFOwcArgL+AvihQLFvJMy7JU4DK+XnLwL+\nEvgPLWP+BfAd5efvAt7TMt6+3yVMw+p3U7wj5iqK634/xV9Qi2RNWBMhWBMnG2FNtGVN9FMTwW94\n9iGKdcd/oVgXf0vLeD9A8XLpmOnbGW9tGfPVFOu3Y4q3cf5Ky3gH3UiYd0u8giK/McUgCXFtvpvi\nL4nPUczSQ7xb4kXAN5gWb1v/menbTO+n+Cty0awJa6INa+Jk1oQ10UYMNSFJkiRJkiRJkiRJkiRJ\nkiRJkiRJkiRJkiRJkiRJkiTBvwKF7IZjYItLYgAAAABJRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 13 }, { "cell_type": "markdown", "metadata": {}, "source": [ "As one can see, the more bricks we stack, the higher the tower gets and the larger vaults we can build by simply stacking these bricks on top of each other. \n", "\n", "This being said we can now move on to some practical questions." ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Applying our tools to practical questions" ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "How far can we get?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One of the questions we can ask ourselves after having written this is: is there a maximum horizontal distance that we can cross with such a structure of stacked bricks? Or is there a limit that we cannot overcome inside our model? \n", "\n", "To examine this question, I'll plot the total distance covered as a function of the number of bricks stacked. " ] }, { "cell_type": "code", "collapsed": false, "input": [ "l = 1\n", "number_of_bricks = pl.linspace(1, 200, 50, pl.int32)\n", "distances = pl.zeros_like(number_of_bricks)\n", "for index, n in enumerate(number_of_bricks):\n", " bricks = generate_brick_sequence(l, 1, int(n))\n", " shifts = compute_brick_shifts(bricks)\n", " distances[index] = max(shifts) + l/2." ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 14 }, { "cell_type": "code", "collapsed": false, "input": [ "pl.plot(number_of_bricks, distances)\n", "pl.title(\"distance reached as a function of number of {0} width bricks\".format(l))\n", "pl.xlabel('brick unit width (a. u.)')\n", "pl.ylabel('distance covered (a. u.)')\n", "pl.grid(True)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XecFPX9x/EXIEVpRyT0chQVNeohioqFC4IJiFiiP3ty\n6i8ajb3EmETF/BI1tqhoLNF4iQVrVFAUDXqIoCBNMIACgiId4ahShP398Zll5/a2zN3N7MzevZ+P\nxzx2Z3d25rvfnZ3PfMt8B0RERERERERERERERERERERERERERMSDUuD/nOfHAvPCS0reKAMu8mld\nw4GnfVqXX04FlgAbgUNyuN1zgbE53F7c0cB87PsOC2H7bouB40PadlvgA2ADcHeOtpntmFNK4viU\nynCq9v/ZBXSvwvJe98mqpiOl+jVdQQBizgQwAejl4TPDid5BLZfceebHuqLmHuAyoDnwaUDbKMT+\nrO7/xLPATwLaXiZ/BB7Evu+oELbv5ue+VVUXA6uAFsANKd7/MfA+UA4s8mmb2Y457vwoxk5ckt8P\nktd90pd0RDFAANQLOwEB2CPsBOSpekAXYE4Otxe2XH7fXKnO/t8VmJvh/U3AE6QOHkHKtI8Euf80\nqMKyvqQjCgGiNzAdK0Y+DzRxvVdMxQh9I/CNs+w8YADwU+Am4EysSD7DWfYC7E+2AViInY241/sN\ncC2wElgGlLje3xO4Fytel2NnFfF0HQlMAtYBM4H+Gb7bYuA3wCwnbfWzfD5TmgFOdj6zHlgAnOB6\nrxD40PnsWGBv13uZttkNGO987h2gdYbvUwC8gZ3VrQVGAx1d75c46d4AfAmck2Y9fYGPnP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ZQlmNnyACbgJ3OewOwO2YNAdZXMR2LsDNunHUXVuGz32Nn+L2w0sR9\n2Jn/MVi1jDv9vZxtxUsWz1Cx9ON+HiMxoNpcUt+fozUVh3KuD9yBjWH0LlbqaVOF75LJNmf9TbIt\nKLWbAoTkivvMtV7S/OYsyye/vhCrbtovzTLfU3Hfdh/otrme76Tq7XAfYIFpB1YFdSyVA0Q8nW7Z\nGpa3e1jW/fq5WNA4FLvfxyqyH9Dd+ZJt2eTfSOogBQjJlS4kbm94DpUPqG4xbBTf9sBhzmvNsWqW\nelg1zenYSKAHpPj8YuzAifPYrYpp3Qi0SPPeBKyX0ySsamxvYF/sxvHu9M/DSifdndfcdfobSQzD\n7tUaLCjGtcCCwk6s0burh3UsJpGfp2dYrrGz3m0ZlpE6QAFCciF+wP811kjdEruTWPy9VHZg9wAZ\ngdWJxxuU4/Xon2Nn0S9ROQC8gjVcf+Zs8/OktCSnLdnj2P16kxupwcbPb4OVJMCqeFJ14d0GXAy8\niVVlrXRtazTWfuBupHanI1WadmLfJ15qehY72M8CzseqpuLeJHHDGLd7gEud7e7t2k4H5zNxvUlU\nB4qISB4ooeJN54NyO4leVyIikgcaYSWXXFwoF+Q2RERERERERERERERERERERERERERERKrr/wGd\nI7WvRn4LVAAAAABJRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 15 }, { "cell_type": "markdown", "metadata": {}, "source": [ "This looks like a logarithmic function. And it doesn't look like the growth stops at some point (even though, from this small sampling it looks like it slows down a lot).\n", "\n", "If anyone is interested, I found a reference in [this book](http://www.amazon.fr/physique-tous-jours-Istv%C3%A0n-Berkes/dp/2711771679) that says the growth is unbounded. Therefore you could build this sort of structure to cover any given distance. In practice, this is limited by the accuracy with which you can place your bricks (and also forces other than gravity...)." ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Dependency on the size of the bricks" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Another question we can ask of our model: how does the range covered by the vault change if we change the brick width?" ] }, { "cell_type": "code", "collapsed": false, "input": [ "brick_widths = pl.linspace(0.1, 10)\n", "distances = pl.zeros_like(brick_widths)\n", "for l in brick_widths:\n", " bricks = generate_brick_sequence(l, 1, 100)\n", " distances[brick_widths == l] = max(compute_brick_shifts(bricks)) + l/2." ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 16 }, { "cell_type": "code", "collapsed": false, "input": [ "pl.plot(brick_widths, distances)\n", "pl.xlabel('brick width (distance units)')\n", "pl.ylabel('distance units')\n", "pl.title('distance covered by stacking 100 bricks as a function of brick width')\n", "pl.grid(True)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAagAAAEZCAYAAADCJLEQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcFNW5//EPIAiKMrigSNRxiSJiGJC4XCWMG4oLIprc\neF0Y3KJRQVTciEFUBBfENbm5uSqL+RkXjApqXMAGV4jAKA6MRuMIio6gIihwHZz5/fGcTtX0dPf0\nTPdMVXV/36/XvKarq7v69NNVdeo8p+oUiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIhkZSpwk3s8AKgM\nrigFpxRYmWZ+LbBn6xQla6Wk/i75sl419fc4A3ghg9fdAMxoToFC4BTsd18P9GnFz800trl2GPBP\n7PsOSTK/CjiqCcvLdNsoA15twnIz8Ufgd2nmN7a+V9G079osDwE3NvE9NxDdDSpMSgm+gsrVZ5SS\n/ru0lF8BbwDfA68kmV8CLHLz36bhTnQ08DnwLfAA0CHNZ7XU7zGO6G5PHwEntfBnFGOxb9vCn5OJ\nOcClaeZ/DBzZAp9bRu4rqMb41/epeA2ZuCZ/1+b+gG2a+T6pLwwbUHNE+ff/CrgTmJRkXgfgaWA6\nUARMc9Pt3fxjgauxjWx3bGMcn6NytWvCa6Ma/zbAbsCyVvy8oOXy+26Ro+VERiY7yL7AYmAd8Feg\no29eKfWPgq8GPnWvrcQ25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m7jPh/4xL1mrfs/CBsEdAnwClap+e8AkIkn3f/FJI9BvPxx72K3Uz8D+w3jVqV5v0hGVEFJ\nLvjvK9MmYfr7Rl6f+PxHWItq3xSvmY9XQcWwG/Sd5p5PJtN7RP2f7/GPeJVJolTbTKrPuQhrxe2K\nVciJKUuAm7CK6AAshdbJNy9ZudLdx2cYdgPLvlgF8X7C/M3U/w6dEubHPy9dDPyffwJwP3Zbj3/4\nlt22kXKKNEoVlOTCbthRPcB/Ya2cVOqwnWZ37J494KW42mCtgtOwPqVeSd7/KbADsDfWgnkNSyMm\nq6Dmu/KAnTXX1T1e7z6zqT7Bu59OJVYB7OmmT0/xnr2w1tk4rDL9CbAu4fO3xVocYKmxdOqwPrtf\n4LVQ4pXeC1ifUFzfFN+hF5ZmLcJarE2xHi+V1wb77WNYy60LdnAB9vt+kvhmkaZQBSXZilc4F2Mp\nqC5Y6i0+L5ka7CSBe7F02gtYn078Lp/vYymjx7HbmCd6C+tzAqugdnH/458Z/9zx2I78PaxfK77D\n/ApLvS3F+kmS3V00Wdlfw6tUNwEXAM9iLaNq33v8y7sNS4MtdZ/5LpZ+64V3ksRtwEQsrdYuxXL8\n1rjPfhKLX/zkhJuw/qB33Xcen+S9K4HH3PxH3Wcm4/9s/+O/AmPcd/4pMMN93mLs9P517nUHkbpV\nKyIiOdYZ7261klpbrOJMlSIUyUi7xl8iIs4PWKthM3ZGnSR3EtZKjQVcDhERERERERERERERERER\nERERERERERERyR//H/dg6WnQlHNmAAAAAElFTkSuQmCC\n", "text": [ "" ] } ], "prompt_number": 17 }, { "cell_type": "markdown", "metadata": {}, "source": [ "The relationship seems linear. We can compute the slope of the previous curve:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "(distances[-1] - distances[0])/(10 - 0.1)" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 18, "text": [ "3.08868875881981" ] } ], "prompt_number": 18 }, { "cell_type": "markdown", "metadata": {}, "source": [ "If we increase the brick width by one unit, the we will increase the range of 100 stacked bricks of the same width by 3.088 units." ] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Stacking non-uniform sized bricks" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "To finish this post, I'll show how we can stack up arbitrarily shaped bricks. This is one of the nice features of the code we have written so far: it's generic to the point that you can stack bricks of different sizes. \n", "\n", "First, we write a function that gives back a sequence of arbitrarily shaped bricks." ] }, { "cell_type": "code", "collapsed": false, "input": [ "def generate_random_brick_sequence(n):\n", " return [(pl.rand(1), 0.2) for i in range(n)]" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 19 }, { "cell_type": "markdown", "metadata": {}, "source": [ "And then we write a function that just generates a sequence of n bricks, computes the optimal way to stack them and plots them." ] }, { "cell_type": "code", "collapsed": false, "input": [ "def plot_random_bricks(n):\n", " bricks = generate_random_brick_sequence(n)\n", " shifts = compute_brick_shifts(bricks)\n", " plot_brick_sequence(bricks, shifts)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 20 }, { "cell_type": "code", "collapsed": false, "input": [ "pl.figure(figsize=(11, 4))\n", "format_plot = lambda : pl.xlim(0, 2.5) and pl.ylim(0, 9) and pl.grid(True);\n", "\n", "pl.subplot(131)\n", "plot_random_bricks(40)\n", "format_plot()\n", "\n", "pl.subplot(132)\n", "plot_random_bricks(40)\n", "format_plot()\n", "\n", "pl.subplot(133)\n", "plot_random_bricks(40)\n", "format_plot()" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAoQAAAEACAYAAAAqfmccAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X+MJOl91/HP3M5ubs7bk5kFxeGwUSdBgUAixg6YU7Ch\nT0qk+MAXyUICix8ao0RIGOEDgcxJBMM/ICTQDVaEUAiOYogcKYaAgw4nJOpygiIMVq79A9sBWx7i\n5IiJ2IxnD6+5Pa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HXERnbjnzVI1/NrOXLpSYyRsZ2qSf2OgIAAAAA\nAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAO/j/GcdP7WZUqEAAAAABJRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 21 }, { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Bonus: an analytical formula for equal sized bricks" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "I first read about the \"brick stacking problem\" in a physics book called [\"la physique de tous les jours\"](http://www.amazon.fr/physique-tous-jours-Istv%C3%A0n-Berkes/dp/2711771679). The book chapter explains the stacking algorithm that inspired me to write the code in this notebook. In this section, I derive the analytical formula for stacking identical bricks on top of each other. The reasoning is carried out on unit length bricks, but is valid for any size of brick.\n", "\n", "In the following, we denote the shift of the left right border of brick $i$ by $s(i)$. The mass of brick of $i$ is written as $m_i$.\n", "\n", "The reasoning is the following: suppose you already know the shifts up to order $n$ and you're trying to determine the shift for brick $n+1$. You want the horizontal center of mass of bricks $[1:n]$ to be exactly equal to the shift of brick $n+1$. Thus our first equation:\n", "\n", "$$\n", "s(n+1) = c_{mass}([1:n])\n", "$$\n", "\n", "It turns out that the center of mass of the assembly of bricks $[1:n]$ can be computed from the previous shifts. In effect: the center of mass of bricks $[1:n]$ can be written as the center of mass of brick $n$ alone and of bricks $[1:n-1]$. Using the previous equation, we also know that the center of mass of bricks $[1:n-1]$ is equal to the shift $s(n)$. Thus the following formula, derived from the previous relation and weighted by the brick masses:\n", "\n", "$$\n", "c_{mass}([1:n]) = \\frac{(\\sum_{i=1}^{n-1} m_i)s(n) + m_n(s(n) + 1/2)}{\\sum_{i=1}^{n} m_i}\n", "$$\n", "\n", "Injecting this formula in our previous equation we obtain a recurrence equation of order 1 on $s(n)$:\n", "\n", "$$\n", "s(n+1) = \\frac{(\\sum_{i=1}^{n-1} m_i)s(n) + m_n(s(n) + 1/2)}{\\sum_{i=1}^{n} m_i}\n", "$$\n", "\n", "Assuming that all masses are actually equal, we obtain:\n", "$$\n", "s(n+1) = \\frac{n \\, s(n) + 1/2}{n}\n", "$$\n", "\n", "This relation is to be initialized with $s(1) = 0$. \n", "\n", "The following figure illustrates our demonstration:" ] }, { "cell_type": "code", "collapsed": false, "input": [ "SVG(filename='files/forces_analytical_formula.svg')" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 22, "svg": [ "" ], "text": [ "" ] } ], "prompt_number": 22 }, { "cell_type": "markdown", "metadata": {}, "source": [ "The formula we derived can easily be coded and compared to what we previously computed." ] }, { "cell_type": "code", "collapsed": false, "input": [ "def analytical_shift(n):\n", " if n==1:\n", " return 0\n", " else:\n", " return 1./(n-1) * ((n-1) * analytical_shift(n-1) + 1/2.)" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 23 }, { "cell_type": "code", "collapsed": false, "input": [ "print [analytical_shift(i) for i in range(1, 10)]" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[0, 0.5, 0.75, 0.9166666666666666, 1.0416666666666665, 1.1416666666666664, 1.2249999999999996, 1.296428571428571, 1.358928571428571]\n" ] } ], "prompt_number": 24 }, { "cell_type": "code", "collapsed": false, "input": [ "bricks = generate_brick_sequence(1, 1, 10)\n", "shifts = compute_brick_shifts(bricks)\n", "shifts = shifts[::-1]\n", "print [elem - shifts[0] for elem in shifts]" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "[0.0, -0.5, -0.75, -0.9166666666666666, -1.0416666666666667, -1.1416666666666666, -1.225, -1.2964285714285715, -1.3589285714285715, -1.414484126984127]\n" ] } ], "prompt_number": 25 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Indeed, the results are identical, except for the minus sign that appears in our numerical version." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "It turns out that the analytical formula can enable us to prove something we hinted at when examining convergence of a brick stack (subsection \"how far can we get?\"). We can rewrite the total extent of the arch as:\n", "\n", "$$\n", "l(n) = \\sum_{i=1}^n s(i+1) - s(i) = \\frac{1}{2}\\sum_{i=1}^n \\frac{1}{i}\n", "$$\n", "\n", "However, as it happens, the series on the right, called the harmonic is divergent. This means that if we stack enough bricks, we can end up with any arch extent we'd like! My physics book tells me that this was first proved by [Nicole Oresme](http://en.wikipedia.org/wiki/Nicole_Oresme), \"probably one of the most original thinkers of the 14th century\" (to quote Wikipedia)." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This post was entirely written using the IPython notebook. You can see a static view or download this notebook with the help of nbviewer at [20140808_BricksAndArches.ipynb](http://nbviewer.ipython.org/urls/raw.github.com/flothesof/posts/master/20140808_BricksAndArches.ipynb)." ] } ], "metadata": {} } ] }