# Parametric Curve Tangent Line Word Problem # Adam Springer & Bohao Cheng # Math 151 Honors Section 201 # Fall 2013 # Instructor: Philip Yasskin # # Serious # When a student clicks New Problem, you need to blank out all old answers and all reply boxes. # Step 2 says to find the position and velocity. You only checked for velocity. # You never used the small reply boxes. # # Not serious: # In Steps 3 and 4 you should be asking for vectors rather than x and y components. # I renamed many variables so t and t0 are times for the original curve, while s and s0 are times for the tangent line. # Also I changed V to v for velocity. # I improved the hints. # restart: with(Maplets[Tools]): with(Maplets[Elements]): with(plots): with(plottools): StartEngine(); randomize(): TEXTProbStat:= " Duke Skywater and Ham Duo are travelling in the Aluminum Eagle along the path\n r(t)= %a.\n At time t= %a hours, a garbage pod is released.\n Assume the garbage pod takes the velocity of the Aluminum Eagle upon release and thereafter moves with constant velocity.\n Find the position of the garbage pod s= %a hours after release.": Correct:="That's right. Keep on going!": Wrong:="Not quite there. Try the hints.": randt:=rand(1..5): NewProblem:=proc() global t0, s0, vt, rt0, vt0, rs, rs0; local rt; rt:=[randpoly(t,coeffs=rand(-5..5),expons=rand(3),terms=3), randpoly(t,coeffs=rand(-5..5),expons=rand(3),terms=3)]; t0:=randt(); s0:=randt(); Set(TFProbStat=sprintf(TEXTProbStat, rt,t0,s0)): Set(Lrt0(caption)=sprintf("r(%a) =", t0)): Set(Lvt0(caption)=sprintf("v(%a) =", t0)): Set(Lrs0(caption)=sprintf("r_pod(%a) =", s0)): vt:=diff(rt,t); rt0:=eval(rt,t=t0); vt0:=eval(vt,t=t0); rs:=expand(rt0+s*vt0); rs0:=eval(rs, s=s0); Set(TFvt=""); Set(replyvt=""); Set(TFrt0=""); Set(TFvt0=""); Set(replyrt0vt0=""); Set(TFrs=""); Set(replyrs=""); Set(TFrs0=""); Set(replyrs0=""); Set(reply=""); end proc: Hintvt:= proc() Set(replyvt="hint"): Set(reply=" v(t) is equal to r'(t)."): end proc: Hintrt0vt0:= proc() global t0; Set(replyrt0vt0="hint"): Set(reply=sprintf(" Plug t = %a into r(t) and v(t).", t0)): end proc: Hintrs:= proc() global t0; Set(replyrs="hint"): Set(reply=sprintf(" The tangent line is r_pod(s) = r(%a) + s*v(%a).", t0, t0)): end proc: Hintrs0:= proc() global s0; Set(replyrs0="hint"): Set(reply=sprintf(" Plug s = %a into r_pod(s).", s0)): end proc: Checkvt:=proc() global vt: local uservt; uservt:=Get(TFvt::list(polynom), corrections=true, update=true); if uservt=vt then Set(replyvt="correct"): Set(reply=Correct); else Set(replyvt="incorrect"): Set(reply=Wrong); end if; end proc: Showvt:=proc() global vt: Set(TFvt=vt): Set(replyvt="shown"): end proc: Checkrt0vt0:=proc() global rt0, vt0; local userrt0, uservt0; userrt0:=Get(TFrt0::list(realcons), corrections=true, update=true); uservt0:=Get(TFvt0::list(realcons), corrections=true, update=true); if uservt0=vt0 and userrt0=rt0 then Set(replyrt0vt0="correct"): Set(reply=Correct); else Set(replyrt0vt0="incorrect"): Set(reply=Wrong); end if: end proc: Showrt0vt0:= proc() global rt0, vt0; Set(TFrt0=rt0): Set(TFvt0=vt0): Set(replyrt0vt0="shown"): end proc: Checkrs:=proc() global rs: local userrs; userrs:=Get(TFrs::list(polynom), corrections=true, update=true); if simplify(userrs-rs)=[0,0] then Set(reply=Correct); Set(replyrs="correct"): else Set(reply=Wrong); Set(replyrs="incorrect"): end if: end proc: Showrs:=proc() global rs: Set(TFrs=rs); Set(replyrs="shown"): end proc: Checkrs0:=proc() global rs0: local userrs0; userrs0:=Get(TFrs0::list(realcons), corrections=true, update=true); if simplify(userrs0-rs0)=[0,0] then Set(reply=Correct); Set(replyrs0="correct"): else Set(reply=Wrong); Set(replyrs0="incorrect"): end if: end proc: Showrs0:=proc() global rs0; Set(TFrs0=rs0); Set(replyrs0="shown"): end proc: ParaCurveTanLineWordProblem:=Maplet(onstartup=RunWindow(MAIN), Window[MAIN](title="Parametric Curve Tangent Line Word Problem", [ valign=none, inset=0, spacing=0, [ halign=none, Button("New Problem", Evaluate(function="NewProblem"), background=magenta), HorizontalGlue(), HorizontalGlue(), Button("Quit", Shutdown(), background=pink) ], [ halign=none, border=true, caption="Problem Statement:", TextBox[TFProbStat](sprintf(TEXTProbStat, ['x'(t),'y'(t)], t0, s0), width=70, height=7) ], [ halign=none, border=true, caption="Step 1: Find the velocity of the Aluminum Eagle:", "v(t) =", TextField[TFvt](width=20, background=turquoise), HorizontalGlue(), Button[BHintvt]("Hint", Evaluate(function="Hintvt"), background="Orange"), Button[BCheckvt]("Check", Evaluate(function="Checkvt"), background=green), TextField[replyvt](width=6, editable=false, background=white), Button[BShowvt]("Show", Evaluate(function="Showvt"), background=yellow) ], [ halign=none, border=true, caption="Step 2: Find the position and velocity at the time of release:", Label[Lrt0]("r(t0) ="), TextField[TFrt0](width=8, background=turquoise), HorizontalGlue(), Label[Lvt0]("v(t0) ="), TextField[TFvt0](width=8, background=turquoise), HorizontalGlue(), Button[BHintrt0vt0]("Hint", Evaluate(function="Hintrt0vt0"), background="Orange"), Button[BCheckrt0vt0]("Check", Evaluate(function="Checkrt0vt0"), background=green), TextField[replyrt0vt0](width=6, editable=false, background=white), Button[BShowrt0vt0]("Show", Evaluate(function="Showrt0vt0"), background=yellow) ], [ halign=none, border=true, caption="Step 3: Find the parametric equations of the garbage pod s seconds after release:", "r_pod(s) =", TextField[TFrs](width=15, background=turquoise), HorizontalGlue(), Button[BHintrs]("Hint", Evaluate(function="Hintrs"), background="Orange"), Button[BCheckrs]("Check", Evaluate(function="Checkrs"), background=green), TextField[replyrs](width=6, editable=false, background=white), Button[BShowrs]("Show", Evaluate(function="Showrs"), background=yellow) ], [ halign=none, border=true, caption="Step 4: Find the final position of the garbage pod" , Label[Lrs0]("r_pod(s0) ="), TextField[TFrs0](width=8, background=turquoise), HorizontalGlue(), Button[BHintrs0]("Hint", Evaluate(function="Hintrs0"), background="Orange"), Button[BCheckrs0]("Check", Evaluate(function="Checkrs0"), background=green), TextField[replyrs0](width=6, editable=false, background=white), Button[BShowrs0]("Show", Evaluate(function="Showrs0"), background=yellow) ], [ halign=none, TextBox[reply](width=40, height=2, editable=false) ], [ halign=none, inset=0, spacing=0, "Instructor: Philip Yasskin", HorizontalGlue(), "Programmers: Adam Springer & Bohao Cheng", HorizontalGlue(), "Copyright: Yasskin 2013" ] ] ) ): Maplets[Display]( ParaCurveTanLineWordProblem );