An excellent additional source about electromagnetism can be found here.
History
The discovery of the relationship between magnetism and electricity was, like so many other scientific discoveries, stumbled upon almost by accident. The Danish physicist Hans Christian Oersted was lecturing one day in 1820 on the possibility of electricity and magnetism being related to one another, and in the process demonstrated it conclusively by experiment in front of his whole class. By passing an electric current through a metal wire suspended above a magnetic compass, Oersted was able to produce a definite motion of the compass needle in response to the current. What began as a guess at the start of the class session was confirmed as fact at the end. Needless to say, Oersted had to revise his lecture notes for future classes. His discovery paved the way for a whole new branch of science - electromagnetism.
The Magnetic Field of a Current Carrying Wire
A magnetic field surrounds a wire that is carrying a current.
From the diagram above, you are introduced to the first of several right-hand rules. You will need to memorize these rules to help you determine some things about electromagnetism. The rule above allows you to determine the direction of the magnetic field, B, about a current carrying wire.
Since 3-D diagrams are not always easy to draw, another way to visualize the magnetic field direction is shown below.
When we are drawing directions of magnetic fields and currents, we use the symbol and . The symbol for an arrow that is coming out of the page and the symbol for an arrow that is going into the page. It is easy to remember the meanings of the symbols if you think of an arrow with a head and a tail.
When the arrow is coming out of the page, you see the head of the arrow . When the arrow is going into the page, you see the tail of the arrow .
From the diagrams above, you can see that as the direction of the current changes, the magneitc field strength reverses. You can witness this with a compass, or by placing two current carrying wires next to each other. As the current changes direction, the wires can be made to repel or attract with their magnetic properties.
The Force on a Wire
If the straight wire is placed within the field of a permanent magnet, then the wire's magnetic field will interact with the field of the permanent magnet and a force will act upon the wire.
Notice that in the diagram, that the current in the wire, the field of the permanent magnet, and the force on the wire are all perpendicular to each other. For a force to exist, the current must flow perpendicular to the magnetic field.
The right hand rule shown below will allow you to quickly find force, curent, or field if given two of the three.
Example - May the force be with you
Example - Go with the flow
calculating magnetic force on a wire
The magnitude of the force on the wire depends upon several factors:
These three factors are put together to give us our first firmula - the formula for the force on a current carrying wire in a magnetic field.
F = I×l×B
Example - How long?
The Solenoid
If the objective is to create a strong magnetic force, then leaving your wire straight is out of the question. For forces capable of lifting everyday objects, the wire would need to be 10's if not hundreds of meters long.
So the wire is wrapped in loops.
A loop of wire with a current running through it is known as a solenoid. The magnetic field pattern produced by a solenoid is exactly like produced by a bar magnet. The first diagram below shows the magnetic field pattern of a single loop of wire, while the second that of an extended coil - a solenoid.
A bar magnet has a well-defined north and south pole. So does a solenoid. A third right-hand rule is used to identify the north pole of a solenoid. Your fingers curl in the direction of the current, and your thumb points towards the north pole of the solenoid.
Example - Push or pull?