### Author Topic: Electric field structure and Field lines for two point charges +/-  (Read 34983 times)

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Electric field structure and Field lines for two point charges +/-
« on: October 02, 2007, 12:53:48 am »
You can drag either charge and find out the new electric distribution.
-*-

The field line are calculated in real time. However, please remember field line is not the same as trajectory for a test charge move in the same field.
You can add test charge if the check box were checked and watch the trajectory of test charge.

It is easy to draw those vectors which represent electric field at different positions.
Because we can calculate the electric field with \$vec{E}=frac{kq_1}{r_1^2}hat{r_1}+ frac{kq_2}{r_2^2}hat{r_2}\$.
However, do you know how those field lines were calculated?

Hint: The tangential components of electric field line is the same as the firection of electric field at the same point.

Full screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
• Please feel free to post your ideas about how to use the simulation for better teaching and learning.
• Post questions to be asked to help students to think, to explore.
• Upload worksheets as attached files to share with more users.
Let's work together. We can help more users understand physics conceptually and enjoy the fun of learning physics!

#### lookang

• Hero Member
• Posts: 1772
• http://weelookang.blogspot.com
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #1 on: November 11, 2008, 04:26:02 pm »

#### KezzaH

• Newbie
• Posts: 1
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #2 on: June 02, 2009, 01:35:15 am »
It would be a great improvement if you could vary the charge on the particles in size and from positive to negative
Kind Regards
Kerry H

#### lookang

• Hero Member
• Posts: 1772
• http://weelookang.blogspot.com
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #3 on: June 02, 2009, 09:37:40 am »
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=736.0

Electric Field Applet PhysletsÂ®, Wolfgang Christian.

I do a add + and reposition the charges to create the effects of more than one.

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #4 on: June 02, 2009, 11:28:45 am »
It would be a great improvement if you could vary the charge on the particles in size and from positive to negative
Kind Regards
Kerry H

The applets has been updated with the options you want. I also added option for equal-potential contours.

#### lookang

• Hero Member
• Posts: 1772
• http://weelookang.blogspot.com
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #5 on: June 02, 2009, 06:27:47 pm »
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=736.0

Can make it almost like the physlets charge applet? I wish to study how to do it.

I don't think i can figure out this one, simply too advance for me to redo in Ejs.

May i request more comments line to help others like me understand and learn how to model it in Ejs. Thanks!

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #6 on: June 02, 2009, 08:37:27 pm »
Quote
Can make it almost like the physlets charge applet?
What other features you want to add to the above applet?

#### lookang

• Hero Member
• Posts: 1772
• http://weelookang.blogspot.com
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #7 on: September 30, 2010, 10:41:49 pm »
awesome!
the applet has been updated with physlet style function.
will look at it asap.

#### lookang

• Hero Member
• Posts: 1772
• http://weelookang.blogspot.com
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #8 on: October 05, 2010, 11:54:39 am »
i been looking at the codes
i have a question
i notice the test mass uses

evolution to move
dvxc/dt = -getF(-1,xc,yc,0)/m
dvyc/dt= -getF(-1,xc,yc,1)/m

where getF
double dx1,dy1,dx2,dy2,r12,r22,dx,dy,d,sign=-1;
public double getF (int i, double xi,double yi, int mode) {//return electric field
if(count>=n)return 0; // count >=n , do ntg
dx1=xi-x1; dy1=yi-y1;
dx2=xi-x2; dy2=yi-y2;
r12=dx1*dx1+dy1*dy1; r22=dx2*dx2+dy2*dy2;
if(i>-1){
// if( (x>xmax && (y-ymax)*(y-ymin)>0) || (x<xmin && (y-ymax)*(y-ymin)>0) || //(y>ymax && (x-xmax)*(x-xmin)>0) || (y<ymin && (x-xmax)*(x-xmin)>0) ||
if(xi>scale*xmax || yi>scale*ymax || xi<scale*xmin || yi<scale*ymin || r12<size22 || r22<size22) {
out=true;// if electric field line move outside the drawing region too far=> do not need to following the field line any more
count++;
return 0.;
}
}
if(i<np)sign=q1/Math.abs(q1); // question sign mean sign of q1 ?
else sign=q2/Math.abs(q2); // // question sign mean sign of q2 ?
dx=q1*dx1/(r12*Math.sqrt(r12))+q2*dx2/(r22*Math.sqrt(r22));
dy=q1*dy1/(r12*Math.sqrt(r12))+q2*dy2/(r22*Math.sqrt(r22));
d=Math.sqrt(dx*dx+dy*dy);
if(mode==0)return sign*dx/d; // question what does mode do?
else return sign*dy/d;
}

My thoughts:
i tested the codes in the applet, i change the
Q1 = + or -
Q2 = 0
and the test particles goes in the out of the view direction regardless of the signs of Q1.
it is a bug or i need to modify the codes more to reflect the sign of Q1 and Q2?

#### lookang

• Hero Member
• Posts: 1772
• http://weelookang.blogspot.com
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #9 on: October 06, 2010, 10:14:14 am »
i suspect the original codes for the motion of the test mass is incorrectly modeled.

assumption:
test charge by default is positive,

condition:
When both q1 and q2 are negative,

result:
the path of the test charge defy the electric field vectors direction.

request:
chance to update the codes to reflect the physics of force correctly on the motion of the test charge?

can you made it on a separate page say {Force} so that i can track the changes made. i been editing on the current version of your applet

My thoughts:
i been trying to categorize the codes into
{Field Lines} {Field Vectors} {Potential} for ease of open source sharing of codes!

thanks!

in case you are wondering, my source code is attached
« Last Edit: October 06, 2010, 10:22:29 am by lookang »

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #10 on: October 06, 2010, 05:48:47 pm »
Thank you for the bug report. I modified the code and it is updated.

#### lookang

• Hero Member
• Posts: 1772
• http://weelookang.blogspot.com
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #11 on: October 07, 2010, 06:13:44 pm »
fantastic!

thanks for update.

Can i request for another feature in your applet?
arrows at the mid of charges to edge of applet to be position at midpoint and the direction of arrow is at direction of field lines at the mid point?

the pedagogy reason is field lines are normally drawn with some indication of the direction.
chance to help

#### Fu-Kwun Hwang

• Hero Member
• Posts: 3062
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #12 on: October 07, 2010, 10:36:27 pm »
Right now the arrows are draw as 20x20 matrix.
Do you mean you want it to be draw as 21x21 matrix (Then the middle one is the the center of the drawingPanel)?

#### lookang

• Hero Member
• Posts: 1772
• http://weelookang.blogspot.com
##### Re: Electric field structure and Field lines for two point charges +/-
« Reply #13 on: October 09, 2010, 12:04:25 am »
the picture says it all.
i can't make sense of the variables controlling the field lines so cannot do it myself

when i can make sense of the codes, by observing the changes you made, i will learn more
thanks!
« Last Edit: October 09, 2010, 12:06:38 am by lookang »