(************** Content-type: application/mathematica ************** 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[ 28773, 867]*) (*NotebookOutlinePosition[ 29529, 893]*) (* CellTagsIndexPosition[ 29485, 889]*) (*WindowFrame->Normal*) Notebook[{ Cell["Lab 2: Contour Plots and Animations", "Title", Background->RGBColor[0, 0, 1]], Cell["Math 233\tFall 2003", "Subtitle"], Cell[CellGroupData[{ Cell["\<\ Initialization Cells \ \>", "Subsubsection"], Cell[BoxData[{ \( (*\(:\)\(Title : \ Surface - to - Contour\ Map\ Animation\)\ *) \n\n (*\(:\)\(Context : \ Graphics`ContourAnimate`\)\ *) \n\n (*\(:\)\(Author : \ Bradford\ J . \ Kline\)\ *) \n\n (*\(:\)\(Mathematica\ \(Version : \ 3.0\)\)\ *) \n\n (*\(:\)\(Package\ \(Version : \ 1.1\)\)\ *) \n\n (*\(\(:\)\(History : \n\t V1 .0\ by\ B . \ Kline\)\), \ March\ 1999. \ \ \n\tV1 .1\ by\ B . \ Kline, \ June\ 1999. \ \[IndentingNewLine]\ \ V1 .2\ by\ M . \ Parker, \ August\ 2003\ *) \n\n (*\ Last\ \(Revision : \ \ August\ 2003\)\ *) \n\n\(Off[ General::"\"];\)\), "\n", \(\(\(Off[General::"\"];\)\(\n\) \)\), "\n", \(\(\(BeginPackage["\"];\)\(\n\) \)\), "\n", \(\(\(Needs["\"]\)\(\n\) \)\), "\n", \(\(\(ContourAnimate::usage = "\";\)\(\n\) \)\t\t\), "\n", \(\(\(Begin["\<`Private`\>"];\)\(\n\) \)\), "\n", \(\(\(ContourAnimate[f_, \ {x_, x0_, x1_}, \ {y_, y0_, y1_}, numberofframes_Integer, \ opts___] := \n\t Module[{contours, surface, contours3d, g, a, val, pts, originalview, targetview, plotrange, fullrange, t}, \n contours = ContourPlot[f, {x, x0, x1}, {y, y0, y1}, ContourShading -> False, DisplayFunction -> Identity, Evaluate[FilterOptions[ContourPlot, opts]]]; \n surface = Plot3D[f, {x, x0, x1}, {y, y0, y1}, \ DisplayFunction -> Identity, Evaluate[FilterOptions[Plot3D, opts]], Mesh -> False]; \n plotrange = FullOptions[surface, PlotRange]; \n fullrange = {plotrange[\([1]\)], plotrange[\([2]\)], 1/2 {plotrange[\([3, 1]\)] - Abs[plotrange[\([3, 1]\)]], plotrange[\([3, 2]\)] + Abs[plotrange[\([3, 2]\)]]}}; \n Do[\n\tClear[g]; \ng\ = \ Function[{x, y}, a*f]; \n\t contours3d = \(Graphics[contours]\)[\([1]\)] /. Line[pts_] :> \((val = Apply[g, First[pts]]; Line[Map[Append[#, val] &, pts]])\); \n Show[Graphics3D[contours3d], surface, DisplayFunction -> $DisplayFunction, FilterOptions[Graphics3D, opts], \n\t\t\tPlotRange -> fullrange], {a, 1, 0, N[\(-1\)/\((numberofframes)\)]}]; \n originalview = FullOptions[surface, ViewPoint]; \n targetview\ = \ {0, 3, 30}; \n\t\tDo[\n\t\t\tShow[ Graphics3D[contours3d], DisplayFunction -> $DisplayFunction, ViewPoint -> \((\((1 - t)\)*originalview + \((t)\)*targetview)\), FilterOptions[Graphics3D, opts], PlotRange -> fullrange], {t, 0, 1, .1}]\n\t\t\t\t]\)\(\n\) \)\), "\n", \(\(\(ContourAnimate[f_, \ xRange_List, \ yRange_List, \ opts___Rule] := ContourAnimate[f, \ xRange, \ yRange, \ 10, \ opts]\)\(\n\) \)\), "\n", \(\(\(End[\ ];\)\(\n\) \)\), "\n", \(EndPackage[\ ]\)}], "Input", InitializationCell->True], Cell[BoxData[ \(CPLabel[f_, xlimit_, \ ylimit_, \ xclabl_, \ yclabl_, \ opts___] := \n\t CompoundExpression[\ Clear[p1c, p1t], \n\t\tp1c = ContourPlot[f, xlimit, ylimit, opts, ContourShading -> False, DisplayFunction -> Identity], \ p1t = Table[Text[N[f, 2], {xlimit[\([1]\)], ylimit[\([1]\)]}], xclabl, yclabl], \n\t\tShow[{p1c, Graphics[p1t]}, \ DisplayFunction -> $DisplayFunction]]\)], "Input", InitializationCell->True] }, Closed]], Cell[TextData[{ "The initialization cells in this notebook define the commands ", StyleBox["ContourAnimate ", FontWeight->"Bold"], "and ", StyleBox["CPLabel", FontWeight->"Bold"], ". The ", StyleBox["ContourAnimate", FontWeight->"Bold"], " command allows us to illustrate the relationship between horizontal \ traces of the surface z = f[x,y] and the contour diagram of the function \ f[x,y]. The command generates a sequence of plots showing the traces \ migrating from the surface to the xy-plane. The ", StyleBox["CPLabel ", FontWeight->"Bold"], "command is a modification of ", StyleBox["Mathematica", FontSlant->"Italic"], "'s built-in ", StyleBox["ContourPlot", FontWeight->"Bold"], " command. The main enhancement is that ", StyleBox["CPLabel", FontWeight->"Bold"], " allows us to print z-values on the contour diagram.\nYou ", StyleBox["do not need", FontWeight->"Bold"], " to directly execute these cells (in fact, strange things sometimes happen \ in ", StyleBox["Mathematica", FontSlant->"Italic"], " if you do!). Drop down to ", StyleBox["Part I", FontWeight->"Bold"], " and begin there! Happy Trails..." }], "Text"], Cell[CellGroupData[{ Cell[TextData[StyleBox["Instructions!", FontColor->RGBColor[1, 0, 0]]], "Section"], Cell[TextData[{ "Work in ", StyleBox["pairs", FontWeight->"Bold"], " today, going through the entire notebook. Make sure that you answer ", StyleBox["all ", FontWeight->"Bold"], "questions posed. On the ", StyleBox["You Try It", FontWeight->"Bold"], ", insert your own NEW values or functions. This lab is mainly so that you \ get some experience learning to use ", StyleBox["Mathematica", FontSlant->"Italic"], " to explore multivariable functions, their graphs, and their contour \ diagrams. Take your time going through it; this is an opportunity to learn a \ little about what functions of various forms look like... I'll have you hand \ in a group report on the lab that will be ", StyleBox["due on Tuesday (9 Sept)", FontWeight->"Bold"], ". \n\n", StyleBox["Group Report:", FontWeight->"Bold"], "\n", StyleBox["The heart of the report should be a summary of your observations \ - you may cut and paste from ", FontWeight->"Bold"], StyleBox["Mathematica", FontWeight->"Bold", FontSlant->"Italic"], StyleBox[" to help clarify your explanations. Since this will be a new \ experience for most of you, I've included a number of questions in this lab \ to give you an idea of what type of analysis and reflection I'm looking for \ on ", FontWeight->"Bold"], StyleBox["future", FontWeight->"Bold", FontVariations->{"Underline"->True}], StyleBox[" labs. So, for this lab, you should answer the questions I've \ given you and then use your experiences in the ", FontWeight->"Bold"], StyleBox["You Try It", FontWeight->"Bold", FontVariations->{"Underline"->True}], StyleBox[" sections (along with the questions you answered from the \ previous section) to write a write a summary of your observations. Bottom \ Line: I don't want just a few words written. Reflect on what you have seen \ in each section.\n\n", FontWeight->"Bold"], "The easiest way to create a group report is to open up a Word document \ while doing the lab. When you come to a question, you can highlight the text \ and copy and paste it into the Word document. Your group can then type your \ answers into the Word document. If you want to use a graph in your report to \ help clarify an idea or to answer a question, you can click on the graph (so \ that it is surrounded by a box) and then copy and paste it into the Word \ document. Once you've finished the You Try It section, go back to your \ report and write a summary of your experiences - this summary can either go \ in front of or behind the questions you've already answered. \n\nIn addition \ to the formal write-up for this lab, you will need to send me a ", StyleBox["Mathematica", FontSlant->"Italic"], " notebook containing your function from Part III.\n" }], "Subsubtitle"] }, Closed]], Cell[CellGroupData[{ Cell["Introduction", "Section"], Cell[TextData[{ "OBJECTIVE: Work on visualizing and graphing functions of 2 variables and \ to understand the information that you are seeing when you look at a contour \ diagram of a 3-D surface. \nBy the end of today, you should have a ", StyleBox["working knowledge", FontWeight->"Bold"], " of the ", StyleBox["Mathematica", FontSlant->"Italic"], " (and supplemental) commands ", StyleBox["ContourPlot", FontWeight->"Bold"], ", ", StyleBox["ContourAnimate", FontWeight->"Bold"], ", ", StyleBox["ShadowPlot", FontWeight->"Bold"], ", and ", StyleBox["CPLabel", FontWeight->"Bold"], ". " }], "Text"], Cell[CellGroupData[{ Cell["Technology Guidelines", "Subsection", CellDingbat->"\[LightBulb]"], Cell[TextData[{ StyleBox["NOTE: If you have just finished a module, restart ", CellFrame->True, Background->None], StyleBox["Mathematica", CellFrame->True, FontSlant->"Italic", Background->None], StyleBox[" before executing a new module.\nTO OPEN CELLS, put your cursor \ on the right cell bracket and double click.", CellFrame->True, Background->None], "\nTO STOP AN EXECUTION\n\tSelect the ", StyleBox["Kernel", FontSlant->"Italic"], " pull-down menu and click on ", StyleBox["Abort Evaluation.\n", FontSlant->"Italic"], "ORDER OF EXECUTION\n\tExecute cells in the order given. Do not skip any \ Input cells within a given notebook.\nSAVING NOTEBOOKS\n\tYou can save \ anytime to any directory you choose, and it is wise to save often.\n\t\ However, before you do your final save, delete all your output by selecting \ the \n\t ", StyleBox["Delete All Output", FontSlant->"Italic"], " selection under the ", StyleBox["Kernel", FontSlant->"Italic"], " pull-down menu.\nEXPERIENCING MAJOR PROBLEMS\n\tSave if appropriate, and \ then shut down ", StyleBox["Mathematica", FontSlant->"Italic"], " and start it up again." }], "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Part I: The Commands... (or ", StyleBox["Also Sprach Stephen Wolfram", FontSlant->"Italic"], ")" }], "Section"], Cell[CellGroupData[{ Cell["ContourAnimate", "Subsubsection"], Cell["\<\ Evaluate the following for a brief description of the syntax for \ ContourAnimate:\ \>", "Text"], Cell[TextData[{ "Note: When you execute this cell, you'll be asked if you want to execute \ the initialization cells - ", StyleBox["SAY YES!", FontWeight->"Bold"] }], "Text", FontSize->12, FontColor->RGBColor[0, 0, 1]], Cell[BoxData[ \(\(?ContourAnimate\)\)], "Input"], Cell[TextData[{ "ContourAnimate basically accepts the same arguments as the standard ", StyleBox["Mathematica", FontSlant->"Italic"], " function Plot3D. As an example, let's look at one of the functions from \ yesterday:" }], "Text"], Cell[TextData[{ "Remember: ", StyleBox["Double click", FontWeight->"Bold"], " on one of the graphs to ", StyleBox["animate", FontWeight->"Bold"], " the sequence." }], "Text", FontSize->12, FontColor->RGBColor[0, 0, 1]], Cell[BoxData[{ \(f[x_, y_] = x^2 + y^2\), "\[IndentingNewLine]", \(\(ContourAnimate[f[x, y], {x, \(-5\), 5}, {y, \(-5\), 5}, 10];\)\)}], "Input"], Cell[TextData[{ StyleBox["ContourAnimate", FontWeight->"Bold"], " accepts an optional parameter following the second range. This parameter \ specifies the number of frames before the contours reach the xy-plane. The \ default number of frames is 10. Here is an example with 4 frames:" }], "Text"], Cell[BoxData[ \(\(ContourAnimate[f[x, y], {x, \(-5\), 5}, {y, \(-5\), 5}, 4];\)\)], "Input"], Cell["\<\ We may enter the same options that Plot3D permits, including a change of \ ViewPoint and PlotRange.\ \>", "Text"], Cell[BoxData[ \(\(\(\ \)\(ContourAnimate[f[x, y], {x, \(-5\), 5}, {y, \(-5\), 5}, 20, ViewPoint -> {0.568, \ \(-1.288\), \ \(-1.495\)}, PlotRange -> {0, 25}, ClipFill -> None];\)\)\)], "Input"], Cell["\<\ Here is a simulated mountain scene. You can use the ContourAnimate command \ to demonstrate the relationship between the earth's terrain and the \ corresponding topographic map.\ \>", "Text"], Cell[BoxData[ \(\(ContourAnimate[ Sin[x]\ Sin[y]\ - 5, {x, \(-2\) Pi, 2 Pi}, {y, \(-2\) Pi, 2 Pi}, 15, PlotPoints -> 30];\)\)], "Input", AnimationDisplayTime->0.2197] }, Closed]], Cell[CellGroupData[{ Cell["Shadow Plots", "Subsubsection"], Cell[TextData[{ "Shadow Plots are an interesting way to see both an elevation and contour \ at the same time. \nIn order to use ", StyleBox["ShadowPlot", FontWeight->"Bold"], ", we must first load this package", "." }], "Text", Evaluatable->False], Cell["\<\ Needs[\"Graphics`Graphics3D`\"] ?ShadowPlot3D\ \>", "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell["OK... Here goes:", "Text"], Cell["\<\ ShadowPlot3D[f[x,y],{x,-2,2},{y,-2,2}, \tShadowPosition->1, \tShadowMesh->False, \tPlotPoints->20, \tViewPoint->{1.420,-2.776,1.315}];\ \>", "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[TextData[StyleBox["Question 1:\t On the ShadowPlot above, which hues \ correspond to lower elevations? to higher elevations?", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]] }, Closed]], Cell[CellGroupData[{ Cell["Contour Plot", "Subsubsection"], Cell[TextData[{ "The generic ", StyleBox["Mathematica", FontSlant->"Italic"], " ", StyleBox["ContourPlot ", FontWeight->"Bold"], "command gives us the cool contour diagrams that we are used to seeing. We \ can either have ", StyleBox["colorful contours", FontWeight->"Bold"], ":" }], "Text", Evaluatable->False], Cell["\<\ ContourPlot[f[x,y],{x,-5,5},{y,-5,5}, \tColorFunction->Hue,Axes->True,AxesLabel->{x,y}];\ \>", "Input", PageWidth->Infinity, FontFamily->"Courier New", FontSize->12, FontWeight->"Bold", FontColor->GrayLevel[0], Background->GrayLevel[1]], Cell[TextData[StyleBox["Question 2:\t Do the hues have the same meaning with \ ContourPlot as they did with ShadowPlot above?", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell["\<\ If this is too bright for you, you can tone things down a bit to grayscale:\ \>", "Text"], Cell[BoxData[ \(\(ContourPlot[f[x, y], {x, \(-5\), 5}, {y, \(-5\), 5}, PlotPoints \[Rule] 40, Axes -> True, AxesLabel -> {x, y}];\)\)], "Input"], Cell["\<\ this can be kind of funky to read... let's see what happens if we turn on the \ lights:\ \>", "Text"], Cell[BoxData[ \(\(ContourPlot[f[x, y], {x, \(-5\), 5}, {y, \(-5\), 5}, ContourShading \[Rule] False, PlotPoints \[Rule] 40, Axes -> True, AxesLabel -> {x, y}];\)\)], "Input"], Cell[TextData[StyleBox["Question 3:\t What is the difference between the two \ plots above, and what does light to dark signify in the first plot?", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[TextData[{ "You may be thinking... \"Dr. Parker, why would you ever want a contour \ diagram that only gave you level curves and ", StyleBox["no information about elevations", FontWeight->"Bold"], "?\". And a clever question it would be, indeed. One thing that you ", StyleBox["can", FontWeight->"Bold"], " easily read from an uncluttered contour plot is the ", StyleBox["spacing between contours", FontWeight->"Bold"], ", which gives you some idea about the shape of the function.\nAs an \ example, compare the graph above with the one below:", " " }], "Text"], Cell[BoxData[ \(\(ContourPlot[Sqrt[x^2 + y^2], {x, \(-5\), 5}, {y, \(-5\), 5}, ContourShading \[Rule] False, PlotPoints \[Rule] 40, Axes -> True, AxesLabel -> {x, y}];\)\)], "Input"], Cell[TextData[{ "Just when you thought you could make it through the entire lab without \ engaging your brain... here comes a question that you (hopefully) must stop \ and ponder. \n[if you ", StyleBox["don't", FontWeight->"Bold"], " stop to ponder", ", then what are you doing the first Saturday in December? I've got this \ cool little North American math competition that I'd like to talk to you \ about...]" }], "Text"], Cell[TextData[StyleBox["Question 4:\t What is the difference between the two \ plots above, and what does this tell you about the shapes of the surfaces of \ the two functions?", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]] }, Closed]], Cell[CellGroupData[{ Cell["CPLabel", "Subsubsection"], Cell[TextData[{ "Since it can be quite annoying to try to determine if a function is \ increasing or decreasing by looking ", StyleBox["only", FontWeight->"Bold"], " at a contour diagram from ", StyleBox["ContourPlot", FontWeight->"Bold"], ", a new command ", StyleBox["CPLabel", FontWeight->"Bold"], " is given here that overlays a matrix of elevations on the x-y grid of a \ contour plot. The command is pretty easy to use and accepts all options of \ the ", StyleBox["ContourPlot", FontWeight->"Bold"], " command. Here are the parameters for the command:\n", StyleBox["CPLabel[function[x, y], {x, xmin, xmax}, {y, ymin, ymax}, {x, \ minimum x-label value, maximum x-label value, increment in x}, {y, minimum \ y-label value, maximum y-label value, increment in y}, ", FontWeight->"Bold"], StyleBox["options", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["] ", FontWeight->"Bold"], StyleBox[" \n", FontWeight->"Bold", FontSlant->"Italic"], "Compare this to the ", StyleBox["ContourPlot ", FontWeight->"Bold"], "command:\n", StyleBox["ContourPlot[function[[x,y], ", FontWeight->"Bold"], StyleBox["{x, xmin, xmax}, {y, ymin, ymax},", FontWeight->"Bold"], StyleBox[" ", FontWeight->"Bold"], StyleBox["options", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["]\n", FontWeight->"Bold"], "So, the only difference is this ", StyleBox["{x, minimum x-label value, maximum x-label value, increment in \ x}, {y, minimum y-label value, maximum y-label value, increment in y}", FontWeight->"Bold"], " stuff.\nHere is the translation: on the x-y grid laid out, as you move \ across a row (parallel to the x-axis) print an elevation at the ", StyleBox["minimum x-label value", FontWeight->"Bold"], ", the ", StyleBox["maximum x-label value", FontWeight->"Bold"], ", and at a spacing of ", StyleBox["increment in x", FontWeight->"Bold"], " value in between. For instance ", StyleBox["{x, 0, 10, 2} ", FontWeight->"Bold"], "would have the effect of printing elevations for x=0, x=2, x=4, x=6, x=8, \ and x=10. You control the vertical spacing of elevations with the ", StyleBox["minimum y-label value, maximum y-label value, increment in y", FontWeight->"Bold"], " stuff (in exactly the same way).\n\nBut what the heck, reading about \ something is way more confusing than actually trying it. so go for it:" }], "Text", Evaluatable->False], Cell[BoxData[ \(\(CPLabel[ f[x, y], {x, \(-5\), 5}, {y, \(-5\), 5}, {x, \(-5\), 5, 1}, {y, \(-5\), 5, 1}, Axes -> True, AxesLabel -> {"\", "\"}];\)\)], "Input"], Cell["\<\ cool. The command is much like a C compiler... it will let you do almost \ anything you want, no matter how silly. Look what happens when we are greedy \ and want to much:\ \>", "Text"], Cell[BoxData[ \(\(CPLabel[ f[x, y], {x, \(-5\), 5}, {y, \(-5\), 5}, {x, \(-5\), 5, 0.25}, {y, \(-5\), 5, 0.25}, Axes -> True, AxesLabel -> {"\", "\"}];\)\)], "Input"], Cell["\<\ If you can read this, I'm in trouble with that 8.5\" x 11\" note sheet for \ exam 1...\ \>", "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Part II: The Graphs... (or ", StyleBox["Ghosts of Classes Past", FontSlant->"Italic"], ")" }], "Section"], Cell[TextData[{ "So... No one wanted to graph f[x,y] = ", Cell[BoxData[ \(TraditionalForm\`x\^2 - \ y\^2\)]], "yesterday (yes, it is officially past midnight as I write this, so I am no \ longer looking to the future), so now you have your chance.", "\n", "Recall (indeed, that which we gloss over in class ", StyleBox["does", FontWeight->"Bold"], " actually come back again, so perhaps we should just settle down and deal \ with it in a more collective manner...) Hmmm... Recall that we were \ calculating level curves for this function manually yesterday. Here is how \ ", StyleBox["Mathematica", FontSlant->"Italic"], " would do such a thing for us:\nLevel curve for z=0:" }], "Text"], Cell[BoxData[ \(Solve[x^2 - y^2 \[Equal] 0, {y, x}]\)], "Input"], Cell["\<\ so the lines y=x and y=-x are the level curves for z=0 (don't get too \ stressed about the warning message that popped up in red here). So we can graph them:\ \>", "Text"], Cell[BoxData[ \(\(z0 = Plot[{x, \(-x\)}, {x, \(-5\), 5}, AxesLabel \[Rule] {x, y}];\)\)], "Input"], Cell["\<\ cool... this is fun! But... Hey... Dr. P, aren't you getting a little \ carried away? I mean, we have all those commands from up above that will do \ this a whole lot faster. Patience, grasshopper, you must observe the inner workings before completely \ understanding the external... Observe once more - the contour for z=4:\ \>", "Text"], Cell[BoxData[ \(Solve[x^2 - y^2 \[Equal] 4, {y, x}]\)], "Input"], Cell["and plotting it:", "Text"], Cell[BoxData[ \(\(z4 = Plot[{\(-\@\(\(-4\) + x\^2\)\), \@\(\(-4\) + x\^2\)}, {x, \(-5\), 5}, AxesLabel \[Rule] {x, y}];\)\)], "Input"], Cell["... and combining the plots:", "Text"], Cell[BoxData[ \(\(Show[z0, z4];\)\)], "Input"], Cell["\<\ Ok... so we got here in class... (finally). But what about the area along \ the y-axis? Are there any level curves there?\ \>", "Text"], Cell[TextData[{ StyleBox["Question 5:\tHow do we get level curves that parabolic around the \ y-axis? What elevations do they correspond to? Are they ", FontWeight->"Bold"], StyleBox["really", FontWeight->"Bold", FontVariations->{"Underline"->True}], StyleBox[" complex numbers? Go Forth, Find Them, and Graph Them...", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell["now... put it all together!", "Text"], Cell[TextData[{ StyleBox["Question 6:\tUsing The Commands (and perhaps Plot3D from last \ week), describe the surface f[x,y] = ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`x\^2 - y\^2\)]], StyleBox["? ", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell[TextData[StyleBox["Question 7:\tWhat do you think the contours of a \ linear function would look like - what shape will level curves have? How \ will they be spaced? Test out your hypothesis by graphing a linear function. \ ", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Part III: Spot has Fun With 3D Surfaces! (or ", StyleBox["Stump Your Classmates", FontColor->RGBColor[0, 0, 1]], ")" }], "Section"], Cell[TextData[{ StyleBox["Your task is to submit a ", FontColor->RGBColor[1, 0, 0]], StyleBox["Mathematica", FontSlant->"Italic", FontColor->RGBColor[1, 0, 0]], StyleBox[" notebook showing a function, its surface plot and its contour \ plot. Try to select a function that will stump your classmates - several of \ the best problems will be put on your first exam - the format will be to \ match the functions, surfaces, and level curves. Once you are happy with the \ function, copy and paste these cells into a ", FontColor->RGBColor[1, 0, 0]], StyleBox["new", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[1, 0, 0]], StyleBox["Mathematica", FontSlant->"Italic", FontColor->RGBColor[1, 0, 0]], StyleBox[" notebook and ", FontColor->RGBColor[1, 0, 0]], StyleBox["email", FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], StyleBox[" it to me at mparker@carroll.edu.", FontColor->RGBColor[1, 0, 0]] }], "Text"], Cell[TextData[{ "Just put in your own functions and bounds for the items in red. Be sure to \ use correct notation. You can select any viewpoint you wish for the ", StyleBox["Show", FontWeight->"Bold"], " command." }], "Text"], Cell[BoxData[{\(Clear[x, y, z, f]\), "\n", RowBox[{\(f[x_, y_]\), "=", StyleBox[\(Exp[\(-\((x\^2 + y\^2)\)\)/ 8] \((\((Cos[x])\)\^2 + \((Sin[y])\)\^2)\)\), FontColor->RGBColor[1, 0, 0]]}], "\n", RowBox[{ RowBox[{"xmin", "=", StyleBox[\(-5\), FontColor->RGBColor[1, 0, 0]]}], ";"}], "\n", RowBox[{ RowBox[{"xmax", "=", StyleBox[\(+5\), FontColor->RGBColor[1, 0, 0]]}], ";"}], "\n", RowBox[{ RowBox[{"ymin", "=", StyleBox[\(-\[Pi]\), FontColor->RGBColor[1, 0, 0]]}], ";"}], "\n", RowBox[{ RowBox[{"ymax", "=", StyleBox[\(+\[Pi]\), FontColor->RGBColor[1, 0, 0]]}], ";"}], "\n", \(pict = Plot3D[f[x, y], {x, xmin, xmax}, {y, ymin, ymax}, PlotPoints \[Rule] 40, AxesLabel -> {x, y, z}];\), "\n", RowBox[{ RowBox[{"Show", "[", RowBox[{"pict", ",", RowBox[{"ViewPoint", "\[Rule]", RowBox[{"{", StyleBox[\(0, \(-2\), 0\), FontColor->RGBColor[1, 0, 0]], "}"}]}]}], "]"}], ";"}]}], "Input"], Cell[BoxData[ \(\(ContourPlot[f[x, y], {x, xmin, xmax}, {y, ymin, ymax}, ContourShading \[Rule] False, PlotPoints \[Rule] 40, Axes -> True, AxesLabel -> {x, y}];\)\)], "Input"], Cell["\<\ To get you started, here are some cool (and not-so-cool) functions that you \ might want to play around with ... collect them, observe them, combine them, \ trade them with friends! (just don't send me one of these!)\ \>", "Text"], Cell[BoxData[ \(f[x_, y_] = Cos[x]\ Cos[y]\ Exp[\(-Sqrt[x^2 + y^2]\)/4]\)], "Input"], Cell[BoxData[ \(f[x_, y_] = Sin[x]\)], "Input"], Cell[BoxData[ \(f[x_, y_] = x\ y\)], "Input"], Cell[BoxData[ \(f[x_, y_] = 1 - 2 x\ - y\)], "Input"], Cell[BoxData[ \(f[x_, y_] = x^2 + 4 y^2\)], "Input"], Cell[BoxData[ \(f[x_, y_] = Exp[\(-\((x^2\ + \ y^2)\)\)]\)], "Input"] }, Closed]] }, FrontEndVersion->"4.1 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 678}}, AutoGeneratedPackage->None, WindowToolbars->"EditBar", CellGrouping->Manual, WindowSize->{1016, 646}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, StyleDefinitions -> "DemoText.nb" ] (******************************************************************* 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[1705, 50, 86, 1, 70, "Title"], Cell[1794, 53, 39, 0, 41, "Subtitle"], Cell[CellGroupData[{ Cell[1858, 57, 54, 3, 71, "Subsubsection"], Cell[1915, 62, 3429, 65, 1160, "Input", InitializationCell->True], Cell[5347, 129, 502, 9, 120, "Input", InitializationCell->True] }, Closed]], Cell[5864, 141, 1216, 36, 116, "Text"], Cell[CellGroupData[{ Cell[7105, 181, 84, 1, 54, "Section"], Cell[7192, 184, 2835, 62, 400, "Subsubtitle"] }, Closed]], Cell[CellGroupData[{ Cell[10064, 251, 31, 0, 34, "Section"], Cell[10098, 253, 651, 22, 79, "Text"], Cell[CellGroupData[{ Cell[10774, 279, 74, 1, 44, "Subsection"], Cell[10851, 282, 1206, 33, 370, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[12106, 321, 139, 5, 34, "Section"], Cell[CellGroupData[{ Cell[12270, 330, 39, 0, 44, "Subsubsection"], Cell[12312, 332, 106, 3, 29, "Text"], Cell[12421, 337, 230, 7, 29, "Text"], Cell[12654, 346, 52, 1, 40, "Input"], Cell[12709, 349, 244, 6, 29, "Text"], Cell[12956, 357, 240, 10, 29, "Text"], Cell[13199, 369, 163, 3, 60, "Input"], Cell[13365, 374, 307, 6, 48, "Text"], Cell[13675, 382, 105, 2, 40, "Input"], Cell[13783, 386, 123, 3, 29, "Text"], Cell[13909, 391, 215, 3, 40, "Input"], Cell[14127, 396, 202, 4, 48, "Text"], Cell[14332, 402, 192, 4, 40, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[14561, 411, 37, 0, 28, "Subsubsection"], Cell[14601, 413, 262, 8, 60, "Text", Evaluatable->False], Cell[14866, 423, 215, 9, 58, "Input"], Cell[15084, 434, 32, 0, 29, "Text"], Cell[15119, 436, 304, 12, 112, "Input"], Cell[15426, 450, 196, 3, 45, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[15659, 458, 37, 0, 28, "Subsubsection"], Cell[15699, 460, 340, 13, 29, "Text", Evaluatable->False], Cell[16042, 475, 258, 9, 58, "Input"], Cell[16303, 486, 192, 3, 45, "Text"], Cell[16498, 491, 99, 2, 29, "Text"], Cell[16600, 495, 166, 3, 40, "Input"], Cell[16769, 500, 111, 3, 29, "Text"], Cell[16883, 505, 196, 3, 40, "Input"], Cell[17082, 510, 213, 3, 45, "Text"], Cell[17298, 515, 596, 14, 98, "Text"], Cell[17897, 531, 204, 3, 40, "Input"], Cell[18104, 536, 437, 10, 60, "Text"], Cell[18544, 548, 243, 4, 45, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[18824, 557, 32, 0, 28, "Subsubsection"], Cell[18859, 559, 2503, 68, 341, "Text", Evaluatable->False], Cell[21365, 629, 200, 4, 40, "Input"], Cell[21568, 635, 197, 4, 29, "Text"], Cell[21768, 641, 206, 4, 40, "Input"], Cell[21977, 647, 110, 3, 29, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[22136, 656, 134, 5, 34, "Section"], Cell[22273, 663, 721, 17, 110, "Text"], Cell[22997, 682, 68, 1, 40, "Input"], Cell[23068, 685, 181, 4, 60, "Text"], Cell[23252, 691, 122, 3, 40, "Input"], Cell[23377, 696, 353, 7, 91, "Text"], Cell[23733, 705, 68, 1, 40, "Input"], Cell[23804, 708, 32, 0, 29, "Text"], Cell[23839, 710, 158, 3, 44, "Input"], Cell[24000, 715, 44, 0, 29, "Text"], Cell[24047, 717, 50, 1, 40, "Input"], Cell[24100, 720, 147, 3, 29, "Text"], Cell[24250, 725, 410, 10, 64, "Text"], Cell[24663, 737, 43, 0, 29, "Text"], Cell[24709, 739, 301, 9, 45, "Text"], Cell[25013, 750, 299, 5, 64, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[25349, 760, 158, 5, 34, "Section"], Cell[25510, 767, 1021, 27, 67, "Text"], Cell[26534, 796, 236, 6, 29, "Text"], Cell[26773, 804, 1143, 31, 181, "Input"], Cell[27919, 837, 198, 3, 40, "Input"], Cell[28120, 842, 241, 4, 48, "Text"], Cell[28364, 848, 88, 1, 40, "Input"], Cell[28455, 851, 51, 1, 40, "Input"], Cell[28509, 854, 49, 1, 40, "Input"], Cell[28561, 857, 59, 1, 40, "Input"], Cell[28623, 860, 57, 1, 40, "Input"], Cell[28683, 863, 74, 1, 40, "Input"] }, Closed]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)