written by
Wolfgang Christian, Francisco Esquembre, and Anne Cox
The EJS Magnetic Bar Field Model shows the field of a bar magnet and has a movable compass that reports the magnetic field values. The bar magnet modelĀ is built by placing a group of magnetic dipoles along the bar magnet. You can modify this simulation if you have Ejs installed by right-clicking within the plot and selecting "Open Ejs Model" from the pop-up menu item.
The Magnetic Bar Field model was created using the Easy Java Simulations (Ejs) modeling tool. It is distributed as a ready-to-run (compiled) Java archive. Double clicking the ejs_em_MagneticBarField.jar file will run the program if Java is installed. Ejs is a part of the Open Source Physics Project and is designed to make it easier to access, modify, and generate computer models. Additional Ejs models are available. They can be found by searching ComPADRE for Open Source Physics, OSP, or Ejs.
Please note that this resource requires
at least version 1.5 of Java (JRE).
Magnetic Bar Field Model Source Code
Source Code for the Magnetic Bar Field Model program. The source code zip archive contains an XML representation of the model. Unzip this archive in your EJS workspace to compile and run this model using EJS. download 65kb .zip
Published: September 4, 2009
Rights: This material is released under the GNU General Public License Version 3.
previous versions
Metadata instance created September 3, 2009
by Anne Cox
Record Updated:
May 31, 2016
by wee lookang
Last Update when Cataloged:
September 3, 2009
what it the cause of this runtime error?
Author: lookang
Posted: April 18, 2010 at 6:17AM
when i move the compass very quickly, sometimes it is possible to get a runtime error. any idea how the error can be solved? I tried to fix it but can't figure out the cause, i increase the array to nx and ny to [21] but that didn't solve the runtime error. thanks!
Exception in thread "Thread-3" java.lang.ArrayIndexOutOfBoundsException: 20 at org.opensourcephysics.drawing2d.VectorField.prepareField(Unknown Source) at org.opensourcephysics.drawing2d.VectorField.draw(Unknown Source) at org.opensourcephysics.display.DrawingPanel.paintDrawableList(Unknown Source) at org.opensourcephysics.display.DrawingPanel.paintEverything(Unknown Source) at org.opensourcephysics.display.DrawingPanel.render(Unknown Source) at org.opensourcephysics.display.DrawingPanel.render(Unknown Source) at org.colos.ejs.library.control.swing.ControlDrawablesParent.finalUpdate(Unknown Source) at org.colos.ejs.library.control.EjsControl.finalUpdate(Unknown Source) at org.colos.ejs.library.Animation.update(Unknown Source) at org.colos.ejs.library.Animation.updateWhenIdle(Unknown Source) at org.colos.ejs.library.control.EjsControl.updateSimulationWhenIdle(Unknown Source) at org.colos.ejs.library.control.ControlElement.variablesChanged(Unknown Source)
deleted the rest due to character restriction of 2000
Author: lookang
Posted: September 25, 2009 at 10:59AM
1. a flip magnet simulation possibility 2. better color for the rombus <> blue and red instead of the current teal and red.
can use the version here http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1210.msg4760#msg4760
http://www.phy.ntnu.edu.tw/ntnujava/index.php?action=dlattach;topic=1210.0;attach=1368 i added some other features too. 2 added a slider to simulate "magnetic field strength = 10 to 100 percent" 3 fixed the randomization checkbox to work now by adding to randomPositionCheck Action setLocation () 4 fixed a bug on the markergroup and imagemagnet position not fixed to (xMagnet,yMagnet) 5 show magnetic field inside the magnet made.
W. Christian, F. Esquembre, and A. Cox, Computer Program MAGNETIC BAR FIELD MODEL, Version 1.0 (2009), WWW Document, (https://www.compadre.org/Repository/document/ServeFile.cfm?ID=9414&DocID=1309).
W. Christian, F. Esquembre, and A. Cox, Computer Program MAGNETIC BAR FIELD MODEL, Version 1.0 (2009), <https://www.compadre.org/Repository/document/ServeFile.cfm?ID=9414&DocID=1309>.
Christian, W., Esquembre, F., & Cox, A. (2009). Magnetic Bar Field Model (Version 1.0) [Computer software]. Retrieved December 9, 2024, from https://www.compadre.org/Repository/document/ServeFile.cfm?ID=9414&DocID=1309
Christian, W, F. Esquembre, and A. Cox. "Magnetic Bar Field Model." Version 1.0. https://www.compadre.org/Repository/document/ServeFile.cfm?ID=9414&DocID=1309 (accessed 9 December 2024).
Christian, Wolfgang, Francisco Esquembre, and Anne Cox. Magnetic Bar Field Model. Vers. 1.0. Computer software. 2009. Java (JRE) 1.5. 9 Dec. 2024 <https://www.compadre.org/Repository/document/ServeFile.cfm?ID=9414&DocID=1309>.
%A Wolfgang Christian %A Francisco Esquembre %A Anne Cox %T Magnetic Bar Field Model %D September 3, 2009 %U https://www.compadre.org/Repository/document/ServeFile.cfm?ID=9414&DocID=1309 %O 1.0 %O application/java
%0 Computer Program %A Christian, Wolfgang %A Esquembre, Francisco %A Cox, Anne %D September 3, 2009 %T Magnetic Bar Field Model %7 1.0 %8 September 3, 2009 %U https://www.compadre.org/Repository/document/ServeFile.cfm?ID=9414&DocID=1309
Disclaimer: ComPADRE offers citation styles as a guide only. We cannot offer interpretations about citations as this is an automated procedure. Please refer to the style manuals in the Citation Source Information area for clarifications.
1 change the image to png in an attempt to fix the appear disappear when drag from http://phet.colorado.edu/simulations/sims.php?sim=Faradays_Electromagnetic_Lab#topics didnt work though Angry 2 added a slider to simulate "magnetic flux density = 10 to 100 percent" 3 fixed the randomization checkbox to work now by adding to randomPositionCheck Action setLocation () 4 fixed a bug on the markergroup and imagemagnet position not fixed to (xMagnet,yMagnet) 5 show magnetic field inside the magnet made 6 enable option to allow translation of languages
things i want to do but can't figure out yet. a flip magnet simulation possibility better color for the rombus <> blue and red instead of the current teal and red.