(************** Content-type: application/mathematica ************** 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[ 36952, 1061]*) (*NotebookOutlinePosition[ 37721, 1087]*) (* CellTagsIndexPosition[ 37677, 1083]*) (*WindowFrame->Normal*) Notebook[{ Cell["Lab 8: Just Work It! - George Green and the Conservatives", "Title", Background->RGBColor[0, 0, 1]], Cell[TextData[{ "Math 233\tFall 2002\t", StyleBox["Chapter 13, Sections 2, 3, and 4", FontFamily->"Arial", FontSize->16, FontWeight->"Bold"], " " }], "Subtitle", TextAlignment->Left, TextJustification->0], Cell[CellGroupData[{ Cell["\<\ Initialization Cells - you don't need to open and execute these; they will \ execute automatically.\ \>", "SmallText"], Cell[BoxData[{ \(\(BeginPackage["\"];\)\n\n (*\ Author : \ \ Bradford\ Kline\ *) \n (*\ Last\ \(Revision : \ \ October\ 1998\)\ *) \n\), "\n", \(\(Off[General::spell];\)\), "\n", \(\(\(Off[General::spell1];\)\(\n\) \)\), "\n", \(Needs["\"]\), "\n", \(\(\(Needs["\"]\)\(\n\) \)\), "\n", \(\(\(DirectedCurvePlot::usage = \n"\";\)\(\n\) \)\), "\n", \(\(\(PositionPlot::usage = \n"\";\)\(\n\) \)\), "\n", \(\(\(VelocityPlot::usage = \n"\";\)\(\n\) \)\), "\n", \(\(\(AccelerationPlot::usage = \n"\";\)\(\n\) \)\), "\n", \(\(\(FieldCurvePlot::usage = \n"\";\)\(\n\) \)\), "\n", \(\(\(Begin["\<`Private`\>"];\)\(\n\) \)\), "\n", \(\(\(DirectedCurvePlot[position_, \ {t_, \ t0_, \ t1_}, \ num_Integer, \ opts___]\ := \ \n\ \ Module[{curveplot, \ arrow, \ arrows, \ tail, \ tip, \ j, \ a, \ dt}, \n\ \ \ \ curveplot = \n\ \ \ \ \ \ ParametricPlot[ position, \ {t, \ t0, \ t1}, \ DisplayFunction -> Identity, \ opts]; \n\n\ \ \ \ Do[ a\ = \ N[ t0\ + \ \((t1\ - \ t0)\)* j/num]; \n\ \ \ \ \ \ \ dt\ = \ \((t1\ - \ t0)\)/ 100; \n\ \ \ \ \ \ \ tail\ = \ position /. t -> a; \n\ \ \ \ \ \ \ tip\ = \ position /. t -> \((a\ + \ dt)\); \n\ \ \ \ \ \ \ arrow[ j]\ = \ \n\ \ \ \ \ \ \ \ \ Graphics[{Hue[0], Arrow[tail, tip, \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ HeadScaling -> Absolute, HeadWidth -> .75]}], \n\ \ \ \ {j, 1, num}]; \n\t\t\n\ \ \ \ arrows = Table[arrow[j], {j, 1, num}]; \n\n\ \ \ \ Show[curveplot, \ arrows, \ FilterOptions[Graphics, \ opts], \ DisplayFunction -> $DisplayFunction]\n\ \ ]\)\(\n\) \)\), "\n", \(\(\(DirectedCurvePlot[position_, \ tRange_List, \ opts___Rule]\ := \n\ \ \ DirectedCurvePlot[position, \ tRange, \ 5, \ opts]\)\(\n\) \)\), "\n", \(\(\(PositionPlot[position_, \ {t_, \ t0_, \ t1_}, \ num_Integer, \ opts___]\ := \ \n\ \ Module[{curveplot, \ arrow, \ arrows, \ tail, \ tip, \ j, \ a, \ velocity}, \n\ \ \ \ curveplot = \n\ \ \ \ \ \ ParametricPlot[ position, \ {t, \ t0, \ t1}, \ DisplayFunction -> Identity, \ opts]; \n\n\ \ \ \ Do[ a\ = \ N[ t0\ + \ \((t1\ - \ t0)\)* j/num]; \n\ \ \ \ \ \ \ tail\ = \ {0, 0}; \n\ \ \ \ \ \ \ tip\ = \ position /. t -> a; \n\ \ \ \ \ \ \ arrow[ j]\ = \ \n\ \ \ \ \ \ \ \ \ Graphics[{Hue[0.4], Arrow[tail, tip, \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ HeadScaling -> Absolute, HeadWidth -> .75]}], \n\ \ \ \ {j, 1, num}]; \n\t\t\n\ \ \ \ arrows = Table[arrow[j], {j, 1, num}]; \n\n\ \ \ \ Show[curveplot, \ arrows, \ FilterOptions[Graphics, \ opts], \ DisplayFunction -> $DisplayFunction]\n\ \ ]\)\(\n\) \)\), "\n", \(\(\(PositionPlot[position_, \ tRange_List, \ opts___Rule]\ := \n\ \ \ PositionPlot[position, \ tRange, \ 5, \ opts]\)\(\n\) \)\), "\n", \(\(\(VelocityPlot[position_, \ {t_, \ t0_, \ t1_}, \ num_Integer, \ opts___]\ := \ \n\ \ Module[{curveplot, \ arrow, \ arrows, \ tail, \ tip, \ j, \ a, \ velocity}, \n\ \ \ \ curveplot = \n\ \ \ \ \ \ ParametricPlot[ position, \ {t, \ t0, \ t1}, \ DisplayFunction -> Identity, \ opts]; \n\n\t\tvelocity\ = \ D[position, t]; \n\t\t\n\ \ \ \ Do[ a\ = \ N[ t0\ + \ \((t1\ - \ t0)\)*j/num]; \n\ \ \ \ \ \ \ tail\ = \ position /. t -> a; \n\ \ \ \ \ \ \ tip\ = \ position + velocity /. t -> a; \n\ \ \ \ \ \ \ arrow[ j]\ = \ \n\ \ \ \ \ \ \ \ \ Graphics[{Hue[0], Arrow[tail, tip, \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ HeadScaling -> Absolute, HeadWidth -> .75]}], \n\ \ \ \ {j, 1, num}]; \n\t\t\n\ \ \ \ arrows = Table[arrow[j], {j, 1, num}]; \n\n\ \ \ \ Show[curveplot, \ arrows, \ FilterOptions[Graphics, \ opts], \ DisplayFunction -> $DisplayFunction]\n\ \ ]\)\(\n\) \)\), "\n", \(\(\(VelocityPlot[position_, \ tRange_List, \ opts___Rule]\ := \n\ \ \ VelocityPlot[position, \ tRange, \ 5, \ opts]\)\(\n\) \)\), "\n", \(\(\(AccelerationPlot[position_, \ {t_, \ t0_, \ t1_}, \ num_Integer, \ opts___]\ := \ \n\ \ Module[{curveplot, \ arrow, \ arrows, \ tail, \ tip, \ j, \ a, \ acceleration}, \n\ \ \ \ curveplot = \n\ \ \ \ \ \ ParametricPlot[ position, \ {t, \ t0, \ t1}, \ DisplayFunction -> Identity, \ opts]; \n\n\t\tacceleration\ = \ D[position, {t, 2}]; \n\t\t\n\ \ \ \ Do[ a\ = \ N[ t0\ + \ \((t1\ - \ t0)\)*j/num]; \n\ \ \ \ \ \ \ tail\ = \ position /. t -> a; \n\ \ \ \ \ \ \ tip\ = \ position + acceleration /. t -> a; \n\ \ \ \ \ \ \ arrow[ j]\ = \ \n\ \ \ \ \ \ \ \ \ Graphics[{Hue[0.7], Arrow[tail, tip, \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ HeadScaling -> Absolute, HeadWidth -> .75]}], \n\ \ \ \ {j, 1, num}]; \n\t\t\n\ \ \ \ arrows = Table[arrow[j], {j, 1, num}]; \n\n\ \ \ \ Show[curveplot, \ arrows, \ FilterOptions[Graphics, \ opts], \ DisplayFunction -> $DisplayFunction]\n\ \ ]\)\(\n\) \)\), "\n", \(\(\(AccelerationPlot[position_, \ tRange_List, \ opts___Rule]\ := \n\ \ \ AccelerationPlot[position, \ tRange, \ 5, \ opts]\)\(\n\) \)\), "\n", \(\(\(FieldCurvePlot[position_, \ {t_, \ t0_, \ t1_}, vectorfield_, {x_, y_}, \ num_Integer, \ opts___]\ := \ \n\ \ Module[{curveplot, \ arrow, \ arrows, \ tail, \ tip, \ j, \ a, fieldvector}, \n\ \ \ \ curveplot = \n\ \ \ \ \ \ DirectedCurvePlot[ position, \ {t, \ t0, \ t1}, 3, \ DisplayFunction -> Identity, \ opts]; \n\n\t\ fieldvector = vectorfield /. {x -> position[\([1]\)], y -> position[\([2]\)]}; \n\t\t\n\ \ \ \ Do[ a\ = \ N[ t0\ + \ \((t1\ - \ t0)\)*j/num]; \n\ \ \ \ \ \ \ tail\ = \ position /. t -> a; \n\ \ \ \ \ \ \ tip\ = \ position + fieldvector /. t -> a; \n\ \ \ \ \ \ \ arrow[ j]\ = \ \n\ \ \ \ \ \ \ \ \ Graphics[{Hue[0.9], Arrow[tail, tip, \n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ HeadScaling -> Absolute, HeadWidth -> .75]}], \n\ \ \ \ {j, 1, num}]; \n\t\t\n\ \ \ \ arrows = Table[arrow[j], {j, 1, num}]; \n\n\ \ \ \ Show[curveplot, \ arrows, \ FilterOptions[Graphics, \ opts], \ DisplayFunction -> $DisplayFunction]\n\ \ ]\)\(\n\) \)\), "\n", \(\(\(FieldCurvePlot[position_, \ tRange_List, \ vectorfield_, vars_List, \ opts___Rule]\ := \n\ \ \ FieldCurvePlot[position, \ tRange, \ vectorfield, \ vars, \ \ 5, \ opts]\)\(\n\) \)\), "\n", \(\(\(End[\ ];\)\(\n\) \)\), "\n", \(\(\(Protect[DirectedCurvePlot, \ PositionPlot, \ VelocityPlot, \ AccelerationPlot, \ FieldCurvePlot];\)\(\n\) \)\), "\n", \(EndPackage[\ ]\)}], "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData[StyleBox["Instructions!", FontColor->RGBColor[1, 0, 0]]], "Section"], Cell[TextData[{ "Work in ", StyleBox["groups of 2 or 3", FontWeight->"Bold"], " today, going through the entire notebook. If you have questions, flag me \ down. This lab is for you own personal learning experience, so no need to \ hand it in. Make sure that you actually go through (and understand) all \ parts of the lab since your final will cover this material. \n\nFor ", StyleBox["Homework ", FontWeight->"Bold"], "(practice, not to hand in)", ", you should take the vector field that we introduce in ", StyleBox["Part III", FontWeight->"Bold"], " and calculate the work for the following circulations: \n\t1. the \ counter-clockwise flow from the origin to (1,0) up to (1,1), over to (0,1), \ and back to (0,0)\n\t2. the counter clockwise flow from the origin to (1,0), \ up to (1,1) and back to (0,0)\n\t3. the clockwise flow from (0,0) to (0,1), \ down to (0,1) and back to (0,0)\n\t4. the counter-clockwise flow around the \ circle of radius 1 centered at the origin." }], "Subsubtitle"] }, Closed]], Cell[CellGroupData[{ Cell["Introduction", "Section"], Cell[TextData[{ "OBJECTIVE: Today, you will learn:\n\t1. how to graph vector fields and \ paths through vector fields in ", StyleBox["Mathematica", FontSlant->"Italic"], "\n\t2. to appreciate the differences between types of vector fields \n\t\ 3. how to calculate work in conservative and non-conservative fields \t" }], "Text"], Cell[CellGroupData[{ Cell["Technology Guidelines", "Subsection", CellDingbat->"\[LightBulb]"], Cell[TextData[{ StyleBox["NOTE: If you have just finished a module, restart ", CellFrame->True, Background->None], StyleBox["Mathematica", CellFrame->True, FontSlant->"Italic", Background->None], StyleBox[" before executing a new module.\nTO OPEN CELLS, put your cursor \ on the right cell bracket and double click.", CellFrame->True, Background->None], "\nTO STOP AN EXECUTION\n\tSelect the ", StyleBox["Kernel", FontSlant->"Italic"], " pull-down menu and click on ", StyleBox["Abort Evaluation.\n", FontSlant->"Italic"], "ORDER OF EXECUTION\n\tExecute cells in the order given. Do not skip any \ Input cells within a given notebook.\nSAVING NOTEBOOKS\n\tYou can save \ anytime to any directory you choose, and it is wise to save often.\n\t\ However, before you do your final save, delete all your output by selecting \ the \n\t ", StyleBox["Delete All Output", FontSlant->"Italic"], " selection under the ", StyleBox["Kernel", FontSlant->"Italic"], " pull-down menu.\nEXPERIENCING MAJOR PROBLEMS\n\tSave if appropriate, and \ then shut down ", StyleBox["Mathematica", FontSlant->"Italic"], " and start it up again." }], "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part I: Picture This...", "Section"], Cell[CellGroupData[{ Cell["Graphing a vector field", "Subsubsection"], Cell[TextData[{ "Let's start out by seeing how to graph vector fields. To keep ", StyleBox["Mathematica", FontSlant->"Italic"], " to a reasonable size, several commands that are infrequently used by the \ general populace are stored away in special libraries. Once during the \ session, you must load the following package:\n", StyleBox["Note:", FontWeight->"Bold"], " You'll also be prompted to execute some initialization cells - ", StyleBox["you should say yes!", FontWeight->"Bold"], " There are some extras today that will allow us to visualize even more!" }], "Text"], Cell["\<\ Note: if you have a catastrophic error and must Quit the Kernel, you should \ re-execute this command\ \>", "Commentary", FontColor->RGBColor[0, 0, 1]], Cell[BoxData[ \(Needs["\"]\)], "Input"], Cell["Let's clear some stuff out before we use it...", "Text"], Cell[BoxData[{ \(Off[General::spell]\ \), "\n", \(Off[General::spell1]\ \), "\[IndentingNewLine]", \(Clear[myfield, vecplot, x, y, t, path]\)}], "Input"], Cell[TextData[{ "Here is how we can define a vector field... Let's define ", Cell[BoxData[ \(TraditionalForm\`\(F\& \[RightVector] \)(x, y) = \(-y\) \(i\&^\) + x \( j\&^\)\)]], ":" }], "Text"], Cell[BoxData[ \(myfield = {\(-y\), x}\)], "Input"], Cell[TextData[{ "We use the ", StyleBox["PlotVectorField", FontWeight->"Bold"], " command to plot vector fields... Here is the command explanation:" }], "Text"], Cell[BoxData[ \(\(?PlotVectorField\)\)], "Input"], Cell[TextData[{ "To get a list of options for a command (which you can then use the ", StyleBox["Help", FontWeight->"Bold"], " utility to get more info on), use the ", StyleBox["Options[ ] ", FontWeight->"Bold"], "command:" }], "Text"], Cell[BoxData[ \(Options[PlotVectorField]\)], "Input"], Cell["OK... enough funny stuff... let's graph the vector field:", "Text"], Cell[BoxData[ \(\(vecplot = PlotVectorField[myfield, {x, 0, 4}, {y, \(-2\), 2}, \ Frame -> True, \n\t PlotRange -> {{0, 4}, {\(-2\), 2}}];\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["How to add a path of an object in the vector field", "Subsubsection"], Cell[TextData[{ "Suppose that we have a particle that travels from the point (0,0) to the \ point (1,1) along the path ", Cell[BoxData[ \(TraditionalForm\`y = x\^2\)]], ". We can parameterize this as: ", Cell[BoxData[ \(TraditionalForm\`\(r\& \[RightVector] \)(t) = t \( i\&^\) + \(t\^2\) \(j\&^\)\)]], ":" }], "Text"], Cell[BoxData[ \(r[t_] = {t, t^2}\)], "Input"], Cell[TextData[{ "We can use the ", StyleBox["ParametricPlot", FontWeight->"Bold"], " command to graph paths:", " " }], "Text"], Cell[BoxData[ \(\(?ParametricPlot\)\)], "Input"], Cell["Let's graph this path:", "Text"], Cell[TextData[{ "Note that I'm using the ", StyleBox["Evaluate", FontWeight->"Bold"], " command around the vector r(t)... this is because ", StyleBox["Mathematica", FontSlant->"Italic"], " sometimes has trouble with what are known as \"uncompiled\" functions \ (such as a vector function)." }], "Commentary", FontColor->RGBColor[0, 0, 1]], Cell[BoxData[ \(\(path = ParametricPlot[Evaluate[r[t]], {t, 0, 1}, PlotStyle -> Thickness[0.008], \t PlotRange -> {{0, 4}, {\(-2\), 2}}];\)\)], "Input"], Cell["Now, we can show the path and the vector field together...", "Text"], Cell[BoxData[ \(\(Show[vecplot, path];\)\)], "Input"], Cell["Cool.", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["\<\ A Note on Evaluating the Vector Field along the Path of the Object\ \>", "Subsubsection"], Cell[TextData[{ "In class, and on the worksheet introducing line integrals, we talked about \ needing to evaluate the vector field specifically at the points the object \ will follow through the vector field. Problem B on the front page of the \ worksheet asks you to compare the ", StyleBox["velocity", FontWeight->"Bold"], " of the rubber ducky with the ", StyleBox["vector field", FontWeight->"Bold"], ". A direct comparison isn't possible, since the RDV V (Rubber Ducky \ Velocity Vector) is in terms of ", StyleBox["t", FontSlant->"Italic"], " and the vector field is in terms of ", StyleBox["x", FontSlant->"Italic"], " and ", StyleBox["y", FontSlant->"Italic"], ".", StyleBox[" ", FontSlant->"Italic"], "How can we make direct comparisons? The position vector, ", Cell[BoxData[ \(TraditionalForm\`\(r\&\[RightVector]\)(t) = 2 \( cos(t)\) i\&^ + 2 \( sin(t)\) j\&^\)]], ", tells us that the ", StyleBox["x", FontSlant->"Italic"], " coordinate of the rubber ducky at time ", StyleBox["t", FontSlant->"Italic"], " is: 2 cos(t) and that the ", StyleBox["y", FontSlant->"Italic"], " coordinate of the rubber ducky at time ", StyleBox["t", FontSlant->"Italic"], " is: 2 sin(t). \nWhat if we want to see what the vectors in the vector \ field look like at those points? The easiest way is to evaluate ", Cell[BoxData[ \(TraditionalForm\`F\&\[RightVector]\)]], " when x = 2 cost(t) and y = 2 sin(t). Which gives us ", Cell[BoxData[ \(TraditionalForm\`\(F\&\[RightVector]\)(\(r\&\[RightVector]\)( t)) = \(-2\) \(sin(t)\) i\&^ + 2 \( cos(t)\) j\&^\)]], ". Now, we have the vector field as a function of the position of the \ rubber ducky (which is in itself a function of time). Now you can make a \ direct comparison between the RDVV and the vector field. " }], "Text"], Cell[TextData[StyleBox["Question 1:\tHow does the rubber ducky's velocity \ vector relate to the vector field?", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[TextData[StyleBox["Question 2:\tWhat does this mean?", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part II: I'm Workin...", "Section"], Cell[CellGroupData[{ Cell["Line Integrals The Graphical Way!", "Subsubsection"], Cell[TextData[{ "The vector field is: ", Cell[BoxData[ \(TraditionalForm\`\((2 x + y)\) Cos[x\^2 + x\ y] i\&^ + \((x\ Cos[x\^2 + x\ y] + 1)\) j\&^\)]], " . We will plot two paths between (0, 0) and (1, 1) on this force field: \ ", Cell[BoxData[ RowBox[{ StyleBox["y", FontSlant->"Italic"], StyleBox[" ", FontSlant->"Italic"], StyleBox["=", FontSlant->"Italic"], " ", RowBox[{ RowBox[{ StyleBox[\(\@x\), FontFamily->"Times New Roman", FontSlant->"Italic"], StyleBox["and", FontFamily->"Times New Roman"], StyleBox[" ", FontFamily->"Times New Roman"], StyleBox["y", FontFamily->"Times New Roman"]}], StyleBox[" ", FontFamily->"Times New Roman"], StyleBox["=", FontFamily->"Times New Roman"], StyleBox[" ", FontFamily->"Times New Roman"], StyleBox[\(x\^3\), FontFamily->"Times New Roman", FontSlant->"Italic"]}]}]]], "." }], "Text"], Cell[BoxData[{ RowBox[{\(Clear[x, y, z, force]\), " "}], "\n", RowBox[{ RowBox[{"force", "=", RowBox[{"{", RowBox[{ FormBox[\(\((2 x + y)\) Cos[x\^2 + x\ y]\), "TraditionalForm"], ",", FormBox[\((x\ Cos[x\^2 + x\ y] + 1)\), "TraditionalForm"]}], "}"}]}], ";"}], "\n", RowBox[{ RowBox[{"pv", "=", RowBox[{"PlotVectorField", "[", RowBox[{ "force", ",", \({x, 0, Pi/2}\), ",", \({y, 0, Pi/2}\), ",", " ", \(Frame -> True\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"pc", "=", RowBox[{"Plot", "[", RowBox[{\({\@x, x\^3}\), ",", \({x, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\n", \(Show[pv, pc, DisplayFunction\ :> \ $DisplayFunction];\)}], "Input"], Cell[TextData[{ "Remember a long time ago... I gave you a supplemental package called ", StyleBox["DirCurve", FontWeight->"Bold"], " (directed curve) which is a ", StyleBox["Mathematica", FontSlant->"Italic"], " add-on (the initialization cells that are defined at the top of this \ notebook). We can specify directions on our graphs using the ", StyleBox["DirectedCurvePlot", FontWeight->"Bold"], " command:" }], "Text"], Cell[BoxData[ \(\(?DirectedCurvePlot\)\)], "Input"], Cell[TextData[{ "To use the command, we'll parameterize each curve: ", Cell[BoxData[ \(TraditionalForm\`x = t\ , \ y = \@t\)]], " and ", Cell[BoxData[ \(TraditionalForm\`x = t\ , \ y = t\^3\)]] }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"pc1", "=", RowBox[{"DirectedCurvePlot", "[", RowBox[{\({t, \@t}\), ",", \({t, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"pc2", "=", RowBox[{"DirectedCurvePlot", "[", RowBox[{\({t, t\^3}\), ",", \({t, 1, 0}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\[IndentingNewLine]", \(Show[pv, pc1, \ pc2, DisplayFunction\ :> \ $DisplayFunction];\)}], "Input"], Cell[TextData[StyleBox["Question 3:\tDo you think the work done by the vector \ field as the object moves along this path is positive, negative, or 0? Why?", FontWeight->"Bold"]], "Text", FontWeight->"Plain", Background->RGBColor[0, 1, 1]], Cell[TextData[{ "It might be hard to visualize... here is another tool that you might use: \ What if we ", StyleBox["only", FontWeight->"Bold"], " plot the vector field along the path. We use the ", StyleBox["FieldCurvePlot", FontWeight->"Bold"], " command (again, this isn't a standard ", StyleBox["Mathematica", FontSlant->"Italic"], " command - it is defined in the initialization cells at the top of the \ notebook).", "\n", "Evaluate the following for a brief description of the syntax for \ FieldCurvePlot:" }], "Text"], Cell[BoxData[ \(\(?FieldCurvePlot\)\)], "Input"], Cell[TextData[{ "Basically, this command mimics the step we take when we evaluate the ", StyleBox["vector field", FontWeight->"Bold"], " at the (x,y) pairs that are along the path the object follows through the \ vector field (so that we have the vector field as a function of time).", "\n", "Here is how we would use it to graph our path from above:" }], "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"pc3", "=", RowBox[{"FieldCurvePlot", "[", RowBox[{\({t, \@t}\), ",", \({t, 0, 1}\), ",", "force", ",", \({x, y}\), ",", "3", ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"pc4", "=", RowBox[{"FieldCurvePlot", "[", RowBox[{\({t, t\^3}\), ",", \({t, 1, 0}\), ",", "force", ",", \({x, y}\), ",", "3", ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\[IndentingNewLine]", \(Show[pc3, \ pc4, DisplayFunction\ :> \ $DisplayFunction];\)}], "Input"], Cell[TextData[{ "We can also plot this with the entire vector field (which we called ", StyleBox["pv", FontWeight->"Bold"], " above):" }], "Text"], Cell[TextData[{ "Notice that the", StyleBox[" PlotVectorField", FontWeight->"Bold"], " ", "command", StyleBox[" scales ", FontWeight->"Bold"], "the size of its vectors... the command we used", StyleBox[" doesn't", FontWeight->"Bold"], "." }], "Text", FontColor->RGBColor[0, 0, 1]], Cell[BoxData[ \(\(Show[pv, pc3, \ pc4, DisplayFunction\ :> \ $DisplayFunction];\)\)], "Input"], Cell[TextData[StyleBox["Question 4:\tDo you want to change your estimate from \ Question 3, based upon this cool new graph? ", FontWeight->"Bold"]], "Text", FontWeight->"Plain", Background->RGBColor[0, 1, 1]] }, Closed]], Cell[CellGroupData[{ Cell["Line Integrals The Long Way!", "Subsubsection"], Cell["Let's evaluate our integral the old fashioned way!", "Text"], Cell["Here is the field again:", "Text"], Cell[BoxData[{ RowBox[{\(Clear[x, y, t, force]\), " "}], "\n", RowBox[{ RowBox[{"force", "=", RowBox[{"{", RowBox[{ FormBox[\(\((2 x + y)\) Cos[x\^2 + x\ y]\), "TraditionalForm"], ",", FormBox[\((x\ Cos[x\^2 + x\ y] + 1)\), "TraditionalForm"]}], "}"}]}], ";"}]}], "Input"], Cell[TextData[{ "Here is the parameterization of the first half of our journey: (0,0) to \ (1,1) along ", Cell[BoxData[ RowBox[{ StyleBox["y", FontSlant->"Italic"], StyleBox[" ", FontSlant->"Italic"], StyleBox["=", FontSlant->"Italic"], " ", StyleBox[\(\@x\), FontFamily->"Times New Roman", FontSlant->"Italic"]}]]], ":" }], "Text"], Cell[BoxData[{ \(\(x = t;\)\), "\n", \(\(y = \@t;\)\), "\n", \(r1 = {x, y}\)}], "Input"], Cell["Here is the derivative of the position vector:", "Text"], Cell[BoxData[ \(dr1 = D[r1, t]\)], "Input"], Cell["And finally... here is the work integral:", "Text"], Cell[BoxData[ \(Print["\", \n w1 = Integrate[force . dr1, {t, 0, 1}] // N]\)], "Input"], Cell[TextData[{ "And now for the return trip: ", StyleBox["note that we want to start at (1,1) and end at (0,0) ", FontWeight->"Bold"], "in order to complete a round trip. From a parameterization standpoint, it \ is easier to say that we start at (0,0) and end at (1,1). If we do this, we \ are following our intended path exactly backwards." }], "Text"], Cell[TextData[StyleBox["Question 5:\tHow will starting at (0,0) and ending at \ (1,1) affect our work integral? [hint: think about what is happening \ geometrically!]", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell["Here is the second half of our journey:", "Text"], Cell[BoxData[{ \(\(x = t;\)\), "\n", \(\(y = \@t;\)\), "\n", \(\(r2 = {x, y};\)\), "\[IndentingNewLine]", \(\(dr2 = D[r1, t];\)\), "\[IndentingNewLine]", \(Print["\", \n w2 = Integrate[force . dr2, {t, 1, 0}] // N]\)}], "Input"], Cell["Now, add the two together to get the total work.", "Text"], Cell[BoxData[ \(Print["\", workaroundclosedpath = w1 + w2\ ]\)], "Input"], Cell[TextData[StyleBox["Question 6:\tDoes the fact that the answer is 0 match \ up with what you had predicted? ", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]] }, Closed]], Cell[CellGroupData[{ Cell["Line Integrals with the FTCLI!", "Subsubsection"], Cell["\<\ Hmmm... was this vector field conservative, or were we just lucky? Here is a \ test we can use:\ \>", "Text"], Cell[TextData[{ "The ", StyleBox["force[[1]] ", FontWeight->"Bold"], "grabs the", StyleBox[" ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`i\&^\)]], " component of the force vector and the ", StyleBox["force[[2]]", FontWeight->"Bold"], " grabs the ", Cell[BoxData[ \(TraditionalForm\`j\&^\)]], " component." }], "Text", FontColor->RGBColor[0, 0, 1]], Cell[BoxData[{\(Clear[force, x, y, t]\), "\[IndentingNewLine]", RowBox[{ RowBox[{"force", "=", RowBox[{"{", RowBox[{ FormBox[\(\((2 x + y)\) Cos[x\^2 + x\ y]\), "TraditionalForm"], ",", FormBox[\((x\ Cos[x\^2 + x\ y] + 1)\), "TraditionalForm"]}], "}"}]}], ";"}], "\[IndentingNewLine]", \(D[force[\([1]\)], y]\), "\[IndentingNewLine]", \(D[force[\([2]\)], x]\)}], "Input"], Cell[TextData[StyleBox["Question 7:\tWell... is it a conservative field? Why \ or why not? ", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell["\<\ Well... let's try to find a potential function. We can do this by \ integrating instead of differentiating:\ \>", "Text"], Cell[BoxData[{ \(Integrate[force[\([1]\)], x]\), "\[IndentingNewLine]", \(Integrate[force[\([2]\)], y]\)}], "Input"], Cell[TextData[StyleBox["Question 8:\tWhat is the potential function? ", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[TextData[StyleBox["Question 9:\tGo ahead and evaluate the potential \ function at the starting point (0,0) and the ending point (0,0). What is the \ work? ", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[TextData[StyleBox["Question 10:\tThat was pretty boring... how much work \ is done as you move from (0,0) to (1,1) (the half-way point on our journey)? \ ", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]] }, Closed]], Cell[CellGroupData[{ Cell["Line Integrals with Green's Theorem!", "Subsubsection"], Cell["\<\ OK... let's see what happens if we use Green's theorem! Here is the vector \ field again:\ \>", "Text"], Cell[BoxData[{\(Clear[force, x, y, t]\), "\[IndentingNewLine]", RowBox[{ RowBox[{"force", "=", RowBox[{"{", RowBox[{ FormBox[\(\((2 x + y)\) Cos[x\^2 + x\ y]\), "TraditionalForm"], ",", FormBox[\((x\ Cos[x\^2 + x\ y] + 1)\), "TraditionalForm"]}], "}"}]}], ";"}]}], "Input"], Cell["\<\ Now, we need to figure out the limits of integration for the region in the \ x-y plane. Here are the graphs again:\ \>", "Text"], Cell[BoxData[{ RowBox[{ RowBox[{"pv", "=", RowBox[{"PlotVectorField", "[", RowBox[{ "force", ",", \({x, 0, Pi/2}\), ",", \({y, 0, Pi/2}\), ",", " ", \(Frame -> True\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"pc1", "=", RowBox[{"DirectedCurvePlot", "[", RowBox[{\({t, \@t}\), ",", \({t, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\n", RowBox[{ RowBox[{"pc2", "=", RowBox[{"DirectedCurvePlot", "[", RowBox[{\({t, t\^3}\), ",", \({t, 1, 0}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";"}], "\n", \(Show[pv, pc1, \ pc2, DisplayFunction\ :> \ $DisplayFunction];\)}], "Input"], Cell[TextData[{ "So... let's say that we will integrate with respect to ", StyleBox["y first", FontWeight->"Bold"], "... remember that the upper curve is ", Cell[BoxData[ RowBox[{ StyleBox["y", FontSlant->"Italic"], StyleBox[" ", FontSlant->"Italic"], StyleBox["=", FontSlant->"Italic"], " ", RowBox[{ RowBox[{ StyleBox[\(\@x\), FontFamily->"Times New Roman", FontSlant->"Italic"], StyleBox["and", FontFamily->"Times New Roman"], StyleBox[" ", FontFamily->"Times New Roman"], StyleBox["y", FontFamily->"Times New Roman"]}], StyleBox[" ", FontFamily->"Times New Roman"], StyleBox["=", FontFamily->"Times New Roman"], StyleBox[" ", FontFamily->"Times New Roman"], StyleBox[\(x\^3\), FontFamily->"Times New Roman", FontSlant->"Italic"]}]}]]], " is the lower curve." }], "Text"], Cell[TextData[StyleBox["Question 11:\tWhat are the limits of integration that \ describe the enclosed region? ", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[TextData[{ "Ok... remember that Green's theorem says that our circulation must be \ oriented ", StyleBox["counter-clockwise", FontWeight->"Bold"], ". Ours is ", StyleBox["clockwise", FontWeight->"Bold"], ". We should take the ", StyleBox["negative of the resulting integral! \n", FontWeight->"Bold"], "In the integral below, enter the appropriate limits of integration that \ you defined above" }], "Text"], Cell[BoxData[ \(\(\(-\(\[Integral]\_\[Placeholder]\%\[Placeholder]\(\[Integral]\_\ \[Placeholder]\%\[Placeholder]\((D[force[\([2]\)], x] - D[force[\([1]\)], y])\) \[DifferentialD]y \[DifferentialD]x\)\)\)\(\ \[IndentingNewLine]\) \)\)], "Input"], Cell[TextData[StyleBox["Question 12:\tDid you get the answer you expected? ", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part III: Green's Workin... ", "Section"], Cell[TextData[{ "Suppose that we have this vector field instead: \n", StyleBox["I changed +1 to a +x at the end of the ", FontColor->RGBColor[0, 0, 1]], Cell[BoxData[ \(TraditionalForm\`j\&^\)], FontColor->RGBColor[0, 0, 1]], StyleBox[" component.", FontColor->RGBColor[0, 0, 1]] }], "Text"], Cell[BoxData[{\(Clear[force, x, y, t];\), "\[IndentingNewLine]", RowBox[{ RowBox[{"force", "=", RowBox[{"{", RowBox[{ FormBox[\(\((2 x + y)\) Cos[x\^2 + x\ y]\), "TraditionalForm"], ",", FormBox[\((x\ Cos[x\^2 + x\ y] + x)\), "TraditionalForm"]}], "}"}]}], ";"}]}], "Input"], Cell[TextData[StyleBox["Question 13:\tIs the vector field conservative or \ not? Explain.", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[TextData[StyleBox["Question 14:\tGo ahead and graph the vector field, \ with the circulation from (0,0) to (1,1) and back to (0,0) that we used \ above, and then calculate the work (using Green's Theorem).\nDon't forget \ that the circulation we have is clockwise!", FontWeight->"Bold"]], "Text", Background->RGBColor[0, 1, 1]], Cell[BoxData[""], "Input"] }, Closed]] }, FrontEndVersion->"4.1 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 677}}, AutoGeneratedPackage->None, WindowToolbars->{"RulerBar", "EditBar"}, CellGrouping->Manual, WindowSize->{803, 631}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, StyleDefinitions -> "DemoText.nb" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1705, 50, 108, 1, 124, "Title"], Cell[1816, 53, 228, 9, 41, "Subtitle"], Cell[CellGroupData[{ Cell[2069, 66, 128, 3, 28, "SmallText"], Cell[2200, 71, 9228, 171, 3240, "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell[11465, 247, 84, 1, 34, "Section"], Cell[11552, 250, 1033, 20, 220, "Subsubtitle"] }, Closed]], Cell[CellGroupData[{ Cell[12622, 275, 31, 0, 34, "Section"], Cell[12656, 277, 342, 7, 122, "Text"], Cell[CellGroupData[{ Cell[13023, 288, 74, 1, 44, "Subsection"], Cell[13100, 291, 1206, 33, 370, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[14355, 330, 43, 0, 34, "Section"], Cell[CellGroupData[{ Cell[14423, 334, 48, 0, 44, "Subsubsection"], Cell[14474, 336, 603, 13, 98, "Text"], Cell[15080, 351, 164, 4, 23, "Commentary"], Cell[15247, 357, 65, 1, 40, "Input"], Cell[15315, 360, 62, 0, 29, "Text"], Cell[15380, 362, 167, 3, 80, "Input"], Cell[15550, 367, 216, 6, 29, "Text"], Cell[15769, 375, 54, 1, 40, "Input"], Cell[15826, 378, 171, 5, 29, "Text"], Cell[16000, 385, 53, 1, 40, "Input"], Cell[16056, 388, 253, 8, 29, "Text"], Cell[16312, 398, 57, 1, 40, "Input"], Cell[16372, 401, 73, 0, 29, "Text"], Cell[16448, 403, 187, 4, 60, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[16672, 412, 75, 0, 28, "Subsubsection"], Cell[16750, 414, 351, 10, 48, "Text"], Cell[17104, 426, 49, 1, 40, "Input"], Cell[17156, 429, 138, 6, 29, "Text"], Cell[17297, 437, 52, 1, 40, "Input"], Cell[17352, 440, 38, 0, 29, "Text"], Cell[17393, 442, 358, 10, 36, "Commentary"], Cell[17754, 454, 186, 4, 60, "Input"], Cell[17943, 460, 74, 0, 29, "Text"], Cell[18020, 462, 57, 1, 40, "Input"], Cell[18080, 465, 21, 0, 29, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[18138, 470, 99, 2, 28, "Subsubsection"], Cell[18240, 474, 1911, 50, 174, "Text"], Cell[20154, 526, 177, 3, 45, "Text"], Cell[20334, 531, 124, 2, 45, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[20507, 539, 42, 0, 34, "Section"], Cell[CellGroupData[{ Cell[20574, 543, 58, 0, 44, "Subsubsection"], Cell[20635, 545, 1164, 36, 48, "Text"], Cell[21802, 583, 985, 25, 144, "Input"], Cell[22790, 610, 448, 12, 67, "Text"], Cell[23241, 624, 55, 1, 40, "Input"], Cell[23299, 627, 226, 7, 29, "Text"], Cell[23528, 636, 625, 14, 84, "Input"], Cell[24156, 652, 249, 5, 45, "Text"], Cell[24408, 659, 557, 16, 98, "Text"], Cell[24968, 677, 52, 1, 40, "Input"], Cell[25023, 680, 377, 8, 79, "Text"], Cell[25403, 690, 745, 18, 84, "Input"], Cell[26151, 710, 156, 5, 29, "Text"], Cell[26310, 717, 310, 13, 29, "Text"], Cell[26623, 732, 108, 2, 40, "Input"], Cell[26734, 736, 214, 4, 45, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[26985, 745, 53, 0, 28, "Subsubsection"], Cell[27041, 747, 66, 0, 29, "Text"], Cell[27110, 749, 40, 0, 29, "Text"], Cell[27153, 751, 361, 9, 61, "Input"], Cell[27517, 762, 429, 15, 29, "Text"], Cell[27949, 779, 102, 3, 82, "Input"], Cell[28054, 784, 62, 0, 29, "Text"], Cell[28119, 786, 47, 1, 40, "Input"], Cell[28169, 789, 57, 0, 29, "Text"], Cell[28229, 791, 134, 2, 60, "Input"], Cell[28366, 795, 366, 7, 67, "Text"], Cell[28735, 804, 235, 4, 64, "Text"], Cell[28973, 810, 55, 0, 29, "Text"], Cell[29031, 812, 296, 6, 142, "Input"], Cell[29330, 820, 64, 0, 29, "Text"], Cell[29397, 822, 140, 2, 40, "Input"], Cell[29540, 826, 180, 3, 45, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[29757, 834, 55, 0, 28, "Subsubsection"], Cell[29815, 836, 120, 3, 29, "Text"], Cell[29938, 841, 406, 17, 29, "Text"], Cell[30347, 860, 470, 10, 101, "Input"], Cell[30820, 872, 160, 3, 45, "Text"], Cell[30983, 877, 132, 3, 29, "Text"], Cell[31118, 882, 125, 2, 60, "Input"], Cell[31246, 886, 137, 2, 45, "Text"], Cell[31386, 890, 229, 4, 64, "Text"], Cell[31618, 896, 227, 4, 64, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[31882, 905, 61, 0, 28, "Subsubsection"], Cell[31946, 907, 114, 3, 29, "Text"], Cell[32063, 912, 358, 8, 61, "Input"], Cell[32424, 922, 139, 3, 29, "Text"], Cell[32566, 927, 903, 22, 124, "Input"], Cell[33472, 951, 1096, 34, 29, "Text"], Cell[34571, 987, 178, 3, 45, "Text"], Cell[34752, 992, 440, 13, 79, "Text"], Cell[35195, 1007, 289, 6, 72, "Input"], Cell[35487, 1015, 142, 2, 45, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[35678, 1023, 47, 0, 34, "Section"], Cell[35728, 1025, 319, 9, 60, "Text"], Cell[36050, 1036, 359, 8, 61, "Input"], Cell[36412, 1046, 156, 3, 45, "Text"], Cell[36571, 1051, 336, 5, 95, "Text"], Cell[36910, 1058, 26, 0, 40, "Input"] }, Closed]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)