(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 36645, 914] NotebookOptionsPosition[ 35796, 879] NotebookOutlinePosition[ 36399, 905] CellTagsIndexPosition[ 36300, 899] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Math 2374 Notebook Template - 2/18/2008 Version", FontSize->18]], "Subsubsection", CellDingbat->None, CellChangeTimes->{{3.411776341573003*^9, 3.4117763434100847`*^9}, { 3.412390623966487*^9, 3.412390625211959*^9}}, TextAlignment->Center, FontWeight->"Plain", FontVariations->{"Underline"->True}, FontColor->GrayLevel[1], Background->RGBColor[0, 0, 1], CellTags->"initgroup"], Cell["\<\ You should not do anything with this section. These cells make sure that \ certain commands are loaded and defined. If you don't evaluate these \ initialization cells, certain parts of your labs will not work.\ \>", "Text", CellFrame->True, Background->GrayLevel[0.849989]], Cell[TextData[{ "We're going to try to load every package and define every new command which \ will be needed this semester. Experience has shown that asking students to \ load packages causes more problems than it's worth. This new approach has \ the disadvantage that students will never learn how to load a package. But \ anybody who is interested enough in Mathematica to want to load new packages \ can probably figure out how. (Perhaps with the help of a TA, if needed.)\n\n\ Significant updates (mostly deletions) made in Spring 2008 for ", StyleBox["Mathematica", FontSlant->"Italic"], " 6.0. We finally don't have to use add-on Java packages for interactivity \ -- but it's slow. Win some, lose some...\n\nJonathan Rogness\n\ rogness@math.umn.edu\nSpring 2004 through 2008\n \n" }], "Text", CellChangeTimes->{{3.411776477431945*^9, 3.4117765248796864`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"(*", " ", RowBox[{ RowBox[{"Minor", " ", "issues"}], ";", " ", RowBox[{ "set", " ", "axes", " ", "labels", " ", "by", " ", "default", " ", "so", " ", "students", " ", "feel", " ", RowBox[{"oriented", "."}]}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"SetOptions", "[", RowBox[{"Plot3D", ",", RowBox[{"Axes", "\[Rule]", "True"}], ",", " ", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SetOptions", "[", RowBox[{"ContourPlot3D", ",", RowBox[{"Axes", "\[Rule]", "True"}], ",", " ", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SetOptions", "[", RowBox[{"ParametricPlot3D", ",", RowBox[{"Axes", "\[Rule]", "True"}], ",", " ", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SetOptions", "[", RowBox[{"Graphics3D", ",", RowBox[{"Axes", "\[Rule]", "True"}], ",", " ", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Off", "[", RowBox[{"General", "::", "spell"}], "]"}], ";"}], "\n", RowBox[{ RowBox[{"Off", "[", RowBox[{"General", "::", "spell1"}], "]"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Now", " ", "some", " ", "other", " ", "packages", " ", "which", " ", "get", " ", "used", " ", "now", " ", "and", " ", RowBox[{"then", "."}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Needs", "[", "\"\\"", "]"}], "\n", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Vector", " ", "Analysis", " ", "Stuff"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Needs", "[", "\"\\"", "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"SetCoordinates", "[", RowBox[{"Cartesian", "[", RowBox[{"x", ",", "y", ",", "z"}], "]"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Here", "'"}], "s", " ", "a", " ", "really", " ", "cheap", " ", "way", " ", "of", " ", "defining", " ", "a", " ", "2", "D", " ", "grad", " ", "function"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Grad2D", "[", "f_", "]"}], ":=", RowBox[{"D", "[", RowBox[{"f", ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], ",", "1"}], "}"}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{"Argh", " ", "--"}], " ", "Mathematica", " ", "now", " ", "comes", " ", "with", " ", "a", " ", "Norm", " ", "function"}], ",", " ", RowBox[{"but", " ", "it", "\[IndentingNewLine]", " ", "assumes", " ", RowBox[{"we", "'"}], "re", " ", "dealing", " ", "with", " ", "complex", " ", "numbers"}], ",", " ", RowBox[{ "giving", "\[IndentingNewLine]", " ", "monstrosities", " ", "like", " ", RowBox[{ RowBox[{"Sqrt", "[", RowBox[{ RowBox[{ RowBox[{"Abs", "[", "x", "]"}], "^", "2"}], "+", RowBox[{ RowBox[{"Abs", "[", "y", "]"}], "^", "2"}]}], "]"}], ".", " ", "So"}], " ", "we", " ", "not", " ", "only", "\[IndentingNewLine]", " ", "have", " ", "to", " ", "do", " ", "it", " ", "the", " ", "old", " ", "fashioned", " ", "way"}], ",", " ", RowBox[{ "but", " ", "first", " ", "we", " ", "have", "\[IndentingNewLine]", " ", "to", " ", "use", " ", "the", " ", "Attributes", " ", "command", " ", "to", " ", "allow", " ", "Norm", " ", "to", " ", "be", " ", "\[IndentingNewLine]", " ", RowBox[{"redefined", "!"}]}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Attributes", "[", "Norm", "]"}], "=", RowBox[{"{", "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Norm", "[", "v_", "]"}], "=", RowBox[{"Sqrt", "[", RowBox[{"v", ".", "v"}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Options", "[", "Arrow3D", "]"}], "=", RowBox[{"{", RowBox[{ RowBox[{"HeadLength", "\[Rule]", "0.3"}], ",", RowBox[{"HeadNormal", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], ",", RowBox[{"HeadWidth", "\[Rule]", "0.5"}]}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Arrow3D", "[", RowBox[{"a_", ",", "b_", ",", "opts___"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"abLength", "=", RowBox[{"N", "[", RowBox[{"Sqrt", "[", RowBox[{ RowBox[{"(", RowBox[{"b", "-", "a"}], ")"}], ".", RowBox[{"(", RowBox[{"b", "-", "a"}], ")"}]}], "]"}], "]"}]}], ",", "abUnit", ",", "headPerp", ",", "headPerpLength", ",", "headLength", ",", "headNormal", ",", "headWidth"}], "}"}], ",", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"headLength", ",", "headNormal", ",", "headWidth"}], "}"}], "=", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"HeadLength", ",", "HeadNormal", ",", "HeadWidth"}], "}"}], "/.", RowBox[{"{", "opts", "}"}]}], "/.", RowBox[{"Options", "[", "Arrow3D", "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"abUnit", "=", RowBox[{ RowBox[{"(", RowBox[{"b", "-", "a"}], ")"}], "/", "abLength"}]}], ";", "\[IndentingNewLine]", RowBox[{"headPerp", "=", RowBox[{"Cross", "[", RowBox[{"abUnit", ",", RowBox[{"N", "[", "headNormal", "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"headPerp", "=", RowBox[{"headPerp", "/", RowBox[{"Sqrt", "[", RowBox[{"N", "[", RowBox[{"headPerp", ".", "headPerp"}], "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"Line", "[", RowBox[{"{", RowBox[{"a", ",", RowBox[{"b", "-", RowBox[{"abUnit", "*", "headLength"}]}]}], "}"}], "]"}], ",", RowBox[{"Polygon", "[", RowBox[{"{", RowBox[{"b", ",", RowBox[{"b", "-", RowBox[{"abUnit", "*", "headLength"}], "+", RowBox[{"headPerp", "*", RowBox[{"headWidth", "/", "2"}], "*", "headLength"}]}], ",", RowBox[{"b", "-", RowBox[{"abUnit", "*", "headLength"}]}], ",", RowBox[{"b", "-", RowBox[{"abUnit", "*", "headLength"}], "-", RowBox[{"headPerp", "*", RowBox[{"headWidth", "/", "2"}], "*", "headLength"}]}]}], "}"}], "]"}]}], "}"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Needed", " ", "in", " ", "Lab", " ", "6", "A"}], " ", "-", " ", RowBox[{"Graphics`Shapes`", " ", "now", " ", RowBox[{"gone", "!"}], RowBox[{"??", "!"}]}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"ShowTorus", "[", RowBox[{"a_", ",", "b_"}], "]"}], ":=", RowBox[{"ParametricPlot3D", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"b", " ", RowBox[{"Cos", "[", "t", "]"}]}], "+", "a"}], ")"}], " ", RowBox[{"Cos", "[", "s", "]"}]}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"b", " ", RowBox[{"Cos", "[", "t", "]"}]}], "+", "a"}], ")"}], " ", RowBox[{"Sin", "[", "s", "]"}]}], ",", RowBox[{"b", " ", RowBox[{"Sin", "[", "t", "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", "0", ",", RowBox[{"2", "Pi"}]}], "}"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"2", "Pi"}]}], "}"}]}], "]"}]}], "\n", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Next", " ", "up"}], " ", "-", " ", RowBox[{"my", " ", RowBox[{"Arctools", ".", "m"}], " ", RowBox[{"package", "."}]}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ "This", " ", "is", " ", "a", " ", "conglomeration", " ", "of", " ", "two", " ", RowBox[{"packages", ".", " ", "\n", "\n", "\"\\""}], " ", "and", " ", "\"\\"", " ", "are", " ", "taken", " ", "from", " ", "a", " ", "package", "\n", "created", " ", "at", " ", "Lafayette", " ", "College", " ", "named", " ", "\"\\"", " ", "\n", "The", " ", "original", " ", "message", " ", "from", " ", "that", " ", "package", " ", RowBox[{"follows", ":", "\n", "\n", "\t", RowBox[{ "This", " ", "package", " ", "may", " ", "be", " ", "distributed", " ", "freely"}]}]}], ",", " ", RowBox[{ "but", " ", "is", " ", "\n", "\t", "copyright", " ", "by", " ", "Lafayette", " ", "College"}], ",", " ", RowBox[{"1994.", "\n", "\n", RowBox[{"(", RowBox[{ RowBox[{ "Note", " ", "that", " ", "the", " ", "command", " ", "\"\\"", " ", "has", " ", "been", " ", "removed", " ", "from", " ", "\n", "the", " ", "package"}], ",", " ", RowBox[{ "and", " ", "the", " ", "remaining", " ", "function", " ", "names", " ", "have", " ", "been", "\n", "capitalized", " ", "to", " ", "correspond", " ", "to", " ", "standard", " ", RowBox[{"usage", "."}]}]}], ")"}], "\n", "\n", "PathAnimate", " ", "and", " ", "PathTangentAnimate", " ", "were", " ", "written", " ", "for", " ", "use", " ", "\n", "at", " ", "the", " ", "University", " ", "of", " ", "Minnesota", " ", "in", " ", "2002.", " ", "They", " ", "may", " ", "be", " ", "freely", " ", "\n", "used"}], ",", " ", RowBox[{ RowBox[{ "but", " ", "please", " ", "keep", " ", "this", " ", "message", " ", RowBox[{"intact", ".", "\n", "\n", "This"}], " ", "hodge"}], "-", RowBox[{ "podge", " ", "was", " ", "created", " ", "because", " ", "these", " ", "three", " ", "commands", "\n", "are", " ", "used", " ", "in", " ", "one", " ", "of", " ", "our", " ", "labs", " ", "for", " ", "MATH", " ", "2374"}]}], ",", " ", RowBox[{"Multivariable", "\n", RowBox[{"Calculus", ".", "\n", "\n", "Questions"}], " ", RowBox[{"to", ":", " ", RowBox[{ RowBox[{"rogness", "@", "math"}], ".", "umn", ".", "edu"}]}]}]}], "\n", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"Segments", "::", "usage"}], "=", "\"\\""}], ";"}], "\n", "\n", RowBox[{ RowBox[{ RowBox[{"Estimate", "::", "usage"}], "=", "\"\\""}], ";"}], "\n", "\n", RowBox[{ RowBox[{ RowBox[{"PathAnimate", "::", "usage"}], "=", "\"\\""}], ";"}], "\n", "\n", RowBox[{ RowBox[{ RowBox[{"PathTangentAnimate", "::", "usage"}], "=", "\"\\""}], ";"}], "\[IndentingNewLine]", "\n", RowBox[{ RowBox[{ RowBox[{"PathAnimate3D", "::", "usage"}], "=", "\"\\""}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"PathTangentAnimate3D", "::", "usage"}], "=", "\"\\""}], ";"}], "\[IndentingNewLine]", "\n", RowBox[{ RowBox[{ RowBox[{"DoAnimation", "::", "usage"}], "=", "\"\\""}], ";"}], "\n", "\t", "\n", RowBox[{ RowBox[{"Segments", "[", RowBox[{"funclist_", ",", "paramlist_", ",", "n_", ",", "options___"}], "]"}], " ", ":=", "\n", " ", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ "tmin", ",", " ", "tmax", ",", " ", "plotcurve", ",", " ", "plotlines", ",", " ", "points", ",", "\n", " ", "stepsize", ",", " ", "param"}], "}"}], ",", "\n", " ", RowBox[{ RowBox[{"param", " ", "=", " ", RowBox[{"paramlist", "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", "\n", " ", RowBox[{"tmin", " ", "=", " ", RowBox[{"paramlist", "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", " ", RowBox[{"tmax", " ", "=", " ", RowBox[{"paramlist", "[", RowBox[{"[", "3", "]"}], "]"}]}], ";", "\n", " ", RowBox[{"stepsize", " ", "=", " ", RowBox[{ RowBox[{"(", RowBox[{"tmax", " ", "-", " ", "tmin"}], ")"}], "/", "n"}]}], ";", "\n", " ", RowBox[{"plotcurve", " ", "=", " ", RowBox[{"ParametricPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{"funclist", "/.", RowBox[{"param", "->", "t"}]}], "]"}], ",", "\n", " ", RowBox[{"{", RowBox[{"t", ",", "tmin", ",", "tmax"}], "}"}], ",", RowBox[{"PlotStyle", "->", RowBox[{"RGBColor", "[", RowBox[{"1", ",", "0", ",", "0"}], "]"}]}], ",", "\n", " ", RowBox[{"DisplayFunction", "->", "Identity"}]}], "]"}]}], ";", "\n", " ", RowBox[{"plotlines", " ", "=", " ", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], ",", " ", RowBox[{"Line", "[", RowBox[{"Table", "[", "\n", " ", RowBox[{ RowBox[{"funclist", "/.", RowBox[{"param", "->", "t"}]}], ",", "\n", " ", RowBox[{"{", RowBox[{ "t", ",", " ", "tmin", ",", " ", "tmax", ",", " ", "stepsize"}], "}"}]}], " ", "]"}], "]"}]}], "}"}], "]"}]}], ";", "\n", " ", RowBox[{"points", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "1"}], "]"}], ",", " ", RowBox[{"Point", "[", "\n", " ", RowBox[{"funclist", "/.", RowBox[{"param", "->", "t"}]}], " ", "]"}]}], "}"}], "]"}], ",", "\n", " ", RowBox[{"{", RowBox[{ "t", ",", " ", "tmin", ",", " ", "tmax", ",", " ", "stepsize"}], "}"}]}], "]"}]}], ";", "\n", " ", RowBox[{"Show", "[", RowBox[{ "plotcurve", ",", "plotlines", ",", " ", "points", ",", "options", ",", "\n", " ", RowBox[{"DisplayFunction", "->", "$DisplayFunction"}]}], "]"}]}]}], "\n", " ", "]"}]}], "\n", "\n", RowBox[{ RowBox[{"Estimate", "[", RowBox[{"funclist_", ",", "paramlist_", ",", "n_"}], "]"}], " ", ":=", "\n", " ", RowBox[{"Block", "[", RowBox[{ RowBox[{"{", RowBox[{ "tmin", ",", " ", "tmax", ",", " ", "h", ",", " ", "param", ",", " ", "k"}], "}"}], ",", "\n", " ", RowBox[{ RowBox[{"param", " ", "=", " ", RowBox[{"paramlist", "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", "\n", " ", RowBox[{"tmin", " ", "=", " ", RowBox[{"paramlist", "[", RowBox[{"[", "2", "]"}], "]"}]}], ";", "\n", " ", RowBox[{"tmax", " ", "=", " ", RowBox[{"paramlist", "[", RowBox[{"[", "3", "]"}], "]"}]}], ";", "\n", " ", RowBox[{"h", " ", "=", " ", RowBox[{ RowBox[{"(", RowBox[{"tmax", " ", "-", " ", "tmin"}], ")"}], "/", "n"}]}], ";", "\n", " ", RowBox[{"Sum", "[", RowBox[{ RowBox[{"N", "[", RowBox[{"Sqrt", "[", "\n", " ", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"funclist", "[", RowBox[{"[", "1", "]"}], "]"}], " ", "/.", " ", RowBox[{"param", " ", "->", " ", RowBox[{"k", " ", "h"}]}]}], ")"}], " ", "-", "\n", " ", RowBox[{"(", RowBox[{ RowBox[{"funclist", "[", RowBox[{"[", "1", "]"}], "]"}], " ", "/.", " ", RowBox[{"param", " ", "->", " ", RowBox[{ RowBox[{"(", RowBox[{"k", "-", "1"}], ")"}], "h"}]}]}], ")"}]}], ")"}], "^", "2"}], "\n", " ", "+", " ", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"funclist", "[", RowBox[{"[", "2", "]"}], "]"}], " ", "/.", " ", RowBox[{"param", " ", "->", " ", RowBox[{"k", " ", "h"}]}]}], ")"}], " ", "-", "\n", " ", RowBox[{"(", RowBox[{ RowBox[{"funclist", "[", RowBox[{"[", "2", "]"}], "]"}], " ", "/.", " ", RowBox[{"param", " ", "->", " ", RowBox[{ RowBox[{"(", RowBox[{"k", "-", "1"}], ")"}], "h"}]}]}], ")"}]}], ")"}], "^", "2"}]}], "]"}], "]"}], ",", "\n", " ", RowBox[{"{", RowBox[{"k", ",", "1", ",", "n"}], "}"}]}], "]"}]}]}], "\n", " ", "]"}]}], "\n", "\n", RowBox[{ RowBox[{ RowBox[{"PathAnimate", "[", RowBox[{"fun_", ",", RowBox[{"{", RowBox[{"u_", ",", "u0_", ",", "u1_"}], "}"}], ",", "options___"}], "]"}], ":=", RowBox[{"DynamicModule", "[", RowBox[{ RowBox[{"{", RowBox[{ "tmin", ",", "tmax", ",", "param", ",", "graph", ",", "t", ",", "f"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Animate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"ParametricPlot", "[", RowBox[{"fun", ",", RowBox[{"{", RowBox[{"u", ",", "u0", ",", "u1"}], "}"}], ",", "options"}], "]"}], ",", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.03", "]"}], ",", RowBox[{"Point", "[", "fun", "]"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"u", ",", "u0", ",", "u1"}], "}"}], ",", RowBox[{"DisplayAllSteps", "\[Rule]", "True"}]}], "]"}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"PathAnimate3D", "[", RowBox[{"fun_", ",", RowBox[{"{", RowBox[{"u_", ",", "u0_", ",", "u1_"}], "}"}], ",", "options___"}], "]"}], ":=", RowBox[{"DynamicModule", "[", RowBox[{ RowBox[{"{", RowBox[{ "tmin", ",", "tmax", ",", "param", ",", "graph", ",", "t", ",", "f"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Animate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"ParametricPlot3D", "[", RowBox[{"fun", ",", RowBox[{"{", RowBox[{"u", ",", "u0", ",", "u1"}], "}"}], ",", "options"}], "]"}], ",", RowBox[{"Graphics3D", "[", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.03", "]"}], ",", RowBox[{"Point", "[", "fun", "]"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"u", ",", "u0", ",", "u1"}], "}"}], ",", RowBox[{"DisplayAllSteps", "\[Rule]", "True"}]}], "]"}]}], "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"PathTangentAnimate", "[", RowBox[{"fun_", ",", RowBox[{"{", RowBox[{"u_", ",", "u0_", ",", "u1_"}], "}"}], ",", "options___"}], "]"}], ":=", RowBox[{"DynamicModule", "[", RowBox[{ RowBox[{"{", RowBox[{ "tmin", ",", "tmax", ",", "param", ",", "graph", ",", "t", ",", "f", ",", "Df"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Kludgy", " ", "way", " ", "to", " ", "do", " ", "this"}], ",", " ", RowBox[{"but", " ", "it", " ", "works"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"f", "[", "t_", "]"}], "=", RowBox[{"Evaluate", "[", RowBox[{"fun", "/.", RowBox[{"u", "\[Rule]", "t"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"Df", "[", "t_", "]"}], "=", RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", "t", "]"}], ",", "t"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Animate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"ParametricPlot", "[", RowBox[{"fun", ",", RowBox[{"{", RowBox[{"u", ",", "u0", ",", "u1"}], "}"}], ",", "options"}], "]"}], ",", RowBox[{"Graphics", "[", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.03", "]"}], ",", RowBox[{"Point", "[", RowBox[{"f", "[", "t", "]"}], "]"}], ",", "Red", ",", RowBox[{"Thickness", "[", "Medium", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"f", "[", "t", "]"}], ",", RowBox[{ RowBox[{"f", "[", "t", "]"}], "+", RowBox[{"Df", "[", "t", "]"}]}]}], "}"}], "]"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "u0", ",", "u1"}], "}"}], ",", RowBox[{"DisplayAllSteps", "\[Rule]", "True"}]}], "]"}]}]}], " ", "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"PathTangentAnimate3D", "[", RowBox[{"fun_", ",", RowBox[{"{", RowBox[{"u_", ",", "u0_", ",", "u1_"}], "}"}], ",", "options___"}], "]"}], ":=", RowBox[{"DynamicModule", "[", RowBox[{ RowBox[{"{", RowBox[{ "tmin", ",", "tmax", ",", "param", ",", "graph", ",", "t", ",", "f", ",", "Df"}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Kludgy", " ", "way", " ", "to", " ", "do", " ", "this"}], ",", " ", RowBox[{"but", " ", "it", " ", "works"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"f", "[", "t_", "]"}], "=", RowBox[{"Evaluate", "[", RowBox[{"fun", "/.", RowBox[{"u", "\[Rule]", "t"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"Df", "[", "t_", "]"}], "=", RowBox[{"D", "[", RowBox[{ RowBox[{"f", "[", "t", "]"}], ",", "t"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Animate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"ParametricPlot3D", "[", RowBox[{"fun", ",", RowBox[{"{", RowBox[{"u", ",", "u0", ",", "u1"}], "}"}], ",", "options"}], "]"}], ",", RowBox[{"Graphics3D", "[", RowBox[{"{", RowBox[{ RowBox[{"PointSize", "[", "0.03", "]"}], ",", RowBox[{"Point", "[", RowBox[{"f", "[", "t", "]"}], "]"}], ",", "Red", ",", RowBox[{"Thickness", "[", "Medium", "]"}], ",", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"f", "[", "t", "]"}], ",", RowBox[{ RowBox[{"f", "[", "t", "]"}], "+", RowBox[{"Df", "[", "t", "]"}]}]}], "}"}], "]"}]}], "}"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "u0", ",", "u1"}], "}"}], ",", RowBox[{"DisplayAllSteps", "\[Rule]", "True"}]}], "]"}]}]}], " ", "\[IndentingNewLine]", "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"For", " ", "the", " ", "record"}], ",", " ", RowBox[{ RowBox[{ "the", " ", "button", " ", "which", " ", "loads", " ", "the", " ", "commands", " ", "was", " ", "created", " ", "with", " ", "the", " ", "following", " ", "command"}], ";", " ", RowBox[{ RowBox[{ "the", " ", "button", " ", "was", " ", "then", " ", "cut", " ", "and", " ", "pasted", " ", "into", " ", "its", " ", "current", " ", RowBox[{ "location", ":", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Cell", "[", RowBox[{ RowBox[{"BoxData", "[", RowBox[{"ButtonBox", "[", RowBox[{ RowBox[{"StyleBox", "[", RowBox[{"\"\\"", ",", RowBox[{"FontWeight", "\[Rule]", "Bold"}], ",", RowBox[{"FontVariations", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", "\[Rule]", "False"}], "}"}]}], ",", RowBox[{"FontColor", "\[Rule]", RowBox[{"RGBColor", "[", RowBox[{"0", ",", "0", ",", "0"}], "]"}]}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"ButtonFunction", "\[RuleDelayed]", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"nb", "=", RowBox[{"ButtonNotebook", "[", "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"NotebookLocate", "[", "\"\\"", "]"}], ";", "\[IndentingNewLine]", RowBox[{"SelectionEvaluateCreateCell", "[", "nb", "]"}], ";", "\[IndentingNewLine]", RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "After", ",", "ButtonCell"}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"CellPrint", "[", RowBox[{"Cell", "[", RowBox[{ "\"\\"", ",", "\"\\"", ",", RowBox[{"FontWeight", "->", "\"\\""}], ",", RowBox[{"CellFrame", "\[Rule]", "True"}], ",", RowBox[{"Background", "\[Rule]", RowBox[{"GrayLevel", "[", "0.699992", "]"}]}], ",", RowBox[{"TextAlignment", "\[Rule]", "Center"}]}], "]"}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"FrontEndExecute", "[", RowBox[{"{", RowBox[{ RowBox[{"FrontEnd`NotebookFind", "[", RowBox[{ RowBox[{"FrontEnd`InputNotebook", "[", "]"}], ",", "\[IndentingNewLine]", "\"\\"", ",", "All", ",", "CellTags"}], "]"}], ",", RowBox[{"FrontEndToken", "[", RowBox[{ RowBox[{"FrontEnd`InputNotebook", "[", "]"}], ",", "\"\\""}], "]"}]}], "}"}], "]"}], ";", RowBox[{"SelectionMove", "[", RowBox[{"nb", ",", "After", ",", "Notebook"}], "]"}], ";"}]}], "]"}]}], ",", RowBox[{"ButtonEvaluator", "\[Rule]", "Automatic"}], ",", RowBox[{"Active", "\[Rule]", "True"}], ",", RowBox[{"ButtonFrame", "->", "\"\\""}], ",", RowBox[{"Background", "\[Rule]", RowBox[{"GrayLevel", "[", "0.7", "]"}]}], ",", RowBox[{"ButtonMargins", "\[Rule]", "5"}]}], "]"}], "]"}], ",", RowBox[{"TextAlignment", "\[Rule]", "Center"}]}], "]"}]}]}], "//", "CellPrint"}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "*)"}]}]}]], "Input", ShowCellTags->False, CellChangeTimes->{{3.411776621937744*^9, 3.411776696031011*^9}, { 3.411776730588786*^9, 3.41177674257628*^9}, {3.411776908690983*^9, 3.4117769642505283`*^9}, {3.411777005114678*^9, 3.4117770240409527`*^9}, 3.4117771785951633`*^9, {3.4117772542609253`*^9, 3.411777255761898*^9}, { 3.411777298439021*^9, 3.411777300702506*^9}, {3.4117773678361683`*^9, 3.411777372935615*^9}, {3.411777407055366*^9, 3.411777407391292*^9}, { 3.411777448371626*^9, 3.4117774514655933`*^9}, {3.4117775919177313`*^9, 3.411777610516162*^9}, {3.4117786992767277`*^9, 3.411778706479958*^9}, { 3.411780695101157*^9, 3.41178070137613*^9}, 3.412351498066369*^9, 3.41235162851718*^9, {3.412354703407163*^9, 3.412354749015011*^9}, { 3.412354816261922*^9, 3.412354816774201*^9}, {3.412354951262697*^9, 3.412354981848552*^9}, 3.412355179680432*^9, {3.412388621680992*^9, 3.412388667482402*^9}, 3.412390594914757*^9}, CellTags->"initcell"] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ "You should click on the button below before you begin reading any labs or \ doing your own work. If you use ", StyleBox["Mathematica", FontSlant->"Italic"], " to write your solutions to lab exercises, please don't include this \ message or the template header above; delete them before handing anything \ in." }], "Subsubsection", CellFrame->True, CellDingbat->None, Background->GrayLevel[0.859998]], Cell[BoxData[ ButtonBox[ StyleBox[ RowBox[{ "Click", " ", "Here", " ", "to", " ", "Load", " ", "Math", " ", "2374", " ", "Commands"}], FontWeight->"Bold", FontVariations->{"Underline"->False}, FontColor->GrayLevel[0]], Active->True, Background->GrayLevel[0.699992], ButtonFrame->"DialogBox", ButtonFunction:> Module[{nb = ButtonNotebook[]}, NotebookLocate["initcell"]; SelectionEvaluateCreateCell[nb]; SelectionMove[nb, After, ButtonCell]; CellPrint[ Cell[ "Done! You can now continue working.", "Text", FontWeight -> "Bold", CellFrame -> True, Background -> GrayLevel[0.699992], TextAlignment -> Center]]; FrontEndExecute[{ FrontEnd`NotebookFind[ FrontEnd`InputNotebook[], "initgroup", All, CellTags], FrontEndToken[ FrontEnd`InputNotebook[], "SelectionCloseAllGroups"]}]; SelectionMove[nb, After, Notebook]; Null], ButtonMargins->5, Evaluator->Automatic]], GeneratedCell->True, CellAutoOverwrite->True, TextAlignment->Center, Background->GrayLevel[1]] }, Open ]] }, AutoGeneratedPackage->Automatic, WindowSize->{675, 849}, WindowMargins->{{Automatic, 67}, {56, Automatic}}, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (April 20, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "initcell"->{ Cell[2177, 59, 32069, 769, 2968, "Input", CellTags->"initcell"]}, "initgroup"->{ Cell[590, 23, 410, 10, 46, "Subsubsection", CellTags->"initgroup"]} } *) (*CellTagsIndex CellTagsIndex->{ {"initcell", 36116, 890}, {"initgroup", 36203, 893} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 410, 10, 46, "Subsubsection", CellTags->"initgroup"], Cell[1003, 35, 287, 6, 57, "Text"], Cell[1293, 43, 881, 14, 206, "Text"], Cell[2177, 59, 32069, 769, 2968, "Input", CellTags->"initcell"] }, Closed]], Cell[CellGroupData[{ Cell[34283, 833, 425, 11, 77, "Subsubsection"], Cell[34711, 846, 1069, 30, 40, InheritFromParent] }, Open ]] } ] *) (* End of internal cache information *)