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

Information about this web site => Request for physics Simulations => Topic started by: lookang on October 27, 2009, 11:24:22 pm



Title: Individual and Resultant Force Magnetic Field of a wire and external mag. field
Post by: lookang on October 27, 2009, 11:24:22 pm
Individual and Resultant Force Magnetic Field of a Current-Carrying Rectangular Coil in a External Magnetic Field.


I am wondering if i can use this http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1266msg4902;topicseen#msg4902

Or the original http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=912.0 also can?

to create a checkbox for (http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1273.0;attach=1426;image)

some beginning trainee teacher wanted a picture of magnetic field of a current carrying wire in a external magnetic field like the attached picture right side resultant diagram.

i don't seem to have seen it before as an applet here.
for ur consideration ;D


Title: Re: Individual and Resultant Force Magnetic Field of a wire and external mag. field
Post by: Fu-Kwun Hwang on October 28, 2009, 05:09:29 pm
Is it a Current-Carrying Rectangular Coil (3D model)or two parallel wire with current in opposite direction (2D model)?



Title: Re: Individual and Resultant Force Magnetic Field of a wire and external mag. fi
Post by: lookang on October 28, 2009, 06:16:25 pm
3d would be fantastic .



2d would be ok too :)


Title: Re: Individual and Resultant Force Magnetic Field of a wire and external mag. field
Post by: Fu-Kwun Hwang on October 28, 2009, 10:01:17 pm
Here is the field structure produced from two long wires.
It is shown in 2D (I am afraid it will be too complicated to display it in 3D -- too many arrows).

You can use mouse to drag both wires to change separation between wires.
If you click inside the region, field line pass throught that point will be traced out.


Title: Re: Individual and Resultant Force Magnetic Field of a wire and external mag. field
Post by: lookang on November 06, 2009, 02:29:26 pm
This is fantastic applet, it will add to your collection of good simulations for physics learners.

two questions,

1. how can i automatically plot the magnetic field lines?
for example, http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=740.0 (http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=740.0;attach=1065;image)


2.i changed the dt from 0.5 to 2 but it looks rougher (less accurate). how to make the drawing of magnetic field lines faster n still accurate?


i edited your applet and i notice a bug, changed it for u already. it is posted here and i think i will start a new post on it here http://www.phy.ntnu.edu.tw/ntnujava/index.php?board=28.0



Title: Re: Individual and Resultant Force Magnetic Field of a wire and external mag. field
Post by: lookang on December 09, 2009, 11:32:50 pm
Hi prof hwang,[noeqn]

did u notice that only one applet loads correctly on this forum page.

the second applet failed to load.

i noticed this happened also in other 2 applet pages
the error message is
Java Plug-in 1.6.0_17
Using JRE version 1.6.0_17-b04 Java HotSpot(TM) Client VM
User home directory = C:\Users\160
----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
o:   trigger logging
q:   hide console
r:   reload policy configuration
s:   dump system and deployment properties
t:   dump thread list
v:   dump thread stack
x:   clear classloader cache
0-5: set trace level to
----------------------------------------------------


Reading certificates from 11 http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticField2Wire.jar | C:\Users\160\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\20\f64d854-45cedbce.idx
Reading certificates from 11 http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/2/ejs_twowiresBfield.jar | C:\Users\160\AppData\LocalLow\Sun\Java\Deployment\cache\6.0\35\252779a3-55ac904d.idx
load: class users.sgeducation.lookang.MagneticField2Wire_pkg.MagneticField2WireApplet.class not found.
java.lang.ClassNotFoundException: users.sgeducation.lookang.MagneticField2Wire_pkg.MagneticField2WireApplet.class
   at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/users/sgeducation/lookang/MagneticField2Wire_pkg/MagneticField2WireApplet/class.class
   at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   ... 7 more
Exception: java.lang.ClassNotFoundException: users.sgeducation.lookang.MagneticField2Wire_pkg.MagneticField2WireApplet.class
load: class users.sgeducation.lookang.MagneticField2Wire_pkg.MagneticField2WireApplet.class not found.
java.lang.ClassNotFoundException: users.sgeducation.lookang.MagneticField2Wire_pkg.MagneticField2WireApplet.class
   at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
   at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: open HTTP connection failed:http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/users/sgeducation/lookang/MagneticField2Wire_pkg/MagneticField2WireApplet/class.class
   at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
   at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   ... 7 more
Exception: java.lang.ClassNotFoundException: users.sgeducation.lookang.MagneticField2Wire_pkg.MagneticField2WireApplet.class


Title: Re: Strange EJS jar file
Post by: Fu-Kwun Hwang on December 10, 2009, 05:21:20 pm
I downloaded you jar file,
and the class file is located at
users/sgeducation/lookang/ejs_MagneticField2Wire/MagneticField_pkg/MagneticField2Qire.class

However, the java was looking for users/sgeducation/lookang/MagneticField2Wire_pkg/MagneticField2WireApplet.class

You have one more level of structure. That is the reason why it was not working.

Please do not use the same filename as your folder name if you want to add one more level file structure.

Please MagneticField2Wire.xml to users/sgeducation/lookang/MagneticField2Wire.xml
, open it with EJS , rebuild it and upload it again.


Title: Re: Individual and Resultant Force Magnetic Field of a wire and external mag. field
Post by: lookang on December 10, 2009, 08:50:13 pm
please delete the early jar post as i cannot modify it.  not needed, it now also loads correctly, just let it be then. :D
thanks for your feedback

wait, it still cannot be viewed ;D
i already re complied it.
Please check. it works now! after re start firefox. thanks!


btw u realized the model bug in your applet?
your top post applet shows the field vector is for out of plane out of plane current. it is a small error which i already remodel accurately in my remixed of your applet. http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1290


Title: Re: Individual and Resultant Force Magnetic Field of a wire and external mag. field
Post by: Fu-Kwun Hwang on December 10, 2009, 10:42:37 pm
Thank you for point out the bug. It is fixed.  ;D