Sure but it takes quite a bit of energy per shot. A fairly standard 7.62mmx51mm NATO shell puts out a bullet with about 4000 Joules of energy. That's roughly a 0.4F, 100V capacitor or 2,000 200uF, 100V capacitors (around $2,500) _per shot_. 20 rounds means that the gun has around $50k worth of capacitors and that's before we start talking about rapid-discharge/charge rate systems and energy transport.
Once the electrical rail machine gun is built, the per-shot costs are pretty low (copper, lead, machining) and grid supplied energy (hello supply-lines), but then a 7.62x51mm NATO round is $0.42 (in volume).
The rail guns that being trialed are monsters: not a whole lot of point in shooting a $0.42 NATO round when you have nuclear power generator to recharge the gun. By the same token, there's probably not a whole lot of point spending $100k per soldier to kit them with a barely portable weapon that is matched by a $2,000 AR-15 firing $0.42 mass-produced ammunition with a mature supply line and easy portability.
Conversely, a base Tesla Model 3 puts out about 200kW sustained for longer than most machine guns fire a string; 5.56 NATO is about 1800J; a M16 fires at 13Hz; if your process is 100% efficient this is about a power demand of 24KW or about 1/8th of what the Model 3 draws from its battery pack.
Incidentally, such a Tesla-machinegun would not be regulated as a firearm in many/most jurisdictions.
> the per-shot costs are pretty low (copper, lead, machining)
Bullets are not machined (except for exotic uses where insane accuracy is required-- 1000yd championships employing exotic chamberings and weapons, etc).
And it would be regulated as a firearm in the UK ("a lethal barrelled weapon of any description from which any shot, bullet or other missile can be discharged"; section 57 (1) Firearms Act 1968). There is also a specific list of prohibited weapons in the same act which are firearms even if non-lethal.
A 5.56 bullet will leave a full length 20" rifle barrel in under 2ms with something like 1500J kinetic energy, which is greater than 750kW. I don't know what the acceleration profile is like in the barrel - I suspect it might peak much higher than that.
A model 3 also has a battery pack that weighs hundreds of pounds, and doesn't have the need for large bursts of instantaneous energy a railgun would (hence the $50k capacitor bank), so average energy usage isn't very meaningful.
Once the electrical rail machine gun is built, the per-shot costs are pretty low (copper, lead, machining) and grid supplied energy (hello supply-lines), but then a 7.62x51mm NATO round is $0.42 (in volume).
The rail guns that being trialed are monsters: not a whole lot of point in shooting a $0.42 NATO round when you have nuclear power generator to recharge the gun. By the same token, there's probably not a whole lot of point spending $100k per soldier to kit them with a barely portable weapon that is matched by a $2,000 AR-15 firing $0.42 mass-produced ammunition with a mature supply line and easy portability.
But, yeah, I'd like to see them, too...