(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 19130, 561] NotebookOptionsPosition[ 17770, 520] NotebookOutlinePosition[ 18225, 537] CellTagsIndexPosition[ 18182, 534] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[TextData[StyleBox["Flux", FontSize->36, FontWeight->"Bold"]], "Text", CellChangeTimes->{{3.5206254234030547`*^9, 3.520625530401*^9}, { 3.520625586134305*^9, 3.520625586290552*^9}, {3.7315288829661474`*^9, 3.7315289049064026`*^9}}, TextAlignment->Center, FontFamily->"Times New Roman", FontSize->24], Cell["\<\ In this worksheet, you will examine the flux of the electric field due to a \ point charge through a cube, with sides of length 2L, centered at the origin. \ Set up the Problem Define the dimensions of the square box to be L=1:\ \>", "Text", CellChangeTimes->{{3.5206254234030547`*^9, 3.520625530401*^9}, { 3.520625586134305*^9, 3.520625586290552*^9}, 3.7315288829661474`*^9, 3.7315291403878713`*^9, {3.731529183434333*^9, 3.7315291838513575`*^9}}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"Clear", "[", RowBox[{"x", ",", "y", ",", "z"}], "]"}]], "Input", CellChangeTimes->{{3.5206848807566757`*^9, 3.5206848953501453`*^9}, 3.731529105912899*^9, {3.731529150946475*^9, 3.731529175143859*^9}, { 3.731529276778672*^9, 3.7315292769336815`*^9}}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[BoxData[ RowBox[{"Needs", "[", "\"\\"", "]"}]], "Input", CellChangeTimes->{{3.5206848807566757`*^9, 3.5206848953501453`*^9}, 3.731529105912899*^9, {3.731529150946475*^9, 3.731529177730007*^9}}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[BoxData[ RowBox[{ RowBox[{"L", "=", "1"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.5206848807566757`*^9, 3.5206848953501453`*^9}, 3.731529105912899*^9, {3.731529150946475*^9, 3.7315291884166183`*^9}}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell["Define the unit vectors in rectangular coordinates:", "Text", CellChangeTimes->{{3.5206849244589615`*^9, 3.5206849487866197`*^9}, { 3.5206850015199823`*^9, 3.5206850092385836`*^9}}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[{ RowBox[{"ihat", "=", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0"}], "}"}]}], "\[IndentingNewLine]", RowBox[{"jhat", "=", RowBox[{"{", RowBox[{"0", ",", "1", ",", "0"}], "}"}]}], "\[IndentingNewLine]", RowBox[{"khat", "=", RowBox[{"{", RowBox[{"0", ",", "0", ",", "1"}], "}"}]}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.5206850183634086`*^9, 3.520685026628875*^9}, { 3.5206850661593657`*^9, 3.5206850742373357`*^9}, {3.520686087389758*^9, 3.5206860887178574`*^9}, {3.5206885215773954`*^9, 3.52068852342111*^9}, 3.7315291052988644`*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell["\<\ Initially, define the location of the point charge to be at the origin of a \ rectangular coordinate system: \ \>", "Text", CellChangeTimes->{{3.520685114986553*^9, 3.5206851873757887`*^9}, { 3.520692934430167*^9, 3.520692935273901*^9}}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"point", "=", RowBox[{"{", RowBox[{"0", ",", "0", ",", "0"}], "}"}]}]], "Input", CellChangeTimes->{{3.5206851924694405`*^9, 3.5206852096253614`*^9}, { 3.5206853380447707`*^9, 3.5206853584662533`*^9}, {3.5206856567105274`*^9, 3.5206856871161933`*^9}, 3.5206884595942106`*^9, {3.520692967038916*^9, 3.5206929965071*^9}, 3.731529109928129*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"{", RowBox[{"a", ",", "b", ",", "c"}], "}"}], "=", "point"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.5206929712575855`*^9, 3.52069298297611*^9}, { 3.5206930430687065`*^9, 3.520693055755963*^9}, {3.529280055006258*^9, 3.529280058288127*^9}, 3.7315291073199797`*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell["Find the electric field of the point charge.", "Text", CellChangeTimes->{{3.5206857248185945`*^9, 3.5206857438651037`*^9}}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"r", "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{"x", "-", "a"}], ")"}], "^", "2"}], "+", RowBox[{ RowBox[{"(", RowBox[{"y", "-", "b"}], ")"}], "^", "2"}], "+", RowBox[{ RowBox[{"(", RowBox[{"z", "-", "c"}], ")"}], "^", "2"}]}], ")"}], "^", RowBox[{"(", RowBox[{"1", "/", "2"}], ")"}]}]}]], "Input", CellChangeTimes->{{3.520685780864393*^9, 3.5206858237854443`*^9}}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[BoxData[ RowBox[{ RowBox[{"Efield", "=", RowBox[{ RowBox[{"(", RowBox[{"q", "/", RowBox[{"(", RowBox[{"4", "\[Pi]", " ", "\[Epsilon]"}], ")"}]}], ")"}], "*", RowBox[{"Grad", "[", RowBox[{ RowBox[{ RowBox[{"-", "1"}], "/", "r"}], ",", RowBox[{"Cartesian", "[", RowBox[{"x", ",", "y", ",", "z"}], "]"}]}], "]"}]}]}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.5206858390351515`*^9, 3.5206858992683697`*^9}, 3.529280080224812*^9, 3.7315291114552164`*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[TextData[{ "Plot the three dimensional vector field. For plotting purposes, choose the \ charge so that ", Cell[BoxData[ FormBox[ FractionBox[ RowBox[{"|", "q", "|"}], RowBox[{"4", "\[Pi]", " ", "\[Epsilon]"}]], TraditionalForm]]], Cell[BoxData[ FormBox[ RowBox[{"=", "1"}], TraditionalForm]], FormatType->"TraditionalForm"], "." }], "Text", CellChangeTimes->{{3.5206861565290556`*^9, 3.520686181841069*^9}, { 3.520686244105499*^9, 3.5206862959326286`*^9}, 3.5213125349583707`*^9, { 3.52928014067195*^9, 3.529280140672011*^9}, 3.7315291249859905`*^9, 3.731529246859961*^9}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"Esubs", "=", RowBox[{"Efield", "/.", RowBox[{"q", "\[Rule]", RowBox[{"4", "\[Pi]", " ", "\[Epsilon]"}]}]}]}]], "Input", CellChangeTimes->{{3.5206931608789444`*^9, 3.520693178800475*^9}, 3.52928013438189*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[BoxData[ RowBox[{ RowBox[{"VectorPlot3D", "[", RowBox[{"Esubs", ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"x", ",", "y", ",", "z"}], "}"}]}], ",", RowBox[{"VectorPoints", "\[Rule]", "5"}], ",", RowBox[{"VectorScale", "\[Rule]", "Small"}]}], "]"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.520686374821739*^9, 3.520686429351942*^9}, { 3.520686473007354*^9, 3.5206865460997005`*^9}, {3.5206866273637652`*^9, 3.5206866435978284`*^9}, {3.5206867419865646`*^9, 3.5206867490020547`*^9}, {3.5206873167099047`*^9, 3.5206874331295443`*^9}, {3.5206936443540363`*^9, 3.5206936889938045`*^9}, {3.5206949492664814`*^9, 3.5206949579694395`*^9}, {3.5206950192807627`*^9, 3.520695089763784*^9}, { 3.520695161840525*^9, 3.520695177355852*^9}, {3.5206952969160566`*^9, 3.5206953213062134`*^9}, {3.520695358243004*^9, 3.5206954372727365`*^9}, 3.7315291131513133`*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[TextData[{ "Calculate the flux through the surface (", Cell[BoxData[ FormBox[ RowBox[{"z", "=", Cell["L"]}], TraditionalForm]], FormatType->"TraditionalForm"], ")." }], "Text", CellChangeTimes->{{3.5206865866145477`*^9, 3.5206866171295867`*^9}, 3.520687556361553*^9, 3.521312532442794*^9, 3.731529126481076*^9, { 3.7315291965010805`*^9, 3.7315292259947677`*^9}, {3.731529266458082*^9, 3.731529268008171*^9}}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"E1", "=", RowBox[{"Esubs", "/.", RowBox[{"z", "\[Rule]", "L"}]}]}]], "Input", CellChangeTimes->{{3.520687757138948*^9, 3.520687807559855*^9}, { 3.52069384545955*^9, 3.5206938477720056`*^9}, {3.529280212507346*^9, 3.529280217240003*^9}}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[BoxData[ RowBox[{ RowBox[{"Integrand1", "=", RowBox[{"Dot", "[", RowBox[{"E1", ",", "khat"}], "]"}]}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.520687879886591*^9, 3.520687894761306*^9}, { 3.520690238575679*^9, 3.5206902445130644`*^9}, {3.5206938509125705`*^9, 3.5206938515688076`*^9}, 3.7315291145983963`*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell["Examine the integrand.", "Text", CellChangeTimes->{{3.5206878536683445`*^9, 3.5206878577463913`*^9}, 3.521312579020025*^9, 3.529280244822068*^9}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{ RowBox[{"Plot3D", "[", RowBox[{"Integrand1", ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}], ",", RowBox[{"BoxRatios", "\[Rule]", " ", "Automatic"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"\"\\"", ",", "\"\\""}], "}"}]}], ",", RowBox[{"ColorFunction", "\[Rule]", RowBox[{"Function", "[", RowBox[{ RowBox[{"{", RowBox[{"x", ",", "y", ",", "z"}], "}"}], ",", RowBox[{"Hue", "[", "z", "]"}]}], "]"}]}], ",", RowBox[{"MeshFunctions", "\[Rule]", RowBox[{"{", RowBox[{"#3", " ", "&"}], "}"}]}]}], "]"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.5206878640431457`*^9, 3.5206878656681147`*^9}, { 3.520687906714201*^9, 3.52068800105614*^9}, {3.5206883271592536`*^9, 3.5206883492682037`*^9}, {3.5206885587173076`*^9, 3.520688563967207*^9}, { 3.520968036361167*^9, 3.520968049126547*^9}, {3.529280294382219*^9, 3.529280332706913*^9}, {3.559411447711937*^9, 3.559411460173492*^9}, 3.7315291158854694`*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[TextData[{ "Perform the integration. Put back in the factor of ", Cell[BoxData[ FormBox[ FractionBox[ RowBox[{"|", "q", "|"}], RowBox[{"4", "\[Pi]", " ", "\[Epsilon]"}]], TraditionalForm]]], "." }], "Text", CellChangeTimes->{{3.5206886169036903`*^9, 3.5206886284972177`*^9}, { 3.5206886889335575`*^9, 3.5206887133237143`*^9}, {3.5206897846625185`*^9, 3.520689785115635*^9}, 3.521312603441431*^9, 3.529280256895742*^9, { 3.529280377478587*^9, 3.529280377478651*^9}}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"Clear", "[", "q", "]"}]], "Input", CellChangeTimes->{{3.520689176361698*^9, 3.520689179486638*^9}}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell[BoxData[ RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"q", "/", RowBox[{"(", RowBox[{"4", "\[Pi]", " ", "\[Epsilon]"}], ")"}]}], "*", "Integrand1"}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.520688798618951*^9, 3.5206888086031346`*^9}, { 3.5206888433368425`*^9, 3.52068895988148*^9}, {3.520688991037132*^9, 3.520689139784276*^9}, {3.5206891962050676`*^9, 3.5206892055955124`*^9}, 3.5206940726114388`*^9, 3.5206941043920784`*^9, {3.529280393091187*^9, 3.529280396545506*^9}, 3.7315291187506337`*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell["\<\ Calculate the total flux (summed over all six sides of the cube).\ \>", "Text", CellChangeTimes->{{3.5206896069159317`*^9, 3.520689636259118*^9}, 3.5213126229566813`*^9, 3.731529123145885*^9, {3.7315292568375316`*^9, 3.7315292618488183`*^9}}, FontFamily->"Times New Roman", FontSize->24, Background->RGBColor[0.87, 0.94, 1]], Cell[BoxData[ RowBox[{"\[IndentingNewLine]", RowBox[{ RowBox[{"Simplify", "[", RowBox[{ RowBox[{"(", RowBox[{"q", "/", RowBox[{"(", RowBox[{"4", "Pi", "*", "\[Epsilon]"}], ")"}]}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"Dot", "[", RowBox[{"Esubs", ",", "ihat"}], "]"}], "/.", RowBox[{"x", "\[Rule]", " ", "L"}]}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], "\[IndentingNewLine]", "+", RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"Dot", "[", RowBox[{"Esubs", ",", RowBox[{"-", "ihat"}]}], "]"}], "/.", RowBox[{"x", "\[Rule]", RowBox[{"-", " ", "L"}]}]}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], "\[IndentingNewLine]", "+", RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"Dot", "[", RowBox[{"Esubs", ",", "jhat"}], "]"}], "/.", RowBox[{"y", "\[Rule]", " ", "L"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], "\[IndentingNewLine]", "+", RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"Dot", "[", RowBox[{"Esubs", ",", RowBox[{"-", "jhat"}]}], "]"}], "/.", RowBox[{"y", "\[Rule]", RowBox[{"-", "L"}]}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"z", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], "\[IndentingNewLine]", "+", RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"Dot", "[", RowBox[{"Esubs", ",", "khat"}], "]"}], "/.", RowBox[{"z", "\[Rule]", "L"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], "\[IndentingNewLine]", "+", RowBox[{"Integrate", "[", RowBox[{ RowBox[{"Integrate", "[", RowBox[{ RowBox[{ RowBox[{"Dot", "[", RowBox[{"Esubs", ",", RowBox[{"-", "khat"}]}], "]"}], "/.", RowBox[{"z", "\[Rule]", " ", RowBox[{"-", "L"}]}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"y", ",", RowBox[{"-", "L"}], ",", "L"}], "}"}]}], "]"}]}], ")"}]}], "]"}], "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.520689747663229*^9, 3.520689757100548*^9}, { 3.5206898064746*^9, 3.5206898561923957`*^9}, {3.5206900050332875`*^9, 3.5206900054551544`*^9}, {3.5206904360250125`*^9, 3.5206907603000364`*^9}, {3.520690861454344*^9, 3.5206908970630355`*^9}, { 3.5206909391247277`*^9, 3.5206912150569296`*^9}, {3.520691282633757*^9, 3.520691383834939*^9}, {3.520691489911028*^9, 3.520691492270357*^9}, { 3.520691554831656*^9, 3.5206916530797696`*^9}, {3.520691690344679*^9, 3.520691731281393*^9}, {3.5206917767961445`*^9, 3.5206917831397724`*^9}, { 3.520691823795242*^9, 3.520691873997403*^9}, {3.5206919153559837`*^9, 3.520691927262005*^9}, {3.520693972191492*^9, 3.5206939918004904`*^9}, 3.529280477362994*^9, 3.731529119661686*^9}, FontFamily->"Consolas", FontSize->24, FontWeight->"Bold"], Cell["\<\ by Shannon Mayer and Corinne Manogue Copyright 1997 Corinne Manogue \ \>", "Text", CellChangeTimes->{3.7315288879194307`*^9}, FontFamily->"Times New Roman", FontSize->24] }, AutoGeneratedPackage->None, WindowSize->{2560, 1388}, WindowMargins->{{-9, Automatic}, {Automatic, -9}}, PrivateNotebookOptions->{"VersionedStylesheet"->{"Default.nb"[8.] -> False}}, FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (September 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 314, 8, 55, "Text"], Cell[862, 30, 557, 14, 177, "Text"], Cell[1422, 46, 346, 8, 43, "Input"], Cell[1771, 56, 283, 6, 43, "Input"], Cell[2057, 64, 290, 7, 79, "Input"], Cell[2350, 73, 275, 5, 57, "Text"], Cell[2628, 80, 668, 17, 149, "Input"], Cell[3299, 99, 335, 8, 57, "Text"], Cell[3637, 109, 443, 10, 43, "Input"], Cell[4083, 121, 405, 11, 79, "Input"], Cell[4491, 134, 215, 4, 57, "Text"], Cell[4709, 140, 552, 19, 43, "Input"], Cell[5264, 161, 609, 19, 79, "Input"], Cell[5876, 182, 700, 20, 70, "Text"], Cell[6579, 204, 309, 9, 43, "Input"], Cell[6891, 215, 1297, 31, 79, "Input"], Cell[8191, 248, 520, 14, 57, "Text"], Cell[8714, 264, 334, 9, 43, "Input"], Cell[9051, 275, 411, 10, 79, "Input"], Cell[9465, 287, 241, 5, 57, "Text"], Cell[9709, 294, 1270, 32, 79, "Input"], Cell[10982, 328, 584, 15, 70, "Text"], Cell[11569, 345, 185, 5, 43, "Input"], Cell[11757, 352, 916, 25, 79, "Input"], Cell[12676, 379, 346, 8, 57, "Text"], Cell[13025, 389, 4555, 120, 289, "Input"], Cell[17583, 511, 183, 7, 101, "Text"] } ] *)