(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.2' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 43296, 1767]*) (*NotebookOutlinePosition[ 44224, 1798]*) (* CellTagsIndexPosition[ 44180, 1794]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Displaying and Analyzing Data", "Title", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->True], Cell[TextData[{ "Sean Mauch\nsean@caltech.edu\n", ButtonBox["http://www.its.caltech.edu/~sean", ButtonData:>{ URL[ "http://www.its.caltech.edu/~sean"], None}, ButtonStyle->"Hyperlink"], "\n", "This work is distributed under the GNU FDL. See ", ButtonBox["license.nb ", ButtonData:>{"license.nb", None}, ButtonStyle->"Hyperlink"], "for details." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["File Input and Output", "Section"], Cell[CellGroupData[{ Cell["Basic File Operations", "Subsection"], Cell[TextData[{ "You can see the current working directory with ", StyleBox["Directory[]", "Input"], "." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Directory[]\)], "Input"], Cell[TextData[{ "You can list the files in the working directory with the ", Cell[BoxData[ FormBox[ StyleBox[\(FileNames[]\), "Input"], TraditionalForm]]], " function." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(FileNames[]\)], "Input"], Cell[TextData[{ "You can change the working directory with the ", Cell[BoxData[ FormBox[ StyleBox[\(SetDirectory[]\), "Input"], TraditionalForm]]], " function. This function is useful when you are reading in files; it \ saves you from having to specify the full path of a file." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?SetDirectory\)\)], "Input"], Cell[TextData[{ "You can move, copy, and delete files with the following functions. \ (Unless you are programming or writing scripts in ", StyleBox["Mathematica", FontSlant->"Italic"], ", you probably won't need to use these functions. Manipulating files \ through the operating system is easier.)" }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?RenameFile\)\)], "Input"], Cell[BoxData[ \(\(?CopyFile\)\)], "Input"], Cell[BoxData[ \(\(?DeleteFile\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "Saving and Loading Data for Use in ", StyleBox["Mathematica", FontSlant->"Italic"], " " }], "Subsection"], Cell["Below we make a list of 10 random numbers.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(randlist = Table[Random[], {n, 1, 10}]; \)\)], "Input"], Cell[TextData[{ "The ", Cell[BoxData[ FormBox[ StyleBox[\(Put[]\), "Input"], TraditionalForm]]], " function write expressions to a file. The infix form of this function is \ ", Cell[BoxData[ FormBox[ StyleBox[\(expr >> filename\), "Input"], TraditionalForm]]] }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?>>\)\)], "Input"], Cell[BoxData[ \(\(randlist >> rand.txt; \)\)], "Input"], Cell["\<\ We can write the contents of the file into the notebook with the \ following syntax.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(! \(! "\"\)\)\)], "Input"], Cell[TextData[{ "Note that this does not generate any output, (technically it generates the \ ", StyleBox["Null", "Input"], " output). If we want to use the contents of the file in a calcluation, we \ have to read the file." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(<< rand.txt\)], "Input"], Cell["\<\ The output is the contents of the file. We can use this output in \ subsequent calculations.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Sin[%]\)], "Input"], Cell[BoxData[ \(DeleteFile["\"]\)], "Input"], Cell[TextData[{ "You can save the value of a variable with the ", StyleBox["Save[]", "Input"], " function. " }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?Save\)\)], "Input"], Cell[TextData[{ "Note that ", StyleBox["Save[]", FontWeight->"Bold"], " appends definitions if the file already exists. Thus we will remove the \ file first." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(If[FileInformation["\"] != {}, DeleteFile["\"]]\)], "Input"], Cell[BoxData[ \(\(Save["\", randlist]; \)\)], "Input"], Cell[BoxData[ \(\(!! "\"\)\)], "Input"], Cell["\<\ If we clear the definition of randlist and then read in the file \ \"rand.ma\", the definition will be restored.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Clear[randlist]\)], "Input"], Cell[BoxData[ \(\(?randlist\)\)], "Input"], Cell[BoxData[ \(<< rand.ma\)], "Input"], Cell[BoxData[ \(\(?randlist\)\)], "Input"], Cell[BoxData[ \(Clear[randlist]\)], "Input"], Cell[BoxData[ \(DeleteFile["\"]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Saving and Loading Data with Other Applications", "Subsection"], Cell[CellGroupData[{ Cell["A List of Numbers", "Subsubsection"], Cell[TextData[{ "Suppose you want to save ", StyleBox["Mathematica", FontSlant->"Italic"], " numerical data for use in another application, (Matlab, or a C program \ for example). The easiest file format for this is floating point numbers \ separated by white space. If you have programmed in C, then the following \ will look familiar." }], "Text", TextAlignment->Left, TextJustification->1], Cell["First we open a file for output.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?OpenWrite\)\)], "Input"], Cell[BoxData[ \(\(ostream = OpenWrite["\"]; \)\)], "Input"], Cell["Then we write 10 random floating point numbers to that file.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?Write\)\)], "Input"], Cell[BoxData[ \(\(?Do\)\)], "Input"], Cell[BoxData[ \(Do[Write[ostream, Random[]], {n, 1, 10}]\)], "Input"], Cell["Finally we close the file.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?Close\)\)], "Input"], Cell[BoxData[ \(\(Close[ostream]; \)\)], "Input"], Cell["Below we see that the operation was successful.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(!! data.txt\)\)], "Input"], Cell[TextData[{ "We can read this data into ", StyleBox["Mathematica", FontSlant->"Italic"], " with the ", StyleBox["ReadList[]", FontWeight->"Bold"], " function." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?ReadList\)\)], "Input"], Cell[BoxData[ \(numlist = ReadList["\", Number]; \nnumlist // MatrixForm\)], "Input"], Cell[BoxData[ \(Clear[numlist]\)], "Input"], Cell[TextData[{ "The following command may or may not work depending on the operating \ system. If it complains about a privilege violation then you can delete the \ file outside of ", StyleBox["Mathematica", FontSlant->"Italic"], "." }], "Text", TextJustification->1], Cell[BoxData[ \(DeleteFile["\"]\)], "Input"], Cell[TextData[{ "It would be handy if ", StyleBox["Mathematica", FontSlant->"Italic"], " had a ", StyleBox["WriteList[]", FontWeight->"Bold"], " function that would print the elements of a list to a file and separate \ the elements with white space, but alas it does not." }], "Text", TextAlignment->Left, TextJustification->1] }, Closed]], Cell[CellGroupData[{ Cell["A Formatted Array of Numbers", "Subsubsection"], Cell[TextData[{ "The file format for an ", Cell[BoxData[ \(TraditionalForm\`m\[Times]n\)]], " matrix in Matlab is \n", Cell[BoxData[{ \(TraditionalForm \`a\_\(1\ 1\)\ \ \ a\_\(1\ 2\)\ \ \ \[Ellipsis]\ \ \ a\_\(1\ m\)\), \(TraditionalForm\`\[Ellipsis]\), \(TraditionalForm \`a\_\(m\ 1\)\ \ \ a\_\(m\ 2\)\ \ \ \[Ellipsis]\ \ \ a\_\(m\ n\)\)}]], "\nEach row of the matrix is a space-seperated sequence of numbers followed \ by a newline. You would use a similar file format for exporting data to a \ spreadsheet program like Excel." }], "Text", TextAlignment->Left, TextJustification->1], Cell[TextData[{ "To write this file in ", StyleBox["Mathematica", FontSlant->"Italic"], ", we use some string utility functions. A string is a sequence of \ characters between double quotes. The emtpy string is \"\". We concatenate \ strings with the ", StyleBox["<>", "Input"], " operator." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \("\"<>"\< \>"<>"\"\)], "Input"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " does not show you the quotes in OutputForm. You can see the whole \ expression by using ", StyleBox["FullForm[]", FontWeight->"Bold"], ". " }], "Text", TextJustification->1], Cell[BoxData[ \(FullForm[%]\)], "Input"], Cell["Like C, the newline character is '\\n'.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \("\"\)], "Input"], Cell[TextData[{ "You can convert an expression to a string with the ", StyleBox["ToString[]", FontWeight->"Bold"], " function. The default format is OutputForm, which will print six digits \ of floating point numbers." }], "Text", TextJustification->1], Cell[BoxData[ \(\(?ToString\)\)], "Input"], Cell[BoxData[ \(ToString[Random[]]\)], "Input"], Cell[TextData[{ "Since ", StyleBox["Mathematica", FontSlant->"Italic"], " suppresses the quotes, the above output looks like a number, but it is a \ string." }], "Text", TextJustification->1], Cell[BoxData[ \(FullForm[%]\)], "Input"], Cell["You can print more digits if you like.", "Text"], Cell[BoxData[ \(ToString[NumberForm[Random[], 16]]\)], "Input"], Cell[TextData[{ "Below we write a file containing a ", Cell[BoxData[ \(TraditionalForm\`4\[Times]5\)]], " matrix of random numbers. For each row, we write a sequence of \ space-separated numbers followed by a newline." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?WriteString\)\)], "Input"], Cell[BoxData[ \(ostream = OpenWrite["\"]; \n Do[\n\tDo[WriteString[ostream, ToString[Random[]], "\< \>"], {c, 1, 5}]; \n\tWriteString[ostream, "\<\n\>"]\n, {r, 1, 4}]; \nClose[ostream]; \)], "Input"], Cell[BoxData[ \(\(!! mat.txt\)\)], "Input"], Cell[TextData[{ "To read this file into a matrix in ", StyleBox["Mathematica", FontSlant->"Italic"], ", we will use the ", StyleBox["ReadList[]", "Input"], " function to read a row at a time, (a row is a list of five numbers)." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(numarray = ReadList["\", Table[Number, {c, 1, 5}]]; \n numarray // MatrixForm\)], "Input"], Cell["\<\ Alternatively, we could read in a single list of numbers and then \ partition the list into a matrix with five columns.\ \>", "Text", TextJustification->1], Cell[BoxData[ \(numarray = ReadList["\", Number]; \n numarray = Partition[numarray, 5]; \nnumarray // MatrixForm\)], "Input"], Cell[BoxData[ \(Clear[numarray]\)], "Input"], Cell[BoxData[ \(DeleteFile["\"]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["A List or Array of Coordinates.", "Subsubsection"], Cell[TextData[{ "Below we write a ", Cell[BoxData[ \(TraditionalForm\`3\[Times]3\)]], " matrix of two dimensional coordinates." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(ostream = OpenWrite["\"]; \n Do[\n\tDo[\n\t\tWrite[ostream, N[Sin[x]]]; \n\t\t Write[ostream, N[Cos[y]]]\n\t, {x, 0, 2}]\n, {y, 0, 2}]; \n Close[ostream]; \)], "Input"], Cell["We can read this file as a list of numbers.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(numlist = ReadList["\", Number]\)], "Input"], Cell["\<\ We partition the list into a list of two-dimensional coordinates.\ \ \>", "Text"], Cell[BoxData[ \(MatrixForm[coordlist = Partition[numlist, 2]]\)], "Input"], Cell[TextData[{ "Next we partition the list into a ", Cell[BoxData[ \(TraditionalForm\`3\[Times]3\)]], " matrix of two-dimensional coordinates." }], "Text"], Cell[BoxData[ \(MatrixForm[matrixlist = Partition[coordlist, 3]]\)], "Input"], Cell[BoxData[ \(Clear[numlist, coordlist, matrixlist]\)], "Input"], Cell[BoxData[ \(DeleteFile["\"]\)], "Input"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["One Dimensional Data", "Section"], Cell[CellGroupData[{ Cell["Statistical Functions", "Subsection"], Cell["First we generate a list of random numbers.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(scores = Table[N[Random[Integer, {0, 10}]], {i, 1, 20}]\)], "Input"], Cell[TextData[{ "We can sort the scores with the ", StyleBox["Sort[]", "Input"], " function." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(scores = Sort[scores]\)], "Input"], Cell[TextData[{ "The ", StyleBox["DescriptiveStatistics", "Input"], " package contains functions for calculating the mean, mode, etc. of a list \ of numbers." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(<< Statistics`DescriptiveStatistics`\)], "Input"], Cell[BoxData[ \(Median[scores]\)], "Input"], Cell[BoxData[ \(Mean[scores]\)], "Input"], Cell[BoxData[ \(Mode[scores]\)], "Input"], Cell[BoxData[ \(Variance[scores]\)], "Input"], Cell[BoxData[ \(StandardDeviation[scores]\)], "Input"], Cell[TextData[{ "Note that ", StyleBox["scores", FontWeight->"Bold"], " is a list of floating point numbers. If you give the statistics \ functions exact numbers, then will do exact arithmetic. This is probably not \ what you want." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(StandardDeviation[{1, \@2, \[Pi], Sin[1]}]\)], "Input"], Cell["\<\ Of course you could take a numerical approximation of the above \ result, but is it more efficient to work with floating point numbers to start \ with.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(% // N\)], "Input"], Cell[TextData[{ "We can graph the points with the ", StyleBox["ListPlot[]", "Input"], " function." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(ListPlot[scores]; \)\)], "Input"], Cell[TextData[{ "Below we specify that the width of the points should be ", Cell[BoxData[ \(TraditionalForm\`1\/100\)]], " the width of the graph." }], "Text", TextJustification->1], Cell[BoxData[ \(\(ListPlot[scores, PlotStyle -> PointSize[0.01]]; \)\)], "Input"], Cell[TextData[{ "The ", StyleBox["DataManipulation", "Input"], " package contains the ", StyleBox["Frequencies[]", "Input"], " function." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(<< Statistics`DataManipulation`\)], "Input"], Cell[BoxData[ \(\(?Frequencies\)\)], "Input"], Cell[BoxData[ \(Frequencies[scores]\)], "Input"], Cell[TextData[{ "The Graphics package contains the ", StyleBox["BarChart[]", "Input"], " function." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(<< Graphics`Graphics`\)], "Input"], Cell["We can use the frequencies list to make a bar chart.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(BarChart[Frequencies[scores], GridLines -> Automatic]; \)\)], "Input"], Cell[BoxData[ \(Clear[scores]\)], "Input"], Cell[CellGroupData[{ Cell["Exercise 1", "Subsubsection"], Cell[TextData[{ "Simulate 20 tosses of a fair die. What is the value that was rolled most? \ Make a ", StyleBox["BarChart[]", FontWeight->"Bold"], " and a ", StyleBox["PieChart[]", FontWeight->"Bold"], " of the data." }], "Text", TextAlignment->Left, TextJustification->1] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Finite Fourier Transform", "Subsection"], Cell[TextData[{ "Below we solve for the motion of a pendulum under a periodic forcing. The \ result is an ", StyleBox["InterpolatingFunction", FontWeight->"Bold"], ". This contains information about the numerical solution and perhaps its \ derivatives at discrete points in the interval ", Cell[BoxData[ \(TraditionalForm\`t \[Element] \([0, 30]\)\)]], ". ", StyleBox["Mathematica", FontSlant->"Italic"], " interpolates this data to evaluate the numerical solution at any point in \ the interval." }], "Text", TextJustification->1], Cell[BoxData[ \(NDSolve[{\(\(y'\)'\)[t] + Sin[y[t]] == 2 Sin[3 t], y[0] == 0, \(y'\)[0] == 0}, y[t], {t, 0, 30}]\)], "Input"], Cell["\<\ We define soln[t] to be the solution. soln[t] acts just like any \ other function. You can evaluate it, plot it, differentiate it, etc.\ \>", "Text", TextJustification->1], Cell[BoxData[ \(\(soln[t_] = y[t] /. First[%]; \)\)], "Input"], Cell[BoxData[ \(\(Plot[soln[t], {t, 0, 30}]; \)\)], "Input"], Cell["\<\ We sample the solution to get a list of 128 data points and plot \ the data.\ \>", "Text", TextJustification->1], Cell[BoxData[ \(\(data = Table[soln[30\ n/127], {n, 0, 127}]; \)\)], "Input"], Cell[BoxData[ \(\(ListPlot[data]; \)\)], "Input"], Cell[TextData[{ "It's looks better when we have ", StyleBox["Mathematica", FontSlant->"Italic"], " connect the dots." }], "Text", TextJustification->1], Cell[BoxData[ \(\(ListPlot[data, PlotJoined -> True]; \)\)], "Input"], Cell["\<\ We take the finite Fourier transform of the data and plot its real \ part.\ \>", "Text", TextJustification->1], Cell[BoxData[ \(\(ftdata = Fourier[data]; \)\)], "Input"], Cell[BoxData[ \(\(ListPlot[Re[ftdata], PlotJoined -> True, PlotRange -> All]; \)\)], "Input"], Cell["\<\ Here we take the first 64 points, and plot the magnitude of the \ Fourier data.\ \>", "Text", TextJustification->1], Cell[BoxData[ \(\(ftdata = Take[ftdata, 64]; \)\)], "Input"], Cell[BoxData[ \(\(absftdata = Abs[ftdata]; \)\)], "Input"], Cell[BoxData[ \(\(ListPlot[absftdata, PlotJoined -> True, PlotRange -> All]; \)\)], "Input"], Cell[BoxData[ \(Clear[soln, data, ftdata, absftdata]\)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Two Dimensional Data", "Section"], Cell[CellGroupData[{ Cell["Interpolating Data", "Subsection"], Cell["\<\ First we numerically solve a differential equation that models the \ motion of a weakly damped harmonic oscillator.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[{ \(Clear[y]\), \(NDSolve[{\(\(y'\)'\)[t] + 0.1\ \(y'\)[t] + Sin[y[t]] == 0, y[0] == 1, \(y'\)[0] == 0}, y[t], {t, 0, 20}]\)}], "Input"], Cell[TextData[{ "The solution is given as an ", StyleBox["InterpolatingFunction[]", "Input"], ". We can use ", StyleBox["InterpolatingFunction[]", "Input"], "'s in same way as other functions." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(y[t_] = y[t] /. First[%]; \)\)], "Input"], Cell["Here is a plot of the solution.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(Plot[y[t], {t, 0, 20}]; \)\)], "Input"], Cell["\<\ To simulate getting data from another application, we sample the \ solution.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(motion = Table[{N[t], y[t]}, {t, 0, 20, 1/5}]; \)\)], "Input"], Cell["Here is a plot of the data points.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(ListPlot[motion]; \)\)], "Input"], Cell["\<\ We can also view the data as a set of line segments joining the \ points.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(ListPlot[motion, PlotJoined -> True]; \)\)], "Input"], Cell["\<\ Now we construct a function that interpolates the data points.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?Interpolation\)\)], "Input"], Cell[BoxData[ \(inter = Interpolation[motion]\)], "Input"], Cell[TextData[{ "Now we have an ", StyleBox["InterpolatingFunction[]", "Input"], " that we can evaluate to obtain an approximate position of the oscillator \ at any time. At time ", Cell[BoxData[ \(TraditionalForm\`t = 2\)]], " the position is" }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(inter[2]\)], "Input"], Cell[TextData[{ "The ", StyleBox["MultipleListPlot", "Input"], " package contains the ", StyleBox["PlotLegend", "Input"], " option." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(<< Graphics`MultipleListPlot`\)], "Input"], Cell[BoxData[ \(\(?PlotLegend\)\)], "Input"], Cell[TextData[{ "Note that since we can differentiate ", StyleBox["InterpolatingFunction[]", "Input"], "'s just as we would ordinary functions we can obtain approximations of the \ velocity and acceleration." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(Plot[{inter[t], \(inter'\)[t], \(\(inter'\)'\)[t]}, {t, 0, 20}, PlotStyle -> {{RGBColor[1, 0, 0]}, {RGBColor[0, 1, 0]}, { RGBColor[0, 0, 1]}}, PlotLegend -> {Position, Velocity, Acceleration}, LegendPosition -> {1, 0}, \n\tLegendSize -> {2/3, 1/3}]; \)\)], "Input"], Cell[TextData[{ "From the above graph, we see that the minimum velocity, (the maximum \ speed), occurs between time ", Cell[BoxData[ \(TraditionalForm\`t = 1\)]], " and ", Cell[BoxData[ \(TraditionalForm\`t = 2\)]], ". We find this time and velocity below." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(FindMinimum[\(inter'\)[t], {t, 2}]\)], "Input"], Cell[BoxData[ \(Clear[y, inter, motion]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["A Linear Least Squares Fit", "Subsection"], Cell[CellGroupData[{ Cell["Linear Relationship", "Subsubsection"], Cell[TextData[{ "The ", StyleBox["ContinuousDistributions", "Input"], " package contains the definition of a ", StyleBox["NormalDistribution[]", "Input"], "." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(<< Statistics`ContinuousDistributions`\)], "Input"], Cell["\<\ First we make a table of data that has normally distributed errors \ with unit standard deviation.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(lin = Table[{N[x], 1 + x + Random[NormalDistribution[0, 1]]}, {x, 0, 10, 1/2}]; \)\)], "Input"], Cell["Here are the data points.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(ListPlot[lin]; \)\)], "Input"], Cell[TextData[{ "We use the ", StyleBox["Fit[]", "Input"], " function to do a least-squares fit to the data." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?Fit\)\)], "Input"], Cell[TextData[{ "To do a linear fit, we specify that the function should be a linear \ combination of the functions ", Cell[BoxData[ \(TraditionalForm\`1\)]], " and ", Cell[BoxData[ \(TraditionalForm\`x\)]], "." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(linFit[x_] = Fit[lin, {1, x}, x]\)], "Input"], Cell["Below we show the data and the linear fit.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(Show[\n\tListPlot[lin, DisplayFunction -> Identity], \n\t Plot[linFit[x], {x, 0, 10}, DisplayFunction -> Identity], \n\t DisplayFunction -> $DisplayFunction\n]; \)\)], "Input"], Cell[BoxData[ \(Clear[lin, linFit]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Power Law", "Subsubsection"], Cell[TextData[{ "Consider a function ", Cell[BoxData[ \(TraditionalForm\`y(x)\)]], " that has a power law relationship on the dependent variable," }], "Text", TextJustification->1], Cell[BoxData[ \(TraditionalForm\`y(x) = c\ \(x\^a . \)\)], "DisplayFormula", TextAlignment->Center], Cell[TextData[{ "Here ", Cell[BoxData[ \(TraditionalForm\`c\)]], " and ", Cell[BoxData[ \(TraditionalForm\`a\)]], " are constants. An example of this would be the intensity of light, ", Cell[BoxData[ \(TraditionalForm\`y(x)\)]], ", at a distance ", Cell[BoxData[ \(TraditionalForm\`x\)]], " from a point source. In this case we would have ", Cell[BoxData[ \(TraditionalForm\`a = \(-2\)\)]], " since the intensity is inversely proportional to the square of the \ distance." }], "Text", TextJustification->1], Cell[TextData[{ "Suppose we have a data set that we hypothesize to have a power law \ relationship for some constants ", Cell[BoxData[ \(TraditionalForm\`a\)]], " and ", Cell[BoxData[ \(TraditionalForm\`c\)]], ". Below we make a list of data that obeys ", Cell[BoxData[ \(TraditionalForm\`y = x\^\(-3\)\)]], " and has normally distributed errors whose standard deviation is ", Cell[BoxData[ \(TraditionalForm\`5 %\)]], " of the measurement." }], "Text", TextJustification->1], Cell[BoxData[ \(powData = Table[{N[x], \(x\^\(-3\)\) \((1 + 0.05 Random[NormalDistribution[0, 1]])\)}, { x, 1, 10}]\)], "Input"], Cell[BoxData[ \(\(ListPlot[powData, PlotStyle -> PointSize[0.02]]; \)\)], "Input"], Cell[TextData[{ "If we take the logarithm of the power law relationship, we see that the \ logarithm of ", Cell[BoxData[ \(TraditionalForm\`y(x)\)]], " is a linear function of the logarithm of ", Cell[BoxData[ \(TraditionalForm\`x\)]], ". Thus plotting ", Cell[BoxData[ \(TraditionalForm\`log\ y\)]], " versus ", Cell[BoxData[ \(TraditionalForm\`log\ x\)]], " would give us a line with slope ", Cell[BoxData[ \(TraditionalForm\`a\)]], " and ", Cell[BoxData[ \(TraditionalForm\`y\)]], "-intercept ", Cell[BoxData[ \(TraditionalForm\`log\ c\)]], "." }], "Text", TextJustification->1], Cell[BoxData[ \(TraditionalForm\`log\ y = a\ log\ x + log\ \(c . \)\)], "DisplayFormula",\ TextAlignment->Center], Cell[TextData[{ "We take the logarithm of the ", Cell[BoxData[ \(TraditionalForm\`x\)]], " and ", Cell[BoxData[ \(TraditionalForm\`y\)]], " data pairs and plot the result." }], "Text", TextJustification->1], Cell[BoxData[ \(logLogData = Log[powData]\)], "Input"], Cell[BoxData[ \(\(ListPlot[logLogData, PlotStyle -> PointSize[0.02]]; \)\)], "Input"], Cell["We do a linear least squares fit to the log-log data.", "Text", TextJustification->1], Cell[BoxData[ \(Fit[logLogData, {1, x}, x]\)], "Input"], Cell[BoxData[ \(Exp[\(-0.00541016\)]\)], "Input"], Cell[TextData[{ "This yields the experimental power law, ", Cell[BoxData[ \(TraditionalForm\`y \[TildeEqual] 0.995\ x\^\(-2.98\)\)]], "." }], "Text", TextJustification->1] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["A Quadratic Least Squares Fit with Error Bars", "Subsection"], Cell[TextData[{ "First we make a table of data that has normally distributed errors about \ the line ", Cell[BoxData[ \(TraditionalForm\`1 + x + x\^2\)]], ". The standard deviation of the errors is ", Cell[BoxData[ \(TraditionalForm\`1\/2\)]], "." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(quad = Table[{N[x], 1 + x + x\^2\/10 + Random[NormalDistribution[0, 1/2]]}, { x, 0, 10, 1/2}]; \)\)], "Input"], Cell["Here is a plot of the data points.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(ListPlot[quad]; \)\)], "Input"], Cell["From the dimensions we see that there are 21 data points.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(Dimensions[quad]\)], "Input"], Cell[TextData[{ "The ", StyleBox["MultipleListPlot", "Input"], " package contains the definition of the ", StyleBox["MultipleListPlot[]", "Input"], " and ", StyleBox["ErrorBar[]", "Input"], " functions." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(<< Graphics`MultipleListPlot`\)], "Input"], Cell[BoxData[ \(\(?ErrorBar\)\)], "Input"], Cell[TextData[{ "We suppose that the error in making a measurement is ", Cell[BoxData[ \(TraditionalForm\`1\/2\)]], ". We make a table of the values of ", Cell[BoxData[ \(TraditionalForm\`x\)]], ", the measurement, and the error." }], "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(quadError = Table[{{quad[\([n, 1]\)], quad[\([n, 2]\)]}, ErrorBar[1/2]}, {n, 1, 21}]; \)\)], "Input"], Cell[BoxData[ \(Short[quadError, 5]\)], "Input"], Cell["Now we can plot the data with the error bars.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(?MultipleListPlot\)\)], "Input"], Cell[BoxData[ \(\(mlp = MultipleListPlot[quadError]; \)\)], "Input"], Cell["First we try to do a linear least-squares fit to the data.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(lin[x_] = Fit[quad, {1, x}, x]\)], "Input"], Cell["Here is a plot of the data and the linear fit.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(Show[mlp, Plot[lin[x], {x, 0, 10}, DisplayFunction -> Identity], DisplayFunction -> $DisplayFunction]; \)\)], "Input"], Cell["\<\ We can subtract the value of the linear fit from the data points to \ make a difference plot.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(diff = Table[{{quad[\([n, 1]\)], quad[\([n, 2]\)] - lin[quad[\([n, 1]\)]]}, ErrorBar[1/2]}, {n, 1, 21}]; \)\)], "Input"], Cell[BoxData[ \(Short[diff, 5]\)], "Input"], Cell[BoxData[ \(\(MultipleListPlot[diff]; \)\)], "Input"], Cell["\<\ There is a quadratic scattering of the points in the difference \ plot. This leads us to try a quadratic least-squares fit of the data.\ \>", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(q[x_] = Fit[quad, {1, x, x\^2}, x]\)], "Input"], Cell[BoxData[ \(\(Show[mlp, Plot[q[x], {x, 0, 10}, DisplayFunction -> Identity], DisplayFunction -> $DisplayFunction]; \)\)], "Input"], Cell[BoxData[ \(\(diff = Table[{{quad[\([n, 1]\)], quad[\([n, 2]\)] - q[quad[\([n, 1]\)]]}, ErrorBar[1/2]}, {n, 1, 21}]; \)\)], "Input"], Cell["Note the random scattering in the difference plot.", "Text", TextAlignment->Left, TextJustification->1], Cell[BoxData[ \(\(MultipleListPlot[diff]; \)\)], "Input"], Cell[BoxData[ \(Clear[quad, quadError, mlp, lin, q, diff]\)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Three Dimensional Data", "Section"], Cell[CellGroupData[{ Cell["Plotting a Matrix of Values", "Subsection"], Cell["\<\ We make a table of the least common multiple of two integers.\ \>", "Text"], Cell[BoxData[ \(lcmarray = Table[LCM[i, j], {i, 1, 10}, {j, 1, 10}]; \n lcmarray // MatrixForm\)], "Input"], Cell[TextData[{ "We can plot an array of values with the ", Cell[BoxData[ FormBox[ StyleBox[\(ListPlot3D[]\), "Input"], TraditionalForm]]], " function." }], "Text"], Cell[BoxData[ \(\(?ListPlot3D\)\)], "Input"], Cell[BoxData[ \(\(ListPlot3D[lcmarray]; \)\)], "Input"], Cell[BoxData[ \(Clear[lcmarray]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Plotting a List of Three Dimensional Coordinates", "Subsection"], Cell["\<\ To simulate the ouput of another program, we make a list of three \ dimensional coordinates that lie on a curve.\ \>", "Text", TextJustification->1], Cell[BoxData[ \(\(wavy = Table[N[{r\ Cos[2 \[Pi]\ r], r\ Sin[2 \[Pi]\ r], r\ Sin[10 \[Pi]\ r]/4}], {r, 0, 5, 1/100}]; \)\)], "Input"], Cell[TextData[{ "The ", StyleBox["Graphics3D", FontWeight->"Bold"], " package contains the ", Cell[BoxData[ FormBox[ StyleBox[\(ScatterPlot3D[]\), FontWeight->"Bold"], TraditionalForm]]], " function which displays a list of three-dimensional coordinates." }], "Text", TextJustification->1], Cell[BoxData[ \(<< Graphics`Graphics3D`\)], "Input"], Cell[BoxData[ \(\(?ScatterPlot3D\)\)], "Input"], Cell[BoxData[ \(\(ScatterPlot3D[wavy]; \)\)], "Input"], Cell["\<\ We can also view this data as a red line connecting the \ points.\ \>", "Text"], Cell[BoxData[ \(\(ScatterPlot3D[wavy, PlotJoined -> True, PlotStyle -> RGBColor[1, 0, 0]]; \)\)], "Input"], Cell[BoxData[ \(Clear[wavy]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Plotting a Matrix of Three Dimensional Coordinates", "Subsection"], Cell["\<\ Below we make a matrix of three dimensional coordinates that lie on \ a hemisphere.\ \>", "Text"], Cell[BoxData[ \(\(hemi = Table[N[{Cos[\[Theta]] Sin[\[Phi]], Sin[\[Theta]] Sin[\[Phi]], Cos[\[Phi]]}], {\[Theta], 0, \[Pi], \[Pi]/20}, {\[Phi], 0, \[Pi], \[Pi]/20}]; \)\)], "Input"], Cell["\<\ From the dimensions we see that we have a 21 by 21 array of three \ dimensional coordinates.\ \>", "Text"], Cell[BoxData[ \(Dimensions[hemi]\)], "Input"], Cell[TextData[{ "The ", StyleBox["Graphics3D", "Input"], " package contains functions for displaying this information." }], "Text"], Cell[BoxData[ \(<< Graphics`Graphics3D`\)], "Input"], Cell[BoxData[ \(\(?ListSurfacePlot3D\)\)], "Input"], Cell[BoxData[ \(\(ListSurfacePlot3D[hemi]; \)\)], "Input"], Cell[BoxData[ \(\(?ScatterPlot3D\)\)], "Input"], Cell[TextData[{ "If we flatten the matrix of points to a list of points, we can view the \ data with ", StyleBox["ScatterPlot3D[]", "Input"], "." }], "Text"], Cell[BoxData[ \(\(ScatterPlot3D[Flatten[hemi, 1]]; \)\)], "Input"], Cell[BoxData[ \(Clear[hemi]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Interpolating a Matrix of Values", "Subsection"], Cell[TextData[{ "Here is a plot of the function ", Cell[BoxData[ \(TraditionalForm\`\(sin(x)\)\ \(sin(y)\)\)]], "." }], "Text"], Cell[BoxData[ \(\(Plot3D[Sin[x] Sin[y], {x, 0, 2 \[Pi]}, {y, 0, 2 \[Pi]}, PlotPoints -> 50]; \)\)], "Input"], Cell[TextData[{ "We sample this function on a ", Cell[BoxData[ \(TraditionalForm\`9\[Times]9\)]], " grid." }], "Text"], Cell[BoxData[ \(\(data = Table[N[Sin[x] Sin[y]], {x, 0, 2 \[Pi], \[Pi]/4}, {y, 0, 2 \[Pi], \[Pi]/4}]; \)\)], "Input"], Cell["Here is a plot of the data points.", "Text"], Cell[BoxData[ \(\(ListPlot3D[data]; \)\)], "Input"], Cell[TextData[{ "We can interpolate the array of data with the ", StyleBox["ListInterpolation[]", "Input"], " function." }], "Text"], Cell[BoxData[ \(\(?ListInterpolation\)\)], "Input"], Cell[BoxData[ \(f = ListInterpolation[data, {{0, 2 \[Pi]}, {0, 2 \[Pi]}}]\)], "Input"], Cell[BoxData[ \(\(Plot3D[f[x, y], {x, 0, 2 \[Pi]}, {y, 0, 2 \[Pi]}, PlotPoints -> 50]; \)\)], "Input"], Cell[BoxData[ \(Clear[data, f]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Interpolating a List of Three Dimensional Coordinates", "Subsection"], Cell[TextData[{ "Below we make tables of a parameter value and the ", Cell[BoxData[ \(TraditionalForm\`x\)]], ", ", Cell[BoxData[ \(TraditionalForm\`y\)]], " and ", Cell[BoxData[ \(TraditionalForm\`z\)]], " coordinates of a spiral in space." }], "Text"], Cell[BoxData[ \(sx = N[Table[{\[Theta], Cos[\[Theta]]}, {\[Theta], 0, 6 \[Pi], \[Pi]/4}]]; \nsy = N[Table[{\[Theta], Sin[\[Theta]]}, {\[Theta], 0, 6 \[Pi], \[Pi]/4}]]; \n sz = N[Table[{\[Theta], \[Theta]/12}, {\[Theta], 0, 6 \[Pi], \[Pi]/4}]]; \)], "Input"], Cell[TextData[{ "Below we obtain a list of the ", Cell[BoxData[ \(TraditionalForm\`x\)]], " coordinates." }], "Text"], Cell[BoxData[ \(Short[\(Transpose[sx]\)[\([2]\)], 6]\)], "Input"], Cell[TextData[{ "Now we plot a list of the ", Cell[BoxData[ \(TraditionalForm\`\((x, y, z)\)\)]], " coordinates." }], "Text"], Cell[BoxData[ \(\(ScatterPlot3D[ Transpose[{\(Transpose[sx]\)[\([2]\)], \(Transpose[sy]\)[\([2]\)], \(Transpose[sz]\)[\([2]\)]}], PlotStyle -> PointSize[0.01]]; \)\)], "Input"], Cell["\<\ The above plot doesn't give us much of a clue as to what the \ original curve looked like. If we join the points, we'll get a better \ idea.\ \>", "Text"], Cell[BoxData[ \(\(ScatterPlot3D[ Transpose[{\(Transpose[sx]\)[\([2]\)], \(Transpose[sy]\)[\([2]\)], \(Transpose[sz]\)[\([2]\)]}], PlotJoined -> True]; \)\)], "Input"], Cell["\<\ From the line segments above we see that we are dealing with a \ spiral. To get a picture of what the original curve may have looked like we \ will interpolate the points. We do this separately for each coordinate.\ \>", "Text"], Cell[BoxData[ \(fx[\[Theta]_] = \(Interpolation[sx]\)[\[Theta]]; \n fy[\[Theta]_] = \(Interpolation[sy]\)[\[Theta]]; \n fz[\[Theta]_] = \(Interpolation[sz]\)[\[Theta]]; \)], "Input"], Cell[TextData[{ "Now we have an ", StyleBox["InterpolatingFunction[]", "Input"], " for each coordinate." }], "Text"], Cell[BoxData[ \(fx[\[Theta]]\)], "Input"], Cell[TextData[{ "We can plot these continuous functions using ", StyleBox["ParametricPlot3D[]", "Input"], "." }], "Text"], Cell[BoxData[ \(<< Graphics`ParametricPlot3D`\)], "Input"], Cell[BoxData[ \(\(ParametricPlot3D[{fx[\[Theta]], fy[\[Theta]], fz[\[Theta]]}, { \[Theta], 0, 6 \[Pi]}]; \)\)], "Input"], Cell[BoxData[ \(Clear[sx, sy, sz, fx, fy, fz]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Interpolating a Matrix of Three Dimensional Coordinates", "Subsection"], Cell[TextData[{ "Below we make a ", Cell[BoxData[ \(TraditionalForm\`5\[Times]5\)]], " matrix of three dimensional coordinates that lie on a hemisphere." }], "Text"], Cell[BoxData[ \(\(hemi = Table[N[{Cos[\[Theta]] Sin[\[Phi]], Sin[\[Theta]] Sin[\[Phi]], Cos[\[Phi]]}], {\[Theta], 0, \[Pi], \[Pi]/4}, {\[Phi], 0, \[Pi], \[Pi]/4}]; \)\)], "Input"], Cell["\<\ The Graphics3D package contains functions for displaying this \ information.\ \>", "Text"], Cell[BoxData[ \(<< Graphics`Graphics3D`\)], "Input"], Cell[BoxData[ \(\(ListSurfacePlot3D[hemi]; \)\)], "Input"], Cell[TextData[{ "This surface looks roughly like a hemisphere. From the dimensions of \ hemi, we see that it is a ", Cell[BoxData[ \(TraditionalForm\`5\[Times]5\)]], " array of three dimensional coordinates." }], "Text"], Cell[BoxData[ \(Dimensions[hemi]\)], "Input"], Cell[TextData[{ "Using the ", StyleBox["Transpose[]", "Input"], " function we can create a list of three ", Cell[BoxData[ \(TraditionalForm\`5\[Times]5\)]], " arrays. These arrays are the ", Cell[BoxData[ \(TraditionalForm\`x\)]], ", ", Cell[BoxData[ \(TraditionalForm\`y\)]], " and ", Cell[BoxData[ \(TraditionalForm\`z\)]], " coordinates." }], "Text"], Cell[BoxData[ \(\(?Transpose\)\)], "Input"], Cell[BoxData[ \(Dimensions[Transpose[hemi, {3, 2, 1}]]\)], "Input"], Cell[TextData[{ "Now we can interpolate each of these arrays to obtain three functions that \ are ", Cell[BoxData[ \(TraditionalForm\`x\)]], ", ", Cell[BoxData[ \(TraditionalForm\`y\)]], " and ", Cell[BoxData[ \(TraditionalForm\`z\)]], " coordinates of the interpolated data." }], "Text"], Cell[BoxData[ \(fx = ListInterpolation[ \(Transpose[hemi, {3, 2, 1}]\)[\([1]\)], {{0, \[Pi]}, {0, \[Pi]}}]; \n fy = ListInterpolation[ \(Transpose[hemi, {3, 2, 1}]\)[\([2]\)], {{0, \[Pi]}, {0, \[Pi]}}]; \n fz = ListInterpolation[ \(Transpose[hemi, {3, 2, 1}]\)[\([3]\)], {{0, \[Pi]}, {0, \[Pi]}}]; \)], "Input"], Cell[TextData[{ "Finally, we can plot these ", StyleBox["InterpolationFunctions", "Input"], " with ", StyleBox["ParametricPlot3D[]", "Input"], "." }], "Text"], Cell[BoxData[ \(<< Graphics`ParametricPlot3D`\)], "Input"], Cell[BoxData[ \(\(ParametricPlot3D[{fx[\[Theta], \[Phi]], fy[\[Theta], \[Phi]], fz[\[Theta], \[Phi]]}, {\[Theta], 0, \[Pi]}, {\[Phi], 0, \[Pi]}]; \)\)], "Input"], Cell[BoxData[ \(Clear[hemi, fx, fy, fz]\)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Solutions", "Section"], Cell[CellGroupData[{ Cell["Solution 1", "Subsubsection"], Cell[BoxData[ \(toss = Table[Random[Integer, {1, 6}], {20}]\)], "Input"], Cell[BoxData[ \(Mode[toss]\)], "Input"], Cell[BoxData[ \(\(BarChart[Frequencies[toss]]; \)\)], "Input"], Cell[BoxData[ \(\(PieChart[Frequencies[toss]]; \)\)], "Input"], Cell[BoxData[ \(Clear[toss]\)], "Input"] }, Closed]] }, Closed]] }, Open ]] }, FrontEndVersion->"5.2 for Microsoft Windows", ScreenRectangle->{{0, 1680}, {0, 963}}, WindowToolbars->"EditBar", CellGrouping->Automatic, WindowSize->{772, 763}, WindowMargins->{{2, Automatic}, {Automatic, 2}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, CharacterEncoding->"XAutomaticEncoding", Magnification->1.5 ] (******************************************************************* 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[CellGroupData[{ Cell[1776, 53, 119, 3, 222, "Title", Evaluatable->False], Cell[1898, 58, 439, 14, 125, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[2362, 76, 40, 0, 109, "Section"], Cell[CellGroupData[{ Cell[2427, 80, 43, 0, 68, "Subsection"], Cell[2473, 82, 169, 6, 48, "Text"], Cell[2645, 90, 44, 1, 42, "Input"], Cell[2692, 93, 257, 9, 47, "Text"], Cell[2952, 104, 44, 1, 42, "Input"], Cell[2999, 107, 368, 10, 73, "Text"], Cell[3370, 119, 50, 1, 42, "Input"], Cell[3423, 122, 369, 9, 99, "Text"], Cell[3795, 133, 48, 1, 42, "Input"], Cell[3846, 136, 46, 1, 42, "Input"], Cell[3895, 139, 48, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[3980, 145, 132, 5, 42, "Subsection"], Cell[4115, 152, 105, 2, 47, "Text"], Cell[4223, 156, 77, 1, 42, "Input"], Cell[4303, 159, 375, 14, 67, "Text"], Cell[4681, 175, 40, 1, 42, "Input"], Cell[4724, 178, 59, 1, 42, "Input"], Cell[4786, 181, 155, 5, 47, "Text"], Cell[4944, 188, 59, 1, 42, "Input"], Cell[5006, 191, 290, 8, 74, "Text"], Cell[5299, 201, 44, 1, 42, "Input"], Cell[5346, 204, 164, 5, 47, "Text"], Cell[5513, 211, 39, 1, 42, "Input"], Cell[5555, 214, 59, 1, 42, "Input"], Cell[5617, 217, 174, 6, 48, "Text"], Cell[5794, 225, 42, 1, 42, "Input"], Cell[5839, 228, 228, 8, 47, "Text"], Cell[6070, 238, 103, 2, 42, "Input"], Cell[6176, 242, 68, 1, 42, "Input"], Cell[6247, 245, 53, 1, 42, "Input"], Cell[6303, 248, 183, 5, 73, "Text"], Cell[6489, 255, 48, 1, 42, "Input"], Cell[6540, 258, 46, 1, 42, "Input"], Cell[6589, 261, 43, 1, 42, "Input"], Cell[6635, 264, 46, 1, 42, "Input"], Cell[6684, 267, 48, 1, 42, "Input"], Cell[6735, 270, 58, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[6830, 276, 69, 0, 42, "Subsection"], Cell[CellGroupData[{ Cell[6924, 280, 42, 0, 61, "Subsubsection"], Cell[6969, 282, 408, 10, 99, "Text"], Cell[7380, 294, 95, 2, 47, "Text"], Cell[7478, 298, 47, 1, 42, "Input"], Cell[7528, 301, 74, 1, 42, "Input"], Cell[7605, 304, 123, 2, 47, "Text"], Cell[7731, 308, 43, 1, 42, "Input"], Cell[7777, 311, 40, 1, 42, "Input"], Cell[7820, 314, 73, 1, 42, "Input"], Cell[7896, 317, 89, 2, 47, "Text"], Cell[7988, 321, 43, 1, 42, "Input"], Cell[8034, 324, 53, 1, 42, "Input"], Cell[8090, 327, 110, 2, 47, "Text"], Cell[8203, 331, 48, 1, 42, "Input"], Cell[8254, 334, 240, 10, 47, "Text"], Cell[8497, 346, 46, 1, 42, "Input"], Cell[8546, 349, 103, 2, 68, "Input"], Cell[8652, 353, 47, 1, 42, "Input"], Cell[8702, 356, 281, 8, 73, "Text"], Cell[8986, 366, 59, 1, 42, "Input"], Cell[9048, 369, 349, 11, 73, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[9434, 385, 53, 0, 38, "Subsubsection"], Cell[9490, 387, 637, 16, 169, "Text"], Cell[10130, 405, 367, 11, 100, "Text"], Cell[10500, 418, 63, 1, 42, "Input"], Cell[10566, 421, 257, 9, 73, "Text"], Cell[10826, 432, 44, 1, 42, "Input"], Cell[10873, 435, 102, 2, 47, "Text"], Cell[10978, 439, 48, 1, 42, "Input"], Cell[11029, 442, 265, 7, 73, "Text"], Cell[11297, 451, 46, 1, 42, "Input"], Cell[11346, 454, 51, 1, 42, "Input"], Cell[11400, 457, 203, 7, 73, "Text"], Cell[11606, 466, 44, 1, 42, "Input"], Cell[11653, 469, 54, 0, 47, "Text"], Cell[11710, 471, 67, 1, 42, "Input"], Cell[11780, 474, 291, 8, 73, "Text"], Cell[12074, 484, 49, 1, 42, "Input"], Cell[12126, 487, 229, 4, 198, "Input"], Cell[12358, 493, 47, 1, 42, "Input"], Cell[12408, 496, 300, 9, 74, "Text"], Cell[12711, 507, 124, 2, 68, "Input"], Cell[12838, 511, 167, 4, 73, "Text"], Cell[13008, 517, 143, 2, 94, "Input"], Cell[13154, 521, 48, 1, 42, "Input"], Cell[13205, 524, 58, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[13300, 530, 56, 0, 38, "Subsubsection"], Cell[13359, 532, 198, 7, 47, "Text"], Cell[13560, 541, 219, 4, 224, "Input"], Cell[13782, 547, 106, 2, 47, "Text"], Cell[13891, 551, 79, 1, 42, "Input"], Cell[13973, 554, 91, 3, 47, "Text"], Cell[14067, 559, 78, 1, 42, "Input"], Cell[14148, 562, 168, 5, 47, "Text"], Cell[14319, 569, 81, 1, 42, "Input"], Cell[14403, 572, 70, 1, 42, "Input"], Cell[14476, 575, 63, 1, 42, "Input"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[14600, 583, 39, 0, 62, "Section"], Cell[CellGroupData[{ Cell[14664, 587, 43, 0, 68, "Subsection"], Cell[14710, 589, 106, 2, 47, "Text"], Cell[14819, 593, 88, 1, 42, "Input"], Cell[14910, 596, 158, 6, 48, "Text"], Cell[15071, 604, 54, 1, 42, "Input"], Cell[15128, 607, 223, 7, 74, "Text"], Cell[15354, 616, 69, 1, 42, "Input"], Cell[15426, 619, 47, 1, 42, "Input"], Cell[15476, 622, 45, 1, 42, "Input"], Cell[15524, 625, 45, 1, 42, "Input"], Cell[15572, 628, 49, 1, 42, "Input"], Cell[15624, 631, 58, 1, 42, "Input"], Cell[15685, 634, 303, 9, 73, "Text"], Cell[15991, 645, 75, 1, 49, "Input"], Cell[16069, 648, 222, 6, 73, "Text"], Cell[16294, 656, 39, 1, 42, "Input"], Cell[16336, 659, 163, 6, 48, "Text"], Cell[16502, 667, 55, 1, 42, "Input"], Cell[16560, 670, 195, 6, 52, "Text"], Cell[16758, 678, 85, 1, 42, "Input"], Cell[16846, 681, 206, 8, 48, "Text"], Cell[17055, 691, 64, 1, 42, "Input"], Cell[17122, 694, 49, 1, 42, "Input"], Cell[17174, 697, 52, 1, 42, "Input"], Cell[17229, 700, 164, 6, 48, "Text"], Cell[17396, 708, 54, 1, 42, "Input"], Cell[17453, 711, 115, 2, 47, "Text"], Cell[17571, 715, 92, 1, 42, "Input"], Cell[17666, 718, 46, 1, 42, "Input"], Cell[CellGroupData[{ Cell[17737, 723, 35, 0, 61, "Subsubsection"], Cell[17775, 725, 296, 11, 73, "Text"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[18120, 742, 46, 0, 42, "Subsection"], Cell[18169, 744, 563, 15, 125, "Text"], Cell[18735, 761, 140, 2, 68, "Input"], Cell[18878, 765, 188, 5, 73, "Text"], Cell[19069, 772, 66, 1, 42, "Input"], Cell[19138, 775, 64, 1, 42, "Input"], Cell[19205, 778, 124, 4, 47, "Text"], Cell[19332, 784, 81, 1, 42, "Input"], Cell[19416, 787, 53, 1, 42, "Input"], Cell[19472, 790, 163, 6, 47, "Text"], Cell[19638, 798, 73, 1, 42, "Input"], Cell[19714, 801, 122, 4, 47, "Text"], Cell[19839, 807, 61, 1, 42, "Input"], Cell[19903, 810, 100, 2, 42, "Input"], Cell[20006, 814, 127, 4, 47, "Text"], Cell[20136, 820, 64, 1, 42, "Input"], Cell[20203, 823, 62, 1, 42, "Input"], Cell[20268, 826, 99, 2, 42, "Input"], Cell[20370, 830, 69, 1, 42, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[20488, 837, 39, 0, 62, "Section"], Cell[CellGroupData[{ Cell[20552, 841, 40, 0, 68, "Subsection"], Cell[20595, 843, 186, 5, 73, "Text"], Cell[20784, 850, 167, 3, 120, "Input"], Cell[20954, 855, 263, 8, 75, "Text"], Cell[21220, 865, 63, 1, 42, "Input"], Cell[21286, 868, 94, 2, 47, "Text"], Cell[21383, 872, 61, 1, 42, "Input"], Cell[21447, 875, 147, 5, 47, "Text"], Cell[21597, 882, 84, 1, 42, "Input"], Cell[21684, 885, 97, 2, 47, "Text"], Cell[21784, 889, 55, 1, 42, "Input"], Cell[21842, 892, 144, 5, 47, "Text"], Cell[21989, 899, 75, 1, 42, "Input"], Cell[22067, 902, 136, 5, 47, "Text"], Cell[22206, 909, 51, 1, 42, "Input"], Cell[22260, 912, 62, 1, 42, "Input"], Cell[22325, 915, 320, 10, 74, "Text"], Cell[22648, 927, 41, 1, 42, "Input"], Cell[22692, 930, 201, 8, 48, "Text"], Cell[22896, 940, 62, 1, 42, "Input"], Cell[22961, 943, 48, 1, 42, "Input"], Cell[23012, 946, 273, 7, 74, "Text"], Cell[23288, 955, 320, 5, 172, "Input"], Cell[23611, 962, 339, 11, 73, "Text"], Cell[23953, 975, 67, 1, 42, "Input"], Cell[24023, 978, 56, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[24116, 984, 48, 0, 42, "Subsection"], Cell[CellGroupData[{ Cell[24189, 988, 44, 0, 61, "Subsubsection"], Cell[24236, 990, 227, 8, 75, "Text"], Cell[24466, 1000, 71, 1, 42, "Input"], Cell[24540, 1003, 169, 5, 47, "Text"], Cell[24712, 1010, 135, 3, 68, "Input"], Cell[24850, 1015, 88, 2, 47, "Text"], Cell[24941, 1019, 52, 1, 42, "Input"], Cell[24996, 1022, 174, 6, 48, "Text"], Cell[25173, 1030, 41, 1, 42, "Input"], Cell[25217, 1033, 292, 11, 73, "Text"], Cell[25512, 1046, 65, 1, 42, "Input"], Cell[25580, 1049, 105, 2, 47, "Text"], Cell[25688, 1053, 210, 3, 146, "Input"], Cell[25901, 1058, 51, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[25989, 1064, 34, 0, 38, "Subsubsection"], Cell[26026, 1066, 194, 6, 47, "Text"], Cell[26223, 1074, 105, 2, 35, "DisplayFormula"], Cell[26331, 1078, 562, 19, 99, "Text"], Cell[26896, 1099, 521, 16, 99, "Text"], Cell[27420, 1117, 161, 4, 94, "Input"], Cell[27584, 1123, 86, 1, 42, "Input"], Cell[27673, 1126, 656, 25, 99, "Text"], Cell[28332, 1153, 120, 3, 35, "DisplayFormula"], Cell[28455, 1158, 230, 9, 47, "Text"], Cell[28688, 1169, 58, 1, 42, "Input"], Cell[28749, 1172, 89, 1, 42, "Input"], Cell[28841, 1175, 93, 1, 47, "Text"], Cell[28937, 1178, 59, 1, 42, "Input"], Cell[28999, 1181, 53, 1, 42, "Input"], Cell[29055, 1184, 185, 6, 47, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[29289, 1196, 67, 0, 42, "Subsection"], Cell[29359, 1198, 329, 11, 78, "Text"], Cell[29691, 1211, 149, 3, 128, "Input"], Cell[29843, 1216, 97, 2, 47, "Text"], Cell[29943, 1220, 53, 1, 42, "Input"], Cell[29999, 1223, 120, 2, 47, "Text"], Cell[30122, 1227, 49, 1, 42, "Input"], Cell[30174, 1230, 276, 10, 75, "Text"], Cell[30453, 1242, 62, 1, 42, "Input"], Cell[30518, 1245, 46, 1, 42, "Input"], Cell[30567, 1248, 312, 10, 78, "Text"], Cell[30882, 1260, 141, 3, 68, "Input"], Cell[31026, 1265, 52, 1, 42, "Input"], Cell[31081, 1268, 108, 2, 47, "Text"], Cell[31192, 1272, 54, 1, 42, "Input"], Cell[31249, 1275, 72, 1, 42, "Input"], Cell[31324, 1278, 121, 2, 47, "Text"], Cell[31448, 1282, 63, 1, 42, "Input"], Cell[31514, 1285, 109, 2, 47, "Text"], Cell[31626, 1289, 147, 2, 94, "Input"], Cell[31776, 1293, 164, 5, 47, "Text"], Cell[31943, 1300, 160, 3, 94, "Input"], Cell[32106, 1305, 47, 1, 42, "Input"], Cell[32156, 1308, 61, 1, 42, "Input"], Cell[32220, 1311, 210, 6, 73, "Text"], Cell[32433, 1319, 67, 1, 42, "Input"], Cell[32503, 1322, 145, 2, 68, "Input"], Cell[32651, 1326, 158, 3, 94, "Input"], Cell[32812, 1331, 113, 2, 47, "Text"], Cell[32928, 1335, 61, 1, 42, "Input"], Cell[32992, 1338, 74, 1, 42, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[33115, 1345, 41, 0, 62, "Section"], Cell[CellGroupData[{ Cell[33181, 1349, 49, 0, 68, "Subsection"], Cell[33233, 1351, 88, 3, 47, "Text"], Cell[33324, 1356, 115, 2, 68, "Input"], Cell[33442, 1360, 194, 7, 47, "Text"], Cell[33639, 1369, 48, 1, 42, "Input"], Cell[33690, 1372, 59, 1, 42, "Input"], Cell[33752, 1375, 48, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[33837, 1381, 70, 0, 42, "Subsection"], Cell[33910, 1383, 160, 4, 73, "Text"], Cell[34073, 1389, 160, 3, 68, "Input"], Cell[34236, 1394, 329, 11, 73, "Text"], Cell[34568, 1407, 56, 1, 42, "Input"], Cell[34627, 1410, 51, 1, 42, "Input"], Cell[34681, 1413, 58, 1, 42, "Input"], Cell[34742, 1416, 89, 3, 47, "Text"], Cell[34834, 1421, 117, 2, 68, "Input"], Cell[34954, 1425, 44, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[35035, 1431, 72, 0, 42, "Subsection"], Cell[35110, 1433, 107, 3, 47, "Text"], Cell[35220, 1438, 216, 4, 68, "Input"], Cell[35439, 1444, 116, 3, 47, "Text"], Cell[35558, 1449, 49, 1, 42, "Input"], Cell[35610, 1452, 137, 4, 48, "Text"], Cell[35750, 1458, 56, 1, 42, "Input"], Cell[35809, 1461, 55, 1, 42, "Input"], Cell[35867, 1464, 62, 1, 42, "Input"], Cell[35932, 1467, 51, 1, 42, "Input"], Cell[35986, 1470, 163, 5, 75, "Text"], Cell[36152, 1477, 70, 1, 42, "Input"], Cell[36225, 1480, 44, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[36306, 1486, 54, 0, 42, "Subsection"], Cell[36363, 1488, 139, 5, 47, "Text"], Cell[36505, 1495, 121, 2, 68, "Input"], Cell[36629, 1499, 130, 5, 47, "Text"], Cell[36762, 1506, 141, 3, 68, "Input"], Cell[36906, 1511, 50, 0, 47, "Text"], Cell[36959, 1513, 55, 1, 42, "Input"], Cell[37017, 1516, 138, 4, 48, "Text"], Cell[37158, 1522, 55, 1, 42, "Input"], Cell[37216, 1525, 92, 1, 42, "Input"], Cell[37311, 1528, 115, 2, 42, "Input"], Cell[37429, 1532, 47, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[37513, 1538, 75, 0, 42, "Subsection"], Cell[37591, 1540, 285, 11, 47, "Text"], Cell[37879, 1553, 298, 6, 94, "Input"], Cell[38180, 1561, 129, 5, 47, "Text"], Cell[38312, 1568, 69, 1, 42, "Input"], Cell[38384, 1571, 137, 5, 47, "Text"], Cell[38524, 1578, 200, 4, 94, "Input"], Cell[38727, 1584, 165, 4, 73, "Text"], Cell[38895, 1590, 187, 3, 94, "Input"], Cell[39085, 1595, 243, 5, 99, "Text"], Cell[39331, 1602, 194, 3, 94, "Input"], Cell[39528, 1607, 122, 4, 48, "Text"], Cell[39653, 1613, 45, 1, 42, "Input"], Cell[39701, 1616, 127, 4, 48, "Text"], Cell[39831, 1622, 62, 1, 42, "Input"], Cell[39896, 1625, 133, 2, 42, "Input"], Cell[40032, 1629, 62, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[40131, 1635, 77, 0, 42, "Subsection"], Cell[40211, 1637, 177, 5, 47, "Text"], Cell[40391, 1644, 214, 4, 68, "Input"], Cell[40608, 1650, 100, 3, 47, "Text"], Cell[40711, 1655, 56, 1, 42, "Input"], Cell[40770, 1658, 62, 1, 42, "Input"], Cell[40835, 1661, 233, 6, 73, "Text"], Cell[41071, 1669, 49, 1, 42, "Input"], Cell[41123, 1672, 400, 16, 74, "Text"], Cell[41526, 1690, 47, 1, 42, "Input"], Cell[41576, 1693, 71, 1, 42, "Input"], Cell[41650, 1696, 320, 12, 73, "Text"], Cell[41973, 1710, 359, 8, 172, "Input"], Cell[42335, 1720, 168, 6, 48, "Text"], Cell[42506, 1728, 62, 1, 42, "Input"], Cell[42571, 1731, 179, 3, 68, "Input"], Cell[42753, 1736, 56, 1, 42, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[42858, 1743, 28, 0, 62, "Section"], Cell[CellGroupData[{ Cell[42911, 1747, 35, 0, 61, "Subsubsection"], Cell[42949, 1749, 76, 1, 42, "Input"], Cell[43028, 1752, 43, 1, 42, "Input"], Cell[43074, 1755, 66, 1, 42, "Input"], Cell[43143, 1758, 66, 1, 42, "Input"], Cell[43212, 1761, 44, 1, 42, "Input"] }, Closed]] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)