(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of 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[ 8568, 309]*) (*NotebookOutlinePosition[ 9461, 340]*) (* CellTagsIndexPosition[ 9417, 336]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData[{ StyleBox["Your Assignment:", CellFrame->True, Evaluatable->False, InitializationCell->True, AspectRatioFixed->True, Background->GrayLevel[0.899992]], StyleBox[ "\n1) Execute the entire notebook. Experiment if you like. \n2) Generate \ plots as described at the end of this Notebook.\n3) Hand in the plots.", CellFrame->True, Evaluatable->False, InitializationCell->True, AspectRatioFixed->True, FontSize->14, Background->GrayLevel[0.899992]] }], "Section", CellFrame->True, Evaluatable->False, InitializationCell->True, AspectRatioFixed->True, Background->GrayLevel[0.899992]], Cell[TextData[ " Suggestion: if you want to save this file on you disk, CUT the graphics \ first so it will fit. (Graphics take up over 1MB.)"], "Subsubsection", CellFrame->True, Evaluatable->False, AspectRatioFixed->True, Background->GrayLevel[0.899992]], Cell[CellGroupData[{ Cell[TextData[{ StyleBox["**********************************\nInitialization Stuff:", Evaluatable->False, InitializationCell->True, AspectRatioFixed->True], StyleBox["\n(Just execute this, don't read it!!!)", Evaluatable->False, InitializationCell->True, AspectRatioFixed->True, FontSize->14] }], "Section", Evaluatable->False, InitializationCell->True, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["Packages ", "Subsection", Evaluatable->False, InitializationCell->True, AspectRatioFixed->True], Cell[TextData[ " You may wish to turn off the spell checker before starting this \ chapter:"], "Special5", Evaluatable->False, InitializationCell->True, AspectRatioFixed->True], Cell["\<\ Clear[\"Global`*\"]; Unprotect[{Monopole,VEPlot}]; Off[General::spell ]; Off[General::spell1];\ \>", "Input", InitializationCell->True, AspectRatioFixed->True], Cell[TextData["Load package:"], "Special5", Evaluatable->False, InitializationCell->True, AspectRatioFixed->True], Cell["Needs[\"Graphics`PlotField`\"] ", "Input", InitializationCell->True, AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData["3. Monopole"], "Subsubsection", Evaluatable->False, InitializationCell->True, AspectRatioFixed->True], Cell["\<\ Monopole::usage=\"Monopole[q,{x0,y0,z0},{x,y,z}] computes the potential due to a monopole of charge q located at position {x0,y0,z0} in {x,y,z} coordinates.\";\ \>", "Input", InitializationCell->True, AspectRatioFixed->True], Cell["\<\ Monopole[q_:1,r0_:{0,0,0},r_:{x,y,z}]:= q/Sqrt[ Sum[(r0[[i]]-r[[i]])^2,{i,1,Length[r0]}] ]; \ \>", "Input", InitializationCell->True, AspectRatioFixed->True] }, Open ]], Cell[TextData["5. VEPlot"], "Subsubsection", Evaluatable->False, InitializationCell->True, AspectRatioFixed->True], Cell["\<\ VEPlot::usage= \"VEPlot[potential,xlim:{x,-2,2},ylim:{y,-2,2}] plots the electric field and equipotential surfaces xlim and ylim.\"; VEPlot[potentialIN_,xlim_:{x,-2,2.1},ylim_:{y,-2,2.1}]:= Module[{plot1,plot2}, potential=potentialIN /.{z->0} //Evaluate; plot1=PlotGradientField[-potential ,xlim,ylim ,ScaleFunction->(1&) ,DisplayFunction->Identity]; plot2=ContourPlot[potential ,xlim,ylim ,ContourShading->False ,ContourSmoothing->True ,DisplayFunction->Identity]; Return[ Show[plot1,plot2 ,DisplayFunction->$DisplayFunction] ] ];\ \>", "Input", InitializationCell->True, AspectRatioFixed->True], Cell["\<\ Protect[{Monopole,VEPlot}]; Off[Clear::wrsym];\ \>", "Input", InitializationCell->True, AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell[TextData[ "**********************************\nSingle Charge: Monopole"], "Section", CellFrame->True, Evaluatable->False, AspectRatioFixed->True, Background->GrayLevel[0.899992]], Cell[TextData[{ StyleBox[" The ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Monopole[q,{x,y,z}]", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[ " function places a single charge q \n at position {x,y,z}. An example \ would be: ", Evaluatable->False, AspectRatioFixed->True], StyleBox[" Monopole[+1,{1,0,0}]\n", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[ "Let's look at the field due to a single charge located at the origin, \ {x,y,z}={0,0,0}. \n\nThe function ", Evaluatable->False, AspectRatioFixed->True], StyleBox["VEPlot", Evaluatable->False, AspectRatioFixed->True, FontFamily->"Courier", FontWeight->"Bold"], StyleBox[ " automatically plots the electric field vector and the equipotential lines \ in the {x,y} plane. \n(This automatically plots the region from {-2,2}.)", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["Monopole[+1,{0,0,0}]", "Input", AspectRatioFixed->True], Cell["VEPlot[ Monopole[+1,{0,0,0}] ];", "Input", AspectRatioFixed->True] }, Open ]], Cell[CellGroupData[{ Cell[TextData[ "**********************************\nTwo Charges: Dipole"], "Section", CellFrame->True, Evaluatable->False, PageBreakAbove->True, AspectRatioFixed->True, Background->GrayLevel[0.899992]], Cell[TextData[ "We can create a dipole from two Monopole functions:\n(Notice that the signs \ are opposite)"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[CellGroupData[{ Cell["dipole= Monopole[+1,{1,0,0}]+Monopole[-1,{-1,0,0}]", "Input", AspectRatioFixed->True], Cell[BoxData[ \(\(-\(1\/\@\(\((\(-1\) - x)\)\^2 + y\^2 + z\^2\)\)\) + 1\/\@\(\((1 - x)\)\^2 + y\^2 + z\^2\)\)], "Output"] }, Open ]], Cell["VEPlot[dipole];", "Input", AspectRatioFixed->True] }, Open ]], Cell[TextData[{ StyleBox["**********************************\nYour Assignment:\n\n", CellFrame->True, Evaluatable->False, AspectRatioFixed->True, Background->GrayLevel[0.899992]], StyleBox[ "1) Modify the dipole solution above for the case where the two charges are \ the same sign. \n\n2) Make a configuration of charges of your own choice. \ Plot the fields. \n\n3) Hand in the plot of the fields for 1) and 2). \n\n", CellFrame->True, Evaluatable->False, AspectRatioFixed->True, FontSize->14, Background->GrayLevel[0.899992]], StyleBox[ "(Hint: Use the PRINT SELECTION command from the FILE menu to print only \ the parts you want.)", CellFrame->True, Evaluatable->False, AspectRatioFixed->True, FontSize->12, Background->GrayLevel[0.899992]] }], "Section", CellFrame->True, Evaluatable->False, AspectRatioFixed->True, Background->GrayLevel[0.899992]] }, FrontEndVersion->"Microsoft Windows 3.0", ScreenRectangle->{{0, 1152}, {0, 808}}, AutoGeneratedPackage->None, WindowToolbars->{}, CellGrouping->Manual, WindowSize->{480, 684}, WindowMargins->{{Automatic, 314}, {22, Automatic}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False} ] (*********************************************************************** 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[1709, 49, 653, 21, 123, "Section", Evaluatable->False, InitializationCell->True], Cell[2365, 72, 263, 6, 76, "Subsubsection", Evaluatable->False], Cell[CellGroupData[{ Cell[2653, 82, 415, 13, 92, "Section", Evaluatable->False, InitializationCell->True], Cell[CellGroupData[{ Cell[3093, 99, 108, 3, 47, "Subsection", Evaluatable->False, InitializationCell->True], Cell[3204, 104, 185, 5, 25, "Special5", Evaluatable->False, InitializationCell->True], Cell[3392, 111, 174, 7, 84, "Input", InitializationCell->True], Cell[3569, 120, 119, 3, 25, "Special5", Evaluatable->False, InitializationCell->True], Cell[3691, 125, 102, 2, 30, "Input", InitializationCell->True] }, Open ]], Cell[CellGroupData[{ Cell[3830, 132, 122, 3, 43, "Subsubsection", Evaluatable->False, InitializationCell->True], Cell[3955, 137, 240, 6, 66, "Input", InitializationCell->True], Cell[4198, 145, 175, 5, 48, "Input", InitializationCell->True] }, Open ]], Cell[4388, 153, 120, 3, 43, "Subsubsection", Evaluatable->False, InitializationCell->True], Cell[4511, 158, 761, 28, 462, "Input", InitializationCell->True], Cell[5275, 188, 125, 5, 48, "Input", InitializationCell->True] }, Closed]], Cell[CellGroupData[{ Cell[5437, 198, 191, 5, 70, "Section", Evaluatable->False], Cell[5631, 205, 1104, 36, 150, "Text", Evaluatable->False], Cell[6738, 243, 63, 1, 30, "Input"], Cell[6804, 246, 74, 1, 30, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6915, 252, 211, 6, 90, "Section", Evaluatable->False, PageBreakAbove->True], Cell[7129, 260, 166, 4, 52, "Text", Evaluatable->False], Cell[CellGroupData[{ Cell[7320, 268, 93, 1, 30, "Input"], Cell[7416, 271, 132, 2, 47, "Output"] }, Open ]], Cell[7563, 276, 58, 1, 30, "Input"] }, Open ]], Cell[7636, 280, 928, 27, 289, "Section", Evaluatable->False] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)