{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 "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {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 1" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 8 4 1 0 1 0 2 2 0 1 }{PSTYLE "Normal" -1 257 1 {CSTYLE "" -1 -1 "Times " 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }3 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 26 "Partial Derivatives Mapl et" }}{PARA 257 "" 0 "" {TEXT -1 23 "by : Mohamed Moutadayne" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 146 "This Maplet wi ll draw the Partial Derivative to any point on any surface (defined by f) in 3-space. f must be differentiable at the given point." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 256 57 "To run t his maplet, click the !!! button in the tool bar." }{TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "restart:\n\nwith(Maplets[Elements]): with (plots):\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1768 "# ----This procedure draws partia l derivative of a given point and surface.\nplotPartials := proc (f, w hichPlane, xVal, yVal, lowerB, upperB, lowerZ, upperZ, vView, hView, w hichplot)\n\n local expr, pnt, funcPlot, planePlot, m, spacecurvePlot , tangentPlot, returnVal:\n\n if whichplot = 1 then\n if (whichPla ne = true) then # ----Plot along x axis\n expr := y = yVal:\n \+ m:= subs(x = xVal, diff(f(x, yVal), x)):\n spacecurvePlot := s pacecurve([t, yVal, f(xVal,yVal) + m*(t - xVal)], t=lowerB..upperB, co lor=red, thickness=3, color=RED):\n else # \+ ----Plot along y axis \n expr := x = xVal:\n m:= subs(y = yV al, diff(f(xVal, y), y)):\n spacecurvePlot := spacecurve([xVal, t , f(xVal,yVal) + m*(t - yVal)], t=lowerB..upperB, color=red, thickness =3, color=RED):\n end if:\n funcPlot := plot3d(f(x,y), x=lowerB. .upperB, y=lowerB..upperB, color=CYAN):\n planePlot := implicitplot 3d (expr, x=lowerB..upperB, y=lowerB..upperB, z=lowerZ..upperZ, color= GREEN, style=PATCHNOGRID):\n returnVal := display (funcPlot, planeP lot, spacecurvePlot, axes=BOXED, orientation=[hView, vView], title=\"P lot of F(x,y) And Partial Derivatives\", titlefont = [TIMES, BOLD, 14] ):\n else\n if (whichPlane = true) then\n funcPlot := plot (f (x, yVal), x=lowerB..upperB, color=BLUE):\n tangentPlot := plot(s ubs(x=xVal, diff(f(x,yVal), x)) * (x - xVal) + f(xVal, yVal), x=lowerB ..upperB):\n else\n funcPlot := plot (f(xVal, y), y=lowerB..up perB, color=BLUE):\n tangentPlot := plot(subs(y=yVal, diff(f(xVal ,y), y)) * (y - yVal) + f(xVal, yVal), y=lowerB..upperB):\n end if: \n returnVal := display (funcPlot, tangentPlot, title=\"Plot of F(x ,y) Along the Plane\", titlefont = [TIMES, BOLD, 14]):\n end if:\n\n \+ returnVal;\n\nend:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1002 " # ----This procedure does error check on plotPartials and returns an e rror msg when attemp to plot fails. \nDrawPartial := proc(func, wPlane , xC, yC, lB, uB, lZ, uZ, vV, hV, wPlot)\n\n local failPlot, newfunc: \n\n newfunc := unapply(func, (x, y)):\n\n try\n plotPartials(new func, wPlane, xC, yC, lB, uB, lZ, uZ, vV, hV, wPlot):\n catch:\n i f wP = 1 then\n failPlot := \n textplot3d([4,4,3,\"There i s an error with your parameters.\"]), textplot3d([4,4,2, \"The functio n may not be differentiable at the given points.\"]):\n display(f ailPlot, axes=BOXED, view=[-5..5, -5..5, -5..5], color=RED, title=\"Pl ot of F(x,y) And Partial Derivatives\", titlefont = [TIMES, BOLD, 14]) :\n else\n failPlot :=\n textplot(\{[2,3,\"There is an \+ error with your parameters.\"],[3,2,\"The function may not be differen tiable at the given points.\"]\}):\n display(failPlot, view=[0..5 , 0..5], color=RED, title=\"Plot of F(x,y) Along the Plane\", titlefon t = [TIMES, BOLD, 14]):\n end if:\n end try;\n\nend:\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6384 "b := 'border'=true:\ns := 'inset' =0, 'spacing'=0:\nc := 'background'=\"#DDFFFF\":\ndc := 'background'= \"#CCFFFF\":\nlc := 'background'=\"#EEFFFF\":\n\nPartialDerivativesMap let := Maplet( \n \n 'onstartup' = RunWindow('MainWin'),\n\n Font[' F1']('family'=\"Comic Sans MS\", 'bold'='false', 'italic'='false', siz e=12),\n Font['F2']('family'=\"Comic Sans MS\", 'bold'='true', 'itali c'='false', size=14),\n \n Window['MainWin']('title' = \"Surfaces \+ in 3-space and Their Partial Derivatives\", 'menubar'='Menu', 'layout' = 'Body', 'width'=900, 'height'=800),\n Window['HelpWin']('title' = \+ \"Help: Partial Derivatives\", 'layout' = 'HelpBody'),\n Window['DefW in']('title' = \"Definition: Partial Derivatives\", 'layout' = 'DefBod y'),\n\n BoxLayout['HelpBody']( \n BoxColumn(b, c, 'inset'=0, ' spacing'=4,\n BoxRow(s, c, \n TextBox('wrapped'=true, 'wid th'=80, 'height'=15, c, 'font'='F1', 'editable'='false', 'value'=\n### ######################### HELP TEXT (BELOW) ########################## ##\n\"The purpose of this Maplet is to aid the user to visualize parti al derivatives to a surface in 3 dimensions.\n\nTo Use this Maplet the user must enter 5 pieces of information:\n\n1) Enter a function F, of x and y, that will be used to determine the partial derivative at the given point: Z = F(x,y).\n2) Enter the domain in x and y on which th e the graph of F(x,y) will be plotted.\n3) Enter the range that is des ired for the plot of the plane along either the x or y axis.\n4) Enter the co-ordinate at which the parital derivative is to be determined. \n5) Select which partial derivative is to be plotted (either along th e x axes or the y axis).\n\nWhen the above pieces of information have \+ been entered it is then possible to 'Plot' the graph of F(x,y) and its partial derivative. 2 Graphs will appear, a 3-D graph of F(x,y) and \+ a 2-D graph of F(x,y) evaluated at either x or y. Both graphs will co ntain a plot of the Partial Derivative at the given co-ordinate. Ther e are 2 slider bars located by the graph. These bars are used to cont rol the angle of rotation of the graph. The default setting is 45 deg rees down and 235 degrees to the side. After the desired values are s et on the slider bar, it is necessary to re-plot the graph.\n\nPLOTTIN G ERROR:\nIf a division by 0 occurs or the graph is not continuous/dif ferentiable at the desired co-ordinates then an error will occur and t his Maplet will not plot the graphs. The values must be re-entered at this point.\n\nSyntax erros are caused by entereing invalid values in any of the prompts. If this happens the Maplet must be restarted.\" \n\n############################ HELP TEXT (ABOVE) ################### #########\n )\n ),\n BoxRow(s, c, \n Button(\" Close\", 'font'='F1', dc, CloseWindow('HelpWin') )\n )\n ) \n \+ ), \n\n BoxLayout['DefBody'](\n BoxColumn(b, 'inset'=0, 'spacing '=4, c, \n BoxRow(s, c, 'border'='false', \n TextBox('wrap ped'=true, 'width'=35, 'height'=2, c, 'font'='F2', 'editable'='false', 'value'=\n \"If F is a function of two variables, its partia l derivatives are the functions Fx and Fy defined by:\"\n )\n \+ ),\n BoxRow(s,c,\n MathMLViewer['partDerivX']('height' =50, 'width'=400, 'value'=\n MathML[Export](Fx(x,y) = Limit ( (F(x + h, y) - F(x,y))/h, h=0))\n )\n ),\n BoxRow(s,c ,\n MathMLViewer['partDerivY']('height'=50, 'width'=400, 'value '=\n MathML[Export](Fy(x,y) = Limit ((F(x, y + h) - F(x,y))/h , h=0))\n )\n ),\n BoxRow (s,c, \n Button(\"Cl ose\", 'font'='F1', dc, CloseWindow('DefWin'))\n )\n )\n ),\n \n BoxLayout['Body'](\n BoxRow(s, c, \n BoxColumn(s, c, b , 'caption'=\"Plotter\", \n BoxRow(s,c,\n BoxColumn(s, c, b, \n BoxRow(s, c, b,\n Plotter[' Plot1'](lc)\n ),\n BoxRow(s, c, b,\n \+ Plotter['Plot2'](lc)\n )\n ), \n Slider ['VertView'](lower=0,background=\"#DDFFFF\",filled=true,majorticks=30, minorticks=10,orientation=vertical,snapticks=false,upper=360,value=45) \n ),\n BoxRow(s,c,b, \n Slider['HorView'](lowe r=0,background=\"#DDFFFF\",filled=true,majorticks=30,minorticks=10,ori entation=horizontal,snapticks=false,upper=360,value=225)\n )\n \+ ), \n BoxColumn(s, c, \n BoxRow(s,c,b, 'caption'=\"En ter a function\", \n Label(\"F(x,y) = \", 'font'='F1', c), \+ \n TextField['Func'](16, lc, 'value'=x^2 - y^2 + x*y, 'toolti p'=\"Enter a function\")\n ), \n BoxRow(s, c, b, 'captio n'=\"Domain and Range of z = F(x,y)\", \n Label(\"x, y\", 'f ont'='F1', c), \n Label(\" = \", 'font'='F1', c),\n \+ TextField['xLow'](2, lc, 'value'=-2), \n Label(\"..\", 'font' ='F1', c),\n TextField['xHigh'](2, lc, 'value'=2),\n \+ Label(\" z\", 'font'='F1', c), \n Label(\" = \", 'font'='F1 ', c),\n TextField['zLow'](2, lc, 'value'=-2),\n Lab el(\"..\", 'font'='F1', c),\n TextField['zHigh'](2, lc, 'valu e'=2) \n ),\n BoxRow(s, c, b, 'caption'=\"Coordinates:\" ,\n Label(\" x = \", 'font'='F1', c),\n TextField['x Const'](2, lc, 'value'=1), \n Label(\" y = \", 'font'='F1', c ),\n TextField['yConst'](2, lc, 'value'=-1)\n ),\n \+ BoxRow(s,c,\n RadioButton['whichPlane1'](\"Plot along the x axes\", c, 'value'=true, 'group'='planePlot'), \n RadioBut ton['whichPlane2'](\"Plot along the y axes\", c, 'value'=false, 'group '='planePlot')\n ),\n BoxRow('inset'=0, 'spacing'=0, c, \+ \n Button(\"Plot Partial Derivatives\", dc, 'tooltip'=\"Plot \+ Partial Derivatives\", 'onclick'='PlotFunction'\n ),\n \+ Button(\"Close\", Shutdown(), dc, 'tooltip'=\"Close\")\n ) \+ \n ) \n ) \n ),\n\n MenuBar['Menu'](\n Menu(\"File\",\n \+ MenuItem(\"Plot Partial Derivatives\", 'onclick'='PlotFunction'), \n MenuSeparator(),\n MenuItem(\"Close\", 'onclick'=Shutdown ())\n ), \n Menu(\"About\", \n MenuItem(\"Definition\", 'on click'=RunWindow('DefWin'))\n ), \n Menu(\"Help\", \n Menu Item(\"Help\", 'onclick'=RunWindow('HelpWin'))\n ) \n ),\n\n Acti on['PlotFunction'](\n Evaluate('Plot1'='DrawPartial(Func,whichPlane 1,xConst,yConst,xLow,xHigh,zLow,zHigh,VertView,HorView,1)'),\n Eval uate('Plot2'='DrawPartial(Func,whichPlane1,xConst,yConst,xLow,xHigh,zL ow,zHigh,VertView,HorView,0)')\n ),\n\n ButtonGroup['planePlot']()\n \n):\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "Maplets[Display] \+ (PartialDerivativesMaplet);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 1 0" 23 }{VIEWOPTS 1 1 0 3 4 1802 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }