{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 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 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 106 "# Integrating Accel eration to Find Velocity and Position\n# \n# Chase Caruth and Matt Nee ly\n# MATH 152-201\n#" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "res tart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "with(Maplets): wit h(Maplets[Tools]): with(Maplets[Elements]): with(plots):\nStartEngine( );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "randomize():" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "lightorange:=\"#FFB300\":" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 530 "right:= [\"Bullseye!\", \"Great!\", \"That's abso lutely right!\", \"You're unstoppable!\", \"Correct!\", \"You nailed t hat one!\", \"YES!\", \"Way to go!\", \"I knew you could do it!\", \"P erfecto!\", \"You're awesome!\", \"That's amazing!\", \"You're a math \+ whiz!\", \"Whoop!\", \"Nice job!\", \"That's right!\", \"That's the wa y!\", \"I like the sound of that!\", \"Ding! That's correct!\", \"You 're a genius!\", \"Right on the mark!\", \"Brick...house!\", \"Oh yeah !\", \"Wonderful!\", \"Excellent!\", \"You got it!\", \"Can I get a wh at what!\", \"Holla!\", \"You're incredible!\"]: " }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 34 "rightrand := rand(1..nops(right)):" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 263 "wrong:=[\"Try again.\", \"Nope. I'm sorry.\", \"C 'mon, you can do it.\", \"You can do better.\", \"You're close.\", \"L ook closer.\", \"Put on your thinking cap.\", \"Better luck next time. \", \"Keep trying.\", \"Never give up.\", \"Try again. I have faith i n you.\", \"Try harder.\"]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "wrongrand := rand(1..nops(wrong)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 297 "final: =[\"You know your stuff! Move on to the next one!\", \"You're doing s o awesome! Keep on keepin' on!\", \"Wow! That's awesome! Don't stop now!\", \"You got all of them right! Way to go! Go on to the next p roblem!\", \"You're doing great! Keep on truckin'!\", \"Oh yeah! Try the next function!\"]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 " finalrand := rand(1..nops(final)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 191 "hint:= [\"Now try it yourself.\", \"There it is. Now figure it out.\", \"The hint is great, but try it yourself.\", \"That was practice. Try it a gain.\", \"Don't settle for the hint. Work it out.\"]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "hintrand := rand(1..nops(hint)):" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 123 "constanthintC:=[\"So close. Don't forget the con stant.\", \"Plus C?\", \"You're off by a constant.\", \"Remember the c onstant.\"]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "constCrand \+ := rand(1..nops(constanthintC)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 123 "consta nthintK:=[\"So close. Don't forget the constant.\", \"Plus K?\", \"Yo u're off by a constant.\", \"Remember the constant.\"]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "constKrand := rand(1..nops(constant hintK)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "gen1:=rand(-2..2):\ngen2:=rand(2..4 ):\ngen3:=rand(0..3):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1381 "ask:=proc()\nlocal a, b, c ,d, tempeq;\nglobal gen1, gen2, gen3, acc, pos, vel, t0, r0, v0,\n \+ correctanswer1, correctanswer2, correctanswer3, correctanswer4, correc tanswer5, correctanswer6;\na:=gen1();\nb:=gen1();\nwhile(a=0 and b=0) \+ do\n a:=gen1();\n b:=gen1();\nend do;\nc:=gen2();\nd:=gen2();\nwhile (c=d) do\n d:=gen2();\nend do;\npos:=a*t^c + b*t^d;\nvel:=diff(pos,t) ;\nacc:=diff(vel,t);\nt0:=gen3();\nr0:=gen3();\nv0:=gen3();\ncorrectan swer1:=vel+C;\ntempeq:=correctanswer1=v0;\ntempeq:=subs(t=t0,tempeq); \ncorrectanswer2:=solve(tempeq,C);\ncorrectanswer3:=subs(C=correctansw er2,correctanswer1);\ncorrectanswer4:=pos+correctanswer2*t+K;\ntempeq: =correctanswer4=r0;\ntempeq:=subs(t=t0,tempeq);\ncorrectanswer5:=solve (tempeq,K);\ncorrectanswer6:=subs(K=correctanswer5, correctanswer4);\n Set('curve'(value)=MathML[Export]('a(t)' = acc));\nSet('given_r'= conv ert(x(t0) = r0, string));\nSet('given_v'= convert(v(t0) = v0, string)) ;\nSet('answer1'=\"\"):\nSet('response1'=\"\", 'response1'(background) =white);\nSet('answer2'=\"\"):\nSet('response2'=\"\", 'response2'(back ground)=white);\nSet('answer3'=\"\"):\nSet('response3'=\"\", 'response 3'(background)=white);\nSet('answer4'=\"\"):\nSet('response4'=\"\", 'r esponse4'(background)=white);\nSet('answer5'=\"\"):\nSet('response5'= \"\", 'response5'(background)=white);\nSet('answer6'=\"\"):\nSet('resp onse6'=\"\", 'response6'(background)=white);\nSet('reply'=\"\", 'reply '(background)=white);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 738 "check1 :=proc()\nlocal useranswer1, constantcheck;\nglobal rightrand, wrongra nd, constCrand, correctanswer1;\nuseranswer1:=Get('answer1'::anything, corrections=true, update=true):\nconstantcheck:=correctanswer1-C;\nSe t('reply'=\"\", 'reply'(background)=white);\nif useranswer1=correctans wer1 then\n Set('response1'=\" Correct \", 'response1'(background)=gr een);\n Set('reply'=right[rightrand()], 'reply'(background)=green);\n elif useranswer1=constantcheck then\n Set('response1'=\" Warning \", \+ 'response1'(background)=lightorange);\n Set('reply'=constanthintC[con stCrand()], 'reply'(background)=lightorange);\nelse\n Set('response1' =\"Incorrect\", 'response1'(background)=red);\n Set('reply'=wrong[wro ngrand()], 'reply'(background)=red);\nend if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 216 "show1:=proc()\nglobal hintrand, co rrectanswer1;\nSet('answer1'=correctanswer1);\nSet('response1'=\" Show n \", 'response1'(background)=lightorange);\nSet('reply'=hint[hintrand ()], 'reply'(background)=lightorange);\nend proc:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 504 "check2:=proc()\nlocal useranswer2, tempeq;\nglobal rightrand, wro ngrand, correctanswer2;\nuseranswer2:=Get('answer2'::anything, correct ions=true, update=true):\nSet('reply'=\"\", 'reply'(background)=white) ;\nif useranswer2=correctanswer2 then\n Set('response2'=\" Correct \" , 'response2'(background)=green);\n Set('reply'=right[rightrand()], ' reply'(background)=green);\nelse\n Set('response2'=\"Incorrect\", 're sponse2'(background)=red);\n Set('reply'=wrong[wrongrand()], 'reply'( background)=red);\nend if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 216 "show2:=proc()\nglobal hintrand, correctanswer2;\nSet ('answer2'=correctanswer2);\nSet('response2'=\" Shown \", 'response2'( background)=lightorange);\nSet('reply'=hint[hintrand()], 'reply'(backg round)=lightorange);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 496 "check3:=proc() \nlocal useranswer3;\nglobal rightrand, wrongrand, correctanswer3;\nus eranswer3:=Get('answer3'::anything, corrections=true, update=true):\nS et('reply'=\"\", 'reply'(background)=white);\nif useranswer3=correctan swer3 then\n Set('response3'=\" Correct \", 'response3'(background)=g reen);\n Set('reply'=right[rightrand()], 'reply'(background)=green); \nelse\n Set('response3'=\"Incorrect\", 'response3'(background)=red); \n Set('reply'=wrong[wrongrand()], 'reply'(background)=red);\nend if; \nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 216 "show3:=proc ()\nglobal hintrand, correctanswer3;\nSet('answer3'=correctanswer3);\n Set('response3'=\" Shown \", 'response3'(background)=lightorange);\nSe t('reply'=hint[hintrand()], 'reply'(background)=lightorange);\nend pro c:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 738 "check4:=proc()\nlocal useranswer4, constantc heck;\nglobal rightrand, wrongrand, constKrand, correctanswer4;\nusera nswer4:=Get('answer4'::anything, corrections=true, update=true):\ncons tantcheck:=correctanswer4-K;\nSet('reply'=\"\", 'reply'(background)=wh ite);\nif useranswer4=correctanswer4 then\n Set('response4'=\" Correc t \", 'response4'(background)=green);\n Set('reply'=right[rightrand() ], 'reply'(background)=green);\nelif useranswer4=constantcheck then\n \+ Set('response4'=\" Warning \", 'response4'(background)=lightorange); \n Set('reply'=constanthintK[constKrand()], 'reply'(background)=light orange);\nelse\n Set('response4'=\"Incorrect\", 'response4'(backgroun d)=red);\n Set('reply'=wrong[wrongrand()], 'reply'(background)=red); \nend if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 216 "sh ow4:=proc()\nglobal hintrand, correctanswer4;\nSet('answer4'=correctan swer4);\nSet('response4'=\" Shown \", 'response4'(background)=lightora nge);\nSet('reply'=hint[hintrand()], 'reply'(background)=lightorange); \nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 496 "check5:=proc()\nlocal useranswer5; \nglobal rightrand, wrongrand, correctanswer5;\nuseranswer5:=Get('answ er5'::anything, corrections=true, update=true):\nSet('reply'=\"\", 're ply'(background)=white);\nif useranswer5=correctanswer5 then\n Set('r esponse5'=\" Correct \", 'response5'(background)=green);\n Set('reply '=right[rightrand()], 'reply'(background)=green);\nelse\n Set('respon se5'=\"Incorrect\", 'response5'(background)=red);\n Set('reply'=wrong [wrongrand()], 'reply'(background)=red);\nend if;\nend proc:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 216 "show5:=proc()\nglobal hintr and, correctanswer5;\nSet('answer5'=correctanswer5);\nSet('response5'= \" Shown \", 'response5'(background)=lightorange);\nSet('reply'=hint[h intrand()], 'reply'(background)=lightorange);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 507 "check6:=proc()\nlocal useranswer6;\nglobal rightrand , wrongrand, finalrand, correctanswer6;\nuseranswer6:=Get('answer6'::a nything, corrections=true, update=true):\nSet('reply'=\"\", 'reply'(ba ckground)=white);\nif useranswer6=correctanswer6 then\n Set('response 6'=\" Correct \", 'response6'(background)=green);\n Set('reply'=final [finalrand()], 'reply'(background)=green);\nelse\n Set('response6'=\" Incorrect\", 'response6'(background)=red);\n Set('reply'=wrong[wrongr and()], 'reply'(background)=red);\nend if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 216 "show6:=proc()\nglobal hintrand, co rrectanswer6;\nSet('answer6'=correctanswer6);\nSet('response6'=\" Show n \", 'response6'(background)=lightorange);\nSet('reply'=hint[hintrand ()], 'reply'(background)=lightorange);\nend proc:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 3324 "AccelVelPos:=Maplet(onstartup = RunWindow(MAIN), Font[helv10](\" helvetica\",10),\nWindow[MAIN]('title'=\"Integrating Acceleration to F ind Velocity and Position\",\n [ halign=none,\n [ Button(\"New Fun ction\", Evaluate('function' = \"ask\")),\n HorizontalGlue(),\n \+ Button(\"Quit\", Shutdown())\n ],\n [ border=true, caption= \"Goal: Find the position of a particle given that its acceleration, i nitial position and initial velocity are:\",\n MathMLViewer['curv e'](value=MathML[Export](a(t) = a), 'width'=150, 'height'=35),\n \+ HorizontalGlue(),\n TextField['given_r'](\"x(0) = x0\", 'width'=1 0, 'editable'='false', background=white),\n HorizontalGlue(),\n \+ TextField['given_v'](\"v(0) = v0\", 'width'=10, 'editable'='false' , background=white)\n ],\n [ border=true, caption=\"Find the vel ocity with a constant of integration C:\",\n \"v(t) =\", TextFiel d['answer1']('width'=25, background=turquoise),\n HorizontalGlue( ),\n Button(\"Check\", Evaluate('function' = \"check1\")),\n \+ TextField['response1']('width'=10, 'editable'='false', background=whi te),\n Button(\"Show\", Evaluate('function' = \"show1\"))\n ], \n [ border=true, caption=\"Find C using the initial velocity:\",\n \"C = \", TextField['answer2']('width'=25, background=turquois e),\n HorizontalGlue(),\n Button(\"Check\", Evaluate('functi on'= \"check2\")),\n TextField['response2']('width'=10, 'editable '='false', background=white),\n Button(\"Show\", Evaluate('functi on'=\"show2\"))\n ],\n [ border=true, caption=\"Substitute C int o the velocity:\",\n \"v(t) =\", TextField['answer3']('width'=25, background=turquoise),\n HorizontalGlue(),\n Button(\"Check \", Evaluate('function' = \"check3\")),\n TextField['response3']( 'width'=10, 'editable'='false', background=white),\n Button(\"Sho w\", Evaluate('function' = \"show3\"))\n ],\n [ border=true, cap tion=\"Find the position with a constant of integration K:\",\n \+ \"x(t) =\", TextField['answer4']('width'=25, background=turquoise),\n \+ HorizontalGlue(),\n Button(\"Check\", Evaluate('function' = \+ \"check4\")),\n TextField['response4']('width'=10, 'editable'='fa lse', background=white),\n Button(\"Show\", Evaluate('function' = \"show4\"))\n ],\n [ border=true, caption=\"Find K using the in itial position:\",\n \"K = \", TextField['answer5']('width'=25, background=turquoise),\n HorizontalGlue(),\n Button(\"Check \", Evaluate('function' = \"check5\")),\n TextField['response5']( 'width'=10, 'editable'='false',background=white),\n Button(\"Show \", Evaluate('function' = \"show5\"))\n ],\n [ border=true, capt ion=\"Substitute K into the position: \",\n \"x(t) =\", TextField ['answer6']('width'=25, background=turquoise),\n HorizontalGlue() ,\n Button(\"Check\", Evaluate('function' = \"check6\")),\n \+ TextField['response6']('width'=10, 'editable'='false', background=whit e),\n Button(\"Show\", Evaluate('function' = \"show6\"))\n ], \n [ TextField['reply']('width'=40, 'editable'='false', background= white)\n ],\n BoxRow('background'=\"#DDFFFF\", 'inset'=0, 'spaci ng'=0,\n Label(\"Programmers: Chase Caruth / Matt Neely\", 'font' =helv10),\n HorizontalGlue(),\n Label(\"Copyright 2006, D.B. Meade and P.B. Yasskin\", 'font'=helv10),\n HorizontalGlue(),\n \+ Label(\"v. 1.2a May 2006\", 'font'=helv10)\n )\n ]\n)\n):" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "Display( AccelVelPos );" }} }}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }