This applet is a magnetostatics demonstration which displays the magnetic field in a number of situations. You can select from a number of fields and see how particles move in the field if it is treated as either a velocity field (where the particles move along the field lines) or an actual force field (where the particles move as if they were little magnets). This helps you visualize the field. You can also view the vector potential (A).

When you start the applet, you will see 500 particles moving in the field of a current line. By default the particles are treating the field as a velocity field, which means that the magnetic field vectors determine how fast the particles are moving and in what direction. In this case, the particles follow the field lines around the current line. Of course in real life, particles do not follow the field lines; magnetized particles will align themselves with the field lines and then move closer to the source of the field, whereas moving charged particles are accelerated in a direction perpendicular to the field (and their velocity).

The Field Selection popup will allow you to select a vector field. The choices are:

• current line: This is the field of an infinitely long line of current.
• current line double: This is two lines of current moving in the same direction.
• cur line double + ext: This is two lines of current moving in the same direction, plus a uniform external field.
• current line dipole: This is two lines of current moving in opposite directions.
• cur line dipole + ext: This is two lines of current moving in opposite directions, plus a uniform external field. (In fluid dynamics this field is called the Lamb dipole.)
• uniform field: A uniform magnetic field; the direction is adjustable by modifying the two angles theta and phi.
• moving charge: The field of a moving point charge.
• fast charge: The field of a point charge moving close to the speed of light. The ratio between the speed of the particle and the speed of light is adjustable.
• moving charge double: The field of two moving point charges.
• moving charge dipole: The field of two point charges moving in opposite directions.
• current loop: Current moving in a circular loop. This field is equivalent to that of a flat disc magnet; the north pole is at the top by default.
• loop pair: Current moving in two circular loops (or two flat disc magnets). The size of the loops and the separation are both adjustable. Also you can introduce a vertical offset between the two loops.
• loop pair opposing: Two circular loops with current moving in opposite directions. (Or two opposing flat disc magnets.)
• loop pair stacked: Current moving in two stacked circular loops. (Or two stacked disc magnets.)
• loop pair stacked, opp.: Two stacked circular loops with current moving in opposite directions. (Or two stacked disc magnets with their north poles pushed together.)
• concentric loops: Two concentric circular loops with the current moving in opposite directions. The field is the same as that of a flat ring magnet.
• solenoid: A coil of wire with current running through it. (In real life the coil would need to be attached to something in order to have current running through it, of course.) The diameter of the coil, the height, and the number of turns are adjustable. The field is the same as that of a magnetic rod (assuming a large number of turns).
• toroidal solenoid: A coil of wire wrapped around a torus (donut). Outside the torus, the field is fairly weak.
• horseshoe electromagnet: A coil of wire wrapped around half a torus.
• square loop: Current moving in a square.
• corner: Current rounding a corner.
• magnetic sphere: The field of a magnetized sphere, with the north pole at the top. This is similar to the earth's magnetic field, except upside down, because the earth's north pole (even the "magnetic north" as opposed to the geographic north) is actually its magnetic south pole. See this page and this page.
• monopole attempt: This is a simulation of what would happen if you tried to make a magnetic monopole (a magnet with only a north pole and no south pole) by taking a bunch of square magnets and forcing them into a cube with their south poles in the center. Instead of getting a monopole, you would find that the gaps between the magnets would act as south poles, and the field there would be much stronger than on the faces of the magnets. If you could force them together perfectly with no gaps, there would be no field at all anywhere because all the currents would cancel out. (This field is so slow to compute that we display field vectors by default instead of particles.)

The Display popup will allow you to select how the field is displayed:

• Display: Particles (Vel.) means particles will move through the field, with the magnetic field vectors (B) determining their velocity. Note that the particles are only a educational device intended to show what the field looks like; in real life, particles would not move in this manner.
• Display: Particles (A Field, Vel.) means particles will move, with the vector potential (A) determining their velocity.
• Display: Field Vectors shows you the field vectors at an array of locations.
• Display: Field Vectors (A) shows you the vector potential at an array of locations.
• Display: Field Lines shows you the field lines. The Line Density slider controls how many lines to draw. The color indicates the field strength.
• Display: Parts (Magnetic) means that magnetized particles (little current loops) will move through the field in a realistic fashion. Particles are displayed as little arrows; their north pole is at the head of the arrow and the south pole is at the tail. (So, the arrow represents the magnetic moment vector.) They align themselves with the field lines and then move closer to the source of the field. In the case of a uniform field; they don't move; they just align themselves with it. A fair amount of damping is used so that the particles don't oscillate very much if they are out of alignment with the field.
• Display: Mag View Film simulates the behavior of magnetic viewing film. This requires slicing to be on.

The Mouse popup controls what happens when you click on the box. If you set it to Adjust Angle or Adjust Zoom, you can adjust the orientation or size of the 3-d view by clicking and dragging on the box.

The Slice popup allows you to look at planar slices of the box rather than looking at the contents of the entire box. If the popup is set to No Slicing, you view the entire box. Otherwise you will see the box sliced in one of three directions. The location of the slice can be adjusted by dragging the line running along the sides of box near the slice.

The Stopped checkbox will stop the particles.

The Reverse checkbox will reverse the direction of all the field vectors.

The Reset button can be used to reset the positions of all the particles to random values.

The Field Strength slider makes the field stronger or weaker, and also adjusts the brightness of the field vectors if you have Display: Field Vectors selected.

The Vector Density slider controls the number of vectors present if you have Display: Field Vectors selected. It controls the resolution of the viewing paper if you have Display: Mag View Film selected.

The Number of Particles slider allows you to reduce the number of particles, which can be useful if you want to watch the behavior of just a few of them. Also it might speed things up if you have fewer particles.

A few additional field-specific sliders may be present, depending on the field you have selected.