(* 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[ 33540, 964] NotebookOptionsPosition[ 28755, 828] NotebookOutlinePosition[ 31031, 894] CellTagsIndexPosition[ 30600, 882] WindowTitle->Lecture 11 MIT 3.016 (Fall 2011) \251 W. Craig Carter \ 2003--2011 WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell["Visualizing Time-Dependent Scalar and Vector Fields", "Title"], Cell[CellGroupData[{ Cell["Cross Products", "Subtitle"], Cell["Here is the built-in cross product between two vectors", "Text"], Cell[BoxData[ RowBox[{"crossab", " ", "=", RowBox[{"Cross", "[", RowBox[{ RowBox[{"{", RowBox[{ SubscriptBox["a", "1"], ",", SubscriptBox["a", "2"], ",", SubscriptBox["a", "3"]}], "}"}], " ", ",", RowBox[{"{", RowBox[{ SubscriptBox["b", "1"], ",", SubscriptBox["b", "2"], ",", SubscriptBox["b", "3"]}], "}"}]}], "]"}]}]], "Input"], Cell["\<\ And, here is the standard visual way to do it by hand with the determinant.\ \>", "Text"], Cell[BoxData[ RowBox[{"detab", " ", "=", RowBox[{"Det", "[", RowBox[{"(", GridBox[{ {"i", "j", "k"}, { SubscriptBox["a", "1"], SubscriptBox["a", "2"], SubscriptBox["a", "3"]}, { SubscriptBox["b", "1"], SubscriptBox["b", "2"], SubscriptBox["b", "3"]} }, GridBoxDividers->{ "Columns" -> {{True}}, "ColumnsIndexed" -> {}, "Rows" -> {{True}}, "RowsIndexed" -> {}}], ")"}], "]"}]}]], "Input", CellTags->{ "mtag:11:cross_products_example", "mtag:11:vector_products_example"}], Cell["Pick out each of the compenents to create the vector", "Text"], Cell[BoxData[ RowBox[{"testcrossab", "=", RowBox[{"{", RowBox[{ RowBox[{"Coefficient", "[", RowBox[{"detab", ",", "i"}], "]"}], ",", " ", RowBox[{"Coefficient", "[", RowBox[{"detab", ",", "j"}], "]"}], ",", RowBox[{"Coefficient", "[", RowBox[{"detab", ",", "k"}], "]"}]}], "}"}]}]], "Input"], Cell["\<\ Check for equality between the old-fashioned way and Mathematica's built-in \ function\ \>", "Text"], Cell[BoxData[ RowBox[{"testcrossab", " ", "\[Equal]", " ", "crossab"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Visualizing Space Curves as Time-Dependent Vectors", "Subtitle", CellChangeTimes->{{3.399024434597324*^9, 3.399024436684186*^9}}], Cell["Create a trajectory of a point or a particle", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"XVector", "[", "t_", "]"}], " ", ":=", " ", RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", RowBox[{"6", " ", "t"}], "]"}], ",", RowBox[{"Sin", "[", RowBox[{"4", "t"}], " ", "]"}], ",", " ", RowBox[{ RowBox[{"Sin", "[", "t", "]"}], " ", "+", " ", RowBox[{"Cos", "[", "t", "]"}]}]}], "}"}]}]], "Input", CellChangeTimes->{{3.398938526577839*^9, 3.398938560066228*^9}, { 3.39893860356325*^9, 3.398938611978594*^9}, {3.398938645917617*^9, 3.398938646920697*^9}, {3.3989386833752193`*^9, 3.398938696356805*^9}, { 3.398939056140594*^9, 3.398939060906686*^9}, {3.398939725285697*^9, 3.398939732922943*^9}, {3.398939936966131*^9, 3.3989399413481092`*^9}, { 3.398940022491366*^9, 3.3989400509149427`*^9}, {3.3989420518572073`*^9, 3.398942067037017*^9}, 3.3990245188277073`*^9}], Cell["\<\ ParametricPlot3D allows us to visualize the entire trajectory at once.\ \>", "Text"], Cell[BoxData[ RowBox[{"ParametricPlot3D", "[", RowBox[{ RowBox[{"XVector", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"2", " ", "\[Pi]"}]}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", " ", RowBox[{"{", RowBox[{"Thick", ",", " ", "Blue"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.39893717374819*^9, 3.39893719654604*^9}, { 3.3989385112601967`*^9, 3.398938511822048*^9}, {3.398938583133102*^9, 3.3989385869504967`*^9}, {3.3989387840193453`*^9, 3.3989387893712187`*^9}, 3.398938837012837*^9, {3.398939738708152*^9, 3.398939739573153*^9}, { 3.398942071916224*^9, 3.3989420730769577`*^9}, 3.399024525798478*^9}, CellTags->"mtag:11:ParametricPlot3D[]"], Cell["\<\ Here is a function to create a graphic with a variable end - point. We will \ have the function remember when it has already computed a graphic, trading \ memory for a possible speed-up.\ \>", "Text", CellChangeTimes->{{3.399023448814796*^9, 3.399023463204712*^9}, { 3.399023612469404*^9, 3.399023648267984*^9}, 3.399023934869885*^9}], Cell[BoxData[ RowBox[{ RowBox[{"paraplot", "[", "time_", "]"}], " ", ":=", RowBox[{ RowBox[{"paraplot", "[", "time", "]"}], "=", " ", RowBox[{"ParametricPlot3D", "[", RowBox[{ RowBox[{"XVector", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "time"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", " ", RowBox[{"{", RowBox[{"Thick", ",", " ", "Blue"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]}]}]], "Input", CellChangeTimes->{{3.398938840545042*^9, 3.3989388733472357`*^9}, { 3.398939782326624*^9, 3.3989397832791233`*^9}, {3.399023542335149*^9, 3.3990235508944902`*^9}, 3.399024531118664*^9}], Cell["\<\ Use manipulate on the graphics function to visualize how the curve develops \ with its parameter\ \>", "Text", CellChangeTimes->{{3.399023474591178*^9, 3.399023494366028*^9}}], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"paraplot", "[", "time", "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"time", ",", "0.05"}], "}"}], ",", "0.01", ",", RowBox[{"2", " ", "\[Pi]"}]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.398938797769754*^9, 3.3989388097382507`*^9}, { 3.398938891255632*^9, 3.3989389404344263`*^9}, {3.3989420892441273`*^9, 3.398942090485051*^9}}], Cell["\<\ However, we need to fix the length scale between frames, so we use the last \ graphic to infer what PlotRange should be.\ \>", "Text", CellChangeTimes->{{3.399023474591178*^9, 3.3990235157719812`*^9}, { 3.399023664019722*^9, 3.399023696531802*^9}}], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"paraplot", "[", "time", "]"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.5"}], ",", "1.5"}], "}"}]}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"time", ",", "0.05"}], "}"}], ",", "0.01", ",", RowBox[{"2", " ", "\[Pi]"}]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.398938797769754*^9, 3.3989388097382507`*^9}, { 3.398938891255632*^9, 3.3989389404344263`*^9}, {3.398938973660116*^9, 3.398939034267025*^9}, {3.398939111180785*^9, 3.398939115491376*^9}, { 3.3989421270537987`*^9, 3.39894212812386*^9}}], Cell["\<\ Next, we add a graphic element to show the vector, drawn from the origin, for \ each end-point.\ \>", "Text", CellChangeTimes->{{3.399023474591178*^9, 3.3990235157719812`*^9}, { 3.399023664019722*^9, 3.399023696531802*^9}, {3.399023750893639*^9, 3.39902379723598*^9}}], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"paraplot", "[", "time", "]"}], ",", RowBox[{"Graphics3D", "[", RowBox[{"{", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"XVector", "[", "time", "]"}]}], "}"}], ",", "0.03"}], "]"}], "}"}], "]"}]}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.5"}], ",", "1.5"}], "}"}]}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"time", ",", "0.05"}], "}"}], ",", "0.01", ",", RowBox[{"2", " ", "\[Pi]"}]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.398939306789699*^9, 3.398939325854747*^9}, { 3.3989394133756037`*^9, 3.3989395670441*^9}, {3.39893960404208*^9, 3.398939681096155*^9}, {3.3989398230147953`*^9, 3.398939909144534*^9}, { 3.398942150815586*^9, 3.398942157040504*^9}, 3.399024539967445*^9}] }, Closed]], Cell[CellGroupData[{ Cell["Visualizing Local Tangent Vectors of Space Curves", "Subtitle", CellChangeTimes->{{3.3990244145352716`*^9, 3.399024430411911*^9}}], Cell[TextData[{ "Compute the local derivative of the vector that we visualized above: ", Cell[BoxData[ FormBox[ OverscriptBox["v", "\[RightVector]"], TraditionalForm]]], " = ", Cell[BoxData[ FormBox[ FractionBox[ RowBox[{"d", OverscriptBox["x", "\[RightVector]"]}], "dt"], TraditionalForm]]] }], "Text", CellChangeTimes->{{3.399024463680479*^9, 3.399024466851901*^9}, { 3.3990247223751574`*^9, 3.399024781710598*^9}}], Cell[BoxData[ RowBox[{"Simplify", "[", RowBox[{"D", "[", RowBox[{ RowBox[{"XVector", "[", "t", "]"}], ",", "t"}], "]"}], "]"}]], "Input", CellChangeTimes->{{3.3989401059583683`*^9, 3.3989401730186243`*^9}, { 3.398940222235014*^9, 3.3989402693468018`*^9}, {3.39894031310679*^9, 3.398940319246875*^9}, {3.399024545205615*^9, 3.399024552181038*^9}}], Cell["Write out a function for the derivative:", "Text", CellChangeTimes->{{3.399024814196199*^9, 3.3990248610522738`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"dxdt", "[", "s_", "]"}], " ", ":=", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "6"}], " ", RowBox[{"Sin", "[", RowBox[{"6", " ", "s"}], "]"}]}], ",", RowBox[{"4", " ", RowBox[{"Cos", "[", RowBox[{"4", " ", "s"}], "]"}]}], ",", RowBox[{ RowBox[{"Cos", "[", "s", "]"}], "-", RowBox[{"Sin", "[", "s", "]"}]}]}], "}"}]}]], "Input", CellChangeTimes->{{3.39894032341877*^9, 3.398940336775806*^9}, { 3.39894070221378*^9, 3.3989407113669653`*^9}, 3.398940762620303*^9, { 3.398941067234968*^9, 3.398941093879298*^9}, 3.3989418799726667`*^9, { 3.398942176563261*^9, 3.398942187775881*^9}, 3.399024477883621*^9}], Cell["\<\ Plot it.... Note that it doesn't \"appear\" to be periodic, which would be \ wrong.\ \>", "Text", CellChangeTimes->{{3.399024814196199*^9, 3.399024967716174*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{"dxdtplot", "[", "time_", "]"}], " ", ":=", " ", RowBox[{"ParametricPlot3D", "[", RowBox[{ RowBox[{"dxdt", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "time"}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", " ", RowBox[{"{", RowBox[{"Thick", ",", " ", RowBox[{"Darker", "[", "Red", "]"}]}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}]}], "]"}]}], "\[IndentingNewLine]", RowBox[{"dxdtplot", "[", RowBox[{"2", " ", "\[Pi]"}], "]"}]}], "Input", CellChangeTimes->{{3.3989407355815163`*^9, 3.3989407368191147`*^9}, { 3.398940804177651*^9, 3.398940808499555*^9}, {3.398941131685041*^9, 3.398941174196624*^9}, {3.398941228543888*^9, 3.398941245484045*^9}, { 3.3989422013981133`*^9, 3.398942202492248*^9}, {3.399024480206724*^9, 3.399024488398385*^9}}], Cell["\<\ The puzzle can be visualizing the time-development of both curves:\ \>", "Text", CellChangeTimes->{{3.399024814196199*^9, 3.399024967716174*^9}, { 3.399024999109838*^9, 3.399025033196002*^9}}], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"paraplot", "[", "time", "]"}], ",", RowBox[{"dxdtplot", "[", "time", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Graphics3D", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Lighter", "[", "Blue", "]"}], ",", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"XVector", "[", "time", "]"}]}], "}"}], ",", "0.1"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"Lighter", "[", "Red", "]"}], ",", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", " ", RowBox[{"dxdt", "[", "time", "]"}]}], "}"}], ",", "0.1"}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "}"}], "]"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4"}], ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.5"}], ",", "1.5"}], "}"}]}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"time", ",", "0.05"}], "}"}], ",", "0.01", ",", RowBox[{"2", " ", "\[Pi]"}]}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.398939306789699*^9, 3.398939325854747*^9}, { 3.3989394133756037`*^9, 3.3989395670441*^9}, {3.39893960404208*^9, 3.398939681096155*^9}, {3.3989398230147953`*^9, 3.398939909144534*^9}, { 3.398941258759438*^9, 3.398941262566104*^9}, {3.398941313127961*^9, 3.3989414887341948`*^9}, {3.398941545445347*^9, 3.398941547783265*^9}, { 3.398941610493061*^9, 3.39894163991018*^9}, {3.398941731740634*^9, 3.3989417399362993`*^9}, {3.398941922929287*^9, 3.39894193984608*^9}, { 3.398942212135667*^9, 3.398942256168208*^9}, {3.398942288188596*^9, 3.398942318840629*^9}, {3.399024492680708*^9, 3.3990244960485086`*^9}, 3.399024565369018*^9}], Cell["\<\ To visualize the \"tangency property,\" we translate the derivative-vector \ to the end of the space curve\ \>", "Text", CellChangeTimes->{{3.399024814196199*^9, 3.399024967716174*^9}, { 3.399024999109838*^9, 3.399025033196002*^9}, {3.399025066397944*^9, 3.3990251212120667`*^9}}], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"paraplot", "[", "time", "]"}], ",", RowBox[{"dxdtplot", "[", "time", "]"}], ",", "\[IndentingNewLine]", RowBox[{"Graphics3D", "[", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Lighter", "[", "Blue", "]"}], ",", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}], ",", RowBox[{"XVector", "[", "time", "]"}]}], "}"}], ",", "0.1"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"Lighter", "[", "Red", "]"}], ",", RowBox[{"Cylinder", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"XVector", "[", "time", "]"}], ",", " ", RowBox[{"dxdt", "[", "time", "]"}]}], "}"}], ",", "0.1"}], "]"}]}], "}"}]}], "\[IndentingNewLine]", "}"}], "]"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "6"}], ",", "6"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4"}], ",", "4"}], "}"}]}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"time", ",", "0.05"}], "}"}], ",", "0.01", ",", RowBox[{"2", " ", "\[Pi]"}]}], "}"}]}], "]"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ The Time-Dependent Solution to the Diffusion Equation in the Plane \ Rectangular Initial Conditions\ \>", "Subtitle", CellChangeTimes->{{3.399025694207859*^9, 3.39902573841193*^9}, 3.399029965151432*^9}], Cell["\<\ This is the solution to the time-dependent diffusion equation in the infinite \ plane for iniital conditions c = 1 inside a rectangle (-a/2 < x < a/2 && -b/2 \ < y < b/2) and zero outside.\ \>", "Text", CellChangeTimes->{{3.398950745605343*^9, 3.3989508743796797`*^9}}], Cell[BoxData[ RowBox[{"concentration", " ", "=", RowBox[{"Integrate", "[", RowBox[{ FractionBox[ RowBox[{"Exp", "[", FractionBox[ RowBox[{"-", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"xsource", "-", "x"}], ")"}], "^", "2"}], " ", "+", " ", RowBox[{ RowBox[{"(", RowBox[{"ysource", "-", "y"}], ")"}], "^", "2"}]}], ")"}]}], RowBox[{"4", "Diffusivity", " ", "t"}]], "]"}], RowBox[{"4", " ", "Pi", " ", "Diffusivity", " ", "t"}]], ",", " ", RowBox[{"{", RowBox[{"xsource", ",", RowBox[{ RowBox[{"-", "a"}], "/", "2"}], ",", RowBox[{"a", "/", "2"}]}], "}"}], ",", RowBox[{"{", RowBox[{"ysource", ",", RowBox[{ RowBox[{"-", "b"}], "/", "2"}], ",", RowBox[{"b", "/", "2"}]}], "}"}], ",", RowBox[{"Assumptions", "\[Rule]", RowBox[{ RowBox[{"Diffusivity", ">", "0"}], "&&", RowBox[{"t", ">", "0"}], " ", "&&", " ", RowBox[{"a", ">", "0"}], " ", "&&", " ", RowBox[{"b", ">", " ", "0"}], " ", "&&", " ", RowBox[{"x", " ", "\[Element]", " ", "Reals"}], " ", "&&", " ", RowBox[{"y", " ", "\[Element]", " ", "Reals"}]}]}]}], "]"}]}]], "Input",\ CellChangeTimes->{{3.3989485663262167`*^9, 3.398948587692474*^9}, 3.39895073016965*^9}, CellTags-> "mtag:11:diffusion_equation_solution__example__2D_point_source_at_origin"], Cell[TextData[{ "Introduce a fixed model parameter and", StyleBox[" non-dimensional variables:", FontWeight->"Bold"] }], "Text", CellChangeTimes->{{3.398950887609941*^9, 3.398950913482429*^9}, { 3.3990292549831*^9, 3.399029264484557*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"aspectRatio", "=", "3"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"b", " ", "=", " ", RowBox[{"aspectRatio", " ", "a"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"length", " ", "=", " ", "a"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"time", " ", "=", " ", RowBox[{ RowBox[{"length", "^", "2"}], "/", "Diffusivity"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"ScaleRules", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"t", " ", "->", " ", RowBox[{"\[Tau]", " ", "time"}]}], ",", RowBox[{"x", " ", "->", " ", RowBox[{"\[Xi]", " ", "length"}]}], ",", RowBox[{"y", " ", "->", " ", RowBox[{"\[Eta]", " ", "length"}]}]}], "}"}]}], ";"}]}], "Input", CellChangeTimes->{{3.39895088330954*^9, 3.3989508847229433`*^9}, { 3.3989509287230873`*^9, 3.398950981451663*^9}, {3.39895102471551*^9, 3.398951268716894*^9}, {3.398963850177671*^9, 3.398963898862855*^9}, { 3.398963941220104*^9, 3.398963962351323*^9}, {3.399029281463336*^9, 3.399029291232435*^9}, {3.399029333927183*^9, 3.399029341254506*^9}, { 3.399029438888629*^9, 3.399029439390892*^9}}], Cell[BoxData[ RowBox[{"scaledconc", " ", "=", RowBox[{"Simplify", "[", RowBox[{ RowBox[{"concentration", "/.", "ScaleRules"}], ",", RowBox[{"Assumptions", "\[Rule]", RowBox[{"a", ">", "0"}]}]}], "]"}]}]], "Input", CellChangeTimes->{{3.398951396781345*^9, 3.398951402187666*^9}, { 3.39896058623066*^9, 3.3989605909403267`*^9}, {3.3989606545202093`*^9, 3.398960687948903*^9}, 3.39896397644069*^9}], Cell[BoxData[ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"scaledconc", "/.", RowBox[{"\[Tau]", "\[Rule]", "0.003"}]}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Eta]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", RowBox[{"MeshFunctions", "\[Rule]", " ", RowBox[{"{", RowBox[{"#3", "&"}], "}"}]}], ",", RowBox[{"PlotPoints", "\[Rule]", "30"}], ",", RowBox[{"Mesh", "\[Rule]", "5"}], ",", RowBox[{"MeshStyle", "\[Rule]", RowBox[{"{", "Thick", "}"}]}]}], "]"}]], "Input", CellChangeTimes->{{3.398951602630186*^9, 3.398951613212438*^9}, { 3.398952636650877*^9, 3.398952638148683*^9}, {3.3989526736936007`*^9, 3.398952694855546*^9}, {3.3989527677997417`*^9, 3.398952805965127*^9}, { 3.3989533289432364`*^9, 3.398953465590302*^9}, {3.3989535097813396`*^9, 3.398953510462091*^9}, {3.398953550016724*^9, 3.39895370855097*^9}, { 3.3989537911607037`*^9, 3.398953836438465*^9}, {3.398953892297365*^9, 3.3989539567574263`*^9}}], Cell["\<\ Visualize the solution by plotting the concentration as function of x and y, \ and animate as function of time.\ \>", "Text"], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Plot3D", "[", RowBox[{ RowBox[{"scaledconc", "/.", RowBox[{"\[Tau]", "\[Rule]", "timevar"}]}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Eta]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", RowBox[{"MaxRecursion", "\[Rule]", "4"}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"timevar", ",", "0.05"}], "}"}], ",", "0.001", ",", "0.1"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.3989539880038233`*^9, 3.398954023989163*^9}, { 3.3989540710123262`*^9, 3.3989541001266193`*^9}, {3.398954217910687*^9, 3.3989542186621027`*^9}, {3.3989542726935577`*^9, 3.3989543721664658`*^9}, {3.398958399268092*^9, 3.398958401094524*^9}, { 3.398958717264575*^9, 3.3989587406068373`*^9}, {3.398958779158977*^9, 3.398958787046905*^9}, {3.3989588284057083`*^9, 3.398958843960526*^9}, { 3.398958974929153*^9, 3.398958997145321*^9}, 3.398959060813199*^9, { 3.398959139971465*^9, 3.398959143139144*^9}, {3.398959247663522*^9, 3.398959251358405*^9}, {3.39895929236462*^9, 3.398959303885988*^9}}], Cell["\<\ Another visualization scheme: plot the isoconcentration lines as function of \ x and y, and animate as function of time. This is like the temporal \ evolution of a topographical map.\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{"cplots", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"ContourPlot", "[", RowBox[{ RowBox[{"scaledconc", "/.", RowBox[{"\[Tau]", "\[Rule]", "timevar"}]}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Eta]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"ColorData", "[", "\"\\"", "]"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"timevar", ",", ".001", ",", ".5", ",", ".005"}], "}"}]}], "]"}]}], ";"}]], "Input", CellTags->"mtag:11:MovieContourPlot[]"], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"cplots", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "cplots", "]"}], ",", "1"}], "}"}]}], "]"}]], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Visualizing Diffusional Flux: The Time-Dependent Gradient Field\ \>", "Subtitle", CellChangeTimes->{{3.399025694207859*^9, 3.39902573841193*^9}, { 3.399029965151432*^9, 3.399030004660471*^9}}], Cell["\<\ Flux is a vector that points in the direction of the flow and is a measure \ of how much is flowing per unit time. This is Fick's first law.\ \>", "Text"], Cell[BoxData[ RowBox[{"flux", " ", "=", " ", RowBox[{"{", RowBox[{ RowBox[{"-", RowBox[{"D", "[", RowBox[{"scaledconc", ",", "\[Xi]"}], "]"}]}], ",", RowBox[{"-", RowBox[{"D", "[", RowBox[{"scaledconc", ",", "\[Eta]"}], "]"}]}]}], "}"}]}]], "Input", CellChangeTimes->{{3.3989601797574863`*^9, 3.398960196406342*^9}}], Cell["\<\ An example of the vector field as a function of position at time = 0.8\ \>", "Text"], Cell[BoxData[ RowBox[{"VectorPlot", "[", RowBox[{ RowBox[{"flux", "/.", RowBox[{"\[Tau]", "\[Rule]", ".08"}]}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Eta]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"VectorPoints", "\[Rule]", " ", "32"}], ",", RowBox[{"VectorColorFunction", "\[Rule]", RowBox[{"ColorData", "[", "\"\\"", "]"}]}]}], "]"}]], "Input", CellTags->{ "mtag:11:PlotVectorField[]", "mtag:11:ScaleFunction__in_PlotVectorField[]"}], Cell["\<\ An example of the vector field as a function of position at time = 0.2, but \ with more control over the appearance of the arrows.\ \>", "Text"], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"vplots", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"VectorPlot", "[", RowBox[{ RowBox[{"flux", "/.", RowBox[{"\[Tau]", "\[Rule]", "timevar"}]}], ",", RowBox[{"{", RowBox[{"\[Xi]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"{", RowBox[{"\[Eta]", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"VectorPoints", "\[Rule]", " ", "32"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "4"}], ",", "4"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "4"}], ",", "4"}], "}"}]}], "}"}]}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"VectorColorFunction", "\[Rule]", " ", RowBox[{"(", RowBox[{ RowBox[{"Hue", "[", RowBox[{"0.25", "+", RowBox[{"0.75", " ", "#"}]}], "]"}], "&"}], ")"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"timevar", ",", ".001", ",", ".5", ",", ".005"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]"}]}]], "Input"], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"vplots", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "vplots", "]"}], ",", "1"}], "}"}]}], "]"}]], "Input"], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{ RowBox[{"cplots", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"vplots", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"3.5", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "}"}]}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"Length", "[", "cplots", "]"}], ",", "1"}], "}"}]}], "]"}]], "Input"] }, Closed]] }, ScreenStyleEnvironment->"Presentation", WindowToolbars->{}, CellGrouping->Manual, WindowSize->{1289, 768}, WindowMargins->{{72, Automatic}, {Automatic, 94}}, WindowTitle->"Lecture 11 MIT 3.016 (Fall 2011) \[Copyright] W. Craig Carter \ 2003--2011", PrintingCopies->1, PrintingPageRange->{1, Automatic}, ShowCellLabel->False, CellLabelAutoDelete->True, Magnification->1, FrontEndVersion->"8.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (November 6, \ 2010)", StyleDefinitions->FrontEnd`FileName[{"Creative"}, "NaturalColor.nb", CharacterEncoding -> "UTF-8"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "mtag:11:cross_products_example"->{ Cell[1336, 49, 568, 18, 70, "Input", CellTags->{ "mtag:11:cross_products_example", "mtag:11:vector_products_example"}]}, "mtag:11:vector_products_example"->{ Cell[1336, 49, 568, 18, 70, "Input", CellTags->{ "mtag:11:cross_products_example", "mtag:11:vector_products_example"}]}, "mtag:11:ParametricPlot3D[]"->{ Cell[3710, 122, 873, 19, 58, "Input", CellTags->"mtag:11:ParametricPlot3D[]"]}, "mtag:11:diffusion_equation_solution__example__2D_point_source_at_origin"->{ Cell[17416, 500, 1475, 40, 183, "Input", CellTags-> "mtag:11:diffusion_equation_solution__example__2D_point_source_at_origin"]\ }, "mtag:11:MovieContourPlot[]"->{ Cell[23676, 665, 858, 24, 84, "Input", CellTags->"mtag:11:MovieContourPlot[]"]}, "mtag:11:PlotVectorField[]"->{ Cell[25668, 731, 597, 16, 84, "Input", CellTags->{ "mtag:11:PlotVectorField[]", "mtag:11:ScaleFunction__in_PlotVectorField[]"}]}, "mtag:11:ScaleFunction__in_PlotVectorField[]"->{ Cell[25668, 731, 597, 16, 84, "Input", CellTags->{ "mtag:11:PlotVectorField[]", "mtag:11:ScaleFunction__in_PlotVectorField[]"}]} } *) (*CellTagsIndex CellTagsIndex->{ {"mtag:11:cross_products_example", 29452, 850}, {"mtag:11:vector_products_example", 29620, 854}, {"mtag:11:ParametricPlot3D[]", 29783, 858}, {"mtag:11:diffusion_equation_solution__example__2D_point_source_at_origin", \ 29946, 861}, {"mtag:11:MovieContourPlot[]", 30119, 866}, {"mtag:11:PlotVectorField[]", 30237, 869}, {"mtag:11:ScaleFunction__in_PlotVectorField[]", 30432, 874} } *) (*NotebookFileOutline Notebook[{ Cell[628, 22, 68, 0, 183, "Title"], Cell[CellGroupData[{ Cell[721, 26, 34, 0, 39, "Subtitle"], Cell[758, 28, 70, 0, 70, "Text"], Cell[831, 30, 400, 13, 70, "Input"], Cell[1234, 45, 99, 2, 70, "Text"], Cell[1336, 49, 568, 18, 70, "Input", CellTags->{ "mtag:11:cross_products_example", "mtag:11:vector_products_example"}], Cell[1907, 69, 68, 0, 70, "Text"], Cell[1978, 71, 331, 9, 70, "Input"], Cell[2312, 82, 110, 3, 70, "Text"], Cell[2425, 87, 82, 1, 70, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[2544, 93, 136, 1, 39, "Subtitle"], Cell[2683, 96, 60, 0, 44, "Text"], Cell[2746, 98, 864, 18, 58, "Input"], Cell[3613, 118, 94, 2, 44, "Text"], Cell[3710, 122, 873, 19, 58, "Input", CellTags->"mtag:11:ParametricPlot3D[]"], Cell[4586, 143, 348, 6, 73, "Text"], Cell[4937, 151, 793, 19, 109, "Input"], Cell[5733, 172, 186, 4, 44, "Text"], Cell[5922, 178, 446, 11, 58, "Input"], Cell[6371, 191, 261, 5, 73, "Text"], Cell[6635, 198, 967, 27, 84, "Input"], Cell[7605, 227, 284, 6, 44, "Text"], Cell[7892, 235, 1393, 39, 84, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[9322, 279, 137, 1, 39, "Subtitle"], Cell[9462, 282, 444, 13, 59, "Text"], Cell[9909, 297, 364, 7, 58, "Input"], Cell[10276, 306, 124, 1, 44, "Text"], Cell[10403, 309, 710, 18, 58, "Input"], Cell[11116, 329, 173, 4, 44, "Text"], Cell[11292, 335, 964, 22, 109, "Input"], Cell[12259, 359, 205, 4, 44, "Text"], Cell[12467, 365, 2413, 59, 159, "Input"], Cell[14883, 426, 297, 6, 44, "Text"], Cell[15183, 434, 1692, 47, 159, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[16912, 486, 218, 5, 83, "Subtitle"], Cell[17133, 493, 280, 5, 73, "Text"], Cell[17416, 500, 1475, 40, 183, "Input", CellTags-> "mtag:11:diffusion_equation_solution__example__2D_point_source_at_origin"], Cell[18894, 542, 245, 6, 44, "Text"], Cell[19142, 550, 1227, 30, 184, "Input"], Cell[20372, 582, 426, 9, 58, "Input"], Cell[20801, 593, 1171, 27, 84, "Input"], Cell[21975, 622, 137, 3, 44, "Text"], Cell[22115, 627, 1347, 30, 84, "Input"], Cell[23465, 659, 208, 4, 73, "Text"], Cell[23676, 665, 858, 24, 84, "Input", CellTags->"mtag:11:MovieContourPlot[]"], Cell[24537, 691, 258, 8, 58, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[24832, 704, 205, 4, 39, "Subtitle"], Cell[25040, 710, 165, 3, 73, "Text"], Cell[25208, 715, 360, 10, 58, "Input"], Cell[25571, 727, 94, 2, 44, "Text"], Cell[25668, 731, 597, 16, 84, "Input", CellTags->{ "mtag:11:PlotVectorField[]", "mtag:11:ScaleFunction__in_PlotVectorField[]"}], Cell[26268, 749, 154, 3, 73, "Text"], Cell[26425, 754, 1361, 37, 159, "Input"], Cell[27789, 793, 258, 8, 58, "Input"], Cell[28050, 803, 689, 22, 84, "Input"] }, Closed]] } ] *) (* End of internal cache information *)