APS Excellence in Physics Education Award
November 2019

Education Prize Logo
Science SPORE Prize
November 2011

NSF Logo
The Open Source Physics Project is supported by NSF DUE-0442581.

Computer Program Detail Page

Item Picture
Magnetic Bar Field Model
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).
1 source code document is available
Subjects Levels Resource Types
Electricity & Magnetism
- Magnetic Fields and Forces
= Magnetic Fields
- Magnetic Materials
= Magnets
- Lower Undergraduate
- High School
- Instructional Material
= Activity
= Simulation
Intended Users Formats Ratings
- Learners
- Educators
- application/java
  • Currently 5.0/5

Rated 5.0 stars by 2 people

Want to rate this material?
Login here!


Access Rights:
Free access
License:
This material is released under a GNU General Public License Version 3 license. Additional information is available.
Rights Holder:
Wolfgang Christian
PACSs:
01.50.hv
07.05.Tp
Keywords:
Ejs, bar magnet, dipole, magnetic moment
Record Cloner:
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

» reply

can add new feature?

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.

for your consideration :)

» reply

Post a new comment on this item
ComPADRE is beta testing Citation Styles!

Record Link
AIP Format
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).
AJP/PRST-PER
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>.
APA Format
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
Chicago Format
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).
MLA Format
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>.
BibTeX Export Format
@misc{ Author = "Wolfgang Christian and Francisco Esquembre and Anne Cox", Title = {Magnetic Bar Field Model}, Month = {September}, Year = {2009} }
Refer Export Format

%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

EndNote Export Format

%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.

Citation Source Information

The AIP Style presented is based on information from the AIP Style Manual.

The APA Style presented is based on information from APA Style.org: Electronic References.

The Chicago Style presented is based on information from Examples of Chicago-Style Documentation.

The MLA Style presented is based on information from the MLA FAQ.

This resource is stored in 2 shared folders.

You must login to access shared folders.

Magnetic Bar Field Model:

Is Based On Easy Java Simulations Modeling and Authoring Tool

The Easy Java Simulations Modeling and Authoring Tool is needed to explore the computational model used in the Magnetic Bar Field Model.

relation by Anne Cox
Is the Basis For http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1210.msg4760#msg4760

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.

relation by wee lookang
Is the Basis For 2 Magnetic Bars Field JavaScript HTML5 Applet Simulation Model

a remixed version on JavaScript
added second magnet
add ability to rotate
enjoy!

relation by wee lookang

Know of another related resource? Login to relate this resource to it.
Save to my folders

Supplements

Contribute

Related Materials

Similar Materials

OSP Projects:
Open Source Physics - EJS Modeling
Tracker
Physlet Physics
Physlet Quantum Physics
STP Book