(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 4.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 11808, 375]*) (*NotebookOutlinePosition[ 12519, 400]*) (* CellTagsIndexPosition[ 12475, 396]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ Cell[BoxData[{ StyleBox[\(MATH\ 257\ Calculus\ III\t\t\t\tWeek\ of\ May\ 19, \ 2003\), FontSize->14], "\n", StyleBox[\(Lab\ 8 : \ Surfing\ Surfaces\), "Title"], "\n", StyleBox[\(Name\ 1\), "Section"], "\n", StyleBox[\(Name\ 2\), "Section"], "\n", StyleBox[\(\(Section\)\(:\)\), "Section"]}], "Input"], "\n" }], "Text", FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1]], Cell[TextData[{ StyleBox["Make sure", "Text", FontWeight->"Bold"], StyleBox[" you execute all the commands in this lab as you read through it. \ Do this, or you will perish...", "Text"] }], "Text", FontSize->14], Cell[TextData[StyleBox["Graphing 3D Surfaces", FontWeight->"Bold", FontColor->RGBColor[0, 0, 1]]], "Subtitle"], Cell[TextData[{ "Graphing 3D surfaces in ", StyleBox["Mathematica", FontSlant->"Italic"], " is easy if you have a function of the form z=f(x,y). Just use the ", StyleBox["Plot3D[]", "Input"], " command, which works just like ", StyleBox["Plot[]", "Input"], " except you have to specify the x ", StyleBox["and", FontWeight->"Bold"], " y ranges.\n\nFor example, let's plot ", StyleBox["f[x,y]=Cos[x*y] - Sin[x*y]", FontWeight->"Bold"], ":" }], "Text", FontSize->14], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(Plot3D[ Cos[x*y] - Sin[x*y], \ {x, \ \(-4\), 4}, \ {y, \(-4\), 4}]\)\)\)], "Input"], Cell[TextData[{ "Cool, but notice how chunky the graph is. To make it finer, use the ", StyleBox["PlotPoints", "Input"], " option:\n" }], "Text", FontSize->14], Cell[BoxData[ \(Plot3D[Cos[x*y] - Sin[x*y], \ {x, \ \(-4\), 4}, \ {y, \(-4\), 4}, \ PlotPoints \[Rule] 40]\)], "Input"], Cell[TextData[{ "\nWe can also make ", StyleBox["traces", FontWeight->"Bold"], ", that is, slices through the x or y axes. The easiest way to do this is \ using the ", StyleBox["Table[] ", "Input"], "command. Here we make traces where we fix ", StyleBox["x=k", FontWeight->"Bold"], " for some constant k:" }], "Text", FontSize->14], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{\(\(Clear[f, x, y];\)\[IndentingNewLine]\(f[x_, y_] := \ Cos[x*y] - Sin[x*y];\)\[IndentingNewLine]\(xtraces = Table[f[k, y], \ {k, 0, 2}]\);\), " ", StyleBox[\( (*\ see\ how\ that\ works?\ we\ let\ x = k\ *) \), FontColor->RGBColor[0, 0, 1]], "\[IndentingNewLine]", \(Plot[ Evaluate[xtraces], \ {y, \ \(-3\), 3}]\)}]}]], "Input"], Cell[TextData[{ StyleBox["Question 1:", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], StyleBox[" In the above trace graph, which curve corresponds to the trace \ x=0, x=1, and x=2? You can answer this in a few sentances or make additional \ pictures to give your answer. ", FontColor->RGBColor[1, 0, 0]] }], "Text", FontSize->14], Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell["\<\ We can also do the y-traces. Notice that for this surface that are \ notably similar to the x-traces.\ \>", "Text", FontSize->14], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(\(ytraces = Table[f[x, k], \ {k, 0, 3}];\)\ \ \[IndentingNewLine] Plot[Evaluate[ytraces], \ {x, \ \(-3\), 3}]\)\)\)], "Input"], Cell[TextData[{ "To do the z-traces (slices through the z-axis, parallel to the xy-plane), \ we need to use the ", StyleBox["ContourPlot[]", "Input"], " command. If you don't like the resolution, use the ", StyleBox["PlotPoints", "Input"], " option again." }], "Text", FontSize->14], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(ztrace = ContourPlot[f[x, y], \ {x, \(-3\), 3}, \ {y, \(-3\), 3}]\)\)\)], "Input"], Cell["If you don't like the shading, you can get rid of it.", "Text", FontSize->14], Cell[BoxData[ \(ztrace = ContourPlot[f[x, y], \ {x, \(-3\), 3}, \ {y, \(-3\), 3}, \ PlotPoints \[Rule] 40, \ ContourShading \[Rule] False]\)], "Input"], Cell[TextData[{ StyleBox["Question 2:", FontWeight->"Bold"], " Notice how in the above contour plot the trace curves look like ... what? \ Hyperbolas? Get an equation for one of them using the ", StyleBox["Solve[]", "Input"], " command to solve f[x,y] = z when z=1. (Solve for either y or x.) Make a \ plot of the equation you get to see that it looks like one of the contours \ above." }], "Text", FontSize->14, FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[TextData[{ StyleBox["Question 3:", FontWeight->"Bold"], " For the following functions, make (i) a 3D plot, (ii) x- and y-traces, \ and (iii) a contour plot (z-trace). Be sure to ", StyleBox["LABEL", FontWeight->"Bold"], " your images so we can tell what they are!", "\n\t(a) ", StyleBox["z = Sin[x+y] + Cos[x-y]\t\n\t ", "Input"], "(b) ", StyleBox["z = 20 ", "Input"], StyleBox[Cell[BoxData[ \(TraditionalForm\`\[ExponentialE]\^\(-\(\(x\^2\ + \ y\^2\)\/3\)\)\)], "Input"], "Input"], StyleBox[" ", "Input"], "(make sure you get the whole thing!)" }], "Text", FontSize->14, FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[TextData[StyleBox["Spherical Surfaces", FontWeight->"Bold", FontColor->RGBColor[0, 0, 1]]], "Subtitle"], Cell[TextData[{ "Graphing surfaces made by equations in spherical coordinates takes a \ little bit of prep-work. ", StyleBox["Mathematica", FontSlant->"Italic"], " doesn't just do it all for you. It helps a lot if we define a function \ to ", StyleBox["convert from spherical to rectangular", FontWeight->"Bold"], " coordinates. ", StyleBox["DO THIS COMMAND:", FontWeight->"Bold"] }], "Text", FontSize->14], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(sphrToRect[{\[Rho]_, \ \[Theta]_, \ \ \[Phi]_}] = {\[Rho]*Sin[\[Phi]]*Cos[\[Theta]], \ \[Rho]*Sin[\[Phi]] Sin[\[Theta]], \ \[Rho]*Cos[\[Phi]]}\)\)\)], "Input"], Cell["\<\ This takes a point in spherical coordinates (\[Rho], \[Theta], \ \[Phi]) and converts it to regular (x, y, z), like God intended! Test it out: \ \>", "Text", FontSize->14], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(sphrToRect[{1, \ \[Pi]/6, \ \[Pi]/ 3}]\)\)\)], "Input"], Cell[TextData[{ "We can use this command to graph equations in spherical coordinates. \n\n\ ", StyleBox["Example: ", FontWeight->"Bold"], " Suppose we wanted to graph the equation ", StyleBox["\[Rho] = 3", FontWeight->"Bold"], ", which should be a sphere of radius 1. Just set \[Rho] = 3 and let \ \[Theta] and \[Phi] range over some values: 0 \[LessEqual] \[Theta] \ \[LessEqual] 2\[Pi] and 0 \[LessEqual] \[Phi] \[LessEqual] \[Pi]: We need \ to use the ", StyleBox["ParametricPlot3D", "Input"], " command to do this, however:", "\n" }], "Text", FontSize->14], Cell[BoxData[ \(ParametricPlot3D[ sphrToRect[{3, \[Theta], \[Phi]}], \ {\[Theta], \ 0, \ 2 \[Pi]}, \ {\[Phi], \ 0, \ \[Pi]}]\)], "Input"], Cell["\<\ But what happens if we change the range of, say, \[Theta]? Let's \ find out:\ \>", "Text", FontSize->14], Cell[BoxData[ \(\(\(\[IndentingNewLine]\)\(ParametricPlot3D[ sphrToRect[{3, \[Theta], \[Phi]}], \ {\[Theta], \ 0, \ 7 \[Pi]/4}, \ {\[Phi], \ 0, \ \[Pi]}]\)\)\)], "Input"], Cell[TextData[{ StyleBox["Question 4a:", FontWeight->"Bold"], " Make a good picture that shows what the spherical equation ", StyleBox["\[Rho] = 2 \[Theta]", "Input", FontWeight->"Bold"], StyleBox[" ", FontWeight->"Bold"], " looks like. ", StyleBox["Tip:", FontWeight->"Bold"], " you have to make \[Theta] range to some higher values, like 0 \ \[LessEqual] \[Theta] \[LessEqual] 10 or something. Also, you won't be able \ to see all the cool stuff going on inside unless you change the range of \ \[Phi] as well. (Like, 1 \[LessEqual] \[Phi] \[LessEqual] \[Pi] or \ something like that.) Make sure your picture displays this. ", StyleBox["Then", FontWeight->"Bold"], " describe what this surface is like in a sentance or two.\n" }], "Text", FontSize->14, FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[TextData[{ StyleBox["Question 4b:", FontWeight->"Bold"], " Do the same thing for ", StyleBox["\[Rho] = 1 + Sin[\[Phi]]", "Input", FontWeight->"Bold"], ". (Make a picture that shows what this surface does, and describe it in \ ", StyleBox["words", FontWeight->"Bold"], " as well.) Make sure to try some negative values of \[Phi] and see what's \ going on inside.", "\n" }], "Text", FontSize->14, FontColor->RGBColor[1, 0, 0]], Cell[BoxData[ \(\[IndentingNewLine]\)], "Input"], Cell[TextData[{ StyleBox["Now that you're done, ", FontSize->18], "\n\t(1) \t", StyleBox["Clean up your work", FontWeight->"Bold"], " by deleting everything that's not needed. \n\t\tThere should only be the \ title, your names, section number, and the questions and your answers\n\t\t\ (with any needed explanations, graphs, etc.).\n\t(2) \tSave this to your \ disk.\n\t(3)\tGo back to Blackboard and upload your final lab report to the \ ", StyleBox["Digital Drop Box", FontWeight->"Bold"], ", located\n\t\tin the ", StyleBox["User Tools", FontWeight->"Bold"], " area. Remember that you have to first ", StyleBox["ADD", FontWeight->"Bold"], " your file to your digital drop box and \n\t\tthen ", StyleBox["SEND it to me!\n\t\t\n", FontWeight->"Bold"], StyleBox["Note:", FontSize->72, FontWeight->"Bold", FontColor->RGBColor[0, 0, 1]], StyleBox[" these graphic images can get BIG. Make sure you DELETE any \ images that you do not need for your answers. This will reduce the chances \ of something going wrong when you upload it to Blackboard.", FontSize->16, FontWeight->"Bold"] }], "Text", CellFrame->{{0, 0}, {0, 2}}, FontSize->12] }, FrontEndVersion->"4.2 for Macintosh", ScreenRectangle->{{0, 750}, {0, 578}}, AutoGeneratedPackage->None, WindowToolbars->"EditBar", CellGrouping->Manual, WindowSize->{677, 526}, WindowMargins->{{1, Automatic}, {Automatic, 1}} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1754, 51, 472, 15, 161, "Text"], Cell[2229, 68, 222, 6, 34, "Text"], Cell[2454, 76, 114, 2, 66, "Subtitle"], Cell[2571, 80, 501, 16, 94, "Text"], Cell[3075, 98, 145, 3, 43, "Input"], Cell[3223, 103, 168, 5, 54, "Text"], Cell[3394, 110, 130, 2, 27, "Input"], Cell[3527, 114, 357, 12, 74, "Text"], Cell[3887, 128, 465, 8, 91, "Input"], Cell[4355, 138, 354, 9, 54, "Text"], Cell[4712, 149, 52, 1, 43, "Input"], Cell[4767, 152, 142, 4, 34, "Text"], Cell[4912, 158, 186, 3, 59, "Input"], Cell[5101, 163, 295, 8, 54, "Text"], Cell[5399, 173, 136, 2, 43, "Input"], Cell[5538, 177, 85, 1, 34, "Text"], Cell[5626, 180, 171, 3, 43, "Input"], Cell[5800, 185, 462, 11, 74, "Text"], Cell[6265, 198, 52, 1, 43, "Input"], Cell[6320, 201, 657, 19, 101, "Text"], Cell[6980, 222, 52, 1, 43, "Input"], Cell[7035, 225, 112, 2, 66, "Subtitle"], Cell[7150, 229, 435, 13, 74, "Text"], Cell[7588, 244, 217, 3, 43, "Input"], Cell[7808, 249, 183, 5, 54, "Text"], Cell[7994, 256, 112, 2, 43, "Input"], Cell[8109, 260, 593, 16, 134, "Text"], Cell[8705, 278, 157, 3, 27, "Input"], Cell[8865, 283, 117, 4, 34, "Text"], Cell[8985, 289, 190, 3, 43, "Input"], Cell[9178, 294, 835, 21, 114, "Text"], Cell[10016, 317, 52, 1, 43, "Input"], Cell[10071, 320, 462, 15, 74, "Text"], Cell[10536, 337, 52, 1, 43, "Input"], Cell[10591, 340, 1213, 33, 308, "Text"] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)