How to Create a 3D Plot of Electric Potential for Electromagnetism Homework?

In summary, a student is struggling with plotting 3D plots of electric potential for examples in their electromagnetism course. They have tried using Microsoft Mathematics, Scilab, and Python, but have encountered difficulties. One person suggests using MATLAB, but there are concerns about handling the summation to infinity. The student is open to other suggestions and is seeking a "magical solution" to their problem.
  • #1
jplcarpio
7
0
Hi all, I apologize in advance if this isn't the right forum to put my question.


Homework Statement


In our electromagnetism course, we were asked to give the 3D plots of the electric potential V(x/y) for the examples on our book. (We're currently using Introduction to Electrodynamics (3rd Ed.) by Griffiths.) Unfortunately, I have no background in programming though our professor assumes that all of us do. :(


Homework Equations


There were three examples:

[PLAIN]http://img820.imageshack.us/img820/9798/tograph1.jpg
[PLAIN]http://img688.imageshack.us/img688/2117/tograph2.jpg
[PLAIN]http://img694.imageshack.us/img694/1479/tograph3.jpg


The Attempt at a Solution


I've gotten a copy of Microsoft Mathematics, Scilab and Python. When I tried it on Mathematics, the program stated that the equation was too complex. As for Scilab and Python, I'm still trying to cram how-to's.

Are there other programs I can use? Or are there newbie-friendly how-to's for Scilab and Python that cover 3D plots for the three equations?

I'm already a bit desperate, I'm a few steps short of just having a friend plot it for me. :(
 
Last edited by a moderator:
Physics news on Phys.org
  • #2
hmmm, I'm not sure how to do those with the summation to infinity, but if there were non of those summations, then it would be really easy with MATLAB (I assume scilab is a free alternative of MATLAB so they should function similarly)

in matlab, for example, the first term of your first example, plotting the potential I would do the following:

n = 1;
V0 = 1; a = 1; % or whatever your V0 or a are supposed to be
x = -1:0.01:1; %this specifies x from -1 to +1 in 0.01 step size
y = -1:0.01:1; %this specifies y from -1 to +1 in 0.01 step size
[xx, yy] = meshgrid(x,y);
V = 4*V0/pi*1/n*exp(-n*pi*xx/a).*sin(n*pi*yy/a);
surf(x,y,V)that will plot the case for n=1, as for n=3, n=5 etc, I'm not sure how that will work. You can do them each manually, obtaining V1, V3, V5 for n=1, n=3, n=5 respectively and add them all up, but since the summation continues until n = +inf, this probably isn't the approach...
 
  • #3
wukunlin said:
hmmm, I'm not sure how to do those with the summation to infinity, but if there were non of those summations, then it would be really easy with MATLAB (I assume scilab is a free alternative of MATLAB so they should function similarly)

in matlab, for example, the first term of your first example, plotting the potential I would do the following:

n = 1;
V0 = 1; a = 1; % or whatever your V0 or a are supposed to be
x = -1:0.01:1; %this specifies x from -1 to +1 in 0.01 step size
y = -1:0.01:1; %this specifies y from -1 to +1 in 0.01 step size
[xx, yy] = meshgrid(x,y);
V = 4*V0/pi*1/n*exp(-n*pi*xx/a).*sin(n*pi*yy/a);
surf(x,y,V)


that will plot the case for n=1, as for n=3, n=5 etc, I'm not sure how that will work. You can do them each manually, obtaining V1, V3, V5 for n=1, n=3, n=5 respectively and add them all up, but since the summation continues until n = +inf, this probably isn't the approach...


One of my friends suggested something like this, however I need n= +inf. :( I tried plotting the first equation in MS Math, and it just gave me a horizontal plane which I doubt is the answer.

I'll still try out your suggestion, perhaps I can improvise a way. (But if someone out there has the magical solution, I'm wide open for suggestions. :D ) Thanks! :)
 

FAQ: How to Create a 3D Plot of Electric Potential for Electromagnetism Homework?

What is a 3D plot of electrical potential?

A 3D plot of electrical potential is a graphical representation of the distribution of electrical potential in a three-dimensional space. It shows how the electrical potential varies at different points in a given region.

How is a 3D plot of electrical potential created?

A 3D plot of electrical potential is created by using mathematical equations to calculate the electrical potential at different points in the region and then plotting these values on a three-dimensional graph.

What information can be obtained from a 3D plot of electrical potential?

A 3D plot of electrical potential can provide information about the strength and direction of the electric field in the region, as well as the location of any regions with high or low potential.

What factors can affect the shape of a 3D plot of electrical potential?

The shape of a 3D plot of electrical potential can be affected by the distribution of charges in the region, the geometry of the objects in the region, and the presence of any conductors or insulators.

How is a 3D plot of electrical potential used in scientific research?

A 3D plot of electrical potential is commonly used in scientific research to study the behavior of electric fields and to analyze the properties of different materials in relation to electric potential. It can also be used to design and optimize electrical systems and devices.

Back
Top