{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 8 2 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 257 1 {CSTYLE "" -1 -1 "Ti mes" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 8 2 1 0 1 0 2 2 0 1 }} {SECT 0 {PARA 256 "" 0 "" {TEXT -1 47 "Directional Derivatives and the Gradient Vector" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "restart; \nwith(plots):" }}}{SECT 0 {PARA 257 "" 0 "" {TEXT -1 26 "Snowboarding in a Halfpipe" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 91 "Define a path al ong which the snowboarder will move, and produce an animated (planar) \+ plot:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 168 "r := t -> [8*Pi*cos(t/2)* sin(t/2)^2, Pi/3*sin(t)^3];\nanimate([r(d*t)[1], r(d*t)[2], t=0..4*Pi] , d=0..1, numpoints=200);\nFlatPath := plot([r(t)[1], r(t)[2], t=0..4* Pi]):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 108 "Plot the halfpipe toget her with an animated 3D plot of the path.\nThe animation is \"shifted \" to the interval " }{XPPEDIT 18 0 "[5*Pi/2,13*Pi/2]" "6#7$*(\"\"&\" \"\"%#PiGF&\"\"#!\"\"*(\"#8F&F'F&F(F)" }{TEXT -1 89 " in order to look more realistic. Everywhere else the problem is treated on the interva l " }{XPPEDIT 18 0 "[0,4*Pi]" "6#7$\"\"!*&\"\"%\"\"\"%#PiGF'" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 517 "halfpipe := (x,y) -> -1 /5*x + 2*y^2:\nPipe := plot3d(halfpipe(x,y), x=-10..10, y=-1.2..1.2, a xes=frame, style=patchcontour, orientation=[-120,35]):\nNframes := 50: \nfor i from 1 to Nframes do\n path[i] := spacecurve([r(t)[1], r(t)[2] , halfpipe(r(t)[1],r(t)[2]), t=5*Pi/2+0..5*Pi/2+i*4*Pi/Nframes], color =red, thickness=3, numpoints=200):\n frame[i] := display(\{path[i],Pip e\}):\nod:\ndisplay(seq(frame[i], i=1..Nframes), insequence=true);\ncp lot := contourplot(halfpipe(x,y), x=-10..10, y=-1.2..1.2, color=blue, \+ contours=20): " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 123 "To have a dire ction (in the xy-plane) for the directional derivatives we consider th e unit tangent vector T along our path:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 144 "r_prime := diff(r(t), t):\nlr_prime := sqrt(r_prime[1]^2+r_pr ime[2]^2):\nT := simplify([r_prime[1]/lr_prime, r_prime[2]/lr_prime], \+ trigonometric);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "The gradient v ector of the halfpipe surface is given by" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "gradient := [diff(halfpipe(x,y),x), diff(halfpipe(x,y ),y)];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 78 "The directional derivat ive in the direction of the unit tangent T is therefore" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 48 "DD:=simplify(T[1]*gradient[1]+T[2]*gradient[2] );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 20 "on the path we have " } {XPPEDIT 18 0 "y=r[2](t)" "6#/%\"yG-&%\"rG6#\"\"#6#%\"tG" }{TEXT -1 1 ":" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "DD := simplify(subs(y=r(t)[2] , DD));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 53 "The magnitude of the g radient vector (on the path) is" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 74 " tgrad := subs(y=r(t)[2], gradient):\nltgrad := sqrt(tgrad[1]^2+tgrad[2 ]^2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 51 "Where is the directional derivative equal to zero? " }}{PARA 0 "" 0 "" {TEXT -1 74 "First, a p lot of the directional derivative over the interval of interest:" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "plot(DD, t=0..4*Pi, discont=true); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 67 "Now, solve for all the zeros, and corresponding points on the path:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 324 "t0 := fsolve(DD=0, t, 0..1);\nr(t0);\nt1 := fsolve(DD=0, t, 1 ..Pi/2);\nr(t1);\nt2 := fsolve(DD=0, t, Pi/2..Pi);\nr(t2);\nt3 := fsol ve(DD=0, t, Pi..2*Pi);\nr(t3);\nt4 := fsolve(DD=0, t, 2*Pi..3*Pi);\nr( t4);\nt5 := fsolve(DD=0, t, 3*Pi..7*Pi/2);\nr(t5);\nt6 := fsolve(DD=0, t, 7*Pi/2..11.5);\nr(t6);\nt7 := fsolve(DD=0, t, 11.5..12);\nr(t7);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 94 "When is the value of the direct ional derivative equal to the magnitude of the gradient vector?" }} {PARA 0 "" 0 "" {TEXT -1 104 "First, plot of directional derivative to gether with positive and negative magnitude of gradient vector: " }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 77 "plot([DD, ltgrad, -ltgrad], t=0..4* Pi, color=[red,green,blue], discont=true);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "Find \"positive\" points:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 219 "t8 := fsolve(DD=ltgrad, t, 3..3.5);\nr(t8);\nt9 := fsolve(DD= ltgrad, t, 4..6);\nr(t9);\nt10 := fsolve(DD=ltgrad, t, 6..10);\nr(t10) ;\nt11 := fsolve(DD=ltgrad, t, 10..12);\nr(t11);\nt12 := fsolve(DD=ltg rad, t, 12..4*Pi);\nr(t12);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 23 "Fi nd \"negative\" points:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 223 "t13 := \+ fsolve(DD=-ltgrad, t, 0..0.05);\nr(t13);\nt14 := fsolve(DD=-ltgrad, t, 1..3);\nr(t14);\nt15 := fsolve(DD=-ltgrad, t, 6..7);\nr(t15);\nt16 := fsolve(DD=-ltgrad, t, 8..9);\nr(t16);\nt17 := fsolve(DD=-ltgrad, t, 9 ..10);\nr(t17);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 99 "The points wit h zero directional derivative (black) are where the path is parallel t o the contours." }}{PARA 0 "" 0 "" {TEXT -1 456 "At the points with ma tching positive directional derivative (green) the snowboarder is movi ng in the direction of the gradient vector (perpendicular to the conto urs), i.e., he is aligned with the slope of the half-pipe.\nAt the poi nts with matching negative directional derivative (red) the snowboarde r is moving against the direction of the gradient vector (perpendicula r to the contours), i.e., he is aligned with the slope of the half-pip e, but going up." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 363 "ddzeroPoints : = plot([seq(r(t||i), i=0..7)], style=point, symbolsize=20, axes=frame, color=black):\nddmaxPoints := plot([seq(r(t||i), i=8..12)], style=poi nt, symbolsize=20, axes=frame, color=green):\nddminPoints := plot([seq (r(t||i), i=13..17)], style=point, symbolsize=20, axes=frame, color=re d):\ndisplay(\{cplot, FlatPath, ddzeroPoints, ddmaxPoints, ddminPoints \});" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}{MARK "0 0" 47 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }