(*********************************************************************** 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[ 17951, 553]*) (*NotebookOutlinePosition[ 19008, 593]*) (* CellTagsIndexPosition[ 18890, 585]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Visualizing and Interpreting the Divergence Theorem ", "Title"], Cell[TextData[StyleBox["Chapter 13, Section 8", FontFamily->"Arial", FontSize->16, FontWeight->"Bold"]], "Text"], Cell[CellGroupData[{ Cell["Introduction", "Section"], Cell[TextData[{ "OBJECTIVE: Observe that surface integrals are difficult to evaluate, even \ using ", StyleBox["Mathematica", FontSlant->"Italic"], ". See that using parametrizations to evaluate flux surface integrals and \ applying the Divergence Theorem can help with integral evaluations." }], "Text"], Cell[TextData[{ "You will see that surface integrals are still difficult to set up and to \ evaluate, even with ", StyleBox["Mathematica", FontSlant->"Italic"], ", but parametrizations can assist in evaluating these difficult flux \ surface integrals. You will also verify the Divergence Theorem, just as you \ have done with Green's Theorem. This module is an example; however, those \ familiar with ", StyleBox["Mathematica", FontSlant->"Italic"], " can adjust the code to solve other problems." }], "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: Visualizing the Problem", "Section"], Cell[TextData[{ "We select the object formed by a hemisphere of radius 1, topped with a \ cylinder of radius 1 and height 1, with a circular disk on top on the \ cylinder. This object is similar to the one to which the method of moments \ was applied in the previous chapter. The force we choose has components ", Cell[BoxData[ FormBox[ RowBox[{\({\(-x\^2\) - 4 x\ y, \(-6\)\ y\ z, \ 12 z}\), StyleBox[".", FontWeight->"Plain"]}], TraditionalForm]], FontWeight->"Bold"] }], "Text"], Cell[BoxData[{ RowBox[{\(Off[General::spell]\), " "}], "\n", RowBox[{\(Off[General::spell1]\), " "}], "\n", \(Clear[x, y, z, t, force]\), "\n", RowBox[{"force", ":=", FormBox[\({\(-x\^2\) - 4 x\ y, \(-6\)\ y\ z, \ 12 z}\), "TraditionalForm"]}]}], "Input"], Cell["\<\ Before we apply the Divergence Theorem, we plot the figure. We need to load \ three graphing packages in order to show our plots.\ \>", "Text"], Cell[BoxData[{ \(<< Graphics`ParametricPlot3D`\), "\n", \(<< Graphics`Graphics3D`\n << Graphics`PlotField3D`\)}], "Input"], Cell[BoxData[{ \(Clear[x, y, z, r, \[Theta], t]\), "\n", \(\(forceplot = PlotVectorField3D[ force, {x, \(-1.5\), 1.5}, {y, \(-1.5\), 1.5}, {z, \(-1.5\), 1.5}, VectorHeads -> True, DisplayFunction -> Identity];\)\), "\n", \(\(hemisplot = CylindricalPlot3D[\(-\@\(1 - r\^2\)\), {r, 0, 1}, {\[Theta], 0, 2 \[Pi]}, AxesLabel -> {x, y, z}, DisplayFunction -> Identity];\)\), "\n", \(\(topplot = CylindricalPlot3D[1, {r, 0, 1}, {\[Theta], 0, 2 \[Pi]}, AxesLabel -> {x, y, z}, DisplayFunction -> Identity];\)\), "\n", \(\(cylpts\ = \ Table[{Cos[t]\ , \ Sin[t], \n\ \ u}, \ {t, \ 0, \ 2 Pi, \ Pi/12}, \n\ \ {u, \ 0, \ 1, \ .05}];\)\), "\n", \(\(cylplot = ListSurfacePlot3D[cylpts, DisplayFunction -> Identity];\)\), "\n", \(\(Show[hemisplot, cylplot, topplot, forceplot, DisplayFunction :> $DisplayFunction];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Part II: Evaluating the Divergence Integral", "Section"], Cell["\<\ The divergence integral over the volume is easy to set up and calculate. We \ begin by first loading a package that can perform certain vector \ computations, including the divergence, curl, and cross product.\ \>", "Text"], Cell["<"S5.17.1"], Cell[BoxData[{ \(Clear[x, y, z]\), "\n", \(Print["\", divf = Div[force, Cartesian[x, y, z]]]\), "\n", \(Print["\", totalflux = Integrate[ divf, {x, \(-1\), 1}, {y, \(-\@\(1 - x\^2\)\), \@\(1 - x\^2\)}, {z, \(-\@\(1 - x\^2 \ - y\^2\)\), 1}]]\)}], "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"] }, Closed]], Cell[CellGroupData[{ Cell["Part III: Finding Surface Integrals", "Section"], Cell[TextData[{ "The surface integrals evaluating the flux across each surface require \ considerable set up. As you recall, parametrizations are very convenient in \ determining line integrals. Likewise, parametrizations can facilitate the \ computation of surface integrals. We use spherical coordinates to write the \ equation of the sphere parametrically and follow the procedure outlined in ", StyleBox["Section 12.6", FontWeight->"Bold"], " of your text." }], "Text"], Cell[CellGroupData[{ Cell["Hemisphere", "Subsection"], Cell[BoxData[{ \(Clear[x, y, z, r, \[Theta], \[Phi]]\), "\n", \(\(x\ = \ Sin[\[Theta]] Sin[\[Phi]];\)\), "\n", \(\(y = Cos[\[Theta]] Sin[\[Phi]];\)\), "\n", \(\(z = Cos[\[Phi]];\)\), "\n", \(\(r = {x, y, z};\)\t\), "\n", \(\(rtheta = D[r, \[Theta]];\)\), "\n", \(\(rphi = D[r, \[Phi]];\)\), "\n", \(\(cr = Cross[rtheta, rphi] // Simplify;\)\), "\n", \(Print["\", integrand = force . cr // Simplify]\), "\n", \(Print["\", hemisflux = Integrate[ integrand, {\[Theta], 0, 2 \[Pi]}, {\[Phi], \[Pi]/2, \[Pi]}], \ "\", \n nhemisflux = N[hemisflux]]\)}], "Input"], Cell[TextData[{ "The equations of the cylinder and the top can be written using cylindrical \ coordinates, with ", StyleBox["z", FontSlant->"Italic"], " and \[Theta] the parameters for the cylinder and ", Cell[BoxData[ \(TraditionalForm\`r\ = \ 1\)]], "." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Cylinder", "Subsection"], Cell[BoxData[{ \(Clear[x, y, z]\), "\n", \(\(x = Cos[\[Theta]];\)\), "\n", \(\(y = Sin[\[Theta]];\)\), "\n", \(\(z = z;\)\), "\n", \(\(r = {x, y, z};\)\t\), "\n", \(\(rtheta = D[r, \[Theta]];\)\), "\n", \(\(rz = D[r, z];\)\), "\n", \(\(cr = Cross[rtheta, rz] // Simplify;\)\), "\n", \(Print["\", integrand = force . cr // Simplify]\), "\n", \(Print["\", cylflux = Integrate[ integrand, {\[Theta], 0, 2 \[Pi]}, {z, 0, 1}], "\< or \>", \n ncylflux = N[cylflux]]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Top", "Subsection"], Cell[TextData[{ " Polar coordinates ", StyleBox["r", FontSlant->"Italic"], " and \[Theta] will be the parameters for the top. Recall that for the top, \ the normal is always in the increasing ", StyleBox["z", FontSlant->"Italic"], " direction. Also, the delta area form of the area must contain the polar \ coordinate ", StyleBox["r,", FontSlant->"Italic"], " which varies from 0 to 1." }], "Text"], Cell[BoxData[{ \(Clear[x, y, z, r]\), "\n", \(\(x = Cos[\[Theta]];\)\), "\n", \(\(y = Sin[\[Theta]];\)\), "\n", \(\(z = 1;\)\), "\n", \(\(r = {x, y, z};\)\t\), "\n", \(\(normal = {0, 0, 1};\)\), "\n", \(Print["\", integrand = force . normal // Simplify]\), "\n", \(Print["\", topflux = Integrate[ R\ integrand, {\[Theta], 0, 2 \[Pi]}, {R, 0, 1}], "\< or \>", \n ntopflux = N[topflux]]\)}], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Part IV: Verifying the Divergence Theorem", "Section"], Cell["Compare your answers to verify the Divergence Theorem.", "Text"], Cell[BoxData[{ \(Print["\", totalsurfaceflux = hemisflux + cylflux + topflux, "\", N[totalsurfaceflux]]\), "\n", \(If[totalsurfaceflux <= totalflux + .001 && totalsurfaceflux >= totalflux - .001, Print["\"], Print["\"]]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["You Try It", "Section"], Cell[CellGroupData[{ Cell["Visualize and Evaluate Other Divergence Integrals", "Subsection"], Cell["\<\ You can change the entries in red to define a different force function and \ then to visualize it.\ \>", "Text"], Cell[BoxData[{\(Clear[x, y, z, r, \[Theta]]\), "\n", RowBox[{ RowBox[{"force", ":=", RowBox[{"{", RowBox[{ StyleBox[\(Cos[10 z]\), FontColor->RGBColor[1, 0, 0]], ",", " ", StyleBox[\(Sin[10 z]\), FontColor->RGBColor[1, 0, 0]], ",", StyleBox[\(x\ y\), FontColor->RGBColor[1, 0, 0]]}], "}"}]}], " "}], "\n", \(forceplot = PlotVectorField3D[ force, {x, \(-1.5\), 1.5}, {y, \(-1.5\), 1.5}, {z, \(-1.5\), 1.5}, VectorHeads -> True, DisplayFunction -> Identity];\), "\n", \(hemisplot = CylindricalPlot3D[\(-\@\(1 - r\^2\)\), {r, 0, 1}, {\[Theta], 0, 2 \[Pi]}, AxesLabel -> {x, y, z}, DisplayFunction -> Identity];\), "\n", \(topplot = CylindricalPlot3D[1, {r, 0, 1}, {\[Theta], 0, 2 \[Pi]}, AxesLabel -> {x, y, z}, DisplayFunction -> Identity];\), "\n", \(cylpts\ = \ Table[{Cos[t]\ , \ Sin[t], \n\ \ u}, \ {t, \ 0, \ 2 Pi, \ Pi/12}, \n\ \ {u, \ 0, \ 1, \ .05}];\), "\n", \(cylplot = ListSurfacePlot3D[cylpts, DisplayFunction -> Identity];\), "\n", \(Show[hemisplot, cylplot, topplot, forceplot, DisplayFunction :> $DisplayFunction];\)}], "Input"], Cell[TextData[{ "Now, see if ", StyleBox["Mathematica", FontSlant->"Italic"], " can find the divergence integral." }], "Text"], Cell[BoxData[{ \(Clear[x, y, z]\), "\n", \(Print["\", divf = Div[force, Cartesian[x, y, z]]]\), "\n", \(Print["\", totalflux = Integrate[ divf, {x, \(-1\), 1}, {y, \(-\@\(1 - x\^2\)\), \@\(1 - x\^2\)}, {z, \(-\@\(1 - x\^2 \ - y\^2\)\), 1}]]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Selection of Closed Region to Maximize Flux", "Subsection"], Cell[TextData[StyleBox["Section 13.8, Exercise 24", FontWeight->"Bold"]], "Text"], Cell[TextData[{ "In this problem, you are to find the dimensions of a particular \ rectangular box for which the total flux of a force with components ", Cell[BoxData[ RowBox[{ StyleBox[\({\(-x\^2\) - 4 x\ y, \(-6\)\ y\ z, \ 12 z}\), FontSlant->"Italic"], " "}]]], " is maximized." }], "Text"], Cell[CellGroupData[{ Cell["Visualizing the Problem", "Subsubsection"], Cell["\<\ If you have not already loaded the packages used below, be sure to do that. \ The force here is the same as in Part I, but we are now asked to find the \ coordinates of a rectangular box that will maximize the outward flux. Before \ we apply the Divergence Theorem, let's plot the figure.\ \>", "Text"], Cell[BoxData[{ \(<< Calculus`VectorAnalysis`\), "\n", \(<< Graphics`PlotField3D`\)}], "Input"], Cell[BoxData[{ \(Clear[x, y, z, t, force]\), "\n", \(force := {\(-x\^2\) - 4 x\ y, \(-6\)\ y\ z, \ 12 z}\ \), "\n", \(\(forceplot = PlotVectorField3D[force, {x, 0, 3}, {y, 0, 2}, {z, 0, 1}, VectorHeads -> True, ScaleFactor -> .5, AxesLabel -> {x, y, z}];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Evaluating and Maximizing the Divergence Integral", "Subsubsection"], Cell[BoxData[{ \(\(divf = Div[force, Cartesian[x, y, z]];\)\), "\n", \(divergenceintegral = Integrate[divf, {z, 0, 1}, {y, 0, b}, {x, 0, a}]\)}], "Input"], Cell[TextData[{ "We will find the values of ", StyleBox["a", FontSlant->"Italic"], " and ", StyleBox["b", FontSlant->"Italic"], " that maximize this function by computing the two first partials with \ respect to ", StyleBox["a", FontSlant->"Italic"], " and ", StyleBox["b", FontSlant->"Italic"], " and equating them both to 0." }], "Text"], Cell[BoxData[{ \(\(ma = D[divergenceintegral, a];\)\), "\n", \(\(mb = D[divergenceintegral, b];\)\), "\n", \(solab = Solve[{ma == 0, mb == 0}, {a, b}]\)}], "Input"], Cell[TextData[{ "Based on these results, what answer will you give?\n\nEvaluate the \ divergence integral at these values for ", StyleBox["a", FontSlant->"Italic"], " and ", StyleBox["b", FontSlant->"Italic"], "." }], "Text"], Cell[BoxData[ \(divergenceintegral /. solab\)], "Input"], Cell["\<\ Does the fact that this is less than the divergence integral found in Part II \ mean that you have not maximized the divergence integral as requested?\ \>", "Text"] }, Closed]] }, 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[{ "In computing multiple integrals, ", StyleBox["Mathematica", FontSlant->"Italic"], " starts with the variable and bounds on the extreme right of the ", StyleBox["Integrate", FontWeight->"Bold"], " command and then continues the evaluation from right to left.\n", ButtonBox["Go back.", ButtonData:>"hb1", ButtonStyle->"Hyperlink"] }], "Text", CellTags->"h1"] }, Closed]] }, Open ]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, WindowSize->{742, 505}, WindowMargins->{{59, Automatic}, {Automatic, 53}}, 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->{ "S5.17.1"->{ Cell[6683, 195, 66, 1, 30, "Input", CellTags->"S5.17.1"]}, "hb1"->{ Cell[7147, 209, 851, 25, 40, "Input", Evaluatable->False, CellTags->"hb1"]}, "h1"->{ Cell[17520, 537, 403, 12, 71, "Text", CellTags->"h1"]} } *) (*CellTagsIndex CellTagsIndex->{ {"S5.17.1", 18616, 571}, {"hb1", 18696, 574}, {"h1", 18799, 578} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1739, 51, 69, 0, 150, "Title"], Cell[1811, 53, 118, 3, 37, "Text"], Cell[CellGroupData[{ Cell[1954, 60, 31, 0, 53, "Section"], Cell[1988, 62, 315, 7, 52, "Text"], Cell[2306, 71, 527, 12, 90, "Text"], Cell[CellGroupData[{ Cell[2858, 87, 74, 1, 47, "Subsection"], Cell[2935, 90, 1209, 34, 242, "Text"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[4193, 130, 50, 0, 33, "Section"], Cell[4246, 132, 528, 11, 71, "Text"], Cell[4777, 145, 293, 6, 91, "Input"], Cell[5073, 153, 153, 3, 52, "Text"], Cell[5229, 158, 135, 3, 70, "Input"], Cell[5367, 163, 978, 19, 276, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[6382, 187, 62, 0, 33, "Section"], Cell[6447, 189, 233, 4, 52, "Text"], Cell[6683, 195, 66, 1, 30, "Input", CellTags->"S5.17.1"], Cell[6752, 198, 392, 9, 95, "Input"], Cell[7147, 209, 851, 25, 40, "Input", Evaluatable->False, CellTags->"hb1"] }, Closed]], Cell[CellGroupData[{ Cell[8035, 239, 54, 0, 33, "Section"], Cell[8092, 241, 483, 9, 90, "Text"], Cell[CellGroupData[{ Cell[8600, 254, 32, 0, 47, "Subsection"], Cell[8635, 256, 778, 16, 270, "Input"], Cell[9416, 274, 289, 9, 52, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[9742, 288, 30, 0, 47, "Subsection"], Cell[9775, 290, 671, 15, 270, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[10483, 310, 25, 0, 47, "Subsection"], Cell[10511, 312, 424, 13, 52, "Text"], Cell[10938, 327, 586, 13, 230, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[11573, 346, 60, 0, 33, "Section"], Cell[11636, 348, 70, 0, 33, "Text"], Cell[11709, 350, 387, 7, 90, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[12133, 362, 29, 0, 33, "Section"], Cell[CellGroupData[{ Cell[12187, 366, 71, 0, 47, "Subsection"], Cell[12261, 368, 122, 3, 33, "Text"], Cell[12386, 373, 1322, 26, 296, "Input"], Cell[13711, 401, 136, 5, 33, "Text"], Cell[13850, 408, 392, 9, 119, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[14279, 422, 65, 0, 47, "Subsection"], Cell[14347, 424, 83, 1, 33, "Text"], Cell[14433, 427, 323, 8, 52, "Text"], Cell[CellGroupData[{ Cell[14781, 439, 48, 0, 43, "Subsubsection"], Cell[14832, 441, 312, 5, 71, "Text"], Cell[15147, 448, 103, 2, 50, "Input"], Cell[15253, 452, 318, 6, 91, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[15608, 463, 74, 0, 43, "Subsubsection"], Cell[15685, 465, 170, 3, 50, "Input"], Cell[15858, 470, 373, 15, 52, "Text"], Cell[16234, 487, 178, 3, 70, "Input"], Cell[16415, 492, 243, 9, 71, "Text"], Cell[16661, 503, 60, 1, 30, "Input"], Cell[16724, 506, 174, 3, 52, "Text"] }, Closed]] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[16959, 516, 558, 19, 33, "Section"], Cell[17520, 537, 403, 12, 71, "Text", CellTags->"h1"] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)