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

## Easy Java Simulations (2001- ) => Collaborative Community of EJS => Topic started by: lookang on September 10, 2012, 08:25:26 am

 Title: Ejs Open Source Bar Magnetic Field Lines Model Java Applet Post by: lookang on September 10, 2012, 08:25:26 am Ejs Open Source Bar Magnetic Field Lines Model Java Appletmade possible thanks to Michael Galis http://www.compadre.org/osp/bulletinboard/TDetails.cfm?ViewType=2&TID=2226&CID=51612&#PID51613and Wolfgang Christian http://www.compadre.org/osp/items/detail.cfm?ID=12361[ejsapplet]work in progress.My own naive idea is to use analyticCurve3D but i haven't seen any example on a family of analyticCurve3D, so each is drawn as a single analyticCurve3D.the match is close but not very accurate http://en.wikipedia.org/wiki/EllipseAn ellipse in general position can be expressed parametrically as the path of a point (X(t),Y(t)), whereMinimum = 0Maximum = 2*Math.PIVariable = "theta"X() = "1.4+1.4*Math.cos(theta)*Math.cos(0)-1.4*Math.sin(theta)*Math.sin(0)"z()= "0+0.5*Math.sin(theta)*Math.sin(0)-1*Math.sin(theta)*Math.cos(0)" Title: Re: Ejs Open Source Bar Magnetic Field Lines Model Java Applet Post by: lookang on December 13, 2012, 02:03:18 pm still cannot make the sim run without run-time errors.attached is the new sim with 2 sets of field lines Title: Re: Ejs Open Source Bar Magnetic Field Lines Model Java Applet Post by: Fu-Kwun Hwang on December 15, 2012, 09:29:21 pm You have learned how to draw electric field line from http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=539.0You can use the same method to draw magnetic field line.I tried to open ejs model from your jar file. However, I was not able to understand what you were doing in the model (evolution page: lambdax, lambday, lambdaz???) Title: Re: Ejs Open Source Bar Magnetic Field Lines Model Java Applet Post by: lookang on December 15, 2012, 09:47:11 pm Quote from: Fu-Kwun Hwang on December 15, 2012, 09:29:21 pmYou have learned how to draw electric field line from http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=539.0You can use the same method to draw magnetic field line.I tried to open ejs model from your jar file. However, I was not able to understand what you were doing in the model (evolution page: lambdax, lambday, lambdaz???)it is very difficult for me to implement it is 3D as i only have very limited knowledge, the codes you invented http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=539.0 are too advanced for me redesign in 3D.i can remix :) Quote from: Fu-Kwun Hwang on December 15, 2012, 09:29:21 pmI tried to open ejs model from your jar file. However, I was not able to understand what you were doing in the model (evolution page: lambdax, lambday, lambdaz???)according to prof mike gallis http://www.compadre.org/osp/bulletinboard/TDetails.cfm?ViewType=2&TID=2226&CID=51612&#PID51613For a parameterized path in space λ(t) tangent in space which "follows" a field E(r) the rate of change of the path (the "velocity" of the trajectory) is in the direction of the field. The first try:dλ(t)/dt = E(λ(t))this method works in principle, but in numerical approaches, the computed path λ(t) will have large step sizes where the field is strong, which is probably undesireable. I prefer:dλ(t)/dt = E(λ(t))/|E(λ(t))|which gives the path a "constant velocity".For a dipole field (from Jackson):E(r) = (3n(p⋅n)-p)/|r-r0|3r = field pointr0 = location of dipolep = dipole momentn = normal vector pointing from source to field point = (r-r0)/|r-r0|For the example coded here, the source is at the origin (r0 = 0) and the dipole is oriented along the z axis. With the coordinates of the field point given as x,y,z (and r= x2+y2+z2)1/2 ) the field components areEx=3xzp/r5Ey=3yzp/r5Ez=3z2p/r5 -p/r3 Title: Re: Ejs Open Source Bar Magnetic Field Lines Model Java Applet Post by: Fu-Kwun Hwang on December 17, 2012, 12:49:23 pm OK. I understand what you are trying to do now. I will try to check out your model and see what I can do to help!  Title: Re: Ejs Open Source Bar Magnetic Field Lines Model Java Applet Post by: Fu-Kwun Hwang on December 18, 2012, 08:53:43 pm The following is the version modified from your EJS model. Title: Re: Ejs Open Source Bar Magnetic Field Lines Model Java Applet Post by: lookang on December 19, 2012, 07:46:12 am Quote from: Fu-Kwun Hwang on December 18, 2012, 08:53:43 pmThe following is the version modified from your EJS model.ejsuser/2/ejs_fieldlines3Dwee03a3.jar not foundhi prof!need to upload again? Title: Re: Ejs Open Source Bar Magnetic Field Lines Model Java Applet Post by: Fu-Kwun Hwang on December 20, 2012, 06:55:06 pm Sorry! I should have checked it. It is OK now.