{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{CSTYLE "Text" -1 200 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 2 0 2 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT 200 2430 "\nDavid Goodwin and Chr is Schneider\nMath 152 \nsections 201,202\nFluid Force\nThis maplet al lows the user to practice computing the hydrostatic force on a parabo lic plate submerged in water using integrals. To use this maplet the \+ user presses the new problem button whose called function will randoml y generate a problem in the form a*x^(1/2), as well as the water level and maximum value of the domain which is then used to determine the h eight of the plate. The hint button calls another window that has inf ormation on how to work the problems. The new prolem is displayed in \+ a word problem format that is displayed in the text box below the two \+ previous mentioned buttons. Below the text box and to the right, ther e is a plotter and a button labeled display. The display button calls a function that plots the function, its upperbound and the water leve l in the plot box. The series of text boxes on the right hand side of the screen are there to accept the users answers. The top box expect s an varying width of the parabolic plate, the next box expects the wi dth multiplied by dy, below that the text box expects the varying heig ht of the water above each width, the box below that on eexpects the p ressure which is rho*g*the height. The next box down expects the user to set up the integral to be evaluated and the last box expects the e valuated answer. Each of these text boxes are accompanied by a check \+ button and a show button. The check button checks the users answer ag ainst the right answer and show gives the right answer in the comment \+ box. The text box at the bottom is there to tell the user if he or sh e got the right answer and also displays the right answer when the use r clicks the show button for any given question, i feel that the corre ct answer should be shown here because it allows the user to check the ir answer against the right answer and see what they did wrong. At th e bottom of the screen there is a quit button that allows the user to \+ exit the maplet. \nNote: the function that checks the users dA, check s against the right answer which is just the x*dy. If the user just f orgets the dy then the comment box prompts them to check for that mist ake. The answer accepted by the computed integral text box is checked against and expects the most simplified version of the answer, not a \+ decimal value. This was done so that the user could use the maplet wi thout the need of a calculator. \n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 95 "with(Maplets): with(Maplets[Tools]): with(Maplets[Elements]): with(Ra ndomTools):\nStartEngine();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "randomize():" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 76 "rand0:=rand(1..2):\nrand1:=r and(1..5):\nrand2:=rand(8..10):\nrand3:=rand(1..5):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1019 "new_prob:=proc()\nglobal rand0, rand1, rand2, rand3, w, h, rho g,mini,waterlevel,xright,top, plate;\nlocal a,probtype,plate2,waterlev el2,top2;\na:=rand1();\nwaterlevel:=rand2();\nxright:=rand3();\nprobty pe:=rand0();\nplate:=[a*x^2,a*abs(x)][probtype];\ntop:=eval(plate, x=x right);\nmini:=min(waterlevel,top);\nw:=[2*(y/a)^(1/2),2*y/a][probtype ];\nh:=waterlevel-y;\nrhog:=980;\nplate2:=convert(plate,string);\nwate rlevel2:=convert(waterlevel,string);\ntop2:=convert(top,string);\nSet( 'problem'=cat(\"Compute the fluid force on a plate above the function \+ y = \",plate2,\" below y = \",top2,\" submerged in a bucket of water w ith the water level at y = \",waterlevel2,\".\"));\nSet('myplot'=plot( 0, x=-5..5, 0..10));\nSet('wide'=\"\", 'wide'(background)=white);\nSet ('area'=\"\", 'area'(background)=white);\nSet('depth'=\"\", 'depth'(ba ckground)=white);\nSet('pressure'=\"\", 'pressure'(background)=white); \nSet('integral'=\"\", 'integral'(background)=white);\nSet('value'=\" \", 'value'(background)=white);\nSet('comments'=\"\", 'comments'(backg round)=white);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 241 "plot_it:=proc()\nglob al plate, top, waterlevel, xright;\nSet('myplot'=plot([plate,top,water level],x=-xright..xright, view=[-xright-1..xright+1,0..max(top,waterle vel)], color=[green,green,blue], scaling=constrained, tickmarks=[3,2]) );\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 312 "check_w:=proc()\nglobal w; \nlocal user_w;\n\nuser_w:=Get(wide::algebraic);\nif simplify(normal(u ser_w - w)) = 0 then\n Set('comments'=\"correct keep going\", 'wide'( background)=green, 'comments'(background)=green);\nelse\n Set('commen ts'=\"try again\",'wide'(background)=red,'comments'(background)=red); \nend if; \nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 126 "s how_w:=proc()\nglobal w;\n\nSet('wide'=w,'wide'(background)=yellow);\n Set('comments'=\"\", 'comments'(background)=white);\nend proc:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 472 "check_dA:=proc()\nglobal w;\nlocal da, user_da, no tda;\n\nda:=w*dy;\nnotda:=w;\nuser_da:=Get(area::algebraic);\nif simpl ify(normal(user_da - da)) = 0 then\n Set('comments'=\"correct keep go ing\", 'area'(background)=green,'comments'(background)=green);\nelif u ser_da - notda = 0 then\n Set('comments'=\"Remember the dy.\", 'area' (background)=yellow,'comments'(background)=yellow);\nelse\n Set('comm ents'=\"try again\", 'area'(background)=red,'comments'(background)=red );\nend if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 149 " show_dA:=proc()\nglobal w;\nlocal da;\n\nda:=w*dy;\nSet('area'=da, 'ar ea'(background)=yellow);\nSet('comments'=\"\", 'comments'(background)= white);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 333 "check_depth:=proc()\nglobal h;\nlocal user_depth;\n\nuser_depth:=Get(depth::algebraic);\nif simpl ify(normal(user_depth - h)) = 0 then\n Set('comments'=\"correct keep \+ going\", 'depth'(background)=green, 'comments'(background)=green);\nel se\n Set('comments'=\"try again\", 'depth'(background)=red, 'comments '(background)=red);\nend if; \nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 132 "show_depth:=proc()\nglobal h;\nSet('depth'=h, 'depth '(background)=yellow);\nSet('comments'=\"\", 'comments'(background)=wh ite);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 380 "check_pressure:=proc()\nglo bal h,rhog;\nlocal user_pressure,pres;\n\npres:=rhog*h;\nuser_pressure :=Get(pressure::anything);\nif simplify(normal(user_pressure - pres)) \+ = 0 then\n Set('comments'=\"correct keep going\", 'pressure'(backgrou nd)=green, 'comments'(background)=green);\nelse\n Set('comments'=\"tr y again\", 'pressure'(background)=red, 'comments'(background)=red);\ne nd if; \nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 176 "show _pressure:=proc()\nglobal h,rhog;\nlocal pres;\n\npres:=rhog*h;\nSet(' pressure'=pres, 'pressure'(background)=yellow);\nSet('comments'=\"\", \+ 'comments'(background)=white);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 400 "chec k_int:=proc()\nglobal h,w,rhog,mini;\nlocal user_int,integral1;\n\nint egral1:=Int(rhog*h*w,y=0..mini);\nuser_int:=Get(integral::algebraic); \nif simplify(normal(user_int - integral1)) = 0 then\n Set('comments' =\"correct keep going\", 'integral'(background)=green, 'comments'(back ground)=green);\nelse\n Set('comments'=\"try again\", 'integral'(back ground)=red, 'comments'(background)=red);\nend if; \nend proc:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 209 "show_int:=proc()\nglobal h, w,rho,mini;\nlocal integral1;\n\nintegral1:=Int(rhog*h*w,y=0..mini);\n Set('integral'=integral1, 'integral'(background)=yellow);\nSet('commen ts'=\"\", 'comments'(background)=white);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 376 "check_val:=proc()\nglobal h,w,rhog,mini;\nlocal user_val,val1; \n\nval1:=int(rhog*h*w,y=0..mini);\nuser_val:=Get(value::algebraic);\n if simplify(normal(user_val - val1)) = 0 then\n Set('comments'=\"corr ect keep going\", 'comments'(background)=green, 'value'(background)=gr een);\nelse\n Set('comments'=\"try again\", 'comments'(background)=re d, 'value'(background)=red);\nend if; \nend proc:" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 188 "show_val:=proc()\nglobal h,w,rho,mini;\nloc al val1;\n\nval1:=int(rhog*h*w,y=0..mini);\nSet('value'=val1, 'value'( background)=yellow);\nSet('comments'=\"\", 'comments'(background)=whit e);\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 4471 "Fluid_Force:= Maplet(onsta rtup = RunWindow(MAIN), Font[helv10](\"helvetica\",10),\nWindow[MAIN]( 'title'=\"Fluid Force\",\n [ [ Button(\"New Problem\", Evaluate('func tion' = \"new_prob\")),\n Button(\"Hint\", onclick=A1),\n Bu tton(\"Quit\", Shutdown())\n ],\n [ TextBox['problem']('width'=7 0, height=2)\n ],\n [ \"Enter each of the following for the slic e at height y of thickness dy.\" \n ], \n BoxRow(\n BoxC olumn(\n [ Button(\"Display\",Evaluate('function'=\"plot_it\")) \n ],\n [ Plotter['myplot']('width'=200, 'height'=200)\n ]\n ),\n BoxColumn(\n [ \"w =\",TextField['w ide']('width'=30),\n Button(\"check\", Evaluate('function' = \+ \"check_w\")),\n Button(\"show\", Evaluate('function' = \"sho w_w\")),\n Button(\"hint\", onclick=W)\n ],\n [ \"dA =\",TextField['area']('width'=30),\n Button(\"check\", \+ Evaluate('function' = \"check_dA\")),\n Button(\"show\", Eval uate('function' = \"show_dA\")),\n Button(\"hint\", onclick=d A)\n ],\n [ \"h =\",TextField['depth']('width'=30),\n \+ Button(\"check\", Evaluate('function' = \"check_depth\")),\n \+ Button(\"show\", Evaluate('function' = \"show_depth\")),\n \+ Button(\"hint\", onclick=H)\n ],\n [ \"P =\",Te xtField['pressure']('width'=30),\n Button(\"check\", Evaluate ('function' = \"check_pressure\")),\n Button(\"show\", Evalua te('function' = \"show_pressure\")),\n Button(\"hint\", oncli ck=P)\n ],\n \"Set up the integral for the force:\",\n \+ [ \"F =\",TextField['integral']('width'=30),\n Button (\"check\", Evaluate('function' = \"check_int\")),\n Button( \"show\", Evaluate('function' = \"show_int\")),\n Button(\"hi nt\", onclick=Int)\n ],\n \"Evaluate the integral for th e force:\",\n [ \"F =\",TextField['value']('width'=30),\n \+ Button(\"check\", Evaluate('function' = \"check_val\")),\n \+ Button(\"show\", Evaluate('function' = \"show_val\")),\n \+ Button(\"hint\", onclick=Value)\n ]\n )\n ),\n [ Tex tField['comments']('width'=70, 'editable'='false')\n ],\n BoxRow ('background'=\"#DDFFFF\", 'inset'=0, 'spacing'=0,\n Label(\"Prog rammers: Goodwin / Schneider\", '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\nWindow[Hint]('title'=\"Hints\",\n \+ [ halign=none,\n [ \"F =\",\n MathMLViewer('value' = MathML[Ex port](Int('P','A') = Int('rho'*'g'*'h'*'w','y'='a'..'b')), 'width'=250 ,'height'=75),\n HorizontalGlue(),\n Button(\"Close\", Close Window(Hint))\n ],\n [ TextBox(\"The force is the pressure times the area.\\nThe hydrostatic pressure varies with the depth of the wat er.\\nSo, the hydrostatic force must be computed using an integral.\\n \\nThe limits of integration run from the lowest point to the highest \+ point of the plate submerged under the water.\\n\\nThe density of wate r is rho = 1 gm/cm^3.\\nThe acceleration of gravity is g = 980 cm/sec^ 2\", width=65, height=9)\n ]\n ]\n),\nAction[A1](RunWindow(Hint)), \n\nWindow[HintW]('title'=\"Hint\",\n [ [ \"w is the width of the sli ce of the plate at height y.\\nw = 2 * x where x is expressed as a fun ction of y.\"\n ],\n [ Button(\"Close\", CloseWindow(HintW))\n \+ ]\n ]\n),\nAction[W](RunWindow(HintW)),\n\nWindow[HintdA]('title'= \"Hint\",\n [ [ \"dA is the area of the slice of the plate at height \+ y with thickness dy,\\ndA = w * dy\"\n ],\n [ Button(\"Close\", \+ CloseWindow(HintdA))\n ]\n ]\n),\nAction[dA](RunWindow(HintdA)),\n \nWindow[HintH]('title'=\"Hint\",\n [ [ \"h is the depth of water abo ve of the slice of plate at height y.\\nh = Top of the water - y\"\n \+ ],\n [ Button(\"Close\", CloseWindow(HintH))\n ]\n ]\n),\nAct ion[H](RunWindow(HintH)),\n\nWindow[HintP]('title'=\"Hint\",\n [ [ \" P is the pressure of the water on the slice at height y.\\nP=rho*g*h, \+ where rho = 1 gm/cm^3 and g = 980 cm/sec^2.\"\n ],\n [ Button(\" Close\", CloseWindow(HintP))\n ]\n ]\n),\nAction[P](RunWindow(Hint P)),\n\nWindow[HintInt]('title'=\"Hint\",\n [ [ \"Format: F = Int( P * w, y = min..max).\\nYou only need to integrate over the part of the plate which is under the water.\"\n ],\n [ Button(\"Close\", Cl oseWindow(HintInt))\n ]\n ]\n),\nAction[Int](RunWindow(HintInt)), \n\nWindow[HintValue]('title'=\"Hint\",\n [ [ \"Expand the integrand. \"\n ],\n [ Button(\"Close\", CloseWindow(HintValue))\n ]\n \+ ]\n),\nAction[Value](RunWindow(HintValue))\n):" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 30 "Maplets[Display](Fluid_Force);" }}}{EXCHG }} {MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }