# NTNUJAVA Virtual Physics LaboratoryEnjoy 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 herehttp://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 negativeKind RegardsKerry 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.0Electric 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 Quote from: KezzaH on June 02, 2009, 12:35:15 amIt would be a great improvement if you could vary the charge on the particles in size and from positive to negativeKind RegardsKerry HThe 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 Quote from: lookang on June 02, 2009, 08:37:40 amhttp://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=736.0Can 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 QuoteCan 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 codesi have a questioni notice the test mass usesevolution to movedvxc/dt = -getF(-1,xc,yc,0)/mdvyc/dt= -getF(-1,xc,yc,1)/mwhere 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) || (x0) || //(y>ymax && (x-xmax)*(x-xmin)>0) || (y0) ||  if(xi>scale*xmax || yi>scale*ymax || xi do not need to following the field line any more   count++;    return 0.;  } } if(i