Legal Notice, Disclaimer, and Book Ordering Information:

(* Legal Notice, Disclaimer, and Book Ordering Information:

Last Modified: FIO January 1, 1995

Mathematica For Physics
Robert L. Zimmerman and Fredrick I. Olness
MathSource Number: 0206-862 

ISBN 0-201-53796-6
For ordering information, call 1-800-822-6339
Addison-Wesley Publishing Company

Communication with the authors:
Fredrick I. Olness:  olness@mail.physics.smu.edu
Robert L. Zimmerman: bob@zim.uoregon.edu

Copyright 1995, Addison-Wesley Publishing Company, Inc. The material in
this file may be distributed freely  so long as the content remains
unchanged, and the copyright and  reference notices are included. The
publisher grants permission for the noncommercial use of these programs
and program segments.  All other uses require the prior written consent
of the publisher.    

All rights are reserved with regard to the  material in the
"Mathematica For Physics" text, and may not be reproduced, stored in a
retrieval system, or transmitted,  in any form or by any means,
electronic, mechanical, photocopying,  recording, or otherwise, without
the prior written permission  of the publisher. 

The programs and applications presented in this book have been included
for  their instructional value. They have been tested with care but are
not  guaranteed for any particular purpose. The publisher does not
offer any  warranties or representations, nor does it accept any
liabilities with  respect to the programs or applications. 

 *)

Chapter 5, Section 1, Problem 1:   
Superposition of Point Charges

<<mainDir:subDir:ch5init.m  (* Mac  Version *)

<<mainDir/subDir/ch5init.m  (* Unix Version *)

Solution

Clear["Global`*"];

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

triangle=( Monopole[+2q, {   0,0,   0} ]+
           Monopole[ -q, {+d/2,0,-d/2} ]+
           Monopole[ -q, {-d/2,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} ]);

VEPlot[quad //.{q->1, d->1, y->0},{x,-1,1.1},{z,-1,1.1}];

VEPlot[triangle /.{q->1, d->1, y->0, z->y}];

VEPlot[square /.{q->1, d->1, y->0, z->y}];

seriesQ= quad //PotentialExpansion

seriesQ //TrigToP //Simplify

seriesS= square //PotentialExpansion

seriesS //TrigToY //Simplify

seriesT= triangle //PotentialExpansion //Simplify

p1=PlotGradientField3D[
   quad//.{q->1, d->1} //Evaluate
   ,{x,-1,1.1},{y,-1,1.1},{z,-1,1.1}
   ,Graphics`PlotField3D`ScaleFunction -> (1 & )
   ,VectorHeads->True
   ,PlotPoints->4
];

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