Magnetic weapons have been a part of the Sci-Fi genre for a while and I have recently started writing a story that would implement magnetic weapons, I'm talking about magnetic revolvers, rifles, and cannons. Would magnetic weapons even be more productive than today's gunpowder based guns? and if so how would they work? how would they be implemented into modern infantry?
Let's first look at the pros and cons of a magnetic weapon. I'm not a physicist, but have some interest in the topic.
On the pro side, we definitely have the sheer firepower a magnetic weapon can provide. The projectiles can be accelerated to hilarious speeds, while air friction and the energy used to accelerate the projectile (plus potentially friction inside the gun) can heat up the projectile to the point it turns into super-hot plasma. I guess it's not fun being hit by a little bolt of iron plasma with a small layer of molten iron and a solid iron core inside, moving at ten times the speed of sound... nope.
On the con side, these things require energy. A LOT of energy. So, either they have super amazing batteries or use a different mean of energy storage. They could maybe have a small build-in-fusion/fission reactor, but i think that's a little bit far off. Maybe their batteries are quite small and included in the clip of the weapon? But how to acquire energy "in the field" then? Chemical "batteries" might do the trick, they could store energy in a small physical container (like modern ammo). Current chemical lasers work that way, too. Then you have the problem with the rails. While there are recent ideas how to make these weapons work without rails, the strain on the gun must be enormous. Also, energy can only be partially converted to ballistic energy, part will be converted to heat (and in case of chemical batteries, also poisonous gases).
On the topic of "big weapons": I recently read an article on a ship-based railgun the US is testing at the moment. Here is a Link to a German Article. Its talking about muzzle velocities of 35km/s, which, if using only 1kg of mass, leads to simple devastating results with enormous range. Quite mind-boggling to think about it...
So, for your world: Even if the problems are somewhat solved in your future (TM), i think magnetic weapons will be high-maintenance, low-rate-of-fire weapons. Like... in the wild west. Only in this case, after your 6-shooter is empty, you need to refill the magazine while waiting for the weapon to cool down. Only stationary weapons might have sufficient cooling. And, just a story idea, since these weapons might not get enough maintenance, maybe at some kind of frontier or in the outback, the accuracy goes down by a lot, because the parts are used up. I think that might actually create a nice wild west / world war I feeling.
I don't think we could use magnetic weapons in our current era.
The major issue of magnetic weapons is finding a suitable power supply. I'm using rail guns as an example.
Most of the current rail guns in testing are known to use immense amount power to fire only one round. They needs a constant one million amperes of electricity to accelerate projectiles to velocities of the order of 1000 m/s
Sure, the round is more powerful and could go as fast as 20 km/s, but the sheer size of the power supply would render it unmovable on the battlefield.
Another problem you will face is heat. The heat generated from the propulsion of the object is enough to erode the rails rapidly. If it melts the rails, imagine the damage it does on the ship, truck or plane.
Under high-use conditions, current railguns would require frequent replacement of the rails, or to use a heat-resistant material that would be conductive enough to produce the same effect.
Most electromagnets work the same. They produce heat and need a lot of constant power to work. I don't think magnetic weapons will be seeing the light of day anytime soon. As long as humans don't figure out a new power supply and a good insulator, mankind will never replace the good old cannon with the Railgun.
If you're looking for a truly feasible magnetic weapon, one option ( apart from large scale EMPs as described below ) is to use a conventional weapon to fire a small scale EMP, such as a rocket launcher for example, to fire an EMP to within range of a building to knock it's systems offline, or a shotgun sized device to target another soldier's personal gear, taking down his HUD, night vision or other apparatus.
One of the most devastating forms of magnetic weapons, especially in our day and age, is the EMP device ( Electro Magnetic Pulse ). A large scale weapon of this kind would effectively be as damaging to a nation as a nuclear attack.
EMPs work by generating a very large and powerful magnetic field, bound to an electro-magnet of some kind, either standard or super-conducting, then detonating a charge which destroys the electromagnet. This removes the interplay between the electromagnet and the field, allowing the field to collapse in on itself. When the field collapses it focuses down to a point and the rebound wave is a very energetic electromagnetic wave which can induce large currents in any conductor within a certain radius, depending on the strength of the pulse. This fries electronics, can knock out power grids, cause blackouts and start fires over over varying radii from the epicenter of the blast.
A sufficiently powerful EMP detonated in the right location can knock out the power grid in a cascading effect and put a very large area, several states or nation-states, back into the stone age.