(*^ ::[ Information = "This is a Mathematica Notebook file. It contains ASCII text, and can be transferred by email, ftp, or other text-file transfer utility. It should be read or edited using a copy of Mathematica or MathReader. If you received this as email, use your mail application or copy/paste to save everything from the line containing (*^ down to the line containing ^*) into a plain text file. On some systems you may have to give the file a name ending with ".ma" to allow Mathematica to recognize it as a Notebook. The line below identifies what version of Mathematica created this file, but it can be opened using any other version as well."; FrontEndVersion = "Macintosh Mathematica Notebook Front End Version 2.2"; MacintoshStandardFontEncoding; fontset = title, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e8, 24, "Times"; fontset = subtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, bold, e6, 18, "Times"; fontset = subsubtitle, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeTitle, center, M7, italic, e6, 14, "Times"; fontset = section, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, grayBox, M22, bold, a20, 18, "Times"; fontset = subsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, blackBox, M19, bold, a15, 14, "Times"; fontset = subsubsection, inactive, noPageBreakBelow, nohscroll, preserveAspect, groupLikeSection, whiteBox, M18, bold, a12, 12, "Times"; fontset = text, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = smalltext, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = input, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeInput, M42, N23, bold, L-5, 12, "Courier"; fontset = output, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = message, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, R65535, L-5, 12, "Courier"; fontset = print, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, L-5, 12, "Courier"; fontset = info, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeOutput, M42, N23, B65535, L-5, 12, "Courier"; fontset = postscript, PostScript, formatAsPostScript, output, inactive, noPageBreakInGroup, nowordwrap, preserveAspect, groupLikeGraphics, M7, l34, w218, h221, 12, "Courier"; fontset = name, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, italic, 10, "Geneva"; fontset = header, inactive, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = leftheader, inactive, L2, 12, "Times"; fontset = footer, inactive, noKeepOnOnePage, preserveAspect, center, M7, 12, "Times"; fontset = leftfooter, inactive, L2, 12, "Times"; fontset = help, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 10, "Times"; fontset = clipboard, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = completions, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special1, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special2, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special3, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special4, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; fontset = special5, inactive, nohscroll, noKeepOnOnePage, preserveAspect, M7, 12, "Times"; paletteColors = 128; currentKernel; ] :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Setup: :[font = input; noPageBreak; preserveAspect; endGroup] Clear["Global`*"]; Off[ General::spell ]; Off[ General::spell1]; Off[Clear::wrsym]; :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Load Packages: :[font = input; noPageBreak; preserveAspect; startGroup] Needs["LinearAlgebra`Orthogonalization`"] ?LinearAlgebra`Orthogonalization`* :[font = info; inactive; preserveAspect; endGroup] GramSchmidt InnerProduct Normalize Normalized Projection :[font = input; noPageBreak; preserveAspect; startGroup] Needs["Calculus`VectorAnalysis`"] ?Calculus`VectorAnalysis`* :[font = info; inactive; preserveAspect; endGroup] ArcLengthFactor Div phi Biharmonic DotProduct ProlateSpheroidal Bipolar EllipticCylindrical r Bispherical eta ScalarTripleProduct Cartesian Grad ScaleFactors ConfocalEllipsoidal JacobianDeterminant SetCoordinates ConfocalParaboloidal JacobianMatrix Spherical Conical lambda theta CoordinateRanges Laplacian Toroidal Coordinates mu u CoordinatesFromCartesian nu v CoordinatesToCartesian OblateSpheroidal x CoordinateSystem ParabolicCylindrical xi CrossProduct Paraboloidal y Curl ParameterRanges z Cylindrical Parameters :[font = input; noPageBreak; preserveAspect; startGroup] Needs["Graphics`PlotField`"] ?Graphics`PlotField`* :[font = info; inactive; preserveAspect; endGroup] ListPlotVectorField PlotHamiltonianField ScaleFactor MaxArrowLength PlotPolyaField ScaleFunction PlotGradientField PlotVectorField :[font = input; noPageBreak; preserveAspect; startGroup] Needs["Graphics`PlotField3D`"] ?Graphics`PlotField3D`* :[font = info; inactive; preserveAspect; endGroup; endGroup] ListPlotVectorField3D PlotVectorField3D ScaleFunction MaxArrowLength ScaleFactor VectorHeads PlotGradientField3D :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Initialization: (Don't read this; just execute it) (Click on the outer bracket--far right--and hit the ENTER key. :[font = input; noPageBreak; preserveAspect] Unprotect[{VectorPlot,VectorPlot3D,VectorLength}]; :[font = input; noPageBreak; preserveAspect] VectorPlot[list__List?VectorQ]:= VectorPlot[{list}]; VectorPlot[list_List?MatrixQ]:= Module[{length,totList}, length=Length[list]; totList=Table[{{0,0},list[[i]]} ,{i,1,length}]; Return[ Show[Graphics[{Thickness[0.015],Line /@ totList } ,{GridLines->Automatic ,Axes->True ,AspectRatio->1}]] ] ]; :[font = input; noPageBreak; preserveAspect] VectorPlot3D[list__List?VectorQ]:= VectorPlot3D[{list}]; VectorPlot3D[list_List?MatrixQ]:= Module[{length,totList}, length=Length[list]; totList=Table[{{0,0,0},list[[i]]} ,{i,1,length}]; Return[ Show[Graphics3D[{Thickness[0.015],Line /@ totList} ,{ FaceGrids->{{0,0,-1},{0,1,0},{-1,0,0}} ,BoxRatios->{1,1,1} ,Axes->True}]] ] ]; :[font = input; noPageBreak; preserveAspect] VectorLength[vector_List?VectorQ]:=Sqrt[vector.vector] :[font = input; noPageBreak; preserveAspect; endGroup] Protect[{VectorPlot,VectorPlot3D,VectorLength}]; :[font = section; inactive; noPageBreak; preserveAspect; startGroup] 2-D Example: :[font = input; noPageBreak; preserveAspect; startGroup] v1={1,0} //Normalize v2={1,1} //Normalize v3={0,1} //Normalize VectorPlot[v1,v2,v3]; :[font = output; output; inactive; noPageBreak; preserveAspect; startGroup] {1, 0} ;[o] {1, 0} :[font = output; output; inactive; noPageBreak; preserveAspect] {2^(-1/2), 2^(-1/2)} ;[o] 1 1 {-------, -------} Sqrt[2] Sqrt[2] :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup; endGroup] {0, 1} ;[o] {0, 1} :[font = input; noPageBreak; preserveAspect; startGroup] VectorLength /@ {v1,v2,v3,{1,1}} :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup] {1, 1, 1, 2^(1/2)} ;[o] {1, 1, 1, Sqrt[2]} :[font = input; noPageBreak; preserveAspect; startGroup] ArcCos[v1.v2] :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup] ArcCos[2^(-1/2)] ;[o] 1 ArcCos[-------] Sqrt[2] :[font = input; noPageBreak; preserveAspect; startGroup] ArcCos[v1.v2] /Degree //N :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup; endGroup] 45.00000000000001 ;[o] 45. :[font = section; inactive; noPageBreak; preserveAspect; startGroup] 3-D Example: :[font = input; noPageBreak; preserveAspect; startGroup] v1={1,0,0} //Normalize v2={1,1,0} //Normalize v3={0,1,0} //Normalize VectorPlot3D[v1,v2,v3]; :[font = output; output; inactive; noPageBreak; preserveAspect; startGroup] {1, 0, 0} ;[o] {1, 0, 0} :[font = output; output; inactive; noPageBreak; preserveAspect] {2^(-1/2), 2^(-1/2), 0} ;[o] 1 1 {-------, -------, 0} Sqrt[2] Sqrt[2] :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup; endGroup] {0, 1, 0} ;[o] {0, 1, 0} :[font = input; noPageBreak; preserveAspect; startGroup] VectorLength /@ {v1,v2,v3,{1,1,1}} :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup] {1, 1, 1, 3^(1/2)} ;[o] {1, 1, 1, Sqrt[3]} :[font = input; noPageBreak; preserveAspect; startGroup] CrossProduct[v1,v2] //Normalize :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup] {0, 0, 1} ;[o] {0, 0, 1} :[font = input; noPageBreak; preserveAspect] VectorPlot3D[v1,v2,CrossProduct[v1,v2]]; :[font = input; noPageBreak; preserveAspect; startGroup] {CrossProduct[v1,v2].v1,CrossProduct[v1,v2].v2} :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup] {0, 0} ;[o] {0, 0} :[font = input; noPageBreak; preserveAspect; startGroup] vx={1,0,0}; vy={0,1,0}; vz={0,0,1}; VectorPlot3D[vx,vy,vz]; {CrossProduct[vx,vy].vz,CrossProduct[vz,vy].vx} :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup; endGroup] {1, -1} ;[o] {1, -1} :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Gradient: :[font = input; noPageBreak; preserveAspect] ?Grad :[font = input; noPageBreak; preserveAspect] Plot3D[x^2+y^2+z^2 /.{z->0} ,{x,0,1} ,{y,0,1} ,BoxRatios->{1,1,1} ]; :[font = input; noPageBreak; preserveAspect] ContourPlot[- (x^2+y^2+z^2) /.{z->0} //Evaluate ,{x,0,1} ,{y,0,1} ]; :[font = input; noPageBreak; preserveAspect; startGroup] Grad[x^2+y^2+z^2] :[font = output; output; inactive; noPageBreak; preserveAspect; endGroup] {2*x, 2*y, 2*z} ;[o] {2 x, 2 y, 2 z} :[font = input; noPageBreak; preserveAspect] PlotGradientField[x^2+y^2+z^2 /.{z->0} //Evaluate ,{x,0,1} ,{y,0,1} ,VectorHeads->True ,PlotPoints->4 ,Axes->True ]; :[font = input; noPageBreak; preserveAspect; endGroup] PlotGradientField3D[x^2+y^2+z^2 ,{x,0,1} ,{y,0,1} ,{z,0,1} ,VectorHeads->True ,PlotPoints->4 ,Axes->True ]; :[font = section; inactive; noPageBreak; preserveAspect] Div: :[font = section; inactive; noPageBreak; preserveAspect] Curl: :[font = section; inactive; noPageBreak; preserveAspect] Multiple Operations: :[font = section; inactive; noPageBreak; preserveAspect] Grad[x^2+y^2+z^2] :[font = section; inactive; noPageBreak; preserveAspect] Div[{x,0,0}] :[font = section; inactive; noPageBreak; preserveAspect] Curl[{y,-x,0}] :[font = section; inactive; noPageBreak; preserveAspect; startGroup] Dirac Delta: :[font = input; noPageBreak; preserveAspect] f[1]= n/Sqrt[Pi] Exp[-n^2 x^2]; f[2]=n/Sqrt[Pi] 1/(1+n^2 x^2); f[3]=Sin[n x]/(Pi x); :[font = input; noPageBreak; preserveAspect; endGroup] Do[ Print["================================"]; ftemp=f[i]; Print["f[",i,"] = ",ftemp]; Plot[ Table[ ftemp ,{n,2,10,2}] //Evaluate ,{x,-1,1} ,PlotRange->All]; iftemp= Integrate[ftemp,x]; Print["int-f[",i,"] = ",iftemp]; Plot[ Table[ iftemp ,{n,2,10,2}] //Evaluate ,{x,-1,1} ,PlotRange->All]; ,{i,1,3}] ^*)