(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. 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[ 29755, 915]*) (*NotebookOutlinePosition[ 30702, 951]*) (* CellTagsIndexPosition[ 30611, 944]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["How Can You Visualize Green's Theorem? ", "Title"], Cell[TextData[StyleBox["Chapter 13, Section 4", FontFamily->"Arial", FontSize->16, FontWeight->"Bold"]], "Text"], Cell[CellGroupData[{ Cell["Introduction", "Section"], Cell["\<\ OBJECTIVE: Visualize a force field with a path superimposed on it to enhance \ geometrical insight into Green's Theorem and compute line integrals over \ vector fields using parametrizations.\ \>", "Text"], Cell["\<\ If you can visualize a force field and a curve through it, how can that help \ you understand Green's Theorem? In this module, you will explore integration \ over vector fields and use parametrizations to compute line integrals. You \ will also explore how you can determine the closed curve around which your \ work integral is a maximum and whether or not it makes any difference if a \ force is conservative.\ \>", "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: Green's Theorem (Circulation-Curl Form)", "Section"], Cell[CellGroupData[{ Cell["Visualizing the Problem", "Subsection"], Cell["\<\ Start by loading a package that will allow you to display the vector field. \ Be certain to load that package before you attempt to plot a vector field, \ and recall that a package should be loaded only once.\ \>", "Text"], Cell[BoxData[ \(\(\(<< Graphics`PlotField`\)\(\ \)\)\)], "Input"], Cell[TextData[{ "The force field is given as a vector with component ", StyleBox["Cos(5x)", FontSlant->"Italic"], " in the horizontal direction and ", Cell[BoxData[ \(TraditionalForm\`\((\(-3\) x\ y)\)\)]], " in the vertical direction. 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[{\(Off[General::spell]\), " "}], "\n", RowBox[{\(Off[General::spell1]\), " "}], "\n", RowBox[{\(Clear[x, y, z, force]\), " "}], "\n", RowBox[{\(force = {Cos[5 x], \(-3\) x\ y}\), ";", "\n", RowBox[{"pv", "=", RowBox[{"PlotVectorField", "[", RowBox[{"force", ",", \({x, 0, 1}\), ",", \({y, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", RowBox[{"pc", "=", RowBox[{"Plot", "[", RowBox[{\({\@x, x\^3}\), ",", \({x, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", \(Show[pv, pc, DisplayFunction\ :> \ $DisplayFunction]\), ";"}]}], "Input"], Cell[TextData[{ "If you travel in a counterclockwise direction ", Cell[BoxData[ RowBox[{ StyleBox["(", "Text", FontFamily->"Times New Roman"], RowBox[{ RowBox[{ StyleBox["first", "Text", FontFamily->"Times New Roman"], StyleBox[" ", "Text", FontFamily->"Times New Roman"], StyleBox["along", "Text", FontFamily->"Times New Roman"], StyleBox[" ", "Text", FontFamily->"Times New Roman"], "y"}], StyleBox[" ", "Text", FontFamily->"Times New Roman"], StyleBox["=", "Text", FontFamily->"Times New Roman"], StyleBox[\(\(x\^3\) and\ then\ back\ along\ \ y\ = \@x\), "Text", FontFamily->"Times New Roman"]}], StyleBox[")", "Text", FontFamily->"Times New Roman"]}]]], " from ", Cell[BoxData[ \(TraditionalForm\`\((0, 0)\)\)]], " to", Cell[BoxData[ \(TraditionalForm\`\(\(\ \)\((1, 1)\)\)\)]], " and then back again, can you predict if the work done by the force will \ be positive or negative or zero? Recall that the integrand of the work \ integral is the dot product of the force and a vector in the direction of \ motion." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Computing the Line Integrals", "Subsection"], Cell[TextData[{ "Find the work done in traveling along the lower part of the closed curve \ (", Cell[BoxData[ \(TraditionalForm\`x\^3\)]], "). Note the following parametrization for that curve." }], "Text"], Cell[BoxData[{ \(Clear[x, y, t]\), "\n", \(\(x = t;\)\), "\n", \(\(y = t\^3;\)\), "\n", \(\(r1 = {x, y};\)\), "\n", \(\(dr1 = D[r1, t];\)\), "\n", \(Print["\", w1 = Integrate[force . dr1, {t, 0, 1}] // N]\ \)}], "Input"], Cell[TextData[{ "Does the fact that this answer is negative fit with what you might have \ predicted?\n\nNext, find the work done in traveling along the upper part of \ the closed curve (", Cell[BoxData[ \(TraditionalForm\`\(\(\@x\)\()\)\)\)]], ". As before, you need an appropriate parametrization. Note the direction \ in which you were traveling. You are now at (1, 1) and need to return to (0, \ 0)." }], "Text"], Cell[BoxData[{ \(Clear[x, y, t]\ \), "\n", \(\(x = t;\)\), "\n", \(\(y = \@t;\)\), "\n", \(\(r2 = {x, y};\)\), "\n", \(\(dr2 = D[r2, t];\)\), "\n", \(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"] }, Closed]], Cell[CellGroupData[{ Cell["Applying Green's Theorem", "Subsection"], Cell[TextData[{ "Apply Green's Theorem, and verify that your answers agree. We allow for a \ tolerance level of 0.001 in case numerical integration has to be used at any \ point. You ", StyleBox["must", FontWeight->"Bold"], " clear ", StyleBox["x", FontSlant->"Italic"], " and ", StyleBox["y", FontSlant->"Italic"], " before performing this next integration." }], "Text"], Cell[BoxData[{ \(Clear[x, y]\ \), "\n", \(inside = Integrate[\(-D[force[\([1]\)], y]\) + D[force[\([2]\)], x], {x, 0, 1}, {y, x\^3, \@x}] // N\), "\n", \(If[workaroundclosedpath <= inside + .001 && workaroundclosedpath >= inside - .001, Print["\"], Print["\"]]\)}], "Input"], Cell[BoxData[ ButtonBox[ ButtonBox[ RowBox[{ StyleBox["\[MathematicaIcon]", FontWeight->"Bold", FontColor->RGBColor[0.792981, 0.777356, 0.144533], FontVariations->{"CompatibilityType"->0}], StyleBox[" ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["About", FontWeight->"Bold", FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["Mathematica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]]}], ButtonStyle->"Paste"], ButtonData:>"h1", ButtonStyle->"Hyperlink"]], "Input", Evaluatable->False, CellTags->"hb1"], Cell[TextData[{ "The integrand for the double integral in Green's Theorem is the curl of \ the force function dotted into a unit vector perpendicular to the element of \ area; in this case, this is in the positive ", StyleBox["z", FontSlant->"Italic"], " direction. You can explore the curl vector function in the Java applet, \ \"Concept of the Curl.\"" }], "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: Part I", "Section"], Cell[CellGroupData[{ Cell["Demo of Selection of Closed Path to Maximize Work Done ", "Subsection"], Cell[TextData[StyleBox["Section 13.4 Exercise 34", FontWeight->"Bold"]], "Text"], Cell[TextData[{ "In this problem, you are asked to find the closed path over which the work \ integral is a maximum. The force function given is {", Cell[BoxData[ FormBox[ RowBox[{ FormBox[\(1\/4\), "TraditionalForm"], FormBox[\(x\^2\ y\ + \ 1\/3\), "TraditionalForm"], FormBox[\(y\^3\ , \ x\), "TraditionalForm"]}], TraditionalForm]], FontWeight->"Bold"], "}. Begin by plotting the vector field." }], "Text"], Cell[BoxData[{ \(Clear[x, y, force, pv]\), "\n", \(\(force = {1/4\ x\^2\ y\ + 1/3\ y\^3, \ x};\)\), "\n", \(\(pv = PlotVectorField[force, {x, \(-3\), 3}, {y, \(-2\), 2}];\)\)}], "Input"], Cell["\<\ Next, examine the integrand for the double integral that is equivalent, per \ Green's Theorem, to the work integral.\ \>", "Text"], Cell[BoxData[{ \(Print["\", circintegrand = D[force[\([2]\)], x] - D[force[\([1]\)], y]]\), "\n", \(\(Plot3D[circintegrand, {x, \(-2\), 2}, {y, \(-1\), 1}];\)\)}], "Input"], Cell[TextData[{ "Note that the circulation integrand is nonnegative only when ", Cell[BoxData[ FormBox[ StyleBox[\(x\^2\/4 + y\^2 \[LessEqual] \ 1\), "DisplayFormula"], TextForm]]], " ,that is,only when you are inside the ellipse represented by the \ equality.\n\nRepresent that ellipse parametrically by entering the correct \ functions in for ", StyleBox["x", FontSlant->"Italic"], " and ", StyleBox["y ", FontSlant->"Italic"], "(those in red). " }], "Text"], Cell[BoxData[ RowBox[{ RowBox[{"x", "=", StyleBox[\(Cos[t]\), FontColor->RGBColor[1, 0, 0]]}], ";", "\n", RowBox[{"y", "=", StyleBox[\(Cos[2 t]\), FontColor->RGBColor[1, 0, 0]]}], ";"}]], "Input"], Cell[TextData[{ "Consider a plot of your force field together with this ellipse. If your \ parametrization is correct and your bounds on ", StyleBox["t", FontSlant->"Italic"], " close the path, you should see your ellipse plotted with the force field \ by executing the next set of commands. Adjust the domain in red if necessary. \ If your plot looks wrong, go back and double check your parametrization." }], "Text"], Cell[BoxData[ RowBox[{\(r = {x, y}\), ";", "\n", RowBox[{"pp", "=", RowBox[{"ParametricPlot", "[", RowBox[{\(Evaluate[r]\), ",", RowBox[{"{", RowBox[{"t", ",", StyleBox["0", FontColor->RGBColor[1, 0, 0]], ",", StyleBox[\(2 \[Pi]\), FontColor->RGBColor[1, 0, 0]]}], "}"}], ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", \(Show[pv, pp, DisplayFunction\ :> \ $DisplayFunction]\), ";"}]], "Input"], Cell["\<\ Compute the work done in traveling around the ellipse. Adjust the domain if \ necessary.\ \>", "Text"], Cell[BoxData[ RowBox[{ RowBox[{\(dr = D[r, t]\), ";", "\n", RowBox[{"workaroundclosedpath", "=", RowBox[{ RowBox[{"Integrate", "[", RowBox[{\(force . dr\), ",", RowBox[{"{", RowBox[{"t", ",", StyleBox["0", FontColor->RGBColor[1, 0, 0]], ",", StyleBox[\(2 \[Pi]\), FontColor->RGBColor[1, 0, 0]]}], "}"}]}], "]"}], "//", "N"}]}]}], " "}]], "Input"], Cell["Verify this using Green's Theorem.", "Text"], Cell[BoxData[{ \(Clear[x, y]\ \), "\n", \(inside = Integrate[ circintegrand, {x, \(-2\), 2}, {y, \(-\@\(1 - x\^2/4\)\), \@\(1 - x\^2/4\)}] // N\), "\n", \(If[workaroundclosedpath <= inside + .001 && workaroundclosedpath >= inside - .001, Print["\"], Print["\"]]\)}], "Input"], Cell["\<\ Just for comparison, determine the work done by this force in traveling \ around the curve in the first part of this lab. Frst look at the picture.\ \>", "Text"], Cell[BoxData[{\(Clear[x, y, t]\), "\n", RowBox[{ RowBox[{"pv2", "=", RowBox[{"PlotVectorField", "[", RowBox[{"force", ",", \({x, 0, 1}\), ",", \({y, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", \(Show[pv2, pc, DisplayFunction -> $DisplayFunction]\), ";"}]}], "Input"], Cell["\<\ Now compute the work done in traveling around this closed path with the \ current force field.\ \>", "Text"], Cell[BoxData[{ \(Clear[x, y, t]\), "\n", \(\(x = t;\)\), "\n", \(\(y = t\^3;\)\), "\n", \(\(r1 = {x, y};\)\), "\n", \(\(dr1 = D[r1, t];\)\), "\n", \(\(w1 = Integrate[force . dr1, {t, 0, 1}] // N\ ;\)\), "\n", \(Clear[x, y, t]\ \), "\n", \(\(x = t;\)\), "\n", \(\(y = \@t;\)\), "\n", \(\(r2 = {x, y};\)\), "\n", \(\(dr2 = D[r2, t];\)\), "\n", \(\(w2 = Integrate[force . dr2, {t, 1, 0}] // N;\)\), "\n", \(Print["\", workaroundclosedpath = w1 + w2]\ \)}], "Input"], Cell["\<\ Is this answer smaller or larger than the work done in traveling around the \ ellipse?\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Choose a Conservative Force and See What Happens", "Subsection"], Cell[TextData[{ "What if you had chosen a conservative force? You can check this out by \ merely going back to the force function and replacing it with a different \ function. Nothing else has to be changed. Following is an example, ", Cell[BoxData[ StyleBox[\({2 x\ y, x\^2}\), "DisplayFormula"]]], " (in red), of a conservative force. Try out any others you want. Remember \ to leave spaces between variables when defining functions.\n\nFirst we will \ look at a plot." }], "Text"], Cell[BoxData[{ RowBox[{\(Off[General::spell]\), " "}], "\n", RowBox[{\(Off[General::spell1]\), " "}], "\n", RowBox[{\(Clear[x, y, z, force]\), " "}], "\n", RowBox[{ RowBox[{"force", "=", RowBox[{"{", RowBox[{ StyleBox[\(2 x\ y\), FontColor->RGBColor[1, 0, 0]], ",", StyleBox[\(x\^2\), FontColor->RGBColor[1, 0, 0]]}], "}"}]}], ";", "\n", RowBox[{"pv", "=", RowBox[{"PlotVectorField", "[", RowBox[{"force", ",", \({x, 0, 1}\), ",", \({y, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", RowBox[{"pc", "=", RowBox[{"Plot", "[", RowBox[{\({\@x, x\^3}\), ",", \({x, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", \(Show[pv, pc, DisplayFunction\ :> \ $DisplayFunction]\), ";"}]}], "Input"], Cell["Next, we will find the work done on each segment.", "Text"], Cell[BoxData[{ \(Clear[x, y, t]\), "\n", \(\(x = t;\)\), "\n", \(\(y = t\^3;\)\), "\n", \(\(r1 = {x, y};\)\), "\n", \(\(dr1 = D[r1, t];\)\), "\n", \(Print["\", w1 = Integrate[force . dr1, {t, 0, 1}] // N]\ \), "\n", \(Clear[x, y, t]\ \), "\n", \(\(x = t;\)\), "\n", \(\(y = \@t;\)\), "\n", \(\(r2 = {x, y};\)\), "\n", \(\(dr2 = D[r2, t];\)\), "\n", \(Print["\", \n w2 = Integrate[force . dr2, {t, 1, 0}] // N]\)}], "Input"], Cell["\<\ As long as the force you use is conservative, how should the work done on the \ first portion be related to the work done on the second portion?\ \>", "Text"], Cell[BoxData[ \(Print["\", workaroundclosedpath = w1 + w2\ ]\)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part II: Green's Theorem (Flux-Divergence Form)", "Section"], Cell[CellGroupData[{ Cell["Visualizing the Problem", "Subsection"], Cell["\<\ Start by loading a package that will allow you to display the vector field. \ Be certain to load that package before you attempt to plot a vector field, \ but if you have already loaded the package during this worksession, there is \ no need to read it in again.\ \>", "Text"], Cell[BoxData[ \(\(\(<< Graphics`PlotField`\)\(\ \)\)\)], "Input"], Cell[TextData[{ "As in Part I, the force field is given as a vector with component ", StyleBox["Cos(5x)", FontSlant->"Italic"], " in the horizontal direction and ", Cell[BoxData[ \(TraditionalForm\`\((\(-3\) x\ y)\)\)]], " in the vertical direction. We will plot two paths between (0, 0) and (1, \ 1) on this force field: ", Cell[BoxData[ RowBox[{ StyleBox[\(\@x\), FontFamily->"Times New Roman", FontSlant->"Italic"], StyleBox["and", FontFamily->"Times New Roman"], StyleBox[" ", FontFamily->"Times New Roman"], StyleBox[\(x\^3\), FontFamily->"Times New Roman", FontSlant->"Italic"]}]]], "." }], "Text"], Cell[BoxData[{ RowBox[{\(Off[General::spell]\), " "}], "\n", RowBox[{\(Off[General::spell1]\), " "}], "\n", RowBox[{\(Clear[x, y, z, force]\), " "}], "\n", RowBox[{\(force = {Cos[5 x], \(-3\) x\ y}\), ";", "\n", RowBox[{"pv", "=", RowBox[{"PlotVectorField", "[", RowBox[{"force", ",", \({x, 0, 1}\), ",", \({y, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", RowBox[{"pc", "=", RowBox[{"Plot", "[", RowBox[{\({\@x, x\^3}\), ",", \({x, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", \(Show[pv, pc, DisplayFunction\ :> \ $DisplayFunction]\), ";"}]}], "Input"], Cell[TextData[{ "If you travel in a counterclockwise direction ", Cell[BoxData[ RowBox[{ StyleBox["(", "Text", FontFamily->"Times New Roman"], RowBox[{ RowBox[{ StyleBox["first", "Text", FontFamily->"Times New Roman"], StyleBox[" ", "Text", FontFamily->"Times New Roman"], StyleBox["along", "Text", FontFamily->"Times New Roman"], StyleBox[" ", "Text", FontFamily->"Times New Roman"], "y"}], StyleBox[" ", "Text", FontFamily->"Times New Roman"], StyleBox["=", "Text", FontFamily->"Times New Roman"], StyleBox[\(\(x\^3\) and\ then\ back\ along\ \ y\ = \@x\), "Text", FontFamily->"Times New Roman"]}], StyleBox[")", "Text", FontFamily->"Times New Roman"]}]]], " from (0,0) to (1,1) and then back again, can you predict whether the \ outward flux will be positive, negative or zero? Recall that the integrand of \ the flux integral is the dot product of the force and a vector ", StyleBox["perpendicular to", FontWeight->"Bold"], " the direction of motion." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Computing the Line Integrals", "Subsection"], Cell["\<\ Find the flux in traveling along the lower part of the closed curve. Choose \ an appropriate parametrization.\ \>", "Text"], Cell[BoxData[{ \(Clear[x, y, t]\), "\n", \(\(x = t;\)\), "\n", \(\(y = t\^3;\)\), "\n", \(\(r1 = {x, y};\)\), "\n", \(\(dr1 = D[r1, t];\)\), "\n", \(\(perp1 = {dr1[\([2]\)], \(-dr1[\([1]\)]\)};\)\), "\n", \(Print["\", flux1 = Integrate[force . perp1, {t, 0, 1}] // N]\ \)}], "Input"], Cell["\<\ Does the fact that this answer is small fit with what you might have \ predicted? Now find the flux along the upper part of the closed curve. As before, choose \ an appropriate parametrization. Note the direction in which you are \ traveling. Continue traveling in the same direction as above.\ \>", "Text"], Cell[BoxData[{ \(Clear[x, y, t]\ \), "\n", \(\(x = t;\)\), "\n", \(\(y = \@t;\)\), "\n", \(\(r2 = {x, y};\)\), "\n", \(\(dr2 = D[r2, t];\)\), "\n", \(\(perp2 = {dr2[\([2]\)], \(-dr2[\([1]\)]\)};\)\), "\n", \(Print["\", flux2 = Integrate[force . perp2, {t, 1, 0}] // N]\)}], "Input"], Cell["\<\ Now, add the two together to get the total outward flux along the closed \ path.\ \>", "Text"], Cell[BoxData[ \(Print["\", fluxaroundclosedpath = flux1 + flux2]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Applying Green's Theorem", "Subsection"], Cell[TextData[{ "Apply Green's Theorem, and verify that your answers agree. We allow for a \ tolerance level of 0.001 in case numerical integration has to be used at any \ point. You ", StyleBox["must ", FontWeight->"Bold"], "clear ", StyleBox["x", FontSlant->"Italic"], " and ", StyleBox["y", FontSlant->"Italic"], " before performing this next integration." }], "Text"], Cell[BoxData[{ \(Clear[x, y]\ \), "\n", \(inside = Integrate[ D[force[\([1]\)], x] + D[force[\([2]\)], y], {x, 0, 1}, {y, x\^3, \@x}] // N\), "\n", \(If[fluxaroundclosedpath <= inside + .001 && fluxaroundclosedpath >= inside - .001, Print["\"], Print["\"]]\)}], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["You Try It: Part II", "Section"], Cell[CellGroupData[{ Cell["Choose a Conservative Force and See What Happens.", "Subsection"], Cell[TextData[{ "Do conservative forces mean anything when computing flux integrals? What \ type of force would give the flux around a closed curve to be zero? You can \ check these issues out by merely going back to the force function and \ replacing it with a different function", Cell[BoxData[ \(TraditionalForm\`\(\ -\ \)\)]], "paste over the red with either one of the functions suggested or another \ one of your own. Nothing else has to be changed. " }], "Text"], Cell["Suggested functions:", "Text"], Cell[BoxData[ \(force = {2 x\ y, x\^2}\)], "Input"], Cell[BoxData[ \(force = {x\ Sin[y], Cos[y]}\)], "Input"], Cell["This first set of commands defines and plots your functions.", "Text"], Cell[BoxData[{ RowBox[{\(Off[General::spell]\), " "}], "\n", RowBox[{\(Off[General::spell1]\), " "}], "\n", RowBox[{\(Clear[x, y, z, force]\), " "}], "\n", RowBox[{ StyleBox[\(force = {Cos[5 x], \(-3\) x\ y}\), FontColor->RGBColor[1, 0, 0]], ";", "\n", RowBox[{"pv", "=", RowBox[{"PlotVectorField", "[", RowBox[{"force", ",", \({x, 0, 1}\), ",", \({y, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", RowBox[{"pc", "=", RowBox[{"Plot", "[", RowBox[{\({\@x, x\^3}\), ",", \({x, 0, 1}\), ",", StyleBox[\(DisplayFunction -> Identity\), "MR"]}], "]"}]}], ";", "\n", \(Show[pv, pc, DisplayFunction\ :> \ $DisplayFunction]\), ";"}]}], "Input"], Cell["\<\ The next set of commands finds the associated flux integrals.\ \>", "Text"], Cell[BoxData[{ \(Clear[x, y, t]\), "\n", \(\(x = t;\)\), "\n", \(\(y = t\^3;\)\), "\n", \(\(r1 = {x, y};\)\), "\n", \(\(dr1 = D[r1, t];\)\), "\n", \(\(perp1 = {dr1[\([2]\)], \(-dr1[\([1]\)]\)};\)\), "\n", \(Print["\", flux1 = Integrate[force . perp1, {t, 0, 1}] // N]\ \), "\n", \(Clear[x, y, t]\ \), "\n", \(\(x = t;\)\), "\n", \(\(y = \@t;\)\), "\n", \(\(r2 = {x, y};\)\), "\n", \(\(dr2 = D[r2, t];\)\), "\n", \(\(perp2 = {dr2[\([2]\)], \(-dr2[\([1]\)]\)};\)\), "\n", \(Print["\", flux2 = Integrate[force . perp2, {t, 1, 0}] // N]\)}], "Input"], Cell["Put these results together.:", "Text"], Cell[BoxData[ \(Print["\", fluxaroundclosedpath = flux1 + flux2]\)], "Input"], Cell["Now we verify Green's Theorem for this case.", "Text"], Cell[BoxData[{ \(Clear[x, y]\ \), "\n", \(inside = Integrate[ D[force[\([1]\)], x] + D[force[\([2]\)], y], {x, 0, 1}, {y, x\^3, \@x}] // N\), "\n", \(If[fluxaroundclosedpath <= inside + .001 && fluxaroundclosedpath >= inside - .001, Print["\"], Print["\"]]\)}], "Input"], Cell["\<\ Does the fact that the force field was conservative make any difference here?\ \ \>", "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["\[MathematicaIcon]", FontWeight->"Bold", FontColor->RGBColor[0.792981, 0.777356, 0.144533], FontVariations->{"CompatibilityType"->0}], StyleBox[" ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["About", FontWeight->"Bold", FontColor->RGBColor[0.500008, 0, 0.500008]], StyleBox[" ", FontWeight->"Bold", FontSlant->"Italic"], StyleBox["Mathematica", FontWeight->"Bold", FontSlant->"Italic", FontColor->RGBColor[0.500008, 0, 0.500008]] }], "Section", CellDingbat->None], Cell[TextData[{ "The ", StyleBox["If", FontWeight->"Bold"], " statement used here is in standard programming format. If both of the \ statements (&&) in the first input are true, the second input is executed; if \ false, the third input is executed.\n", ButtonBox["Go back.", ButtonData:>"hb1", ButtonStyle->"Hyperlink"] }], "Text", PageWidth->PaperWidth, CellTags->"h1"] }, Closed]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, WindowSize->{592, 508}, WindowMargins->{{97, Automatic}, {71, Automatic}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic} ] (*********************************************************************** 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->{ "hb1"->{ Cell[10278, 318, 851, 25, 40, "Input", Evaluatable->False, CellTags->"hb1"]}, "h1"->{ Cell[29332, 899, 395, 12, 71, "Text", CellTags->"h1"]} } *) (*CellTagsIndex CellTagsIndex->{ {"hb1", 30416, 933}, {"h1", 30520, 937} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1739, 51, 57, 0, 150, "Title"], Cell[1799, 53, 118, 3, 37, "Text"], Cell[CellGroupData[{ Cell[1942, 60, 31, 0, 53, "Section"], Cell[1976, 62, 215, 4, 52, "Text"], Cell[2194, 68, 435, 7, 90, "Text"], Cell[CellGroupData[{ Cell[2654, 79, 74, 1, 47, "Subsection"], Cell[2731, 82, 1209, 34, 242, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[3989, 122, 66, 0, 33, "Section"], Cell[CellGroupData[{ Cell[4080, 126, 45, 0, 47, "Subsection"], Cell[4128, 128, 232, 4, 52, "Text"], Cell[4363, 134, 69, 1, 30, "Input"], Cell[4435, 137, 1239, 38, 71, "Text"], Cell[5677, 177, 775, 16, 173, "Input"], Cell[6455, 195, 1405, 43, 90, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[7897, 243, 50, 0, 31, "Subsection"], Cell[7950, 245, 218, 6, 52, "Text"], Cell[8171, 253, 293, 7, 150, "Input"], Cell[8467, 262, 428, 9, 109, "Text"], Cell[8898, 273, 295, 7, 152, "Input"], Cell[9196, 282, 64, 0, 33, "Text"], Cell[9263, 284, 140, 2, 50, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[9440, 291, 46, 0, 31, "Subsection"], Cell[9489, 293, 397, 13, 71, "Text"], Cell[9889, 308, 386, 8, 174, "Input"], Cell[10278, 318, 851, 25, 40, "Input", Evaluatable->False, CellTags->"hb1"], Cell[11132, 345, 376, 8, 71, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[11557, 359, 37, 0, 33, "Section"], Cell[CellGroupData[{ Cell[11619, 363, 77, 0, 47, "Subsection"], Cell[11699, 365, 82, 1, 33, "Text"], Cell[11784, 368, 503, 14, 55, "Text"], Cell[12290, 384, 210, 4, 71, "Input"], Cell[12503, 390, 140, 3, 49, "Text"], Cell[12646, 395, 208, 3, 70, "Input"], Cell[12857, 400, 506, 15, 101, "Text"], Cell[13366, 417, 252, 7, 50, "Input"], Cell[13621, 426, 428, 8, 90, "Text"], Cell[14052, 436, 594, 14, 90, "Input"], Cell[14649, 452, 112, 3, 33, "Text"], Cell[14764, 457, 539, 13, 50, "Input"], Cell[15306, 472, 50, 0, 33, "Text"], Cell[15359, 474, 395, 9, 134, "Input"], Cell[15757, 485, 171, 3, 49, "Text"], Cell[15931, 490, 379, 8, 90, "Input"], Cell[16313, 500, 118, 3, 30, "Text"], Cell[16434, 505, 571, 14, 292, "Input"], Cell[17008, 521, 110, 3, 30, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[17155, 529, 70, 0, 31, "Subsection"], Cell[17228, 531, 503, 10, 128, "Text"], Cell[17734, 543, 980, 23, 174, "Input"], Cell[18717, 568, 65, 0, 33, "Text"], Cell[18785, 570, 570, 14, 292, "Input"], Cell[19358, 586, 168, 3, 52, "Text"], Cell[19529, 591, 140, 2, 50, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[19718, 599, 66, 0, 33, "Section"], Cell[CellGroupData[{ Cell[19809, 603, 45, 0, 47, "Subsection"], Cell[19857, 605, 286, 5, 71, "Text"], Cell[20146, 612, 69, 1, 30, "Input"], Cell[20218, 615, 729, 22, 71, "Text"], Cell[20950, 639, 775, 16, 173, "Input"], Cell[21728, 657, 1331, 39, 90, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[23096, 701, 50, 0, 47, "Subsection"], Cell[23149, 703, 133, 3, 33, "Text"], Cell[23285, 708, 362, 8, 170, "Input"], Cell[23650, 718, 318, 7, 90, "Text"], Cell[23971, 727, 362, 8, 172, "Input"], Cell[24336, 737, 104, 3, 33, "Text"], Cell[24443, 742, 126, 2, 50, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[24606, 749, 46, 0, 47, "Subsection"], Cell[24655, 751, 397, 13, 71, "Text"], Cell[25055, 766, 390, 9, 154, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[25494, 781, 38, 0, 33, "Section"], Cell[CellGroupData[{ Cell[25557, 785, 71, 0, 47, "Subsection"], Cell[25631, 787, 481, 9, 90, "Text"], Cell[26115, 798, 36, 0, 33, "Text"], Cell[26154, 800, 56, 1, 31, "Input"], Cell[26213, 803, 60, 1, 30, "Input"], Cell[26276, 806, 76, 0, 33, "Text"], Cell[26355, 808, 830, 18, 173, "Input"], Cell[27188, 828, 85, 2, 33, "Text"], Cell[27276, 832, 706, 16, 332, "Input"], Cell[27985, 850, 44, 0, 33, "Text"], Cell[28032, 852, 126, 2, 50, "Input"], Cell[28161, 856, 60, 0, 33, "Text"], Cell[28224, 858, 392, 9, 174, "Input"], Cell[28619, 869, 103, 3, 33, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[28771, 878, 558, 19, 33, "Section"], Cell[29332, 899, 395, 12, 71, "Text", CellTags->"h1"] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)