The rail gun, or more simply, railgun, utilizes a magnetic field powered by electricity to accelerate a projectile. Although the basic ideas underlying the construction of a rail gun are simple, the firing of a typical rail gun projectile results in a tremendous repulsive force. The result is that the rail gun must be serviced after nearly every shot, making them less practical than conventional projectiles. They also require a very large power supply, able to provide a million or so amperes of current, making the creation of portable rail guns difficult.
A rail gun consists of two firmly anchored parallel metal rails, connected to an electric power supply. A projectile capable of conducting electricity is placed in between the rails, completing the circuit. Being electrically charged, the metal rails behave as electromagnets, creating a magnetic field that circulates around each rail. One field moves clockwise around its rail, the other clockwise, creating a magnetic field in between that creates a net force parallel to the rails, away from the power supply. The projectile behaves like any charged wire in an electric field, experiencing a force perpendicular to the direction of the current and the direction of the magnetic field. This is called the Lorentz force.
When the electric current is very strong, the projectile, undergoing powerful forces, accelerates to the end of the rail gun opposite the power supply, and exits through an aperture. The circuit, thus broken, ends the flow of electric current. The projectile must make physical contact with the rails during acceleration. If the projectile is moving fast enough, the friction alone can seriously damage or even vaporize the rails, absent strong enough materials. Also, if the rails are not securely affixed to a stable surface, they can be propelled apart by powerful energies within the rail gun.
Many millions of dollars have been put into rail gun research by the United States military, and many successful prototypes have been developed, which possess very high muzzle speeds, on the order of 3.5 km/sec (2.17 mps), roughly 3 times faster than modern rifles. However, these designs require large power supplies, and maintenance remains a problem. The US Navy has expressed interest in rail guns due to their non-explosive ammo, but they have not entered into common use. One proposed solution to the problem of rail gun wear-and-tear is the idea of using very small projectiles accelerated at very high velocities, a design sometimes referred to as a needlegun.
Rail guns have also been discussed in the context of peaceful applications such as space travel. A very long rail gun, or mass driver, could be used to accelerate payloads to escape velocity for costs far cheaper than that of chemical rockets. One drawback is the high initial investment required to build such a mass driver. To create a mass driver that accelerates a projectile to escape velocity at a rate acceptable to human passengers (~2 gs), would require a barrel of length ~50 km (30 miles). Another potential application of rail guns may be in the arena of nuclear fusion, where immense pressures and temperatures are required to fuse atomic nuclei together.