NTNUJAVA Virtual Physics Laboratory
Enjoy the fun of physics with simulations!
Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/

Easy Java Simulations (2001- ) => Electromagnetism => Topic started by: Fu-Kwun Hwang on October 01, 2007, 11:53:48 pm



Title: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on October 01, 2007, 11:53:48 pm
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.


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on November 11, 2008, 03:26:02 pm
there is a similar physics applet here
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=730.msg2703#msg2703
(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=730.0;attach=360;image)


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: KezzaH on June 02, 2009, 12: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


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on June 02, 2009, 08: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.


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on June 02, 2009, 10: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.
Thank you for your suggestion.


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on June 02, 2009, 05: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!


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on June 02, 2009, 07:37:27 pm
Quote
Can make it almost like the physlets charge applet?
What other features you want to add to the above applet?

I just added more comments to the code.


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on September 30, 2010, 09:41:49 pm
awesome!
the applet has been updated with physlet style function.
will look at it asap. :)


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on October 05, 2010, 10: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(add || out)return 0.;
//  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?


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on October 06, 2010, 09: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


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on October 06, 2010, 04:48:47 pm
Thank you for the bug report. I modified the code and it is updated.


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on October 07, 2010, 05: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 :)
 


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on October 07, 2010, 09: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)?


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on October 08, 2010, 11:04:25 pm
the picture says it all.
i can't make sense of the variables controlling the field lines so cannot do it myself
(http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=539.0;attach=3468;image)

when i can make sense of the codes, by observing the changes you made, i will learn more ;D
thanks!


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on October 08, 2010, 11:22:14 pm
I think I know what you want now. It has been updated!


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on October 09, 2010, 04:24:27 pm
i tried to download and see it
.
it didn't look updated.

did you check it? see my picture


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on October 09, 2010, 06:23:31 pm
I thought you were talking about the vector field. I changed it so that it re-present direction for the point at the center of of arrow  (instead of the starting point).

Now. I finally understand you want to add arrow for field lines.

It is updated!
 


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on October 09, 2010, 07:27:43 pm
the file invalid or corrupt ?
Download EJS jar file(376kB):

the file size is too small and the web do not deploy  ;D


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on October 09, 2010, 09:20:59 pm
Sorry! It is uploaded again.


Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: lookang on October 09, 2010, 10:09:00 pm
that is what i wanted!

the codes looks like different and amazingly difficult.
fx and fy
will study it soonest!
thanks!



Title: Re: Electric field structure and Field lines for two point charges +/-
Post by: Fu-Kwun Hwang on October 09, 2010, 10:37:18 pm
Because you asl for arrow for each field line, so fx,fy arrays are coordinnate where the arrow are drawn. fdx,fdy are vector for the arrow.
Code are added to find fx,fy, fdx and fdy.