(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. 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[ 54994, 1952]*) (*NotebookOutlinePosition[ 55991, 1986]*) (* CellTagsIndexPosition[ 55947, 1982]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ "Introduction to ", StyleBox["Mathematica", FontSlant->"Italic"], "\nBasic Concepts III" }], "Title", Evaluatable->False, CellHorizontalScrolling->False, TextAlignment->Center, FontFamily->"Times New Roman", FontSize->24, FontWeight->"Bold", FontColor->GrayLevel[0], Background->RGBColor[0, 0.501961, 1]], Cell[TextData[{ "In this notebook, we explore ", StyleBox["Mathematica", FontSlant->"Italic"], "'s powerful graphing capabilities. In the first section, we consider \ basic ", StyleBox["plotting functions", FontWeight->"Bold"], ". The second section discusses the use of various ", StyleBox["plotting options", FontWeight->"Bold"], ". The third section shows you how to create ", StyleBox["animations", FontWeight->"Bold"], ", quickly and easily! Finally, we discuss ", StyleBox["customizing", FontWeight->"Bold"], " your graphics." }], "Text"], Cell[CellGroupData[{ Cell[TextData[{ "A Picture is Worth N[", Cell[BoxData[ \(TraditionalForm\`\@1000000\)]], ",4] Words\n(Basic Plotting Functions)" }], "Section"], Cell[TextData[{ "Graphing with ", StyleBox["Mathematica", FontSlant->"Italic"], " is relatively simple. We will start with the two most basic plotting \ functions that every ", StyleBox["Mathematica", FontSlant->"Italic"], " user should know: ", StyleBox["Plot", FontWeight->"Bold"], " and ", StyleBox["ListPlot", FontWeight->"Bold"], ". Plot is used for rule-defined functions, while ListPlot is used for \ lists of data. (Open each of the following subsection cell groupings in \ order and work through them.)" }], "Text"], Cell[CellGroupData[{ Cell["Plot", "Subsubsection"], Cell["\<\ Evaluate the following cell to see a graph of y = cos x over the interval \ [0,3\[Pi]]:\ \>", "Text"], Cell[BoxData[ \(Plot[Cos[x], {x, 0, 3 \[Pi]}]\)], "Input"], Cell[TextData[{ "(Again, note that \"Plot\" and \"Cos\" are capitalized--they are ", StyleBox["Mathematica", FontSlant->"Italic"], "- defined functions. Note also the use of square brackets around the \ arguments of the functions--", StyleBox["including", FontSlant->"Italic"], " the cosine function.)" }], "Text"], Cell[TextData[{ "The Plot function requires two arguments: a ", StyleBox["function", FontVariations->{"Underline"->True}], " to be plotted and an ", StyleBox["interval", FontVariations->{"Underline"->True}], " over which to plot. The interval is a ", StyleBox["list", FontWeight->"Bold"], " of three items contained within ", StyleBox["squiggly braces. ", FontWeight->"Bold"], "The first item in the list is the independent variable (in this case 'x'). \ The next two items in the list are numeric lower and upper bounds for the \ plot interval." }], "Text"], Cell["\<\ If we want two functions graphed on the same set of axes, we evaluate a cell such as the following: \ \>", "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}]\)], "Input"], Cell[TextData[{ "Note again the use of squiggly braces to contain the ", StyleBox["list", FontWeight->"Bold"], " of two functions." }], "Text"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " allows you to enter the rules for the functions directly:" }], "Text"], Cell[BoxData[ \(Plot[{x\^2, Sqrt[x]}, {x, 0, 1}]\)], "Input"], Cell["\<\ or to enter the symbolic expressions for previously-defined functions: \ \>", "Text"], Cell[BoxData[{ \(\(Clear[f, g, x];\)\), "\n", \(f[x_]\ = \ x\^2\), "\n", \(g[x_]\ = \ Sqrt[x]\), "\n", \(Plot[{f[x], g[x]}, {x, 0, 1}]\)}], "Input"], Cell[TextData[{ StyleBox["Exercise: Plot ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`y = x\)], FontWeight->"Bold"], StyleBox[", ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`y = x\^2\)], FontWeight->"Bold"], StyleBox[", and ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`y = x\^3\)], FontWeight->"Bold"], StyleBox[" on the same set of axes. Plot over the interval [-2,2].", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " can get pretty fussy about the Plot command. For example, suppose we \ enter the following function of t:" }], "Text"], Cell[BoxData[{ \(\(Clear[h, t];\)\), "\n", \(h[t_]\ = \ \(-16\) t\^2\ + \ 96\ t\ + \ 32\)}], "Input"], Cell["Now let's try to plot it:", "Text"], Cell[BoxData[ \(\(\(Plot[ h[t], {x, 0, 7}]\)\(\ \ \ \ \)\( (*This\ command\ is\ flawed*) \)\)\)], "Input"], Cell[TextData[{ "That was unpleasant! What went wrong? The answer is that we gave ", StyleBox["Mathematica", FontSlant->"Italic"], " a function of t, but then an interval of x-values. When ", StyleBox["Mathematica", FontSlant->"Italic"], " tried to evaluate h[t] at the different x-values, it did not come up with \ a numeric result. This is what the message \"h[t] is not a machine-size \ real number at x = ...\" means." }], "Text"], Cell[TextData[{ StyleBox["Exercise: Plot h(t) = -16 ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`t\^2\)], FontWeight->"Bold"], StyleBox[" + 96 t + 32 over the interval [0,7].", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"], Cell[TextData[{ "You must be certain that there are NO non-numeric values within the Plot \ command. ", StyleBox["Mathematica", FontSlant->"Italic"], " cannot make sense of the following if 'a' has not been assigned a value:" }], "Text"], Cell[BoxData[ \(\(\(Plot[ a\ x\^2, {x, \(-2\), 2}]\)\(\ \ \ \)\( (*This\ command\ is\ flawed*) \)\)\)], "Input"], Cell["However, once we assign a value for 'a', we're okay:", "Text"], Cell[BoxData[{ \(\(a\ = \ 2;\)\), "\n", \(Plot[a\ x\^2, {x, \(-2\), 2}]\)}], "Input"], Cell[TextData[{ "In general, whenever ", StyleBox["Mathematica", FontSlant->"Italic"], " gives an error message followed by an empty set of axes, the most likely \ cause is that there is a variable in the plot-expression which has not been \ assigned a numeric value." }], "Text"], Cell[TextData[StyleBox["Exercise: The following cells contain flawed Plot \ functions. These flaws represent the most common errors that are made in \ using the Plot function. Fix each command so that it generates the intended \ graphics output.", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[ \(Plot[16 - t\^2, {0, 4}]\)], "Input"], Cell[BoxData[ \(Plot[t, t^2, {t, 0, 2}]\)], "Input"], Cell[BoxData[ \(Plot[\@x, {t, 0, 9}]\)], "Input"], Cell[BoxData[{ \(Clear[f, x]\), "\n", \(f[x_]\ = \ x\^3\), "\n", \(Plot[f[x_], {x, 0, 1}]\)}], "Input"], Cell[BoxData[ \(Plot[sin\ t, {t, 0, \[Pi]}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["ListPlot", "Subsubsection"], Cell["\<\ The other commonly-used plot function is ListPlot. ListPlot is used to plot lists of data. \ \>", "Text"], Cell["\<\ For example, suppose we wish to plot the population of the United States (in thousands of people) for various years since 1800. We may enter the population data in the following list: \ \>", "Text"], Cell[BoxData[ \(popdata = {{1800, 5308}, {1820, 9638}, {1840, 17069}, {1860, 31443}, {1880, 50156}, {1900, 75995}, {1920, 105711}, {1940, 131669}, {1960, 179323}, {1980, 226505}}\)], "Input"], Cell["\<\ Note that squiggly-braces are used to denote each ordered pair. Note also that the entire list is enclosed in squiggly-braces. We may now plot the data: \ \>", "Text"], Cell[BoxData[ \(ListPlot[popdata]\)], "Input"], Cell["\<\ Note that ListPlot has a very basic syntax--the only argument is the list of data. (We will get into some of the options for ListPlot in the next section.) \ \>", "Text"], Cell[TextData[{ "ListPlot does ", StyleBox["not", FontWeight->"Bold"], " require that the list of data define an underlying function:" }], "Text"], Cell[BoxData[ \(ListPlot[{{0, 0}, {1, 1}, {1, 2}, {1, 3}, {2, 2}, {2, 3}, {3, 3}}]\)], "Input"], Cell["\<\ On occasion, we find ourselves with a list of one-dimensional data--a mere list of numbers rather than a list of ordered pairs. ListPlot works with such lists as well: \ \>", "Text"], Cell[BoxData[ \(ListPlot[{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}]\)], "Input"], Cell[TextData[{ "Thus, ListPlot treats a one-dimensional list ", Cell[BoxData[ \(TraditionalForm\`{a\_1, a\_2, ... , a\_n}\)]], " as though it were a list of ordered pairs of the form ", Cell[BoxData[ \(TraditionalForm\`{k, a\_k}\)]], "." }], "Text"], Cell[TextData[StyleBox["Exercise: Plot a list of the first 5 prime numbers.", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["The Graphics Palette", "Subsubsection"], Cell["\<\ Now that we've mastered the basics of Plot and ListPlot, we can briefly discuss some of the other plot functions available. Most are variations of Plot. A few mimic ListPlot. \ \>", "Text"], Cell[TextData[{ "Before we get into some of the more common ones, this is a good place to \ stop and introduce the ", StyleBox["Graphics pallette", FontWeight->"Bold"], ". To call up the palette, select \"File\" from the Main Menu bar. Then, \ select \"Palettes>\" and, from the secondary pop-up window, select \ \"BasicCalculations.\" A window should appear with a list of options. Click \ on the little triangle to the left of \"Graphics.\" You may then click on \ any one of the buttons to insert a function template into your working \ document at the current cursor position." }], "Text"], Cell[TextData[{ StyleBox["Exercise: Create an input cell immediately following this one. \ Then, use the Graphics palette to insert a template of the Plot function in \ your input cell. Use this template to plot y = ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`\[ExponentialE]\^x\)], FontWeight->"Bold"], StyleBox[" over the interval [-1,1].", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell["", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Show (Combining two or more plots)", "Subsubsection"], Cell["\<\ Suppose you have a list of data that you've plotted with ListPlot, and you wish to Plot a curve on the same graph. The Show command is the answer. To use the Show command, it is generally easiest to assign names to the plots. So, for example, we can plot the first 10 perfect squares using ListPlot, and \ assign the name \"squares\" to the actual plot: \ \>", "Text"], Cell[BoxData[ \(squares = ListPlot[{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}]\)], "Input"], Cell[TextData[{ "Next, we plot the curve ", Cell[BoxData[ FormBox[ RowBox[{"y", " ", "=", " ", FormBox[\(x\^2\), "TraditionalForm"]}], TraditionalForm]]], " using Plot, and assign the name \"xsquared\":" }], "Text"], Cell[BoxData[ \(xsquared = Plot[x\^2, {x, 0, 10}]\)], "Input"], Cell["\<\ Now, the Show command may be used to \"show\" the two plots together: \ \>", "Text"], Cell[BoxData[ \(Show[squares, xsquared]\)], "Input"], Cell["Show may be used to combine any number of plots together:", "Text"], Cell[BoxData[{ \(xcubed = Plot[x\^3, {x, 0, 10}]\), "\n", \(primes = ListPlot[{2, 3, 5, 7, 11, 13, 17, 19}]\), "\n", \(Show[squares, xsquared, xcubed, primes]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Plot3D, ContourPlot, and DensityPlot", "Subsubsection"], Cell["\<\ Plot3D is the function-of-two-variable equivalent of Plot. The syntax is essentially the same, except that you must define a domain of two independent \ variables: \ \>", "Text"], Cell[BoxData[ \(Plot3D[x^2 + y^2, {x, \(-3\), 3}, {y, \(-3\), 3}]\)], "Input"], Cell["\<\ The one feature of Plot that does not apply to Plot3D is that you cannot plot \ two functions on the same set of axes using merely Plot3D: \ \>", "Text"], Cell[BoxData[ \(\(\(Plot3D[{x^2 + y^2, 18 - x^2 - y^2}, {x, \(-3\), 3}, {y, \(-3\), 3}]\)\(\ \ \ \)\( (*This\ command\ is\ flawed*) \)\)\)], "Input"], Cell["\<\ There is no good reason as to why this doesn't work, except that the creators \ of the Plot3D command did not set it up to work this way. \ \>", "Text"], Cell["\<\ You can, however, plot two surfaces together using the Show function. \ \>", "Text"], Cell[TextData[{ StyleBox["Exercise: Use the Plot3D and the Show functions to plot ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`x\^2 + y\^2\)], FontWeight->"Bold"], StyleBox[" and ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`18 - x\^2 - y\^2\)], FontWeight->"Bold"], StyleBox[" on the same set of axes.", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"], Cell[TextData[{ "The syntax for ContourPlot is ", StyleBox["exactly", FontSlant->"Italic"], " the same as that for Plot3D. ContourPlot produces a contour diagram (a \ plot of level curves) for the corresponding function of two variables. ", StyleBox["Mathematica", FontSlant->"Italic"], " uses shading to indicate the relative sizes of the function values, with \ darker regions representing lesser function values:" }], "Text"], Cell[BoxData[ \(ContourPlot[x^2 + y^2, {x, \(-3\), 3}, {y, \(-3\), 3}]\)], "Input"], Cell["DensityPlot is a variation on the ContourPlot theme:", "Text"], Cell[BoxData[ \(DensityPlot[x^2 + y^2, {x, \(-3\), 3}, {y, \(-3\), 3}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["ParametricPlot and ParametricPlot3D", "Subsubsection"], Cell["\<\ ParametricPlot allows you to plot a planar curve defined in terms of a parameter. Evaluate the following for a brief description of the function: \ \>", "Text"], Cell[BoxData[ \(\(?ParametricPlot\)\)], "Input"], Cell["\<\ Here is how you would plot a parameterized ellipse, for example: \ \>", "Text"], Cell[BoxData[ \(ParametricPlot[{2 Cos[t], 3 Sin[t]}, {t, 0, 2 Pi}]\)], "Input"], Cell["\<\ Again, note that the first argument of ParametricPlot is a list (hence, squiggly-braces) containing the x- and y-coordinate functions. The second argument is a list containing the independent variable (the parameter) and its input domain. ParametricPlot allows for a list of parameterized curves: \ \>", "Text"], Cell[BoxData[ \(ParametricPlot[{{2 Cos[t], 3 Sin[t]}, {3 Cos[t], 2 Sin[t]}}, {t, 0, 2 Pi}]\)], "Input"], Cell[TextData[StyleBox["Exercise: Use ParametricPlot to plot 3 concentric \ circles centered at the point {2,3}.", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"], Cell["\<\ To plot a curve in 3-space, use ParametricPlot3D. ParametricPlot3D expects 3 \ coordinate functions. The parameter and its interval of values is entered the same as in ParametricPlot: \ \>", "Text"], Cell[BoxData[ \(ParametricPlot3D[{2 Cos[t], 3 Sin[t], t}, {t, 0, 6 Pi}]\)], "Input"], Cell[TextData[{ "If we specify ", StyleBox["two", FontWeight->"Bold"], " input parameters and their domains, the result is a surface:" }], "Text"], Cell[BoxData[ \(ParametricPlot3D[{2 Cos[t], 3 Sin[t], t + s}, {t, 0, 6 Pi}, {s, 0, 3}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ ImplicitPlot, FilledPlot, and PolarPlot (and other standard add-on packages) \ \>", "Subsubsection"], Cell[TextData[{ "So far, all of the graphics functions we have encountered have been basic \ functions--functions that are loaded automatically when you launch the ", StyleBox["Mathematica", FontSlant->"Italic"], " kernel. There are many other functions of interest that are not a part \ of the basic kernel. They are instead contained in ", StyleBox["standard add-on packages", FontWeight->"Bold"], "." }], "Text"], Cell["\<\ To make use of these functions, we must load them from the Graphics folder of \ the StandardPackages folder. This is done by evaluating the Needs command. Evaluate the following now: \ \>", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell["\<\ ImplicitPlot is used to plot a curve in which y is implicitly a function of x, or vice-versa: \ \>", "Text"], Cell[BoxData[{ \(Clear[x, y]\), "\n", \(\tImplicitPlot[y\^2 == x, {x, 0, 4}]\)}], "Input"], Cell[TextData[{ "Note the use of the double equal-signs! These tell ", StyleBox["Mathematica", FontSlant->"Italic"], " that we wish to plot an ", StyleBox["equation", FontSlant->"Italic"], ". (A single equal sign would tell ", StyleBox["Mathematica", FontSlant->"Italic"], " that we wish to assign the value x to the symbol ", Cell[BoxData[ \(TraditionalForm\`y\^2\)]], ".)" }], "Text"], Cell["\<\ Another useful command (particularly when we consider integration and areas under curves) is FilledPlot. Again, it must be loaded: \ \>", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell["We may shade the region under a curve", "Text"], Cell[BoxData[ \(FilledPlot[x\^2, {x, 0, 1}]\)], "Input"], Cell["between two curves", "Text"], Cell[BoxData[ \(FilledPlot[{x\^2, x\^3}, {x, 0, 1}]\)], "Input"], Cell["or between a number of curves:", "Text"], Cell[BoxData[ \(FilledPlot[{x\^2, x\^3, x\^4}, {x, 0, 1}]\)], "Input"], Cell["\<\ Not all packages correspond to the name of the actual plotting function. The \ function PolarPlot, for example, is contained in the standard package called `Graphics`. To load it, we evaluate the following: \ \>", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell["Now we have access to the PolarPlot function:", "Text"], Cell[BoxData[ \(PolarPlot[1 + Cos[t], {t, 0, 2 Pi}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Troubleshooting with Standard Packages (THE STANDARD MISTAKE!) \ \>", "Subsubsection"], Cell["\<\ It is a very common error to try to evaluate a plotting function before we have loaded it from a standard package. For example, to plot a three-dimensional vector field, we use the following plotting function: \ \>", "Text"], Cell[BoxData[ \(PlotVectorField3D[{x, y, z}, {x, \(-3\), 3}, {y, \(-3\), 3}, {z, \(-3\), 3}]\)], "Input"], Cell["Oops! We forgot to load the package! Let's try to now:", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell["An error!", "Text"], Cell["\<\ What went wrong? After all, \"PlotField3D\" is one of the standard add-on packages!!! \ \>", "Text"], Cell[TextData[{ "The problem is that, once we tried to evaluate the PlotVectorField3D \ function above, ", StyleBox["Mathematica", FontSlant->"Italic"], " reserved a space in memory for a variable called \"PlotVectorField3D\". \ Now it is unable to load the package properly because it is not allowed to \ redefine \"PlotVectorField3D\" in a different context." }], "Text"], Cell[TextData[{ "The natural tendency would be to try to fix the problem by evaluating \ Clear[PlotVectorField3D]. ", StyleBox["This does not work", FontWeight->"Bold"], ", however. We need something stronger than Clear. We need to \"Remove\" \ the symbol PlotVectorField3D from memory altogether. Evaluate the \ following:" }], "Text"], Cell[BoxData[ \(Remove[PlotVectorField3D]\)], "Input"], Cell["Now we can load the package (evaluate the following)", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell["and the function PlotVectorField3D now works fine!", "Text"], Cell[BoxData[ \(PlotVectorField3D[{x, y, z}, {x, \(-3\), 3}, {y, \(-3\), 3}, {z, \(-3\), 3}]\)], "Input"] }, Closed]], Cell["WHEW! THAT'S MORE THAN ENOUGH PLOTTING FOR NOW!", "Text"], Cell[TextData[{ "Hopefully, you are not feeling completely overwhelmed. You should \ certainly not feel that you have to know every plotting function available \ and have the syntax memorized. Even the most veteran of ", StyleBox["Mathematica", FontSlant->"Italic"], " users do not remember the subtleties of all of the functions! What's \ important for the time being is...\n1. that you feel comfortable with Plot, \ ListPlot, and Show\n2. that you are aware that there are many other plotting \ functions available\n3. that you are aware of the Pallettes and the Help \ tools available\n4. that you realize that some plotting functions must be \ loaded from external add-on packages\n5. that you can cause problems for \ yourself by trying to evaluate a function before loading it from an external \ package, but that this problem can be corrected without having to shut down \ ", StyleBox["Mathematica", FontSlant->"Italic"], " and start all over." }], "Text"], Cell[TextData[{ "Many of the plots that we've generated in this section perhaps do not look \ the way we want them to. Let's now explore some of the more common ", StyleBox["options", FontWeight->"Bold"], " for graphics..." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Life in ", StyleBox["Mathematica", FontSlant->"Italic"], " is Full of Plot Options" }], "Section"], Cell["\<\ By now, you should feel comfortable plotting two functions together on the same set of axes: \ \>", "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}]\)], "Input"], Cell["Good enough. But what if we want better?", "Text"], Cell["Then we have options!", "Text"], Cell["\<\ For Plot, there are many. To discover the list of options available, as well \ as their default settings, evaluate the following: \ \>", "Text"], Cell[BoxData[ \(?? Plot\)], "Input"], Cell[TextData[{ "There are more options available than most people ever need! We will \ survey some of the more commonly-sought options now. ", StyleBox["Do not feel that everyone walks around knowing these options off \ the top of their heads! ", FontWeight->"Bold"], " For now, simply be aware that the options exist, and remember to consult \ this notebook or the help menu in the future to make plots look the way you \ want them to." }], "Text"], Cell[CellGroupData[{ Cell["Labels (for axes and entire plots)", "Subsubsection"], Cell["\<\ First, it's good form to label the axes, and to label the plot itself. Here is a way we can do this: \ \>", "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, AxesLabel -> {"\", "\"}, PlotLabel -> "\"]\)], "Input"], Cell[TextData[{ "One nice thing about options is that the order in which you enter \ different options does not matter--", StyleBox["as long as", FontWeight->"Bold"], " they follow the required arguments of the particular plotting function:" }], "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, PlotLabel -> "\", AxesLabel -> {"\", "\"}]\)], "Input"], Cell[TextData[{ "However, if you enter two different settings for the ", StyleBox["same", FontWeight->"Bold"], " option, the one listed first is the one that is actually used:" }], "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, \n\t PlotLabel -> "\", \n\t PlotLabel -> "\", AxesLabel -> {"\", "\"}]\)], "Input"], Cell[TextData[{ StyleBox["Exercise: Plot the first 5 perfect squares as a list of ordered \ pairs of the form ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`{k, k\^2}\)], FontWeight->"Bold"], StyleBox[". Label your plot \"Perfect Squares.\"", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["PlotStyles (colors, dashing, thickness, point sizes, etc.)", \ "Subsubsection"], Cell["\<\ Another option that is nice, especially when you have more than one function on a set of axes, is the ability to specify different colors. This is accomplished in the following manner: \ \>", "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, AxesLabel -> {"\", "\"}, PlotLabel -> "\", PlotStyle -> RGBColor[0, 1, 0]]\)], "Input"], Cell[TextData[{ "RGBColor is a graphics directive that tells ", StyleBox["Mathematica", FontSlant->"Italic"], " what proportion of each of the primary colors (Red, Green, Blue--hence \ the \"RGB\") we desire. If we wish to plot in blue with just a hint of red, \ we might specify the following:" }], "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, AxesLabel -> {"\", "\"}, PlotLabel -> "\", PlotStyle -> RGBColor[ .3, 0, 1]]\)], "Input"], Cell[TextData[{ "Of course, the most natural desire is to plot each curve in a different \ color. This is done in the following manner. (Note now that the RGBColor \ directives are placed in a ", StyleBox["list of lists", FontWeight->"Bold"], ".)" }], "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, AxesLabel -> {"\", "\"}, PlotLabel -> "\", PlotStyle -> {{RGBColor[0, 0, 1]}, {RGBColor[1, 0, 0]}}]\)], "Input"], Cell["\<\ The RGBColor directive is a nice technical way of specifying colors. Using the three parameters for 'R' and 'G' and 'B', we can (in theory) specify an infinite number of possible colors. \ \>", "Text"], Cell[TextData[{ "Now, is this the most user-friendly way of specifying colors? ABSOLUTELY \ NOT! ", StyleBox["Mathematica", FontSlant->"Italic"], " is designed to be as versatile as possible, and sometimes ease of \ implementation suffers." }], "Text"], Cell["\<\ Fortunately, someone did come along and create a standard package geared toward user-friendliness. Evaluate the following cell to load the package: \ \>", "Text"], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell["Here is a listing of the colors available:", "Text"], Cell[BoxData[ \(AllColors\)], "Input"], Cell["Let's check out that DeepCadmiumRed and CadetBlue:", "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, AxesLabel -> {"\", "\"}, PlotLabel -> "\", PlotStyle -> {{DeepCadmiumRed}, {CadetBlue}}]\)], "Input"], Cell["\<\ We can also sketch the curves with dashed lines and different thicknesses: \ \>", "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, AxesLabel -> {"\", "\"}, PlotLabel -> "\", PlotStyle -> {{DeepCadmiumRed, Dashing[{ .05}], Thickness[ .02]}, {CadetBlue, Dashing[{ .02}]}}]\)], "Input"], Cell["For plots of data points, we can also specify a PointSize:", "Text"], Cell[BoxData[ \(ListPlot[{1, 4, 9, 16, 25, 36, 49}, PlotStyle -> {PointSize[ .03], RGBColor[0, 0, 1]}]\)], "Input"], Cell[TextData[StyleBox["Exercise: Plot three functions on the same set of \ axes, assigning each a different color, dashing, or thickness value.", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["AspectRatio (2D vertical and horizontal scaling)", "Subsubsection"], Cell["\<\ AspectRatio is used to specify the relative dimensions of our plot window. Let's take a look at one of our earlier plots: \ \>", "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}]\)], "Input"], Cell[TextData[{ "Note that the amplitude of the sine and cosine curves is quite exaggerated \ compared to the scale along the horizontal axis. The reason for this is \ that, by default, ", StyleBox["Mathematica", FontSlant->"Italic"], " compresses the vertical height of the plot window by an amount equal to \ 1/(golden ratio) (0.618) relative to the horizontal width. What if we wish \ to plot with the relative scale preserved along each axis? We use the \ AspectRatio option with the Automatic setting:" }], "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, AspectRatio -> Automatic]\)], "Input"], Cell["\<\ Automatic is the most common setting used for AspectRatio. If, however, for some reason you would like the plot window to be twice as tall as it is wide, \ you can enter the following: \ \>", "Text"], Cell[BoxData[ \(Plot[{Sin[x], Cos[x]}, {x, \ 0, \ 6 Pi}, AspectRatio -> 2]\)], "Input"], Cell["Ellipses and circles do not look right...", "Text"], Cell[BoxData[ \(ParametricPlot[{{2 Cos[t], 3 Sin[t]}, {3 Cos[t], 2 Sin[t]}}, {t, 0, 2 Pi}]\)], "Input"], Cell["...without AspectRatio->Automatic:", "Text"], Cell[BoxData[ \(ParametricPlot[{{2 Cos[t], 3 Sin[t]}, {3 Cos[t], 2 Sin[t]}}, {t, 0, 2 Pi}, AspectRatio -> Automatic, AxesLabel -> {"\", "\"}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["BoxRatios (3D scaling)", "Subsubsection"], Cell["\<\ BoxRatios specifies the relative dimensions of the output box for a 3-dimensional plot. BoxRatios is a more useful option than AspectRatio for 3-dimensional plots. For example, here is a 3-dimensional plot with no options: \ \>", "Text"], Cell[BoxData[ \(Plot3D[x\^2 + y\^2, {x, \(-3\), 3}, {y, \(-3\), 3}]\)], "Input"], Cell["\<\ Note that the axis of the dependent variable is considerably compressed. We can fix this with BoxRatios. BoxRatios->Automatic is to 3-dimensional plots what AspectRatio->Automatic is to 2-dimensional plots (it preserves the relative scale along each coordinate axis): \ \>", "Text"], Cell[BoxData[ \(Plot3D[x\^2 + y\^2, {x, \(-3\), 3}, {y, \(-3\), 3}, BoxRatios -> Automatic]\)], "Input"], Cell["\<\ You can also specify the relative ratios using a list of 3 numbers. For example, if you want the output box to appear to be a perfect cube, you can specify BoxRatios->{1,1,1}: \ \>", "Text"], Cell[BoxData[ \(Plot3D[x\^2 + y\^2, {x, \(-3\), 3}, {y, \(-3\), 3}, BoxRatios -> {1, 1, 1}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["PlotRange and ClipFill (numeric range of the output graph)", \ "Subsubsection"], Cell["\<\ PlotRange is used to specify the numeric range of our graphs. A PlotRange may be specified in a number of ways: either as a range for our dependent variable: \ \>", "Text"], Cell[BoxData[ \(Plot[1\/\(x\^2 - x\), {x, \(-2\), 3}, PlotRange -> {\(-10\), 10}]\)], "Input"], Cell["or as an output range for each axis:", "Text"], Cell[BoxData[ \(Plot[1\/\(x\^2 - x\), {x, \(-2\), 3}, PlotRange -> {{\(-4\), 4}, {\(-10\), 10}}]\)], "Input"], Cell["This latter method is more often used for parametric plots:", "Text"], Cell[BoxData[ \(ParametricPlot[{{2 Cos[t], 3 Sin[t]}, {3 Cos[t], 2 Sin[t]}}, {t, 0, 2 Pi}, AspectRatio -> 1, AxesLabel -> {"\", "\"}, PlotRange -> {{\(-5\), 5}, {\(-5\), 5}}]\)], "Input"], Cell["\<\ PlotRange may also be used for three-dimensional graphics. Without a PlotRange, paraboloids have \"fins\" that reach upwards in the corners of the \ plot: \ \>", "Text"], Cell[BoxData[ \(Plot3D[x^2 + y^2, {x, \(-3\), 3}, {y, \(-3\), 3}, BoxRatios -> Automatic]\)], "Input"], Cell["\<\ This is not the way we normally visualize paraboloids. To get a more satisfying picture, specify an appropriate PlotRange: \ \>", "Text"], Cell[BoxData[ \(Plot3D[x^2 + y^2, {x, \(-3\), 3}, {y, \(-3\), 3}, BoxRatios -> Automatic, PlotRange -> {0, 9}]\)], "Input"], Cell["\<\ This brings us to another helpful option that may be used in conjunction with \ PlotRange for 3-dimensional plots: ClipFill. ClipFill->None trims the excess surface around the top of the output box: \ \>", "Text"], Cell[BoxData[ \(Plot3D[x^2 + y^2, {x, \(-3\), 3}, {y, \(-3\), 3}, BoxRatios -> Automatic, PlotRange -> {0, 9}, ClipFill -> None]\)], "Input"], Cell[TextData[{ StyleBox["Exercise: Use ParametricPlot3D to plot the trace of ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`z = x\^2 + y\^2\)], FontWeight->"Bold"], StyleBox[" in the plane z = 9. Use the Show command to combine this plot \ with a plot of the surface ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`z = x\^2 + y\^2\)], FontWeight->"Bold"], StyleBox[" with the options PlotRange->{0,9} and ClipFill->None. What do \ you observe?", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Axes and AxesOrigin (intersection of axes)", "Subsubsection"], Cell["Earlier, we plotted population data for the United States:", "Text"], Cell[BoxData[{ \(\(popdata = {{1800, 5308}, {1820, 9638}, {1840, 17069}, {1860, 31443}, {1880, 50156}, {1900, 75995}, {1920, 105711}, {1940, 131669}, {1960, 179323}, {1980, 226505}};\)\), "\n", \(ListPlot[popdata]\)}], "Input"], Cell["\<\ Note that the very first data point is covered by the vertical axis. We can move the vertical axis over by specifying an AxesOrigin: \ \>", "Text"], Cell[BoxData[ \(ListPlot[popdata, AxesOrigin -> {1775, 0}]\)], "Input"], Cell["\<\ Oops! Note that the axes no longer intersect. This is a common problem with \ using AxesOrigin, and may be corrected by using AxesOrigin in conjunction with PlotRange: \ \>", "Text"], Cell[BoxData[ \(ListPlot[popdata, AxesOrigin -> {1775, 0}, PlotRange -> {{1775, 2000}, {0, 250000}}, PlotStyle -> PointSize[ .01]]\)], "Input"], Cell["\<\ Certain plotting functions, such as ContourPlot, do not display axes by default. For these functions, you must use the option Axes->True: \ \>", "Text"], Cell[BoxData[ \(ContourPlot[x\^2 + y\^2, {x, \(-3\), 3}, {y, \(-3\), 3}, AxesLabel -> {"\", "\"}, Axes -> True, AxesOrigin -> {0, 0}, ContourShading -> False]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["PlotPoints (number of sample points for a plot)", "Subsubsection"], Cell[TextData[{ "PlotPoints allows us to improve (or degrade, for that matter) the \ resolution of our plot. When ", StyleBox["Mathematica", FontSlant->"Italic"], " plots a 2-dimensional curve, it essentially generates a list of points \ and then connects the points with lines. Usually, there are so many sample \ points that we cannot tell that the \"curve\" is really a sequence of small \ line segments:" }], "Text"], Cell[BoxData[ \(Plot[Sin[1/t], {t, .1, .3}]\)], "Input"], Cell["But we can begin to tell when the curve varies more rapidly:", "Text"], Cell[BoxData[ \(Plot[Sin[1/t], {t, 0, .01}]\)], "Input"], Cell["\<\ We can fill in the gaps in the above plot by increasing the resolution: \ \>", "Text"], Cell[BoxData[ \(Plot[Sin[1/t], {t, 0, .01}, PlotPoints -> 120]\)], "Input"], Cell["\<\ Poor resolution becomes quite noticeable for 3-dimensional plots. Here is a surface with the default PlotPoints->15: \ \>", "Text"], Cell[BoxData[ \(Plot3D[ Sin[x]\ Sin[y], {x, \(-2\) Pi, 2 Pi}, {y, \(-2\) Pi, 2 Pi}]\)], "Input"], Cell["\<\ Here is the same plot with 4 times the resolution (but 16 times the required plotting time): \ \>", "Text"], Cell[BoxData[ \(Plot3D[Sin[x]\ Sin[y], {x, \(-2\) Pi, 2 Pi}, {y, \(-2\) Pi, 2 Pi}, PlotPoints -> 60]\)], "Input"], Cell["\<\ Note the difference in resolution for contour diagrams as well. With the default of PlotPoints->15, we get the following: \ \>", "Text"], Cell[BoxData[ \(ContourPlot[ Sin[x]\ Sin[y], {x, \(-2\) Pi, 2 Pi}, {y, \(-2\) Pi, 2 Pi}]\)], "Input"], Cell["However, with 4 times the resolution, we get:", "Text"], Cell[BoxData[ \(ContourPlot[ Sin[x]\ Sin[y], {x, \(-2\) Pi, 2 Pi}, {y, \(-2\) Pi, 2 Pi}, PlotPoints -> 60]\)], "Input"], Cell[TextData[StyleBox["Exercise: Plot z = Sin[x y] over the rectangle [0,2\ \[Pi]]\[Times][0,2\[Pi]]. Use enough PlotPoints to smooth out the surface.", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["ViewPoint (3D coordinates for viewing perspective)", "Subsubsection"], Cell[TextData[{ "The ViewPoint option tells ", StyleBox["Mathematica", FontSlant->"Italic"], " from what perspective we wish to view a 3-dimensional plot. Here is a \ bottom view of a paraboloid:" }], "Text"], Cell[BoxData[ \(Plot3D[x^2 + y^2, {x, \(-3\), 3}, {y, \(-3\), 3}, BoxRatios -> Automatic, PlotRange -> {0, 9}, ClipFill -> None, ViewPoint -> {2.565, \ 1.001, \ \(-1.876\)}]\)], "Input"], Cell["\<\ The easiest way to specify a ViewPoint is from the Input|3D ViewPoint Selector window. \ \>", "Text"], Cell[TextData[StyleBox["Exercise: Experiment with the \"3D ViewPoint \ Selector\" under Input on the main menu. Plot a side view of Sin[x] Sin[y] \ over the rectangle [-2\[Pi],2 \[Pi]]\[Times][-2\[Pi],2\[Pi]].", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Options for the Show Function", "Subsubsection"], Cell["\<\ One final remark about the Show function. It does not support any default options: \ \>", "Text"], Cell[BoxData[ \(?? Show\)], "Input"], Cell[TextData[{ "Rather, Show borrows its options from those of the ", StyleBox["first", FontWeight->"Bold"], " plot listed within the Show function. Here are two surfaces:" }], "Text"], Cell[BoxData[{ \(\(surface1 = Plot3D[x\^2 + y\^2, {x, \(-3\), 3}, {y, \(-3\), 3}, ViewPoint -> {1.693, \ 2.250, \ \(-1.876\)}, BoxRatios -> Automatic];\)\), "\n", \(\(surface2 = Plot3D[18 - x\^2 - y\^2, {x, \(-3\), 3}, {y, \(-3\), 3}];\)\)}], "Input"], Cell["Compare...", "Text"], Cell[BoxData[ \(\(Show[surface1, surface2];\)\)], "Input"], Cell["with...", "Text"], Cell[BoxData[ \(\(Show[surface2, surface1];\)\)], "Input"] }, Closed]], Cell["\<\ That's enough options! Again, it is not important that you know all of the above options off the top of your head right now. Just be aware that they exist and consult this notebook to review any syntax. Also, whenever you're in doubt, evaluate a command such as the following to see a list of options: \ \>", "Text"], Cell[BoxData[ \(?? Plot3D\)], "Input"], Cell["\<\ ...and consult the Help menu for specifics on options with which you are not familiar. \ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Animating in ", StyleBox["Mathematica", FontSlant->"Italic"] }], "Section"], Cell["\<\ The good news is that animations are relatively simple to generate! We simply create a table of plots and then double-click on any one of the output \ images. \ \>", "Text"], Cell[CellGroupData[{ Cell["Table", "Subsubsection"], Cell["\<\ We can create a table quite simply with the Table function. For example, if we want a table of the first 20 integers, we evaluate the following function: \ \>", "Text"], Cell[BoxData[ \(Table[k, {k, 1, 20}]\)], "Input"], Cell["\<\ The Table function requires two arguments: the expression to place in each entry of the table (possibly entered as a function of the index variable) and \ a list consisting of the index variable and its lower and upper bounds. The increment (or step size for the index) defaults to 1, but may be changed: \ \>", "Text"], Cell[BoxData[ \(Table[k, {k, 1, 20, 3}]\)], "Input"], Cell[BoxData[ \(Table[k, {k, 1, 20, .5}]\)], "Input"], Cell["\<\ If we desire the first 20 even integers, we may enter a Table function such as \ \>", "Text"], Cell[BoxData[ \(Table[2 k, {k, 1, 20}]\)], "Input"], Cell["or such as", "Text"], Cell[BoxData[ \(Table[k, {k, 2, 40, 2}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Table of Functions", "Subsubsection"], Cell["\<\ The Table function may be used to generate a table of functions: \ \>", "Text"], Cell[BoxData[ \(powerfunctions = Table[x^k, {k, 1, 20}]\)], "Input"], Cell[TextData[{ "The Plot function knows how to plot every function in this table all at \ once. However, we must use the Evaluate function to tell ", StyleBox["Mathematica", FontSlant->"Italic"], " to evaluate each function over the given interval of x-values:" }], "Text", FontWeight->"Plain"], Cell[BoxData[ \(Plot[Evaluate[powerfunctions], {x, 0, 1}, PlotRange -> {0, 1}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Table of Plots (Animating!)", "Subsubsection"], Cell["\<\ To animate a sequence of functions, we simply create a table of plots. To animate the first 10 power functions, we evaluate the following cell: \ \>", "Text"], Cell[BoxData[ \(Table[ Plot[x^k, {x, 0, 1}, PlotRange -> {0, 1}, AspectRatio -> Automatic], {k, 1, 10}]\)], "Input"], Cell["\<\ Now, we place our cursor anywhere over the last image and double-click the left mouse button. Good things should happen! \ \>", "Text"], Cell[TextData[{ StyleBox["Helpful Hint: ", FontWeight->"Bold"], "Usually, in a sequence of plots, the default plot range changes. You \ almost always want to set a PlotRange yourself to keep all of the output \ plots of the same size." }], "Text"], Cell["\<\ What if we want to leave each of the previous plots intact at each step? We can create a table of plots, each consisting of a table of functions: \ \>", "Text"], Cell[BoxData[ \(Table[ Plot[Evaluate[Table[x^j, {j, 1, k}]], {x, 0, 1}, PlotRange -> {0, 1}, AspectRatio -> Automatic], {k, 1, 10}]\)], "Input"], Cell["\<\ Animations may be used to illustrate various real-world processes: \ \>", "Text"], Cell[BoxData[{ \(\(h[x_, y_, t_] = \ Sin[\@\(x\^2 + y\^2\) - t]\^2\/\(1 + \@\(x\^2 + y\^2\)\);\)\), "\n", \(Table[ Plot3D[h[x, y, t], {x, \(-8\), 8}, {y, \(-8\), 8}, PlotRange -> {\(-1\), 1}, PlotPoints -> 30], {t, 0, Pi - .1, Pi/5}]\)}], "Input"], Cell[TextData[{ StyleBox["Exercise: Animate a sequence of 10 paraboloids that vary \ uniformly from ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`z = 0.1 \((x\^2 + y\^2)\)\)], FontWeight->"Bold"], StyleBox[" to ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`z = 1.0 \((x\^2 + y\^2)\)\)], FontWeight->"Bold"], StyleBox[". Make sure that your PlotRange does not change.", FontWeight->"Bold"] }], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Do Loops and Animations", "Subsubsection"], Cell["\<\ Sometimes, we wish to animate a sequence of plots that are more complicated to generate than those of the previous section. Whenever an animation requires several steps in the generation of the functions or plots, it is better to use a Do loop rather than a mere Table. \ \>", "Text"], Cell[TextData[{ "The syntax of the Do function is very similar to that of Table. However, \ whereas the Table function requires an expression to place in each entry of \ the table as its first argument, the Do function accepts any number of lines \ of input, as long as each line is ", StyleBox["separated by semi-colons", FontWeight->"Bold"], "." }], "Text"], Cell["\<\ Here is a simple Do loop that adds the first k integers together and prints the sum at each step: \ \>", "Text"], Cell[BoxData[{ \(\(n\ = \ 0;\)\), "\n", \(Do[\n\t\tn\ = \ n\ + \ k; \n\t\tPrint[n], \ \ \ \ {k, 1, 10}]\)}], "Input"], Cell["\<\ A Do loop may be used to generate animations as well. Here is the first animation of the previous section: \ \>", "Text"], Cell[BoxData[ \(Do[Plot[x^k, {x, 0, 1}, PlotRange -> {0, 1}, AspectRatio -> Automatic], {k, 1, 10}]\)], "Input"], Cell["\<\ The true power of the Do function becomes apparent when several steps are necessary for generating an animation. For example, it is common to wish to illustrate the convergence of a sequence of Taylor polynomial approximations of a certain function as the degree of the polynomials increases. To generate such an animation requires two steps: first calculating the Taylor polynomial of a specific degree, and then plotting this polynomial together with the original function. Here is how we may accomplish this: \ \>", "Text"], Cell[BoxData[{ \(\(Clear[f, x];\)\), "\n", \(\(f[x_]\ = \ Sin[x];\)\), "\n", \(Do[\n\tp[x_]\ = \ Normal[Series[f[x], {x, 0, k}]]; \n\t Plot[{f[x], p[x]}, {x, \(-2\) Pi, 2 Pi}, PlotRange -> {\(-2\), 2}, PlotStyle -> {{RGBColor[0, 0, 1]}, {RGBColor[1, 0, 0]}}], {k, 1, 15, 2}]\)}], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Creating Your Own Graphics Functions (Advanced Users) \ \>", "Section"], Cell["\<\ This final section gives a brief glimpse at the powerful types of graphing functions that you can define on your own terms! \ \>", "Text"], Cell["\<\ For example, suppose we frequently have need to plot the sine function, only \ with different amplitudes and frequencies, over the interval [0,4\[Pi]]. We \ could type a command such as the following each and every time we needed such \ a sine plot:\ \>", "Text"], Cell[BoxData[{ \(\(a = 3;\)\), "\n", \(\(frequency\ = \ 5;\)\), "\n", \(Plot[a*Sin[frequency*t], {t, 0, 4 Pi}]\)}], "Input"], Cell["\<\ Alternatively, we could define our very own plotting function that takes into \ account the fact that we would like to be able to change the amplitude and the frequency each time. We could call this function SinePlot, and define it \ in the following manner: \ \>", "Text"], Cell[BoxData[{ \(\(Clear[SinePlot, amplitude, frequency];\)\), "\n", \(SinePlot[amplitude_, frequency_] := \n\t Plot[amplitude*Sin[frequency*t], {t, 0, 4 Pi}]\)}], "Input"], Cell[TextData[StyleBox["Why the colon-equals ?!?", FontWeight->"Bold"]], "Text"], Cell[TextData[{ "The colon-equals, :=, tells ", StyleBox["Mathematica", FontSlant->"Italic"], " that we do not wish to evaluate the Plot function at this time, but \ rather need to wait until an amplitude and a frequency are actually entered \ as values of SinePlot. You must always use a colon-equals when defining a \ plotting function of your own. Otherwise, you will get an instant error \ caused by the missing values of your input parameters." }], "Text"], Cell["\<\ Anyway, now that SinePlot has been defined (did you remember to evaluate the above cell?!), we may use it at any time: \ \>", "Text"], Cell[BoxData[ \(SinePlot[3, 5]\)], "Input"], Cell[BoxData[ \(SinePlot[ .5, 2]\)], "Input"], Cell["\<\ Note that we have defined SinePlot to plot over the interval [0,4\[Pi]] each \ and every time. If we would like to make our function more versatile, we can \ allow for a different plot interval each time:\ \>", "Text"], Cell[BoxData[ \(Clear[SinePlot, amplitude, frequency]; SinePlot[amplitude_, frequency_, {t0_, \ t1_}] := \n\t Plot[amplitude*Sin[frequency*t], {t, t0, t1}]\)], "Input"], Cell[BoxData[ \(SinePlot[3, 5, {\(-2\) Pi, 2 Pi}]\)], "Input"], Cell["\<\ Well, that's pretty nice and all. But it sure was nice having the default \ interval of [0,4\[Pi]], wasn't it? Notice that our new definition of \ SinePlot does not allow for this default anymore:\ \>", "Text"], Cell[BoxData[ \(SinePlot[3, 5]\)], "Input"], Cell["\<\ We can force SinePlot to plot over the interval [0,4\[Pi]] by default by \ adding the additional definition:\ \>", "Text"], Cell[BoxData[ \(SinePlot[amplitude_, \ frequency_] := SinePlot[amplitude, \ frequency, \ {0, 4 Pi}]\)], "Input"], Cell["\<\ Now, if SinePlot receives only two arguments, it knows to use the plot \ interval [0,4\[Pi]] by default:\ \>", "Text"], Cell[BoxData[ \(SinePlot[3, 5]\)], "Input"], Cell["\<\ ...although we can still change the plot interval by adding an optional interval as a third argument: \ \>", "Text"], Cell[BoxData[ \(SinePlot[3, 5, {\(-2\) Pi, 6 Pi}]\)], "Input"], Cell["What if we wish to plot in red?", "Text"], Cell[BoxData[ \(SinePlot[3, 5, {\(-2\) Pi, 6 Pi}, PlotStyle -> RGBColor[1, 0, 0]]\)], "Input"], Cell["\<\ It doesn't work! We can allow for the inclusion of options by redefining SinePlot (from scratch) one more time. We add an argument opts___ (three underscores): \ \>", "Text"], Cell[BoxData[{ \(Clear[SinePlot, amplitude, frequency]; SinePlot[amplitude_, frequency_, {t0_, \ t1_}, \ opts___] := \n\t Plot[amplitude*Sin[frequency*t], {t, t0, t1}, opts];\), "\n", \(\(SinePlot[amplitude_, \ frequency_, \ opts___] := \n\t SinePlot[amplitude, \ frequency, \ {0, 4 Pi}, opts];\)\)}], "Input"], Cell["Now our enhanced SinePlot works just fine!", "Text"], Cell[BoxData[ \(SinePlot[3, 5, {\(-2\) Pi, 6 Pi}, PlotStyle -> RGBColor[1, 0, 0]]\)], "Input"], Cell[TextData[{ "Remember how the makers of ", StyleBox["Mathematica", FontSlant->"Italic"], " forgot to let us combine two surfaces together using one Plot3D function? \ We can write our own function that does this. We need to use the Module \ function. Module is used to enclose two or more commands into their own \ little module. The first argument of Module is a listing of the local \ variables needed in the module. The second argument is a sequence of \ commands, separated by semi-colons:" }], "Text"], Cell[BoxData[ \(Plot3DTogether[{f_, g_}, {x_, x0_, x1_}, {y_, y0_, y1_}, opts___] := \n\t Module[{surface1, surface2}, \n\t\tsurface1 = Plot3D[f, {x, x0, x1}, {y, y0, y1}, DisplayFunction -> Identity, opts]; \n\t\tsurface2 = Plot3D[g, {x, x0, x1}, {y, y0, y1}, DisplayFunction -> Identity, opts]; \n\t\tShow[surface1, surface2, DisplayFunction -> $DisplayFunction]]\)], "Input"], Cell[TextData[{ "DisplayFunction->Identity tells ", StyleBox["Mathematica", FontSlant->"Italic"], " to define the graphics object, but to hold off on displaying it. \ DisplayFunction->$DisplayFunction tells ", StyleBox["Mathematica", FontSlant->"Italic"], " to go ahead and display the graphics object. Here is how Plot3DTogether \ works:" }], "Text"], Cell[BoxData[ \(Plot3DTogether[{x\^2 + y\^2, 18 - x\^2 - y\^2}, {x, \(-3\), 3}, {y, \(-3\), 3}]\)], "Input"], Cell["\<\ Now, wouldn't it be nice if we could just insert a list of two functions into \ Plot3D instead of Plot3DTogether and everything worked out fine? We can do this too! However, Plot3D is a protected symbol. We first have to unprotect \ it, enhance it, and then, for safekeeping, re-protect it: \ \>", "Text"], Cell[BoxData[{ \(\(Unprotect[Plot3D];\)\), "\n", \(\(Plot3D[{f_, g_}, {x_, x0_, x1_}, {y_, y0_, y1_}, opts___] := \n\t Module[{surface1, surface2}, \n\t\tsurface1 = Plot3D[f, {x, x0, x1}, {y, y0, y1}, DisplayFunction -> Identity, opts]; \n\t\tsurface2 = Plot3D[g, {x, x0, x1}, {y, y0, y1}, DisplayFunction -> Identity, opts]; \n\t\tShow[surface1, surface2, DisplayFunction -> $DisplayFunction]];\)\), "\n", \(\(Protect[Plot3D];\)\)}], "Input"], Cell["\<\ Now we've defined for ourselves an enhanced version of Plot3D... \ \>", "Text"], Cell[BoxData[ \(Plot3D[{x\^2 + y\^2, 18 - x\^2 - y\^2}, {x, \(-3\), 3}, {y, \(-3\), 3}, BoxRatios -> Automatic]\)], "Input"], Cell["...and the original version is still intact!", "Text"], Cell[BoxData[ \(Plot3D[x\^2 + y\^2, {x, \(-3\), 3}, {y, \(-3\), 3}, BoxRatios -> Automatic]\)], "Input"], Cell[TextData[{ "For more on defining your own plotting functions, as well as external \ packages, see the book by Roman Maeder, Programming in ", StyleBox["Mathematica", FontSlant->"Italic"], ", published by Addison-Wesley." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Acknowledgements", "Section"], Cell["\<\ This tutorial notebook was develop by Dr Brad Kline while a faculty member at \ the Department of Mathematical Sciences, United States Air Force Academy. Suggestions on further improvements can be submitted to Lt Col Hadfield via email to: steve.hadfield@usafa.af.mil. \ \>", "Text"] }, Closed]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 800}, {0, 527}}, ScreenStyleEnvironment->"Working", WindowToolbars->{}, CellGrouping->Manual, WindowSize->{619, 426}, WindowMargins->{{2, Automatic}, {Automatic, 5}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, 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[1717, 49, 346, 13, 70, "Title", Evaluatable->False], Cell[2066, 64, 591, 18, 86, "Text"], Cell[CellGroupData[{ Cell[2682, 86, 155, 5, 79, "Section"], Cell[2840, 93, 565, 17, 70, "Text"], Cell[CellGroupData[{ Cell[3430, 114, 29, 0, 70, "Subsubsection"], Cell[3462, 116, 112, 3, 70, "Text"], Cell[3577, 121, 63, 1, 70, "Input"], Cell[3643, 124, 334, 9, 70, "Text"], Cell[3980, 135, 598, 16, 70, "Text"], Cell[4581, 153, 126, 5, 70, "Text"], Cell[4710, 160, 74, 1, 70, "Input"], Cell[4787, 163, 153, 5, 70, "Text"], Cell[4943, 170, 142, 4, 70, "Text"], Cell[5088, 176, 65, 1, 70, "Input"], Cell[5156, 179, 96, 4, 70, "Text"], Cell[5255, 185, 169, 4, 70, "Input"], Cell[5427, 191, 534, 19, 70, "Text"], Cell[5964, 212, 26, 0, 70, "Input"], Cell[5993, 214, 192, 5, 70, "Text"], Cell[6188, 221, 113, 2, 70, "Input"], Cell[6304, 225, 41, 0, 70, "Text"], Cell[6348, 227, 125, 3, 70, "Input"], Cell[6476, 232, 458, 10, 70, "Text"], Cell[6937, 244, 278, 9, 70, "Text"], Cell[7218, 255, 26, 0, 70, "Input"], Cell[7247, 257, 249, 6, 70, "Text"], Cell[7499, 265, 131, 3, 70, "Input"], Cell[7633, 270, 68, 0, 70, "Text"], Cell[7704, 272, 95, 2, 70, "Input"], Cell[7802, 276, 292, 7, 70, "Text"], Cell[8097, 285, 317, 5, 70, "Text"], Cell[8417, 292, 56, 1, 70, "Input"], Cell[8476, 295, 56, 1, 70, "Input"], Cell[8535, 298, 53, 1, 70, "Input"], Cell[8591, 301, 118, 3, 70, "Input"], Cell[8712, 306, 60, 1, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[8809, 312, 33, 0, 70, "Subsubsection"], Cell[8845, 314, 118, 5, 70, "Text"], Cell[8966, 321, 212, 6, 70, "Text"], Cell[9181, 329, 217, 3, 70, "Input"], Cell[9401, 334, 182, 6, 70, "Text"], Cell[9586, 342, 50, 1, 70, "Input"], Cell[9639, 345, 184, 6, 70, "Text"], Cell[9826, 353, 156, 5, 70, "Text"], Cell[9985, 360, 110, 2, 70, "Input"], Cell[10098, 364, 196, 6, 70, "Text"], Cell[10297, 372, 81, 1, 70, "Input"], Cell[10381, 375, 273, 8, 70, "Text"], Cell[10657, 385, 146, 3, 70, "Text"], Cell[10806, 390, 26, 0, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[10869, 395, 45, 0, 70, "Subsubsection"], Cell[10917, 397, 204, 6, 70, "Text"], Cell[11124, 405, 614, 11, 70, "Text"], Cell[11741, 418, 449, 11, 70, "Text"], Cell[12193, 431, 16, 0, 70, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[12246, 436, 59, 0, 70, "Subsubsection"], Cell[12308, 438, 386, 9, 70, "Text"], Cell[12697, 449, 91, 1, 70, "Input"], Cell[12791, 452, 258, 8, 70, "Text"], Cell[13052, 462, 66, 1, 70, "Input"], Cell[13121, 465, 95, 4, 70, "Text"], Cell[13219, 471, 56, 1, 70, "Input"], Cell[13278, 474, 73, 0, 70, "Text"], Cell[13354, 476, 186, 3, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[13577, 484, 61, 0, 70, "Subsubsection"], Cell[13641, 486, 192, 7, 70, "Text"], Cell[13836, 495, 82, 1, 70, "Input"], Cell[13921, 498, 165, 6, 70, "Text"], Cell[14089, 506, 162, 2, 70, "Input"], Cell[14254, 510, 164, 6, 70, "Text"], Cell[14421, 518, 97, 4, 70, "Text"], Cell[14521, 524, 435, 14, 70, "Text"], Cell[14959, 540, 26, 0, 70, "Input"], Cell[14988, 542, 450, 10, 70, "Text"], Cell[15441, 554, 87, 1, 70, "Input"], Cell[15531, 557, 68, 0, 70, "Text"], Cell[15602, 559, 87, 1, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[15726, 565, 60, 0, 70, "Subsubsection"], Cell[15789, 567, 173, 5, 70, "Text"], Cell[15965, 574, 52, 1, 70, "Input"], Cell[16020, 577, 90, 4, 70, "Text"], Cell[16113, 583, 86, 1, 70, "Input"], Cell[16202, 586, 328, 8, 70, "Text"], Cell[16533, 596, 121, 2, 70, "Input"], Cell[16657, 600, 181, 3, 70, "Text"], Cell[16841, 605, 26, 0, 70, "Input"], Cell[16870, 607, 213, 7, 70, "Text"], Cell[17086, 616, 91, 1, 70, "Input"], Cell[17180, 619, 156, 5, 70, "Text"], Cell[17339, 626, 115, 2, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[17491, 633, 112, 5, 70, "Subsubsection"], Cell[17606, 640, 437, 10, 70, "Text"], Cell[18046, 652, 212, 7, 70, "Text"], Cell[18261, 661, 68, 1, 70, "Input"], Cell[18332, 664, 120, 5, 70, "Text"], Cell[18455, 671, 99, 2, 70, "Input"], Cell[18557, 675, 424, 14, 70, "Text"], Cell[18984, 691, 158, 5, 70, "Text"], Cell[19145, 698, 66, 1, 70, "Input"], Cell[19214, 701, 53, 0, 70, "Text"], Cell[19270, 703, 60, 1, 70, "Input"], Cell[19333, 706, 34, 0, 70, "Text"], Cell[19370, 708, 68, 1, 70, "Input"], Cell[19441, 711, 46, 0, 70, "Text"], Cell[19490, 713, 74, 1, 70, "Input"], Cell[19567, 716, 236, 7, 70, "Text"], Cell[19806, 725, 64, 1, 70, "Input"], Cell[19873, 728, 61, 0, 70, "Text"], Cell[19937, 730, 69, 1, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[20043, 736, 97, 4, 70, "Subsubsection"], Cell[20143, 742, 238, 6, 70, "Text"], Cell[20384, 750, 118, 2, 70, "Input"], Cell[20505, 754, 72, 0, 70, "Text"], Cell[20580, 756, 67, 1, 70, "Input"], Cell[20650, 759, 25, 0, 70, "Text"], Cell[20678, 761, 113, 5, 70, "Text"], Cell[20794, 768, 387, 8, 70, "Text"], Cell[21184, 778, 353, 8, 70, "Text"], Cell[21540, 788, 58, 1, 70, "Input"], Cell[21601, 791, 68, 0, 70, "Text"], Cell[21672, 793, 67, 1, 70, "Input"], Cell[21742, 796, 66, 0, 70, "Text"], Cell[21811, 798, 118, 2, 70, "Input"] }, Closed]], Cell[21944, 803, 64, 0, 70, "Text"], Cell[22011, 805, 998, 18, 70, "Text"], Cell[23012, 825, 247, 6, 70, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[23296, 836, 125, 5, 34, "Section"], Cell[23424, 843, 119, 5, 70, "Text"], Cell[23546, 850, 74, 1, 70, "Input"], Cell[23623, 853, 57, 0, 70, "Text"], Cell[23683, 855, 37, 0, 70, "Text"], Cell[23723, 857, 157, 6, 70, "Text"], Cell[23883, 865, 40, 1, 70, "Input"], Cell[23926, 868, 466, 9, 70, "Text"], Cell[CellGroupData[{ Cell[24417, 881, 59, 0, 70, "Subsubsection"], Cell[24479, 883, 128, 5, 70, "Text"], Cell[24610, 890, 171, 3, 70, "Input"], Cell[24784, 895, 264, 6, 70, "Text"], Cell[25051, 903, 171, 3, 70, "Input"], Cell[25225, 908, 198, 5, 70, "Text"], Cell[25426, 915, 240, 4, 70, "Input"], Cell[25669, 921, 344, 10, 70, "Text"], Cell[26016, 933, 26, 0, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[26079, 938, 85, 1, 70, "Subsubsection"], Cell[26167, 941, 213, 6, 70, "Text"], Cell[26383, 949, 210, 4, 70, "Input"], Cell[26596, 955, 320, 7, 70, "Text"], Cell[26919, 964, 212, 4, 70, "Input"], Cell[27134, 970, 273, 7, 70, "Text"], Cell[27410, 979, 235, 4, 70, "Input"], Cell[27648, 985, 215, 6, 70, "Text"], Cell[27866, 993, 266, 7, 70, "Text"], Cell[28135, 1002, 175, 5, 70, "Text"], Cell[28313, 1009, 62, 1, 70, "Input"], Cell[28378, 1012, 58, 0, 70, "Text"], Cell[28439, 1014, 42, 1, 70, "Input"], Cell[28484, 1017, 66, 0, 70, "Text"], Cell[28553, 1019, 224, 4, 70, "Input"], Cell[28780, 1025, 100, 4, 70, "Text"], Cell[28883, 1031, 288, 5, 70, "Input"], Cell[29174, 1038, 74, 0, 70, "Text"], Cell[29251, 1040, 126, 2, 70, "Input"], Cell[29380, 1044, 213, 3, 70, "Text"], Cell[29596, 1049, 26, 0, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[29659, 1054, 73, 0, 70, "Subsubsection"], Cell[29735, 1056, 149, 5, 70, "Text"], Cell[29887, 1063, 74, 1, 70, "Input"], Cell[29964, 1066, 537, 10, 70, "Text"], Cell[30504, 1078, 107, 2, 70, "Input"], Cell[30614, 1082, 213, 7, 70, "Text"], Cell[30830, 1091, 92, 1, 70, "Input"], Cell[30925, 1094, 57, 0, 70, "Text"], Cell[30985, 1096, 121, 2, 70, "Input"], Cell[31109, 1100, 50, 0, 70, "Text"], Cell[31162, 1102, 187, 3, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[31386, 1110, 47, 0, 70, "Subsubsection"], Cell[31436, 1112, 253, 7, 70, "Text"], Cell[31692, 1121, 84, 1, 70, "Input"], Cell[31779, 1124, 298, 7, 70, "Text"], Cell[32080, 1133, 115, 2, 70, "Input"], Cell[32198, 1137, 204, 6, 70, "Text"], Cell[32405, 1145, 115, 2, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[32557, 1152, 85, 1, 70, "Subsubsection"], Cell[32645, 1155, 187, 6, 70, "Text"], Cell[32835, 1163, 105, 2, 70, "Input"], Cell[32943, 1167, 52, 0, 70, "Text"], Cell[32998, 1169, 120, 2, 70, "Input"], Cell[33121, 1173, 75, 0, 70, "Text"], Cell[33199, 1175, 220, 3, 70, "Input"], Cell[33422, 1180, 183, 7, 70, "Text"], Cell[33608, 1189, 113, 2, 70, "Input"], Cell[33724, 1193, 150, 5, 70, "Text"], Cell[33877, 1200, 134, 2, 70, "Input"], Cell[34014, 1204, 228, 7, 70, "Text"], Cell[34245, 1213, 159, 3, 70, "Input"], Cell[34407, 1218, 577, 16, 70, "Text"], Cell[34987, 1236, 26, 0, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[35050, 1241, 67, 0, 70, "Subsubsection"], Cell[35120, 1243, 74, 0, 70, "Text"], Cell[35197, 1245, 262, 4, 70, "Input"], Cell[35462, 1251, 160, 5, 70, "Text"], Cell[35625, 1258, 75, 1, 70, "Input"], Cell[35703, 1261, 197, 7, 70, "Text"], Cell[35903, 1270, 161, 3, 70, "Input"], Cell[36067, 1275, 165, 5, 70, "Text"], Cell[36235, 1282, 197, 3, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[36469, 1290, 72, 0, 70, "Subsubsection"], Cell[36544, 1292, 436, 9, 70, "Text"], Cell[36983, 1303, 62, 1, 70, "Input"], Cell[37048, 1306, 76, 0, 70, "Text"], Cell[37127, 1308, 61, 1, 70, "Input"], Cell[37191, 1311, 97, 4, 70, "Text"], Cell[37291, 1317, 80, 1, 70, "Input"], Cell[37374, 1320, 144, 5, 70, "Text"], Cell[37521, 1327, 117, 3, 70, "Input"], Cell[37641, 1332, 119, 5, 70, "Text"], Cell[37763, 1339, 126, 2, 70, "Input"], Cell[37892, 1343, 149, 5, 70, "Text"], Cell[38044, 1350, 122, 3, 70, "Input"], Cell[38169, 1355, 61, 0, 70, "Text"], Cell[38233, 1357, 138, 3, 70, "Input"], Cell[38374, 1362, 225, 4, 70, "Text"], Cell[38602, 1368, 26, 0, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[38665, 1373, 75, 0, 70, "Subsubsection"], Cell[38743, 1375, 220, 6, 70, "Text"], Cell[38966, 1383, 204, 3, 70, "Input"], Cell[39173, 1388, 113, 5, 70, "Text"], Cell[39289, 1395, 279, 4, 70, "Text"], Cell[39571, 1401, 26, 0, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[39634, 1406, 54, 0, 70, "Subsubsection"], Cell[39691, 1408, 110, 5, 70, "Text"], Cell[39804, 1415, 40, 1, 70, "Input"], Cell[39847, 1418, 196, 5, 70, "Text"], Cell[40046, 1425, 313, 7, 70, "Input"], Cell[40362, 1434, 26, 0, 70, "Text"], Cell[40391, 1436, 62, 1, 70, "Input"], Cell[40456, 1439, 23, 0, 70, "Text"], Cell[40482, 1441, 62, 1, 70, "Input"] }, Closed]], Cell[40559, 1445, 334, 8, 70, "Text"], Cell[40896, 1455, 42, 1, 70, "Input"], Cell[40941, 1458, 113, 5, 70, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[41091, 1468, 100, 4, 34, "Section"], Cell[41194, 1474, 187, 7, 70, "Text"], Cell[CellGroupData[{ Cell[41406, 1485, 30, 0, 70, "Subsubsection"], Cell[41439, 1487, 182, 6, 70, "Text"], Cell[41624, 1495, 53, 1, 70, "Input"], Cell[41680, 1498, 335, 8, 70, "Text"], Cell[42018, 1508, 56, 1, 70, "Input"], Cell[42077, 1511, 58, 1, 70, "Input"], Cell[42138, 1514, 105, 5, 70, "Text"], Cell[42246, 1521, 56, 1, 70, "Input"], Cell[42305, 1524, 26, 0, 70, "Text"], Cell[42334, 1526, 56, 1, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[42427, 1532, 43, 0, 70, "Subsubsection"], Cell[42473, 1534, 90, 4, 70, "Text"], Cell[42566, 1540, 72, 1, 70, "Input"], Cell[42641, 1543, 309, 7, 70, "Text"], Cell[42953, 1552, 102, 2, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[43092, 1559, 52, 0, 70, "Subsubsection"], Cell[43147, 1561, 171, 5, 70, "Text"], Cell[43321, 1568, 135, 3, 70, "Input"], Cell[43459, 1573, 148, 5, 70, "Text"], Cell[43610, 1580, 259, 6, 70, "Text"], Cell[43872, 1588, 173, 5, 70, "Text"], Cell[44048, 1595, 163, 3, 70, "Input"], Cell[44214, 1600, 92, 4, 70, "Text"], Cell[44309, 1606, 290, 6, 70, "Input"], Cell[44602, 1614, 499, 15, 70, "Text"], Cell[45104, 1631, 26, 0, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[45167, 1636, 48, 0, 70, "Subsubsection"], Cell[45218, 1638, 299, 7, 70, "Text"], Cell[45520, 1647, 373, 8, 70, "Text"], Cell[45896, 1657, 124, 5, 70, "Text"], Cell[46023, 1664, 138, 3, 70, "Input"], Cell[46164, 1669, 134, 5, 70, "Text"], Cell[46301, 1676, 125, 2, 70, "Input"], Cell[46429, 1680, 547, 10, 70, "Text"], Cell[46979, 1692, 329, 6, 70, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[47357, 1704, 83, 6, 126, "Section"], Cell[47443, 1712, 150, 5, 70, "Text"], Cell[47596, 1719, 277, 5, 70, "Text"], Cell[47876, 1726, 140, 3, 70, "Input"], Cell[48019, 1731, 288, 9, 70, "Text"], Cell[48310, 1742, 188, 3, 70, "Input"], Cell[48501, 1747, 82, 1, 70, "Text"], Cell[48586, 1750, 477, 9, 70, "Text"], Cell[49066, 1761, 145, 5, 70, "Text"], Cell[49214, 1768, 47, 1, 70, "Input"], Cell[49264, 1771, 49, 1, 70, "Input"], Cell[49316, 1774, 231, 4, 70, "Text"], Cell[49550, 1780, 183, 3, 70, "Input"], Cell[49736, 1785, 67, 1, 70, "Input"], Cell[49806, 1788, 224, 4, 70, "Text"], Cell[50033, 1794, 47, 1, 70, "Input"], Cell[50083, 1797, 133, 3, 70, "Text"], Cell[50219, 1802, 124, 2, 70, "Input"], Cell[50346, 1806, 129, 3, 70, "Text"], Cell[50478, 1811, 47, 1, 70, "Input"], Cell[50528, 1814, 128, 5, 70, "Text"], Cell[50659, 1821, 67, 1, 70, "Input"], Cell[50729, 1824, 47, 0, 70, "Text"], Cell[50779, 1826, 106, 2, 70, "Input"], Cell[50888, 1830, 189, 6, 70, "Text"], Cell[51080, 1838, 339, 5, 70, "Input"], Cell[51422, 1845, 58, 0, 70, "Text"], Cell[51483, 1847, 106, 2, 70, "Input"], Cell[51592, 1851, 530, 10, 70, "Text"], Cell[52125, 1863, 456, 8, 70, "Input"], Cell[52584, 1873, 373, 10, 70, "Text"], Cell[52960, 1885, 121, 2, 70, "Input"], Cell[53084, 1889, 322, 9, 70, "Text"], Cell[53409, 1900, 534, 9, 70, "Input"], Cell[53946, 1911, 90, 4, 70, "Text"], Cell[54039, 1917, 135, 2, 70, "Input"], Cell[54177, 1921, 60, 0, 70, "Text"], Cell[54240, 1923, 115, 2, 70, "Input"], Cell[54358, 1927, 248, 6, 70, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[54643, 1938, 35, 0, 70, "Section"], Cell[54681, 1940, 297, 9, 70, "Text"] }, Closed]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)