\section{Electric charge and current} \subsection{Electrostatics and electric charge} Electric charge is a property of matter. At the most basic level, the constituents of atoms are charged particles---electrons with negative charge ($-e$) and protons with positive charge ($+e$). An atom has equal numbers of electrons and protons so it is electrically neutral. However, a sample of matter becomes electrically charged if the balance between electrons and protons is broken. For example, when amber is rubbed with fur, electrons are transferred from the fur to the amber; the amber then has net negative charge. Like charges repel and unlike charges attract. That is, if two samples of matter have net positive charge (or both have net negative charge) they exert equal but opposite repulsive forces on one another. If the samples have unlike charges, one positive and the other negative, then each exerts an attractive force on the other. The strength $F$ of the electric force $\vec{F}$ was measured accurately by Charles Augustin de Coulomb.\footnote{% Vectors are indicated in bold face, scalars in plain face.} The force is proportional to the product of the charges, $q_1$ and $q_2$, and inversely proportional to the square of the distance of separation $r$, \[ F=\frac{kq_{1}q_{2}}{r^{2}}\qquad \mbox{where} \qquad k=8.99\times 10^9 \ \mbox{Nm$^{2}$/C$^{2}$}. \] This simple mathematical formula has been tested to extreme precision.\footnote{% The dimensional units for the constant $k$ are Nm$^{2}$/C$^{2}$, where N = newton = unit of force, m = meter = unit of length, and C = coulomb = unit of charge. The proton charge is $e=1.602\times 10^{-19}$\,C.} It forms part of the foundation for the theory of electromagnetism. \subsection{Magnetostatics and electric current} Everyone has observed magnets and their forces, which can be quite strong even in small magnets. Every magnet has polarity---north and south poles. Two magnets repel if their north poles approach one another, and repel if the south poles approach, but attract if north approaches south. Magnets have a special attraction to iron; if either pole is placed near an iron object, a magnetic force pulls the magnet and the object toward one another. Science has identified the origins of magnetic forces. Technologies based on magnetic forces are used every day throughout the world. Magnetism is very closely connected to the electric charge of subatomic particles. The most familiar example of a magnet is a ferromagnet---a piece of magnetized iron.\footnote{% Cobalt and nickel are also ferromagnetic elements but iron is the most common example.} However, a ferromagnet is not the only source of magnetism nor even the most basic. Electric currents also produce magnetic forces, and in some ways the magnetic field associated with electric current is the most basic form of magnetism.\footnote{% The term ``magnetic field'' used in this section refers to any magnetic effect. The more technical meaning of the term is explained in Sec.\,III.} \subsubsection{ Electric current as a source of magnetic field} An electric current is a stream of electrically charged particles (of one sign) moving in the same direction. The current may be constant in time (DC, or direct current), oscillating in time with a constant frequency (AC, or alternating current), or varying in time. Currents can exist in metals and in several other forms of conducting matter. In a metal, some electrons occupy states that extend over large distances, i.e., not bound to a single atomic core. If an electric force is applied then these conduction electrons will move in response, creating an electric current. (Ohm's law, $V=IR$ where $V=$ potential difference in volts, $I=$ current in amps, and $R=$ resistance in ohms, expresses quantitatively the relation between the electric force and the current.) In metals the positively charged atomic nuclei are fixed in a crystalline lattice, so the electric current is due to motion of electrons. The first observation of the magnetic field associated with an electric current was an accidental discovery by Hans Christian Oersted during a public lecture in 1819. The current existed in a metal wire connected across a battery. Oersted noticed that a nearby compass needle deflected while the current was flowing. The strength of the magnetic field at a distance of 1 centimeter from a 1 ampere current is $2\times 10^{-5}$\,tesla, comparable to the Earth's magnetic field of approximately $5\times 10^{-5}$\,tesla. Oersted's discovery was studied in detail by Jean Marie Amp\`{e}re. The magnetic field can be determined quantitatively by measuring the force on a pole of a magnet or the torque on a compass needle. A compass needle in equilibrium points in the direction of the field vector at the position of the compass. Therefore a compass can be used to map the field directions. Amp\`{e}re found that the field direction ``curls around'' the current. Figure \ref{fig:Bcurl} shows a segment of current-carrying wire and the associated magnetic field encircling the wire. \fbox{\bf Fig.\,1} The field directions follow the right-hand rule: With the thumb of your right hand pointing along the wire in the direction of the current, the fingers naturally curl in the direction of the magnetic field around the wire. The theory of the magnetic field created by an electric current is called Amp\`{e}re's law. \begin{figure}[p] \begin{center} \ing{./eps/Bcurl.eps} \end{center} \caption{The magnetic field $\vec{B}$ curls around the current $I$. The dashed curve indicates an imaginary circle around the wire segment. A compass needle placed near the wire will point in the direction of the field. \label{fig:Bcurl}} \end{figure} Electric currents can also exist in materials other than metals, such as plasmas and ionic solutions. The associated magnetic fields may be measured for scientific purposes. For example, the current in a neuron in the brain creates a magnetic field that is measured in magnetoencephalography. Or, a lightning strike (current in an ionized path through the atmosphere) creates a magnetic field that may be measured to study the properties of lightning. The magnetic field of the Earth is another natural example of a field produced by an electric current. The core of the Earth is highly metallic and at high temperature and pressure. Electric currents in this metal core create the Earth's magnetism, which we observe at the surface of the Earth. \paragraph{Electromagnets.} Amp\`{e}re's law is applied in electromagnets. The magnetic field due to a straight length of current-carrying wire is weak. However, if the wire is wound around a cylinder, making a coil with many turns as illustrated in Fig.\,\ref{fig:Emagnet}, then the field inside and near the ends of the cylinder can be strong for a practical current. \fbox{\bf Fig.\,2} The cylindrical coil is called a solenoid. The field strength can be increased by putting an iron core in the cylinder. Unlike a permanent ferromagnet, the field of an electromagnet can be turned on and off by an electric switch. Electromagnets are commonly used in electric motors and relay switches. \begin{figure}[p] \begin{center} \ing{./eps/electromagnet.eps} \end{center} \caption{An electromagnet. \label{fig:Emagnet}} \end{figure} \subsubsection{The magnetic force on an electric current} A magnetic field, whether produced by a ferromagnet or by an electric current, exerts a force on any electric current placed in the field. Indeed there exists a magnetic force on any moving charged particle that moves across the magnetic field vectors. So the interaction between electric charges in motion and a magnetic field has two aspects: (i) an electric current creates a magnetic field (Amp\`{e}re's law); (ii) a magnetic field exerts a force on an electric current. \paragraph{The electric motor.} The magnetic force on an electric current is the basis for all electric motors. The magnetic field may be produced by a permanent magnet (in small DC motors) or by an electromagnet (in large DC and AC motors). The current flows in a rotating coil of wire, and may be produced by a battery or some other source of electromotive force. Many practical designs have been invented, with the common feature that a magnetic force acts on the current-carrying coil, in opposite directions on opposite sides of the coil, creating a torque that drives the rotation of the coil. A co-rotating shaft attached to the coil is then connected to a mechanical system to do useful work.