{"id":3633,"date":"2023-03-10T17:56:13","date_gmt":"2023-03-10T23:56:13","guid":{"rendered":"https:\/\/laurentlessard.com\/bookproofs\/?p=3633"},"modified":"2023-03-10T19:57:06","modified_gmt":"2023-03-11T01:57:06","slug":"making-the-fastest-track","status":"publish","type":"post","link":"https:\/\/laurentlessard.com\/bookproofs\/making-the-fastest-track\/","title":{"rendered":"Making the fastest track"},"content":{"rendered":"<p>This week&#8217;s <a href=\"https:\/\/fivethirtyeight.com\/features\/can-you-pack-the-ellipses\/\">Riddler Classic<\/a> is a problem about minimum-time optimization.<\/p>\n<blockquote><p>\nWhile passing the time at home one evening, you decide to set up a marble race course. No Teflon is spared, resulting in a track that is effectively frictionless. The start and end of the track are 1 meter apart, and both positions are 10 centimeters off the floor. It&#8217;s up to you to design a speedy track. But the track must always be at floor level or higher \u2014 please don\u2019t dig a tunnel through your floorboards. What&#8217;s the fastest track you can design, and how long will it take the marble to complete the course?\n<\/p><\/blockquote>\n<p>My solution:<br \/>\n<a href=\"javascript:Solution('soln_brachisto','toggle_brachisto')\" id=\"toggle_brachisto\">[Show Solution]<\/a><\/p>\n<div id=\"soln_brachisto\" style=\"display: none\">\n<p>We will consider a more general version of the problem, where the start and end are $\\ell$ meters apart, and the floor is $h$ meters below. Set up coordinates so the track starts at $(0,0)$ and ends at $(\\ell,0)$, with the $y$-axis pointing downwards, so we have the constraint $y\\leq h$.<\/p>\n<p>If there were no floor to worry about, then the optimal path would be a <a href=\"https:\/\/en.wikipedia.org\/wiki\/Brachistochrone_curve\">brachistochrone curve<\/a>. All minimum-time tracks have a path of this shape, which is given by the parametric equations<br \/>\n\\begin{align}<br \/>\nx &#038;= r(\\theta-\\sin\\theta) \\\\<br \/>\ny &#038;= r(1-\\cos\\theta)<br \/>\n\\end{align}Here, $r$ is a parameter that is chosen depending on the location of the endpoint. Moreover, the marble will travel along this path in such a way that $\\theta$ changes at a uniform rate. In particular, $\\theta(t) = \\sqrt{\\frac{g}{r}} t$. In order to have the curve pass through $(\\ell,0)$, we should pick $r = \\frac{\\ell}{2\\pi}$. This produces the following result when $\\ell=1$:<\/p>\n<p><a href=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto1.png\" alt=\"\" width=\"879\" height=\"315\" class=\"aligncenter size-full wp-image-3639\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto1.png 879w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto1-300x108.png 300w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto1-768x275.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<p>Unfortunately, this path has a maximum height of $y(\\pi) = 2r = \\frac{\\ell}{\\pi} \\approx 0.31831$. So if the floor is any closer than this, the track will run into it. To deal with this situation, we will seek a design in three stages:<\/p>\n<ol>\n<li> From $(0,0)$ to $(a,h)$ (moving down toward the floor).\n<li> From $(a,h)$ to $(\\ell-a,h)$ (moving along the floor).\n<li> From $(\\ell-a,h)$ to $(\\ell,0)$ (moving back up to the endpoint).\n<\/ol>\n<p>We expect the solution to this problem to be symmetric, which is why we will assume the first and third segments of the path are mirror images of one another. Our task is to find $a$ and $r$ in order to minimize total time. Since the first segment is time-optimal, it must be a brachistochrone curve that passes through $(0,0)$ and $(a,h)$. Since it cannot dip below the floor, we must have $0\\lt a \\leq \\frac{\\pi h}{2}$ and since we must actually reach the floor, we must have $r \\geq \\frac{h}{2}$. Assuming it takes $\\Delta T_1$ seconds to complete that portion of the path, we have<br \/>\n\\begin{align}<br \/>\na &#038;= r(\\theta-\\sin \\theta) \\\\<br \/>\nh &#038;= r(1-\\cos\\theta) \\\\<br \/>\n\\theta &#038;= \\sqrt{\\frac{g}{r}} \\Delta T_1<br \/>\n\\end{align}Rearranging these equations, we can express $\\theta,a,\\Delta T_1$ in terms of $r$:<br \/>\n\\begin{align}<br \/>\n\\theta &#038;= \\arccos\\left(1-\\tfrac{h}{r}\\right) \\\\<br \/>\na &#038;= r\\left( \\arccos\\left(1-\\tfrac{h}{r}\\right)-\\sqrt{1-(1-\\tfrac{h}{r})^2} \\right) \\\\<br \/>\n\\Delta T_1 &#038;= \\sqrt{\\frac{r}{g}}\\arccos\\left(1-\\tfrac{h}{r}\\right)<br \/>\n\\end{align}<\/p>\n<p>For the second portion of the path, the marble will travel at constant velocity $\\sqrt{2gh}$ for a distance $\\ell-2a$. So the total time $\\Delta T_2$ for that portion satisfies<br \/>\n\\[<br \/>\n\\Delta T_2 = \\frac{\\ell-2a}{\\sqrt{2gh}}<br \/>\n\\]By symmetry, the third segment will take the same amount of time as the first one, so the total travel time is $\\Delta T = 2\\Delta T_1 + \\Delta T_2$. Expressed in terms of $r$ alone, we get the complicated expression:<br \/>\n\\begin{multline}<br \/>\n\\Delta T = 2\\sqrt{\\frac{r}{g}}\\arccos\\left(1-\\tfrac{h}{r}\\right) \\\\<br \/>\n+ \\frac{\\ell-2r\\left( \\arccos\\left(1-\\tfrac{h}{r}\\right)-\\sqrt{1-(1-\\tfrac{h}{r})^2} \\right)}{\\sqrt{2gh}}<br \/>\n\\end{multline}Using calculus, we can verify that the first derivative of this expression with respect to $r$ is always positive. Therefore, the minimum value of $\\Delta T$ occurs when $r$ is minimal. In other words, $r=\\frac{h}{2}$. Substituting this in, we obtain the expression<br \/>\n\\[<br \/>\n\\frac{\\ell+\\pi h}{\\sqrt{2 g h}}<br \/>\n\\]Putting everything together, we can now write the complete solution to the problem. The minimum-time path has minimum time given by<\/p>\n<p style=\"text-align: center;\"><span style=\"background-color: #AFC8E6; padding: 35px 10px 35px 10px;\">$\\displaystyle<br \/>\n\\Delta T_\\text{min} = \\begin{cases}<br \/>\n\\frac{\\ell+\\pi h}{\\sqrt{2 g h}} &#038; \\text{if }0\\lt h \\leq \\frac{\\ell}{\\pi} \\\\<br \/>\n\\sqrt{\\frac{2\\pi \\ell}{g}} &#038; \\text{if }h \\gt \\frac{\\ell}{\\pi}<br \/>\n\\end{cases}<br \/>\n$<\/span><\/p>\n<p>The second case corresponds to when the floor is far enough away that the fastest possible path (pure brachistocrone curve) does not touch the floor.<\/p>\n<p>For the problem in question, we are told that $\\ell=1$ and $h=0.1$ meters, so we are in the first case, and the minimum time is given by<\/p>\n<p style=\"text-align: center;\"><span style=\"background-color: #AFC8E6; padding: 25px 10px 25px 10px;\">$\\displaystyle<br \/>\n\\Delta T_\\text{min}\\text{ for $\\ell=1$ and $h=0.1$ is }<br \/>\n\\frac{1+0.1\\pi}{\\sqrt{2 g}} \\approx 0.9382\\,\\text{sec.}<br \/>\n$<\/span><\/p>\n<p>Here is what we get when we plot the time-optimal tracks for $\\ell=1$ and several different values of $h$. The plot also includes the minimum times associated with each track.<\/p>\n<p><a href=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto2.png\" alt=\"\" width=\"880\" height=\"319\" class=\"aligncenter size-full wp-image-3640\" srcset=\"https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto2.png 880w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto2-300x109.png 300w, https:\/\/laurentlessard.com\/bookproofs\/wp-content\/uploads\/2023\/03\/brachisto2-768x278.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a><\/p>\n<p>If the floor is at height $h \\leq \\frac{\\ell}{\\pi}$ the equation of the first curved portion of the track follows the parametric equation from earlier, with $r=\\frac{h}{2}$.<br \/>\n\\[<br \/>\n\\begin{aligned}<br \/>\nx &#038;= \\tfrac{h}{2}(\\theta-\\sin\\theta)\\\\<br \/>\ny &#038;= \\tfrac{h}{2}(1-\\cos\\theta)<br \/>\n\\end{aligned}<br \/>\n\\qquad\\theta\\in[0,\\pi]<br \/>\n\\]The actual path traced out by the marble as a function of time is<br \/>\n\\[<br \/>\n\\begin{aligned}<br \/>\nx(t) &#038;= \\tfrac{h}{2}(\\omega t-\\sin\\omega t)\\\\<br \/>\ny(t) &#038;= \\tfrac{h}{2}(1-\\cos\\omega t) \\\\<br \/>\n\\omega &#038;= \\sqrt{\\tfrac{2g}{h}} t<br \/>\n\\end{aligned}<br \/>\n\\qquad\\text{with: }0\\leq t \\leq \\tfrac{\\pi\\sqrt{h}}{\\sqrt{2g}}<br \/>\n\\]<\/p>\n<p>I don&#8217;t have the technical skills required to make an animated gif of the marble moving along the curve at its appropriate speed, but the equations are above, so I&#8217;ll leave it up to somebody else!\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This week&#8217;s Riddler Classic is a problem about minimum-time optimization. While passing the time at home one evening, you decide to set up a marble race course. No Teflon is spared, resulting in a track that is effectively frictionless. The start and end of the track are 1 meter apart, and both positions are 10 &hellip; <a href=\"https:\/\/laurentlessard.com\/bookproofs\/making-the-fastest-track\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Making the fastest track&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":3640,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[7],"tags":[28,41,26],"class_list":["post-3633","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-riddler","tag-calculus","tag-dynamics","tag-optimization"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/comments?post=3633"}],"version-history":[{"count":8,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3633\/revisions"}],"predecessor-version":[{"id":3638,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/posts\/3633\/revisions\/3638"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media\/3640"}],"wp:attachment":[{"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/media?parent=3633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/categories?post=3633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/laurentlessard.com\/bookproofs\/wp-json\/wp\/v2\/tags?post=3633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}