(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of 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[ 17792, 639]*) (*NotebookOutlinePosition[ 30650, 1110]*) (* CellTagsIndexPosition[ 30606, 1106]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Functional Programming", "Title", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Defining your own function", "Section"], Cell[TextData[{ StyleBox["Mathematica", FontSlant->"Italic"], " uses \"pattern matching\" to make function definitions precise; be \ careful to understand the syntax. (Also, use lower-case function names, to \ avoid conflicts with pre-defined functions.)" }], "Text"], Cell[CellGroupData[{ Cell["General definition", "Subsection"], Cell[TextData[{ "To define a function on any expression, use the underscore on the left \ hand side. For example, to define function ", StyleBox["f", FontSlant->"Italic"], " for \"", StyleBox["any parameter, call it ", FontWeight->"Bold"], StyleBox["x", FontWeight->"Bold", FontSlant->"Italic"], "\", use x_." }], "Text"], Cell[BoxData[{ \(f[x_]\ \ = \ \ 3 x + 1\n\), \({\ \ f[1], \ \ f[17], \ \ f[x], \ f[t], \ \ f[foo]\ }\)}], "Input"], Cell[TextData[{ StyleBox["Do not type an underscore on the right side", FontWeight->"Bold"], " -- it is only used on the left hand side to identify the kind of \ expression being used as a parameter, and to give it a name. Without the \ underscore on the left hand side, the definition is valid only for the \ specific variable used, which is usually ", StyleBox["not", FontWeight->"Bold"], " what you want." }], "Text"], Cell[BoxData[ \(f[x]\ \ = \ \ "\"; \n \n{\ \ f[1], \ \ f[17], \ \ f[x], \ f[t], \ \ f[foo]\ }\)], "Input"], Cell["\<\ The definition for a specific expression overrides the general \ definition, as shown in the example above. A common mistake is to define a \ function for only a specific expression, then go back and define it \ generally, but the first definition still exists and can cause trouble. To \ fix this, clear all the defined values, then repeat the (correct) definition.\ \ \>", "Text"], Cell[BoxData[ \(Clear[f]; \nf[x_]\ = \ 3 x + 1; \n{\ \ f[1], \ \ f[17], \ \ f[x], \ f[t], \ \ f[foo]\ }\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Pattern-matching to make specific definitions", "Subsection"], Cell["\<\ Non-general definitions of a function certainly have their uses. \ Here are some examples.\ \>", "Text"], Cell[CellGroupData[{ Cell["\<\ 1. defining a function differently for integers, reals, lists, and \ others\ \>", "Subsubsection"], Cell[TextData[{ "Every ", StyleBox["Mathematica", FontSlant->"Italic"], " expression has a \"head\" (a type name); the possibilities include \ Integer, Real, Complex, List, and Symbol. A function definition can be \ tailored to specific types of parameters." }], "Text"], Cell[BoxData[ \(f1[w_Real]\ = \ Abs[w] + Pi; \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ floating - point\ expressions\ *) \nf1[w_Integer]\ = w + 17; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ integers\ only\ *) \n f1[w_]\ = \ 2 w; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ everything\ else\ *) \n\n f1\ \ \ \ \ /@ \ \ \ \ \ {\ \ 1, \ \ 2, \ \ 2.0, \ \ 3., \ \ foo, \ \ \ I + 1, \ \ w \ , \ Sqrt[25]\ }\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["2. defining a discontinuous function", "Subsubsection"], Cell[TextData[{ "Another peace of syntax, \"", StyleBox["/;", FontFamily->"Courier", FontWeight->"Bold"], "\"(", StyleBox["Condition", FontWeight->"Bold"], "), can be used for more involved definitions, as follows:" }], "Text"], Cell[BoxData[ \(f2[x_\ /; x < 0]\ \ = \ \ 2 - x/3\ \ ; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ negative\ values\ only\ *) \n f2[0]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ = \ \ 1.5; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ for\ x = 0\ only\ *) \n f2[x_\ /; x > 0]\ \ = \ \ Sqrt[2 x] + 0.3\ ; \ \ \ \ \ \ \ \ \ (*\ positive\ values\ *) \n\nPlot[\ f2[t], \ \ {t, \(-3\), 3.2}]; \n NIntegrate[\ \ f2[u], \ \ {u, \(-1\), 0, 2}]\)], "Input"], Cell[TextData[{ "(When using ", StyleBox["NIntegrate", FontWeight->"Bold"], ", list any points of discontinuity between the limit values, as shown \ above.)" }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["3. defining a function on odd/even integers only", "Subsubsection"], Cell[TextData[{ "There are several functions which return True/False values, which can be \ used in another way to modify a pattern. These include ", StyleBox["IntegerQ", FontWeight->"Bold"], ", ", StyleBox["EvenQ", FontWeight->"Bold"], ", ", StyleBox["OddQ", FontWeight->"Bold"], ", ", StyleBox["NumberQ", FontWeight->"Bold"], ", ", StyleBox["PrimeQ", FontWeight->"Bold"], ", ", StyleBox["MatrixQ", FontWeight->"Bold"], ", ", StyleBox["VectorQ", FontWeight->"Bold"], "." }], "Text"], Cell[BoxData[ \(f3[n_?OddQ]\ = \ 3 n + 1; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ for\ odd\ integers\ only\ *) \nf3[n_?EvenQ]\ = \ n/2; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ for\ even\ integers\ only\ *) \n\n f3\ \ /@\ \ {1, 2, 3, 4, 5, 6, \ \ \ 7.5, \ foo}\)], "Input"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Multiple parameters", "Section"], Cell["\<\ Functions of two variables are defined similarly, with an \ underscore used after each \"dummy variable\" name on the left hand side \ only.\ \>", "Text"], Cell[BoxData[ \(g[x_, y_]\ = \ x^2 + y^2; \n \n{\ \ g[3, 4], \ \ \ \ g[a, b], \ \ \ g[Sin[t], Cos[t]], \ \ g[x]\ \ } \)], "Input"], Cell[TextData[{ "A list (vector) is a single entity. A function which operates on a list \ can be defined in terms of the list name, or by specifying individual \ elements (if that is easier). In the example below, the first definiton is \ valid only for 3-vectors; the second definiton (", StyleBox["norm2", FontWeight->"Bold"], ") will work with any length vector." }], "Text"], Cell[BoxData[ \(l2Norm[\ {x1_, x2_, x3_}]\ = Sqrt[x1^2 + x2^2 + x3^2]; \ \ (*\ version\ 1\ *) \n\nnorm2[\ v_List\ ]\ = Sqrt[v.v]; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ version\ 2\ *) \ \n \n{\ \ \ \ \ \ \ \ l2Norm[\ {1, 2, 3}\ ], \ \ \ \ \ \ norm2[{1, 2, 3}], \n \t\ \ \ \ \tl2Norm[{1, 2, 3, 4}], \ \ norm2[{1, 2, 3, 4}]\ }\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Delayed definition", "Section"], Cell[TextData[{ "There are two different ways to make assignments in ", StyleBox["Mathematica", FontSlant->"Italic"], ":\n\n", StyleBox["lhs = rhs\nlhs := rhs\n", FontFamily->"Courier"], "\nThe difference between these forms is when the expression \"", StyleBox["rhs", FontSlant->"Italic"], "\" is evaluated; immediately (at the time of the definition), or later \ when ", StyleBox["lhs", FontSlant->"Italic"], " is actually used. Contrast the behavior of function ", StyleBox["f", FontSlant->"Italic"], " and ", StyleBox["g", FontSlant->"Italic"], ":" }], "Text", TextAlignment->Center], Cell[BoxData[ \(Clear[a, f, g]; \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ clear\ all\ previous\ definitions\ *) \n\na\ = \ 5; \n f[x_]\ \ \ = \ \ \ a\ x; \ng[x_]\ \ := \ \ a\ x; \n{\ \ \ \ \ f[t], \ \ g[t]\ \ \ }\)], "Input"], Cell[TextData[{ "So far, function ", StyleBox["f", FontSlant->"Italic"], " and ", StyleBox["g", FontSlant->"Italic"], " are the same. But now change the value of ", StyleBox["a", FontSlant->"Italic"], " and see the change in ", StyleBox["g", FontSlant->"Italic"], ";" }], "Text"], Cell[BoxData[ \(a\ = \ 17; \n{\ \ \ \ \ f[t], \ \ g[t]\ \ \ }\)], "Input"], Cell[TextData[{ "Very often, but not always, the \"delayed assignment\" definition (using \ \"", StyleBox[":=", FontFamily->"Courier", FontWeight->"Bold"], "\") is the one you want to use." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["local variables", "Section"], Cell[TextData[{ "More involved definitions involve multiple commands and local variables, \ like \"subroutines\" in procedural languages like Fortran. Such functions \ are usually best made using the ", StyleBox["Block", FontWeight->"Bold"], " or ", StyleBox["Module", FontWeight->"Bold"], " commands. The general form for these functions is the same (the only \ difference in their behavior is a subtlety concerning the nature of the local \ variables):\n\n", StyleBox["Module", FontWeight->"Bold"], "[ {", StyleBox["list of local variables", FontSlant->"Italic"], "}, command1", StyleBox[" ; ", FontWeight->"Bold"], " command2 ", StyleBox[" ; ... ; ", FontWeight->"Bold"], "commandN ]\n\nThe returned value of the function is the value of the final \ command (\"commandN\")." }], "Text", TextAlignment->Center], Cell[BoxData[ \(Clear[f]; \n f[x_]\ := \ \ Module[\ \ {i, \ j}, \n\t\t\t\t\t\t\t\ti\ = \ x^2 + 3; \n \t\t\t\t\t\t\t\tj\ = \ Sqrt[i] - 5; \n\t\t\t\t\t\t\t\t A\ \ = \ 4 \[Pi]\ r\^2; \ \ \ V\ = \ 4 \[Pi]\ r\^3/3; \ \ \ Print[\ "\"]; \n\t\t\t\t\t\t\t\t{i, j}\ \ ]; \n\n f[7]\)], "Input"], Cell["\<\ Note that any command may be executed in the body of the module, \ but only the results of the last expression is returned as the value of the \ function.\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Iterative functions", "Section"], Cell[TextData[{ "Much of traditional programming involves ", StyleBox["loops", FontWeight->"Bold"], ", repeating similar operations for every item in a list. Already you have \ seen that looping is usually not necessary for vector/matrix operations, \ since all the usual functions on matrices can be done with simple commands. \ Likewise, for other iteration needs there are functions -- ", StyleBox["Sum", FontWeight->"Bold"], ", ", StyleBox["Product", FontWeight->"Bold"], ", ", StyleBox["Table", FontWeight->"Bold"], " -- which almost always will serve the purpose. When a single function is \ applied iteratively to a starting value, one can use ", StyleBox["Nest", FontWeight->"Bold"], " or ", StyleBox["Fold.", FontWeight->"Bold"], "\n\nNevertheless, ", StyleBox["Mathematica", FontSlant->"Italic"], " does provide function ", StyleBox["Do", FontWeight->"Bold"], " and ", StyleBox["For", FontWeight->"Bold"], ", which closely resemble the iteration constructs in the Fortran and C \ languages. When you have a choice, though, choose the functional programming \ commands instead." }], "Text"], Cell[CellGroupData[{ Cell["Sum", "Subsection"], Cell[TextData[{ StyleBox["Sum", FontWeight->"Bold"], " is used for summing a sequence, usually indexed with a \"dummy \ variable\"." }], "Text"], Cell[BoxData[{ \(Sum[\ \ x^i, \ {i, 1, 5}]\), \(Sum[\ \ x^i, \ {i, \ 1, \ Infinity}]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Product", "Subsection"], Cell[TextData[{ "Analogous to ", StyleBox["Sum", FontWeight->"Bold"], ":" }], "Text"], Cell[BoxData[ \(Product[\ \ \ 1 - 1/x^2, \ \ {x, 2, 100}]\)], "Input"], Cell[BoxData[ \(s\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Table", "Subsection"], Cell["\<\ The most general of the array-creating commands, use this when the \ intent of the iteration is to produce a list of one result per loop.\ \>", "Text"], Cell[BoxData[ \(Table[\ \ 1 - 1/x^2, \ \ {x, 2, 5}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Nest, Fold", "Subsection"], Cell[TextData[{ "The function ", StyleBox["NestList", FontWeight->"Bold"], ", given a function and an initial value, produces a list of the form\n\n\t\ \t\t{ ", StyleBox["x", FontSlant->"Italic"], ", ", StyleBox["f(x)", FontSlant->"Italic"], ", ", StyleBox["f(f(x))", FontSlant->"Italic"], ", ", StyleBox["f(f(f(x))", FontSlant->"Italic"], "), .... , ", Cell[BoxData[ \(TraditionalForm\`\(\ \ \ \(f\^n\)(x)\)\)]], " }" }], "Text"], Cell[BoxData[ \(NestList[\ Cos, \ \ 0.1, \ 9]\)], "Input"], Cell[TextData[{ "To get only the final value of the function after ", Cell[BoxData[ \(TraditionalForm\`n\)]], " iterations, rather than the whole list, use ", StyleBox["Nest", FontWeight->"Bold"], ":" }], "Text"], Cell[BoxData[ \(Nest[\ \ Cos, \ \ 0.1, \ \ 9\ ]\)], "Input"], Cell[TextData[{ StyleBox["Nest", FontWeight->"Bold"], " and ", StyleBox["NestList", FontWeight->"Bold"], " is for functions of a ", StyleBox["single", FontSlant->"Italic"], " variable. Analogous functions exist which iterate functions of ", StyleBox["two", FontSlant->"Italic"], " variables, taking elements of a given list as the 2nd parameter each \ time; these functions are ", StyleBox["Fold", FontWeight->"Bold"], " and ", StyleBox["FoldList:", FontWeight->"Bold"] }], "Text"], Cell[BoxData[ \(g[x_, y_]\ := \ 10 x + y; \n\n FoldList[\ \ g, \ \ 0, \ \ {2, 7, 1, 8, 2, 8}\ ]\)], "Input"], Cell[TextData[{ "In general, the results of ", StyleBox["FoldList[ f, x, {a,b,c,...}]", FontWeight->"Bold"], " are\n\n\t\t\t{ ", StyleBox["x", FontSlant->"Italic"], ", ", StyleBox["f(x,a)", FontSlant->"Italic"], ", ", StyleBox["f(f(x,a), b)", FontSlant->"Italic"], ", ", StyleBox["f(f(f(x,a),b), c)", FontSlant->"Italic"], ", ... }\n\t\t\t\nThe function ", StyleBox["Fold", FontWeight->"Bold"], " gives only the final element of the list that FoldList would produce:" }], "Text"], Cell[BoxData[ \(Fold[\ \ g, \ \ 0, \ \ {1, 8, 2, 8, 4, 5, 9, 0, 4, 5}]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Do", "Subsection"], Cell[TextData[{ "The function ", StyleBox["Do", FontWeight->"Bold"], " returns nothing (\"Null\") as a result, but useful work can be \ accomplished as a \"side effect\" of the commands in the body of the \ function. The general form is ", StyleBox["Do", FontWeight->"Bold"], "[ ", StyleBox["body", FontSlant->"Italic"], ", {", StyleBox["iteration", FontSlant->"Italic"], "}], where body can be a single command or multiple commands separated by \ semicolons, and ", StyleBox["iteration ", FontSlant->"Italic"], "is of the typical form, e.g. {", StyleBox["variable, min, max", FontSlant->"Italic"], "} or {", StyleBox["variable, min, max, stepsize", FontSlant->"Italic"], "}." }], "Text"], Cell[BoxData[{ \(sqs = "\< \>"; \n Do[\ \ \ y = x^2; \n\t\t\t\tsqs = StringJoin[sqs, ToString[y]]; \n\t\t\t\t sqs = StringJoin[sqs, "\<:\>"]; \n\t\ \ \ \ \ \ \ sqs = StringJoin[sqs, "\<)\>"], \n\t\ \ \ \ \ {x, 1, 19, 2}]\n\), \(\(Print[\ "\", \ sqs]; \)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["For", "Subsection"], Cell[TextData[{ StyleBox["For", FontWeight->"Bold"], " is the more general iterative construct original in the C programming \ language. The general form of the command is ", StyleBox["For", FontWeight->"Bold"], "[ ", StyleBox["start", FontSlant->"Italic"], ", ", StyleBox["test", FontSlant->"Italic"], ", ", StyleBox["increment", FontSlant->"Italic"], ", ", StyleBox["body", FontSlant->"Italic"], "], where ", StyleBox["body", FontSlant->"Italic"], " can be multiple commands separated by semicolons." }], "Text"], Cell[BoxData[ \(sn = "\<\>"; \n result\ = \ For[\ \ m = 0, \ \ \ m < 9, \ \ \ \(m++\), \n\t\t\t\t\t\t\tn = m^2; \n \t\t\t\t\t\t\tsn\ = \ StringJoin[sn, \ ToString[n], \ "\<-->\>"]; \n \t\t\t\t\t\t\tPrint[m, \ "\<: \>", \ sn]; \n\t\t\t\t\t\t\t]\)], "Input"] }, Closed]] }, Closed]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 1152}, {0, 900}}, WindowToolbars->{}, CellGrouping->Automatic, WindowSize->{658, 600}, WindowMargins->{{178, Automatic}, {Automatic, 102}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, CharacterEncoding->"MacintoshAutomaticEncoding", StyleDefinitions -> Notebook[{ Cell[CellGroupData[{ Cell["Style Definitions", "Subtitle"], Cell["\<\ Modify the definitions below to change the default appearance of \ all cells in a given style. Make modifications to any definition using commands in the Format menu.\ \>", "Text"], Cell[CellGroupData[{ Cell["Style Environment Names", "Section"], Cell[StyleData[All, "Working"], CellBracketOptions->{"Color"->RGBColor[0.771908, 0.399634, 0.262867]}, ScriptMinSize->9], Cell[StyleData[All, "Printout"], PageWidth->PaperWidth, PrivateFontOptions->{"FontType"->"Outline"}], Cell[StyleData[All, "ColorPrintout"], PageWidth->PaperWidth, PrivateFontOptions->{"FontType"->"Outline"}] }, Closed]], Cell[CellGroupData[{ Cell["Notebook Options", "Section"], Cell["\<\ The options defined for the style below will be used at the \ Notebook level.\ \>", "Text"], Cell[StyleData["Notebook"], PageHeaders->{{Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"], None, Cell[ TextData[ { ValueBox[ "FileName"]}], "Header"]}, {Cell[ TextData[ { ValueBox[ "FileName"]}], "Header"], None, Cell[ TextData[ { CounterBox[ "Page"]}], "PageNumber"]}}, StyleMenuListing->None] }, Closed]], Cell[CellGroupData[{ Cell["Styles for Headings", "Section"], Cell[CellGroupData[{ Cell[StyleData["Title"], CellMargins->{{36, 20}, {2, 10}}, CellGroupingRules->{"TitleGrouping", 0}, PageBreakBelow->False, CellFrameMargins->{{100, 4}, {8, 10}}, TextAlignment->Center, LineSpacing->{1, -5}, CounterIncrements->"Title", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}, { "Subtitle", 0}, {"Subsubtitle", 0}}, FontFamily->"New century schoolbook", FontSize->34, FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Title", "Printout"], TextAlignment->Center, FontFamily->"New century schoolbook", FontSize->33, FontColor->RGBColor[0, 0, 1]], Cell[StyleData["Title", "ColorPrintout"], TextAlignment->Center, FontFamily->"New century schoolbook", FontSize->33, FontColor->RGBColor[0, 0, 1]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subtitle"], CellFrame->{{0, 0}, {0.5, 0}}, CellMargins->{{144, 20}, {2, 10}}, CellGroupingRules->{"TitleGrouping", 10}, PageBreakBelow->False, TextAlignment->Center, CounterIncrements->"Subtitle", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}, { "Subsubtitle", 0}}, FontSize->24, FontSlant->"Italic", FontColor->RGBColor[1, 0, 1]], Cell[StyleData["Subtitle", "Printout"], CellFrame->{{0, 0}, {0.5, 0}}, TextAlignment->Center, FontColor->RGBColor[1, 0, 1]], Cell[StyleData["Subtitle", "ColorPrintout"], CellFrame->{{0, 0}, {0.5, 0}}, TextAlignment->Center, FontColor->RGBColor[1, 0, 1]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subsubtitle"], CellFrame->{{0, 0}, {0.5, 0}}, CellMargins->{{144, 20}, {2, 2}}, CellGroupingRules->{"TitleGrouping", 20}, PageBreakBelow->False, TextAlignment->Center, CounterIncrements->"Subsubtitle", CounterAssignments->{{"Section", 0}, {"Equation", 0}, {"Figure", 0}}, FontFamily->"Helvetica", FontSize->18, FontSlant->"Italic", FontColor->RGBColor[1, 0, 0]], Cell[StyleData["Subsubtitle", "Printout"], CellFrame->{{0, 0}, {0.5, 0}}, TextAlignment->Center, FontSize->18, FontColor->RGBColor[1, 0, 0]], Cell[StyleData["Subsubtitle", "ColorPrintout"], CellFrame->{{0, 0}, {0.5, 0}}, TextAlignment->Center, FontSize->18, FontColor->RGBColor[1, 0, 0]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Section"], CellFrame->{{0, 0}, {0, 0.25}}, CellMargins->{{36, 20}, {10, 20}}, CellGroupingRules->{"SectionGrouping", 30}, PageBreakBelow->False, CellFrameMargins->{{10, 4}, {6, 2}}, CounterIncrements->"Section", CounterAssignments->{{"Subsection", 0}, {"Subsubsection", 0}}, FontSize->18, FontWeight->"Bold", FontColor->RGBColor[1, 0, 0]], Cell[StyleData["Section", "Printout"], FontSize->18, FontColor->RGBColor[1, 0, 0]], Cell[StyleData["Section", "ColorPrintout"], FontSize->18, FontColor->RGBColor[1, 0, 0]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subsection"], CellFrame->{{0, 0}, {0, 0.5}}, CellDingbat->"\[FilledSmallSquare]", CellMargins->{{36, 20}, {Inherited, 18}}, CellGroupingRules->{"SectionGrouping", 40}, PageBreakBelow->False, CellFrameMargins->{{2, 12}, {0, 12}}, CellFrameLabelMargins->6, TextAlignment->Center, CounterIncrements->"Subsection", CounterAssignments->{{"Subsubsection", 0}}, FontSize->18, FontWeight->"Bold", FontColor->RGBColor[1, 0, 1]], Cell[StyleData["Subsection", "Printout"], CellFrame->{{0, 0}, {0, 0.5}}, TextAlignment->Center, FontSize->18, FontColor->RGBColor[1, 0, 1]], Cell[StyleData["Subsection", "ColorPrintout"], CellFrame->{{0, 0}, {0, 0.5}}, TextAlignment->Center, FontSize->18, FontColor->RGBColor[1, 0, 1]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Subsubsection"], CellDingbat->"\[EmptySquare]", CellMargins->{{36, Inherited}, {Inherited, 12}}, CellGroupingRules->{"SectionGrouping", 50}, PageBreakBelow->False, CellFrameLabelMargins->6, CounterIncrements->"Subsubsection", FontFamily->"Helvetica", FontSize->16], Cell[StyleData["Subsubsection", "Printout"], FontSize->16], Cell[StyleData["Subsubsection", "ColorPrintout"], FontSize->16] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Styles for Body Text", "Section"], Cell[CellGroupData[{ Cell[StyleData["Text"], CellFrame->False, CellMargins->{{36, 20}, {4, 4}}, CellFrameMargins->{{4, 10}, {6, 0}}, CellFrameLabelMargins->4, LineSpacing->{1, 2}, CounterIncrements->"Text", FontSize->14], Cell[StyleData["Text", "Printout"], LineSpacing->{1, 1}, FontSize->14], Cell[StyleData["Text", "ColorPrintout"], LineSpacing->{1, 1}, FontSize->14] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["SmallText"], CellMargins->{{100, 38}, {4, 4}}, LineSpacing->{1.1, 1}, CounterIncrements->"SmallText", FontSize->14], Cell[StyleData["SmallText", "Printout"], LineSpacing->{1.1, 1}, FontSize->14], Cell[StyleData["SmallText", "ColorPrintout"], LineSpacing->{1.1, 1}, FontSize->14] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["Styles for Input/Output", "Section"], Cell["\<\ The cells in this section define styles used for input and output \ to the kernel. Be careful when modifying, renaming, or removing these \ styles, because the front end associates special meanings with these style \ names.\ \>", "Text"], Cell[CellGroupData[{ Cell[StyleData["Input"], CellMargins->{{36, 0}, {0, Inherited}}, Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, CellLabelMargins->{{3, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultInputFormatType, FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", FontSize->14, FontWeight->"Bold", FontColor->GrayLevel[0], Background->RGBColor[0.95021, 0.934356, 0.499062]], Cell[StyleData["Input", "Printout"], FontSize->14, Background->GrayLevel[0.900008]], Cell[StyleData["Input", "ColorPrintout"], FontSize->14] }, Open ]], Cell[StyleData["InlineInput"], Evaluatable->True, CellGroupingRules->"InputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, DefaultFormatType->DefaultInputFormatType, AutoItalicWords->{}, FormatType->InputForm, ShowStringCharacters->True, NumberMarks->True, CounterIncrements->"Input", FontSize->14, FontWeight->"Bold"], Cell[CellGroupData[{ Cell[StyleData["Output"], CellFrame->True, CellMargins->{{36, 0}, {Inherited, 0}}, CellEditDuplicate->True, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, CellLabelMargins->{{3, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, TextAlignment->Center, FormatType->InputForm, CounterIncrements->"Output", FontSize->14, FontColor->GrayLevel[0], Background->RGBColor[0, 1, 1]], Cell[StyleData["Output", "Printout"], CellFrame->True, TextAlignment->Center, FontSize->14, Background->RGBColor[0, 1, 1]], Cell[StyleData["Output", "ColorPrintout"], CellFrame->True, TextAlignment->Center, FontSize->14, Background->RGBColor[0, 1, 1]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Message"], CellDingbat->"\[LongDash]", CellMargins->{{64, Inherited}, {Inherited, Inherited}}, CellGroupingRules->"OutputGrouping", PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{3, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, FormatType->InputForm, CounterIncrements->"Message", StyleMenuListing->None, FontFamily->"Helvetica", FontSize->10, FontSlant->"Oblique"], Cell[StyleData["Message", "Printout"], FontSize->8], Cell[StyleData["Message", "ColorPrintout"], FontSize->8] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Print"], CellMargins->{{36, 20}, {3, 3}}, CellGroupingRules->"OutputGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GroupPageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, CellLabelMargins->{{3, Inherited}, {Inherited, Inherited}}, DefaultFormatType->DefaultOutputFormatType, TextAlignment->Left, FormatType->InputForm, CounterIncrements->"Print", StyleMenuListing->None, FontFamily->"Courier", FontSize->12, Background->RGBColor[0.967727, 0.972747, 0.534508]], Cell[StyleData["Print", "Printout"], FontFamily->"Courier", Background->GrayLevel[0.900008]], Cell[StyleData["Print", "ColorPrintout"], FontFamily->"Courier"] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["Graphics"], CellMargins->{{36, 0}, {0, 0}}, CellGroupingRules->"GraphicsGrouping", CellHorizontalScrolling->True, PageBreakWithin->False, GeneratedCell->True, CellAutoOverwrite->True, ShowCellLabel->False, DefaultFormatType->DefaultOutputFormatType, FormatType->InputForm, CounterIncrements->"Graphics", ImageMargins->{{35, Inherited}, {Inherited, 0}}, Background->RGBColor[0, 1, 1]], Cell[StyleData["Graphics", "Printout"], FontSize->10, Background->GrayLevel[0.8]], Cell[StyleData["Graphics", "ColorPrintout"], FontSize->10, Background->RGBColor[0, 1, 1]] }, Open ]], Cell[CellGroupData[{ Cell[StyleData["CellLabel"], StyleMenuListing->None, FontFamily->"Helvetica", FontSize->10, FontColor->RGBColor[0.551492, 0.231144, 0.313466]], Cell[StyleData["CellLabel", "Printout"], FontColor->GrayLevel[0]], Cell[StyleData["CellLabel", "ColorPrintout"]] }, Open ]] }, Open ]] }, Open ]] }] ] (*********************************************************************** 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[1731, 51, 87, 2, 46, "Title"], Cell[CellGroupData[{ Cell[1843, 57, 45, 0, 53, "Section"], Cell[1891, 59, 277, 6, 42, "Text"], Cell[CellGroupData[{ Cell[2193, 69, 40, 0, 55, "Subsection"], Cell[2236, 71, 352, 12, 42, "Text"], Cell[2591, 85, 125, 2, 75, "Input"], Cell[2719, 89, 438, 10, 76, "Text"], Cell[3160, 101, 130, 2, 75, "Input"], Cell[3293, 105, 395, 7, 76, "Text"], Cell[3691, 114, 127, 2, 75, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[3855, 121, 67, 0, 41, "Subsection"], Cell[3925, 123, 115, 3, 25, "Text"], Cell[CellGroupData[{ Cell[4065, 130, 108, 3, 36, "Subsubsection"], Cell[4176, 135, 282, 7, 42, "Text"], Cell[4461, 144, 486, 9, 113, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[4984, 158, 61, 0, 36, "Subsubsection"], Cell[5048, 160, 249, 9, 26, "Text"], Cell[5300, 171, 524, 9, 132, "Input"], Cell[5827, 182, 179, 6, 25, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[6043, 193, 73, 0, 36, "Subsubsection"], Cell[6119, 195, 542, 24, 59, "Text"], Cell[6664, 221, 314, 5, 94, "Input"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[7039, 233, 38, 0, 37, "Section"], Cell[7080, 235, 164, 4, 42, "Text"], Cell[7247, 241, 145, 3, 75, "Input"], Cell[7395, 246, 393, 8, 59, "Text"], Cell[7791, 256, 432, 6, 132, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[8260, 267, 37, 0, 37, "Section"], Cell[8300, 269, 648, 22, 125, "Text"], Cell[8951, 293, 257, 4, 132, "Input"], Cell[9211, 299, 314, 14, 25, "Text"], Cell[9528, 315, 79, 1, 56, "Input"], Cell[9610, 318, 215, 7, 43, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[9862, 330, 34, 0, 37, "Section"], Cell[9899, 332, 873, 26, 144, "Text"], Cell[10775, 360, 355, 7, 173, "Input"], Cell[11133, 369, 178, 4, 42, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[11348, 378, 38, 0, 37, "Section"], Cell[11389, 380, 1177, 35, 161, "Text"], Cell[CellGroupData[{ Cell[12591, 419, 25, 0, 55, "Subsection"], Cell[12619, 421, 152, 5, 25, "Text"], Cell[12774, 428, 107, 2, 56, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[12918, 435, 29, 0, 55, "Subsection"], Cell[12950, 437, 95, 5, 25, "Text"], Cell[13048, 444, 74, 1, 37, "Input"], Cell[13125, 447, 34, 1, 37, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[13196, 453, 27, 0, 55, "Subsection"], Cell[13226, 455, 164, 4, 42, "Text"], Cell[13393, 461, 68, 1, 37, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[13498, 467, 32, 0, 55, "Subsection"], Cell[13533, 469, 499, 21, 59, "Text"], Cell[14035, 492, 62, 1, 37, "Input"], Cell[14100, 495, 232, 8, 25, "Text"], Cell[14335, 505, 64, 1, 37, "Input"], Cell[14402, 508, 529, 19, 59, "Text"], Cell[14934, 529, 118, 2, 75, "Input"], Cell[15055, 533, 540, 20, 93, "Text"], Cell[15598, 555, 87, 1, 37, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[15722, 561, 24, 0, 55, "Subsection"], Cell[15749, 563, 752, 26, 76, "Text"], Cell[16504, 591, 309, 5, 170, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[16850, 601, 25, 0, 55, "Subsection"], Cell[16878, 603, 579, 23, 59, "Text"], Cell[17460, 628, 292, 6, 132, "Input"] }, Closed]] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)