PHY 320 Homework 3 Solution Spring 207 Problem. Brchistochrone time-of-flight From clss discussion nd the textbook, we know tht the functionl to be minimized is the time: 2 t = d s = 2 +(y') v 2 v d x Where we will use the uthors' coordinte system with the x - xis pointing downwrd. The velocity cn be clculted from conservtion of energy: the mss strts t height x nd the bottom of the curve is t x 2. The potentil energy t point x between the initil nd bottom points is U(x) = - mg(x - x ). Using conservtion of energy then, the velocity of the mss between point nd the bottom is v = 2 g(x - x ), yielding for the time t = 2 +(y') 2 x- x 2 g d x From clss, the prmetric equtions of the curve re x = ( - cosθθ) y = (θθ - sinθθ) ( is constnt) so we rewrite the integrl in terms of θθ: So, d x = sinθθ y (x) = d y = (- cosθθ) d x sinθθ θθ 2 t = 2 g θθ +(- cosθθ) 2 sin 2 θθ sinθθ = (- cosθθ)- x θθ 2 θθ 2 g sin 2 θθ+- 2 cosθθ+cos 2 θθ sin 2 θθ(- cosθθ)- x sinθθ = θθ 2 θθ 2 g 2 (- cosθθ) (- cosθθ)- x Now the strting height x = ( - cosθθ ) nd the finl ngle is θθ 2 = ππ, so the time becomes t = g ππ θθ (- cosθθ) cosθθ - cosθθ Finlly, we use trig identity cosθθ = - 2 sin 2 θθ to do nother rewrite of the time integrl: 2 207 R. Mrtin
2 t = g ππ θθ sin(θθ/ 2) sin 2 (θθ/ 2)- sin 2 (θθ / 2) = g ππ θθ sin(θθ/ 2) cos 2 (θθ / 2)- cos 2 (θθ/ 2) Letting the vrible u = cos(θθ/ 2) with d u = - sin(θθ/ 2) we get 2 t = g 0-2 u u 2 - u 2 d u Let Mthemtic do the integrl: In[]:= Frmed Row "time = ", Assuming u > 0, time = - 2 g u 0 u 2 - u 2 d u Out[]= time = g π And we see tht the time is, in fct, independent of the strting point! The brchistochrone curve hs this interesting property tht the velocity increse s the mss flls is effectively cnceled by the decrese in initil potentil energy s the strting height decreses, so the time ends up being the sme. Think bout tht one for minute! Problem 2. Suspended rope problem Consider uniform rope of mss m nd length L > 2 with ends fixed t x = - nd x =. Find the shpe of the rope if grvity cts downwrd in the y-direction. Find the eqution giving the shpe of the rope tht minimizes the rope s potentil energy. Set up the problem We wnt to minimize the potentil energy of the rope. Using coordintes with the y-xis upwrd nd the rope suspended t (x, y) = (-, 0) nd (x, y) = (, 0), the potentil energy of the rope is 2 m J = U = g y d s = m g L L y + (y') 2 d x - where m/ L is the mss per unit length of the rope, ssumed constnt long the rope. From this f(y, y', x) = y + (y') 2 (we leve out the constnt in front of the integrl since it won't be relevnt to the vritionl problem). Next, the constrint tht the rope hs fixed length L cn be expressed s n integrl: K = L = - + (y') 2 d x so its integrnd is g(y, y', t) = integrnd is then + (y') 2. From clss notes nd the textbook, the Lgrnge multiplier 207 R. Mrtin
3 F = f + λλ g = (y + λλ) + (y') 2 nd the solution to the constrined vritionl problem is given by the Euler eqution for F. Before we do tht, note tht the function F (=Fy in the code) does not depend on x explicitly. Hence, first integrl would be F(y, y', x) - y' F = c y', where c is constnt. Here is the numericl set-up. Begin with the bsic integrnd functions In[2]:= fy = y[x] + y [x] 2 ; gy = + y [x] 2 ; Fy = Simplify[fy + λ gy] Out[3]= (λ + y[x]) + y [x] 2 The y derivtive is given s In[4]:= Out[4]= dp = y'[x] Fy (λ + y[x]) y [x] + y [x] 2 So the first integrl, F - y' F is y' In[5]:= Out[5]= fi = Simplify[Fy - y'[x] dp] λ + y[x] + y [x] 2 Solving the eqution F - y' F = c y' for y gives In[6]:= yprime = Solve[fi c, y'[x]] Out[6]= y [x] - - c 2 + λ 2 + 2 λ y[x] + y[x] 2 c, y [x] - c 2 + λ 2 + 2 λ y[x] + y[x] 2 c In[7]:= dydx = Assuming[{λ > 0, c > 0}, FullSimplify[y'[x] /. yprime[[2]]] ] Out[7]= - (c - λ - y[x]) (c + λ + y[x]) c Seprte vribles d y nd d x nd integrte: y d y = d x In[8]:= xx = dydx d y[x] Out[8]= c Log λ + y[x] + - c 2 + λ 2 + 2 λ y[x] + y[x] 2 Note tht I ve not dded constnt of integrtion c 2 here (lterntively I ve tken it to be zero). This llows for much esier mth going forwrd. I ll sy more lter. 207 R. Mrtin
4 llows for much esier mth going forwrd. I ll sy more lter. The expression for x (clled xx in the code) is x(y) nd we wnt y(x). It cn be inverted: In[9]:= Out[9]= yx = Solve[xx x, y[x]] y[x] 2 c2 e - x c + e x c - 2 λ Mthemtic defults to exponentils, but the solution is often given in terms of hyperbolic functions. Oddly, the ExpToTrig function does tht: In[0]:= Out[0]= yy = y[x] /. ExpToTrig[yx][[]] - λ + 2 Cosh x c + 2 c2 Cosh x c + 2 Sinh x c - 2 c2 Sinh x c In[]:= Out[]= To get the constnts λλ nd c we use the boundry conditions. Strt with the left boundry: (x, y) = (-, 0) yyl = yy /. x - λl = Solve[yyL 0, λ] - λ + 2 Cosh c + 2 c2 Cosh c - 2 Sinh c + 2 c2 Sinh c Out[2]= λ 2 Cosh c + c2 Cosh - Sinh c c + c2 Sinh c In[3]:= Out[3]= Then the right boundry: (x, y) = (+, 0) yyr = yy /. x λr = Solve[yyR 0, λ] - λ + 2 Cosh Out[4]= λ 2 Cosh c + 2 c2 Cosh c + 2 Sinh c + c2 Cosh c + Sinh c - 2 c2 Sinh c c - c2 Sinh c These two expressions for the multiplier λλ cn be solved simultneously for the constnt c : In[5]:= Solve[(λ /. λr) == (λ /. λl), c] Solve::ifun: Inversefunctionsre beingusedby Solve, so somesolutionsmynotbe found; usereduceforcompletesolutioninformtion.! Out[5]= {{c - }, {c }} Tking the positive solution for c : In[6]:= Row[{"Multiplier λ = ", λf = (λ /. λr[[]]) /. c }] Frmed[Row[{"Suspended rope: y(x) = ", yf = Simplify[yy /. {λ λf, c }]}], FrmeMrgins Lrge] Out[6]= Multiplier λ = Cosh[] Out[7]= Suspended rope: y(x) = - Cosh[] + Cosh[x] In[8]:= Plot[{yf /., 0}, {x, -, }, AspectRtio 0.4, Frme True, FrmeLbel {x, y}, Epilog {Disk[{-, 0}, 0.02], Disk[{, 0}, 0.02]}] 207 R. Mrtin
5 Out[8]= y 0.0-0. - 0.2-0.3-0.4-0.5 -.0-0.5 0.0 0.5.0 x The length is given by the constrint eqution bove, L = - + (y') 2 d x: In[9]:= yprime = x yf; length = Assuming { > 0}, - + yprime 2 d x ; Row[{"Length = ", length, " = ", N[length /. ], " for = "}] Out[2]= Length = 2 Sinh[] = 2.3504 for = Comment: normlly you d expect to specify the rope length L nd hve to use the constrint eqution to determine the multiplier λλ, but since I chose the constnt c 2 = 0 bove for mthemticl simplicity, I could get λλ from the boundry conditions -- this effectively limits my string length to L = 2 sinh(). Of course ny length rope with L > 2 will hng between our fixed endpoints. You cn go bck to the step in the clcultion where I took c 2 = 0 nd dd in nonzero c 2. The determintion of c, c 2 nd λλ involves trnscendentl equtions, so cnnot be expressed simply, but the constnts cn be determined numericlly for given numericl vlues of nd L. Problem 3. Light ry curve in inhomogeneous medium Consider ry of light initilly horizontl in region of spce in which the index of refrction vries with height, e.g. In the Erth s tmosphere. Assume n(z) = n s ( - ϵε z), where n s > is the refrctive index t the surfce (z = 0) nd ϵε is positive constnt). Use Fermt s principle (minimize time) to find the eqution of the pth of the light ry. First note tht the refrctive index given must hold only for limited rnge of z vlues, since n. Thus n(z) = n s ( - ϵε z) z mx = n s- ϵε n s. For exmple, if n s =.5, then z mx = 0.33/ ϵε. I m tking the z-xis verticl nd the y-xis horizontl. You hve choice here s to which vrible you tke s your independent vrible. Choosing z s independent mkes sense in two wys: () the index of refrction n(z) ws given s dependent on z, nd (2) The resulting integrnd will be independent of y, which mkes the mth esier. We consider curve y(z) with elements of length d s = d z 2 + d y 2 = + y 2 d z. Minimizing time mens minimizing the functionl t = v - d s = v - + y 2 d z, where the velocity here is v = c = c. Thus, n(z) n s (- ϵε z) 207 R. Mrtin
6 t = +y 2 v d z = n s c + y 2 ( - ϵε z) d z. The motion is unconstrined, so the solution is given directly by the Euler eqution for the integrnd function f(y, y', z) = n s + y 2 ( - ϵε z) The Euler eqution involves the derivtive f, which vnishes here. Therefore, the other Euler term y gives d f = d d z y d z n s y +y 2 ( - ϵε z) = 0, implying tht the expression in brckets is constnt: n s c gives y'[z] In[22]:= pc = ns ( - ϵ z) ; + y'[z] Solve[pc p0, y'[z]]; Row[{"y (z) = ", Assuming[ϵ > 0, yp = Simplify[y'[z] /. %[[]]]]}] Out[24]= y (z) = p02 - p0 2 p0 2 + 4 ns 2 (- + z ϵ) 2 2 ns 2 (- + z ϵ) 2 Now integrte this over z to get y(z): y +y 2 ( - ϵε z) = p 0 = constnt. Solving for y In[25]:= yz = Assuming {p0 > 0, ϵ > 0, ns > }, Simplify yp d z + c Out[25]= c + 2 ns 2 ϵ (- + z ϵ) p0 - p0 + p02 + 4 ns 2 (- + z ϵ) 2-2 ns (- + z ϵ) Log ns - 2 ns + 2 ns z ϵ + p0 2 + 4 ns 2 (- + z ϵ) 2 In[26]:= where c is constnt of integrtion. We cn evlute c by tking the initil condition y(0) = 0: yz Out[26]= c + 2 ns 2 ϵ (- + z ϵ) p0 - p0 + p02 + 4 ns 2 (- + z ϵ) 2-2 ns (- + z ϵ) Log ns - 2 ns + 2 ns z ϵ + p0 2 + 4 ns 2 (- + z ϵ) 2 In[27]:= y0 = yz /. z 0; cs = Solve[y0 0, c] Out[28]= c - 2 ns 2 ϵ p0 p0-4 ns2 + p0 2-2 ns Log ns - 2 ns + 4 ns 2 + p0 2 Then plug this c vlue into the generl solution: 207 R. Mrtin
7 In[29]:= Frmed[ Row[{"y(z) = ", yzz = Assuming[{p0 > 0, ϵ > 0, ns > }, Simplify[yz /. cs[[]]]]}], FrmeMrgins Lrge] Out[29]= y(z) = 2 ns 2 ϵ p0 - p0 + 4 ns2 + p0 2 + 2 ns Log ns - 2 ns + 4 ns 2 + p0 2 + - + z ϵ - p0 + p02 + 4 ns 2 (- + z ϵ) 2-2 ns (- + z ϵ) Log ns - 2 ns + 2 ns z ϵ + p0 2 + 4 ns 2 (- + z ϵ) 2 The result looks messy, but I ve left it in terms of the prmeters n s, p 0, nd ϵε, which dds some complexity. We cn evlute the constnt of the motion in terms of the initil ngle the ry mkes with the y- xis, in the next section. Initil ngle nd p 0 constnt I chose z s verticl nd y s horizontl, so the initil ngle θθ 0 (mesured bove the y-xis) would obey cot(θθ 0 ) = y' (0). For the solution just obtined, let s clculte it. First reclculte y (z): In[30]:= Row[{"y (z) = ", dyzz = Simplify[ z yzz]}] Out[30]= y (z) = p0 p0 - p0 2 + 4 ns 2 (- + z ϵ) 2 2 ns 2 (- + z ϵ) 2 Solve for the constnt p 0 using the condition bove: In[3]:= Frmed[Row[{"p 0 = ", p0s = p0 /. Solve[(dyzz /. z 0) Cot[θ0], p0][[]]}]] Out[3]= p 0 = - ns Cot[θ0] + Cot[θ0] So the momentum conservtion constnt p 0 cn be determined from choosing the initil direction θθ 0 of the ry. Mke plot First specify smple numbers for the prmeters. Then pply them nd mke the plot. 207 R. Mrtin
8 In[32]:= ns0 =.5; θ00 = π / 3; ϵ0 = 0.; (* Initil ngle 60 =π/ 3, n s =.5 (glss), ϵ=0. refrctive index sptil vrition rte * ) p0plot = p0s /. {ns ns0, θ0 θ00}; ns - zmx = /. {ns ns0, ϵ ϵ0}; ϵ ns (* See beginning of his problem for def. of z mx * ) zref = z Cot[θ0] /. θ0 θ00; (* reference ry in constnt n medium, for comprison * )yzzp = yzz /. {p0 p0plot} /. {ϵ ϵ0, ns ns0}; p = Plot[{yzzp, zref}, {z, 0, 2 zmx}, PlotStyle {Blue, Red}, Frme True, FrmeLbel {y, z}, PlotLegends LineLegend[{Blue, Red}, {"n = n(z)", "n uniform"}]]; (* Following code switches xes; suggested t StckExchnge.com * ) Show[p /. x_line Reverse[x, 3], PlotRnge Automtic, PlotLbel Row[{"n(z)=n s (- ϵz), n s =", ns0, ", ϵ=", ϵ0}]] 7 n(z)=n s (- ϵεz), n s =.5, ϵε=0. 6 5 Out[37]= z 4 3 2 n = n(z) n uniform 0 0 2 3 4 5 6 7 y The stright line is the pth of the light ry in homogeneous medium, while the curve is the one we solved for in the inhomogeneous medium with n = n(z). You cn convince yourself tht it mkes sense by imgining stck of lyers of mterils with successively lower index n i+ < n i for higher lyers; then use Snell s lw to show the light is bent wy from the norml t ech lyer boundry. Our solution plotted bove is the limit s those lyers become infinitesimlly thin. 207 R. Mrtin