Assignment NP 2.01: A Matlab Example in Electrostatics

Graphics and description

     I began my matlab experience by prerusing through the "Getting 
Started with Matlab" handout using the computer.  Next I followed 
Professor Lockhart's writeup.  The writeup guided me through a problem of 
two point charges. - Find the potential and the electric field and then 
graph the results in various ways.  I then placed the commands into a file 
called matlabex.m for which I could modify at the slightest whim and then 
rerun the program to see the results of the changes.  Through the 
combination of using the help command (similar to the man command in 
UNIX), and the trying out modifications in my program I learned my 
interesting things.  

     Diverging for a moment, I will compare the Lockhart program results 
using Matlab and the Dancing Gaussian from Mathematica.  Both Mathematica 
and Matlab have good and bad points.  Which one that you use depends upon 
what you are doing.  Mathematica can easily do computation of functions 
but Matlab is more user friendly in the area of adding finishing touches 
to a graph and looking at it from different view points.  Anyways, each 
program requires a different technique towards the common goal of finding 
the best resulution of the spike of a given function.

     Returning the to the topic at hand, I decided upon the mesh graph 
style to use for this next part.  Here I increased the resolution of the 
potential function by increasing the x and y arrays used in creating the 
meshgrid from 0.1 to 0.014.  This seemed to yield the best visual results. 
To view the graph refer to graph1.  I wanted a 
better view and thus rotationed it from the default position of:  
azmuthal angle = -37.5 and elevation = 30 to 30 and 0 (a side view).  To 
view the graph refer to graph2.  Wow!  Notice 
that the first graph shows the potential plane with a spike at the 
positive charge and a dot due to the negative charge.  The second graph 
(due to rotation) reveals not only a spike due to the positive change 
but one can clearly see that there's a spike in the opposite direction 
from the plane due to the negative charge.  The color changes also add 
to an easier interpretation of the results.

     I also went through the above process for the gradient of the 
potential.  The graph is labeled the electric field but it's actually 
the negative of the electric field to be more precise.  If you are 
interested the first graph, graph3, is the 
graph using the default settings.  Again, notice the spiking of the 
electric field at the charge points. The last graph,  
 graph4, reveals not only a spike similar to 
the potential but an added "bump" on each.  Something that I noticed in 
both the graph of the potential and the electric field, one spike is 
"longer" than the other.  Off hand that seems incorrect - a glich in the 
program.  If I have more time before this is due, I'll put some thought 
into it.  There must be more to it.