5. Lagrangians and Hamiltonians

Legal Notice, Disclaimer, and Book Ordering Information:

Null

Setup

\(Clear["Global`*"]; 
Off[General::spell]; 
Off[General::spell1]; 
    \)

Needs["Calculus`VectorAnalysis`"]

Needs["Graphics`PlotField`"]

Needs["Graphics`PlotField3D`"]

<< "D:\Mma\Inits\ch5init.m"

Clear["Global`*"];

5.2 Problems

5.2.1  Point Charges, Multipoles, and Image Problems

Problem 1:  Superposition of Point Charges

Consider the following charge distributions: (1) a linear quadrupole, (2) a square quadrupole, and (3) three charges {-q,-q,+2q) located at the vertices of a triangle.

Part (a)   Compute the potential fields for these charge distributions.

quad=(Monopole[2q,{0,0,   0}]
    + Monopole[-q,{0,0, d/2}]
    + Monopole[-q,{0,0,-d/2}])

square=(Monopole[+q,{+d/2,0,+d/2}]
      + Monopole[-q,{+d/2,0,-d/2}]
      + Monopole[+q,{-d/2,0,-d/2}]
      + Monopole[-q,{-d/2,0,+d/2}])

triangle=(Monopole[2q,{   0,0,   0}]
        + Monopole[-q,{+d/2,0,-d/2}]
        + Monopole[-q,{-d/2,0,-d/2}])

Part (b)   Graph the equipotentials and field lines in two dimensions.

val1={q->1,d->1,y->0};

VEPlot[quad//.val1,{x,-1,1.1},{z,-1,1}
,ColorFunction->Hue];

VEPlot[triangle//.val1,{x,-1,1.1},{z,-1,1}];

VEPlot[square//.val1,{x,-1,1.1},{z,-1,1}];

Part (c)   find the potential to lowest order in the expansion of 1/r..

seriesQ=quad//PotentialExpansion

seriesQ//TrigToP//Simplify

??TrigToP

seriesS=square//PotentialExpansion

??TrigToY

seriesS//TrigToY

seriesT=triangle//PotentialExpansion

Part (d)   Make a three-dimensional plot of the electric field for the linear quadrupole distribution.

val2={q->1,d->1};

p1 = PlotGradientField3D[
quad//.val2//Evaluate
,{x,-1,1.1},{y,-1,1.1},{z,-1,1.1}
,Graphics`Common`GraphicsCommon`ScaleFunction->(1&)
,VectorHeads->True
,PlotPoints->6
,ColorFunction->Hue];

Show[p1,ViewPoint->{0,-4,0}];

Show[p1,ViewPoint->{0,0,-4}];