NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
July 23, 2019, 08:43:08 pm

The most important medicine is tender love and care. ..."Mother Teresa(1910-1997, Roman Catholic Missionary, 1979 Nobel Peace Prize)"

 Pages: [1]   Go Down
 Author Topic: Ejs open source Magnetic Field due to moving charges & current java applet  (Read 19273 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message on: August 28, 2009, 02:15:40 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

Ejs open source Magnetic Field due to moving charges & current java applet
Magnetic field due to moving charges and electrical currents

This version here is slightly edited/remixed by lookang. Credits goes to the following people
Reference:
written by Wolfgang Christian and Fu-Kwun Hwang
technical implementer: Robert Mohr
The EJS Magnetic Field from Loops model computes the B-field created by an electric current through a straight wire, a closed loop, and a solenoid. Users can adjust the vertical position of the slice through the 3D field.

Rationale for remix:
was trying to remix into http://www.walter-fendt.de/ph14e/mfwire.htm for students to make sense and open source Ejs allows others to build and customize other works for their learning purposes.
To allow for students to
draw the pattern of the magnetic field due to currents in straight wires and in solenoids and state the effect on the magnetic field of changing the magnitude and/or direction of the current

Embed a running copy of this simulation

Embed a running copy link(show simulation in a popuped window)
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!
 magneticfield.PNG (75.57 KB, 1023x768 - viewed 700 times.) *** There are 1 more attached files. You need to login to acces it! « Last Edit: November 10, 2010, 11:16:23 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #1 on: August 28, 2009, 02:17:59 pm » posted from:SINGAPORE,SINGAPORE,SINGAPORE

1. added codes for step back icon button // actually this 2 codes has been created with ability to be added to any Ejs applet as default controls. Super cool!
if ( dt<0 ) {
_step();
}
else if ( dt>0) {
dt = - dt;
_step();
}
2. modify codes for forward step icon button // actually this 2 codes has been created with ability to be added to any Ejs applet as default controls. Super cool!
if ( dt>0 ) {
_step();
}
else if ( dt<0) {
dt = - dt;
_step();
}
3. reverse the orientation of the blue current arrow to reflect the true direction of current.
4. made the current arrows all GREEN for ease of association and clear distinction from the colors of the magnetic flux
5. added current slider I so that allow inquiry of current direction change, thanks to prof hwang codes here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=181.0
6. repositioned the start of the current vector to be on the wire
7. moved the slider z slice to be on the right for ease of association of intent of z slice
8. added text hints + and - of the polarity of the wires
Sept 10 2009
9. show pole label when solenoid is formed north and south with the current direction

TO DO
one day if i got the codes to do it.
add a 3D object of a hand to illustrate the Maxwell's Right Hand Grip Rule?

a 3D object of a hand gripping

show pole label when solenoid is formed?
 *** There are 2 more attached files. You need to login to acces it! « Last Edit: September 10, 2009, 05:11:27 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #2 on: September 04, 2009, 11:48:08 am » posted from:Singapore,,Singapore

Magnetic Field from Loops
The EJSMagnetic Field from Loops model computes the B-field created by an electric current through a straight wire, a closed loop, and a solenoid. The user can adjust the vertical position of the slice through the 3D field.
Watch the simulation as the field changes from the field around a long straight current-carrying wire to the field near a coil. Explain what happens to the field. Inside a coil of many loops, why is the field fairly uniform near the center (think about vector addition and what vectors would be adding together near the center).
There is an arrow on each end of the wire which represents current (green). Is your idea in agreement with the simulation? What would be the direction of the electrons in the wire?

The simulation also shows the magnetic flux. What is flux? Therefore, what do the different colors represent and why (i.e is pink higher flux than yellow or vice versa)? and what does "higher flux" mean in terms of the geometry and field strength?)?

Credits:
The Magnetic Field from Loops simulation was created by Fu-Kwun Hwang using the Easy Java Simulations (EJS) modeling tool and was adapted to EJS version 4.1 by Robert Mohr and Wolfgang Christian at Davidson College. Additional exercises written by Anne J. Cox. You can examine and modify the model for this simulation if you have Ejs installed by right-clicking within the simulation frame and selecting "Open Ejs Model" from the pop-up menu. Information about EJS is available at: and in the OSP ComPADRE collection
 « Last Edit: September 04, 2009, 01:03:56 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #3 on: September 18, 2010, 09:48:50 pm » posted from:Singapore,,Singapore

how to make java applet as visually stunning as this?

 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #4 on: September 18, 2010, 11:49:57 pm » posted from:,,Taiwan

Use Bio-Savart to calculate Bfield and draw magnetic field lines.
It will take time to calculate field lines.
Use save sa animated gif feature of EJS to save it.

The above movie is a nice animation.
Do you think you really learn something new by watching it?
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #5 on: September 19, 2010, 12:15:57 am » posted from:Singapore,,Singapore

Use Bio-Savart to calculate Bfield and draw magnetic field lines.
It will take time to calculate field lines.
Use save sa animated gif feature of EJS to save it.
Yes, Bio-Savart Law to draw magnetic field lines. ( i also ask wolfgang before during aaptsm10, same answer, use Bio-Savart)
i notice there are a few on the forum, but i still cannot remix it, cannot make sense of the code easily yet.
now i got to do research for my part time study (electricity and magnetism literature review) , it is taking all my time away from learning Ejs.
damn

The above movie is a nice animation.
agreed

Do you think you really learn something new by watching it?
actually it depends on whether the learner is thinking about it. i tend to agree, just looking at it does not help learning.

it is always my wish to see it in Ejs, but like what u and paco (some email on the http://www.compadre.org/osp/items/detail.cfm?ID=10327&S=2) said, the simulation will probably run slow as the animation is running pre-compiled frames and that is why the movie is a movie and not a java applet.
 « Last Edit: September 19, 2010, 12:19:16 am by lookang » Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3082

 « Embed this message Reply #6 on: September 19, 2010, 09:46:05 am » posted from:,,Taiwan

Following a lot of magnetic field lines will need a lot of calculation time.
Especially, those filed lines near the current source (need very small time step).

Another way is : calculate magnetic flux from one component of magnetic field (i.e. Bz) and draw contour.

If the number of field lines is reduced ,you might be able to run it in real time.
Otherwise, generating animated gif file will be easier.

I would not suggest you to reproduce it (why making a copy of the same animation),
unless the purpose is to learn how to create a similar one. i.e. learn how to generate magnetic field lines.
 Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #7 on: September 29, 2010, 07:31:03 pm »

strange error in Mac OSX 10.6.4 under Safari
will investigate

Java Plug-in 1.6.0_20
Using JRE version 1.6.0_20-b02-279-10M3065 Java HotSpot(TM) 64-Bit Server VM
User home directory = /Users/lookang

network: Done.
network: Done.
network: Done.
network: Proxy Configuration: No proxy
basic: Initializing applet…
basic: Starting applet…
basic: completed perf rollup
security: Blacklist revocation check is enabled
security: Trusted libraries list check is enabled
network: Cache entry found [url: http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticFieldFromLoops.jar, version: null] prevalidated=false/0
network: Connecting http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticFieldFromLoops.jar with proxy=DIRECT
network: Connecting socket://www.phy.ntnu.edu.tw:80 with proxy=DIRECT
network: ResponseCode for http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticFieldFromLoops.jar : 200
network: Encoding for http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticFieldFromLoops.jar : null
network: Disconnect connection to http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticFieldFromLoops.jar
network: Connecting http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticFieldFromLoops.jar with proxy=DIRECT
network: Connecting socket://www.phy.ntnu.edu.tw:80 with proxy=DIRECT
Content-Length: 1,190,065
Content-Encoding: null
network: Wrote URL http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticFieldFromLoops.jar to File /Users/lookang/Library/Caches/Java/cache/6.0/28/3a12655c-124b2186-temp
cache: Replacing MemoryCache entry (cnt=0) for http://www.phy.ntnu.edu.tw/ntnujava/ejsuser/14019/ejs_MagneticFieldFromLoops.jarwas=com.sun.deploy.cache.CacheEntry (1172733546) now=com.sun.deploy.cache.CacheEntry (527795456)
basic: Exception: java.lang.NullPointerException
Ignored exception: java.lang.NullPointerException
 « Last Edit: September 29, 2010, 07:45:10 pm by lookang » Logged
lookang
Moderator
Hero Member

Offline

Posts: 1792

http://weelookang.blogspot.com

 « Embed this message Reply #8 on: September 29, 2010, 07:43:38 pm »

strange, is working after recompiling in Ejs 4.2.7 under Windows 7  instead of Ejs 4.3.0 previously recognized
not to worry
 « Last Edit: September 29, 2010, 07:45:54 pm by lookang » Logged
 Pages: [1]   Go Up
The most important medicine is tender love and care. ..."Mother Teresa(1910-1997, Roman Catholic Missionary, 1979 Nobel Peace Prize)"