{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 }{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 5894 "coneDisplay := pro c()\n local m;\n use Maplets, Maplets[Elements] in\n m:= Maplet( \+ \n Window(\n title=\"Maximizing the volume of a cone \",\n [ [\"This Maplet maximizes the volume of a cone forme d by revolving a right triangle with fixed hypotenuse of length L abou t one of its legs\"],\n\n #TEXT AREA FOR ENTERING THE L ENGTH OF THE HYPOTENUSE (NAMED L).\n \n [\"Enter the leng th: L=\",\n TextField[L](6),\n \n #T EXT AREA FOR GUESSING THE OPTIMAL RADIUS. (GUESS STORED IN R). \n \+ #WHEN ENTERED, ACTION A1 GETS INVOKED (DEFINED BELOW), WHIC H\n #COMPUTES THE VOLUME OF THE RESULTING CONE AND PLOT S IT \n\n \"Guess the optimal radius of the cone: r=\", \+ TextField[R](onchange=A1, 6)],\n \n #THE PLOTTING AREA \+ WHERE THE CONE GETS DRAWN (NAMED PL1)\n [Plotter[PL1]()], \n\n #TEXT AREA WHERE THE VOLUME OF THE STUDENTS CHOSE N CONE\n #GETS DISPLAYED (NAMED VOL) \n [ \"Volume of this cone\", \n TextField[VOL](value=0, n ot editable, 6)],\n\n #BUTTON THE STUDENT CLICKS TO OBT AIN THE OPTIMAL POINT.\n #WHEN CLICKED, ACTION A2 GETS \+ INVOKED (DEFINED BELOW),\n #WHICH COMPUTES THE OPTIMAL \+ RADIUS AND DRAWS THE MAX-VOLUME CONE. \n [Button(\"Find t he optimal radius\", onclick=A2)],\n\n #TEXT AREAS WHER E THE OPTIMAL RADIUS AND VOLUME GET DISPLAYED,\n #NAMED ROPT AND VOLOPT, RESPECTIVELY.\n [Label(\"The optimal ra dius\"),\n TextField[ROPT](value=0, not editable, 6), \n \"Maximal volume of the cone\",\n Te xtField[VOLOPT](value=0, not editable, 6)],\n\n #BUTTON FOR SHUTTING DOWN THE MAPLET \n [Button(\"Close\", Shutdo wn())]\n ]\n ),\n\n #ACTIONS THAT GET I NVOKED WHEN THE USER ENTERS DATA OR CLICKS\n #BUTTONS.\n \+ \n #ACTION A1 CALLS THE MAPLE FUNCTION coneVolume() AND dra wCone(), WHICH\n #ARE DEFINED IN THIS MODULE. THE LATTER DR AWS THE GRAPHICS IN THE PLOTTER \n #DEFINED ABOVE AS PL1.\n \n #ACTION A2 IS THE OPTIMIZATION. IT COMPUTES THE OPTIMAL RADIUS (ROPT)\n #AND PASSES THAT VALUE TO coneVolume() AND drawCone().\n \n Action[A1](Evaluate( 'VOL' = 'coneVolume (L, R)'),\n Evaluate( 'PL1' = 'drawCone(L, R)')) , \n Action[A2](Evaluate( 'ROPT' = 'coneRadiusOpt(L)'),\n \+ Evaluate( 'VOLOPT' = 'coneVolume(L, ROPT)'),\n \+ Evaluate( 'PL1' = 'drawCone(L, ROPT)')) ): \n D isplay(m);\n end use;\nend proc:\n\n\n\nconeDisplay2 := proc()\n loc al m;\n\n #INVOKE THE MAPLETS PACKAGE AND THE Elements SUBPACKAGE IN \+ THE FOLLOWING CODE BLOCK\n\n use Maplets, Maplets[Elements] in\n m:= Maplet( \n Window(\n title=\"Maximizing the Area o f a Rectangle Between a Parabola and the x-axis\",\n\n BoxCo lumn \n (\n BoxColumn\n (border='tru e',\n BoxRow #TEXT AREAS WHERE STUDENT ENTERS THE GIVENS \n (\n BoxCell(\"Enter the length: L=\", TextField[L](6)) \n )\n \+ ),\n\n BoxRow #THE PLOTTER WINDOW PLUS THE INTERACTIVE SE CTION OF THE MAPLET\n (\n BoxCell( Plotter[' PL1']() ), #THE PLOTTER WINDOW\n \n BoxColumn #THE INTER ACTIVE SECTION OF THE MAPLET\n (\n BoxCo lumn #THE AREA WHERE THE STUDENT EXPERIMENTS WITH DIFFERENT RADII\n \+ (\n caption=\"Experimentation\", borde r=true,\n\n BoxRow #TEXT AREA WHERE STUDENT ENTERS G UESSES AT THE RADIUS\n (\n BoxCe ll(\"Guess the optimal radius of the cone: r=\", TextField['R'](onchan ge=A1, 6))\n ),\n\n BoxRow #TEXT \+ AREA WHERE THE VOLUME OF THE STUDENT'S CONE GETS DISPLAYED\n \+ (\n BoxCell( \"Volume of this cone\", Te xtField['VOL'](value=0, 'editable'=false, 6) ) \n ) \n ),\n\n BoxColumn #THE AREA WHERE T HE STUDENT RUNS THE OPTIMIZATION\n (\n \+ caption=\"Optimization\", border=true,\n\n BoxRow #BUTTON THAT INVOKES THE OPTIMIZATION ROUTINES\n ( \n BoxCell( halign='left', Button( \"Optimize\", o nclick=A2 ) )\n #ACTION A3 GETS CALLED WHEN BUTT ON CLICKED, \n #WHICH DRAWS THE OPTIMAL CONE\n \+ #AND DISPLAYS THE OPTIMAL RADIUS AND VOLUME OF TH AT CONE.\n ),\n\n BoxRow #TEXT AR EA WHERE THE OPTIMAL RADIUS GETS DISPLAYED (AS MathML). \n \+ (\n BoxCell( halign='left', \"Optimal radi us\" ),\n BoxCell( halign='left', TextField['ROPT ']('editable'=false, 6 ))\n ),\n \+ \n BoxRow #TEXT AREA WHERE THE OPTIMAL VOLUME GETS DISPLAYED.\n (\n BoxCell( halign='left', \"Area of the biggest bo x\" ),\n BoxCell( halign='left', TextField['VOLOP T'](value=0, 'editable'=false, 10 ))\n )\n \+ ), \n\n BoxColumn( Button (\"Close\", Shutdown() ))\n )\n )\n \+ )\n ), \n Action[A1](Evaluate( 'VOL' = 'con eVolume(L, R)'),\n Evaluate( 'PL1' = 'drawCone(L , R)')), \n Action[A2](Evaluate( 'ROPT' = 'coneRadiusOpt(L )'),\n Evaluate( 'VOLOPT' = 'coneVolume(L, ROPT) '),\n Evaluate( 'PL1' = 'drawCone(L, ROPT)')) ) : \n Display(m);\n end use;\nend proc:\n" }}}}{MARK "0 0 0" 3410 } {VIEWOPTS 1 1 0 3 4 1802 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }