
O level Syllabus
draw the magnetic field pattern around a bar magnet and between the poles of two bar magnets
describe the plotting of magnetic field lines with a compass
Magnetic Bar Field Model
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. Users can examine and edit the model if Ejs is installed.
Exercises:
1. Run the simulation. Move the compass around in the magnetic field of the magnet. Move the magnet around. What is the relation between the compass and the field vector (small arrows)?
2. Test to see how well you can use the compass to determine the location of the magnet: Click on the Randomize position check box and then push the Hide Field button. Use the compass to show the direction of the magnetic field and then move the marker (same size as the magnet) to where you think the magnet is located. Click on Show Field to see if you were correct. If you were, describe your strategy. If you weren't, explain what went wrong and try again.
3. The model uses a group of magnetic dipoles to build a model of a bar magnet. If you have Ejs installed, examine the model and determine how many dipoles are stacked together (and in what configuration) to create a model of a bar magnet.
References:
* Giancoli, Physics for Scientists and Engineers, 4th edition, Chapter 27 (2008).
Credits:
The Magnetic Bar Field Model was created by Wolfgang Christian and Francisco Esquembre and modified by Anne J Cox using the Easy Java Simulations (EJS) authoring and modeling tool. Exercises written by Anne J Cox.
You can examine and modify a compiled EJS model if you run the program by double clicking on the model's jar file. Right-click within the running program and select "Open EJS Model" from the pop-up menu to copy the model's XML description into EJS. You must, of course, have EJS installed on your computer.
Information about EJS is available at:
and in the OSP ComPADRE collection
.
Learning Goals : Students will be able to
http://phet.colorado.edu/en/contributions/view/28261.Predict the direction of the magnet field for different locations around a bar magnet and electromagnet.
2.Compare and contrast bar magnets and electromagnets
3.Identify the characteristics of electromagnets that are variable and what effects each variable has on the magnetic field’s strength and direction.
4.Relate magnetic field strength to distance quantitatively and qualitatively
5.Compare and contrast the fields of gravity and magnets qualitatively
Remix:
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

2 added a slider to simulate "magnetic field strength = 10 to 100 percent" or should it be "magnetic flux density"? hmmm
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
14April 2010
7 added Bx., By, Angle to the compass measurement like
http://phet.colorado.edu/simulations/sims.php?sim=Faradays_Electromagnetic_Lab8 added thetadeg which shows the degree format
9 added codes to make the inside of the magnet Bx = 225 T, By = 0 T
10 modify the getBComputeField() to work for the Field only and the getB work for the compass
11 added MagneticFieldStrength B is affected by the slider by a factor of 0 to 1 by using vectorfieldmaxopposite can changing it the double solve the bug of displaying 0 or 225 cause by the integer type initially assigned by original authors
12 learn a new code from open source physics _view.format(getB(xCompass, yCompass)[1],"0.00")
fieldValueBx="B_{x}= "+_view.format(getB(xCompass, yCompass)[0],"0.00")+" T";
fieldValueBy="B_{y}= "+_view.format(getB(xCompass, yCompass)[1],"0.00")+" T";
fieldValueAngle="math_failure (math_unknown_error): \\theta
= "+_view.format(getB(xCompass, yCompass)[3],"0.00") + "radian";
angledeg= getB(xCompass, yCompass)[3]*180/Math.PI;
fieldValueAngledeg = "math_failure (math_unknown_error): \\theta
= "+ _view.format(angledeg,"0.0") + "math_failure (math_unknown_error): \\degree
";
16April 2010
13 rearrange the buttons at the bottom to be more grouped logically
14 added flip magnet from SN to NS orientation!!!! figure out how to change the B field as well as the Get B
15 added accompanying graphics to the new orientation by doing a rotation 180 deg
16 added picture of compass licensed by This file is licensed under the Creative Commons Attribution ShareAlike 3.0 by Sofia from
http://en.wikipedia.org/wiki/File:Kompas_Sofia.JPG 
resize it to only 4 kb
17 change the evolution equation to domega/dt = -k*getB(xCompass, yCompass)[2]*(Math.sin(deltaTheta))-damp*omega so that the motion of the compass depends on the B strength at the location of the xCompass, yCompass.
18 change damping factor of compass to damp instead of b which was confusing to the calculations of b[0]....b[3] in the custom function
19 varied the value of k from 1 to 0.2 to simulate real life behavior closer less spring force constant since B vary from 0 to 225 arbitrary set by lookang
20 varied damp from 0.2 to 1 to simulate real life behavior closer damping higher more critically damped
19April2010
22 better color for the rombus by making 2 triangles one red and one blue
23 change my mind the red n blue combo didnt look good, revert to red and teal
24 made the compass background semi transparent to allow students to place the compass and read off the reading of B
25 found this
http://phet.colorado.edu/simulations/sims.php?sim=Magnet_and_Compass 
to be excellent, well done to University of Colorado Design Team of # Michael Dubson # Chris Malley (developer) # Kathy Perkins # Carl Wieman * Interviewer: Danielle Harlow * Interviewer: Archie Paulson
Kudo!
26 added rotation to the bar magnet thanks to Hwang
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1582.0 thansk to transformation:


for all the coordinates (magnet, compass, field)
27 added code +cta to barmagnet to make drawing follow the rotation correctly
28 fixed a bug is the calculation of B field
double dx=x-(dipoles[i][0]*cs+dipoles[i][1]*sc)-(xMagnet*cs+yMagnet*sc);//FKH
double dy=y-(-dipoles[i][0]*sc +dipoles[i][1]*cs)-(-xMagnet*sc+yMagnet*cs);//FKH
[/s] by applying the transformation to the dipoles as well.
25April 2010
29 think double[] b = getB(xCompass*cs+yCompass*sc,-xCompass*sc+yCompass*cs); //FKH and fieldValue="B= "+_view.format(getB(xCompasstransform, yCompasstransform)[2],"0.00")+" T"; in fixed relationship fix the problem of 28
30 replaced x' y' of Bx By |B| theta' of the axes of magnet coordinate system with the new universal x y system
31 added codes to make the inside of magnet work again for any angle of rotation cta of the bar magnet
32 fixed the hide magnet to work with angle cta
33 setup the dipoles perfectly to achieve symmetry in reading of B.
// spacing done by lookang to achieve perfectly symmetry of B
// need nd =22 because from x =-0.5 to 0.5 put 11 each row
// 2 rows so nd = 11*2 =22
double dx=1.0/(nd-2); //set up dipoles under bar magnet
// dx = (0.5-(-0.5))/20 so that dx = 0.1
for(int i=0; i<=(nd-1); i+=2) {
dipoles[i][0]=-0.5+i*dx; // x position of first line of dipoles bottom
dipoles[i][1]=-.04; // y position move down by -0.04 of first line of dipoles bottom
dipoles[i+1][0]=-0.5+i*dx; // x position of 2nd line of dipoles top
dipoles[i+1][1]=0.04; // y position move up by +0.04 of top line of dipoles bottom
}
34 added earth
http://www.squarecirclez.com/blog/intmath-newsletter-earth-geometry-board-math-and-obama-math/1415 by using Gimp to alter the transparency of the google earth picture with reduce icon for the checkbox image
21 appears to have a runtime bug
http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=1576.0 if you move the compass like mad very quickly sometimes it cause a ArrayIndexOutOfBoundsException: 20 error.
Things i noted when i was at Fiesso D\'artico,Veneto,Italy Sept 24 2009 during my stay at Italy MPTL 14
International Workshop on
Multimedia in Physics Teaching and Learning 14th edition
23-25 September 2009
Rizzi Scientific Campus
University of Udine, Italy!!
http://www.fisica.uniud.it/URDF/mptl14/WEB_Booklet.pdfthings i want to do but can't figure out yet.
a flip magnet simulation possibility DONE!
better color for the rombus <> blue and red instead of the current teal and red.[/s]
DONE!