Fabulous Adventures In Coding
Eric Lippert is a principal developer on the C# compiler team. Learn more about Eric.
Here's some fun for a Friday.
A few years back a bunch of my coworkers and I got to discussing the space program over lunch. Someone asked why it is that we continue to launch devices into orbit by strapping a big old tank full of liquid oxygen to the device and then set it on fire. Why haven't we developed better technology using magnets or something?
I did some poking around the web and wrote up a little summary of the analysis, which I present here for your amusement.
Suppose you've got a 1000 kilogram object that you'd like to be an arbitrary height above the surface of the earth. In order to get an object to an arbitrary height, we need to accelerate it to the escape velocity of the earth, which is 11 kilometres per second. How much energy does that take? The kinetic energy of a projectile is half the mass times the square of the velocity:
Kinetic Energy = 0.5 x 1000 kg x (11000 m/s)2 = about 60 gigajoules
Sixty billion Joules of energy sounds like rather a lot, but really it isn't. The electrical power for your house is measured in Joules, but because Joules are so tiny, the bill comes in kilowatt hours. One Watt is a power consumption of one Joule of energy per second, so a kilowatt hour is a power consumption of 1000 Joules per second for 3600 seconds = 3.6 million Joules. That costs about ten cents. So that sixty billion Joules would only cost about $1700 -- near what it costs to keep 20 one hundred Watt light bulbs burning for a solid year. And power costs less if you buy it in bulk.
$1700 to put a tonne in orbit is incredibly cheap. Why doesn't NASA use electricity instead of chemical power? Turning the electricity into acceleration quickly is harder than turning it into heat and light slowly, but surely we can figure something out.
One way to do it would be to build a coil gun. Coil guns are very easy to build -- in fact, I've built one myself. A coil gun works like this: you have a metal projectile sitting in a tube. One end of the tube has a coil of wire wrapped around it. When an electric current is applied to the wire, it turns the coil into an electromagnet, which pulls the projectile towards it.
Of course, the current has to shut off before the projectile passes entirely through the coil, otherwise the electromagnet will be pulling the object back towards it, slowing it down. The projectile sails on through the coil, out into space.
You can build multi-stage coil guns. The first coil gets the projectile moving. As the projectile leaves the first coil, that triggers a switch that turns on the next coil, and so on. Each coil makes the projectile a little bit faster.
So a coil gun stage has three basic parts: the coil itself, something which stores the electricity -- usually a capacitor of some kind -- and a switch to connect the power source to the coil at exactly the right moment.
I once had an old television set that didn't work anymore. Before I took it to the dump I ransacked it for capacitors. I had everything I needed around the house -- a few capacitors, a diode, some old telephone wire, a piece of spare kite spar tubing, and a light switch. Run wall power through the diode to charge the capacitors, run power from the capacitors to the coil, interrupted by a switch. Put a nail in the tube, hit the switch, and the nail goes flying. Cool! (Note: large capacitors can kill or wound you when charged. Handle with care.)
The problem is that none of these pieces scale up.
Suppose we've got a really huge multi-stage coil gun. Just to keep the math easy, let's say we have ten thousand coils, each a metre long with which we're going to accelerate our projectile to 10000m/s by applying a uniform acceleration of 5000m/s2. That acceleration would squash humans like bugs, but we could use this thing to move large quantities of equipment into orbit. When the on switch is hit, a mere two seconds later the projectile will be heading into space at 10000m/s.
Consider only the last coil of the ten thousand. The projectile is going to be moving at almost 10km/s, so it will only be in the coil for about 100 microseconds. We can assume that this is about how long the last coil is going to be energized.
It is vitally important that the pulse of electricity delivered to the coil be short, for three reasons. First, as I mentioned before, the magnet had better be off by the time the projectile reaches the far side, otherwise the magnet will be slowing the projectile down. Second, the farther the projectile is from the coil when the coil is energized, the weaker the magnetic pull will be; you don't want to waste power by turning the magnet on while the object is too far away to get much oomph from it. And most important, the magnetic field strength of an electromagnet is proportional to the electric current. Current is electrons moved per second, so if you want high current you have to either make the number of electrons moved larger, or the amount of time you spend moving them smaller, or preferably both.
For all these reasons we can assume that the pulse is going to be extremely short, on the order of 100 microseconds.
Current is voltage divided by resistance, power is voltage times current, and the heat produced by resistance is a function of current. (That's why we have high-voltage power lines to deliver power: we step the power up to high voltage so that it moves lots of power without creating too much heat. We then step it back down to more useful low voltage/high current at local transformer stations.) The resistance in copper wire is going to be non-trivial, and worse, the magnetic fields set up in the electromagnet are going to themselves push against the electrons moving through the coil -- we're going to get inductance on the line. The closer together the coils, the stronger the electromagnet will be, but the more impedance will be produced. In order to get enough current, we're going to need huge voltages. And no matter how you slice it, the coils are going to generate heat, lots of it. But that's OK. We can cool the coils, and make sure that we don't pump so much power into each coil that the copper wire melts.
But there is another place where heat is produced. 100% of the current for each coil has to pass through a switch. A conventional switch, where you have two pieces of metal with a gap between them, and you remove the gap, isn't going to work for the kind of power we're talking about. We're talking about currents way larger than arc welders use, so basically the switch will weld itself shut. And as the switch closes, the high voltages will cause current to leak across the channel when the switch is half closed, thereby increasing the amount of time that electrons are flowing. That will weaken the magnetic field. Mechanical switches just aren't going to cut it.
Fortunately we have a very fast, very precisely controllable switching technology: transistors. A transistor is a chunk of silicon which has been carefully constructed so that it can act as either an electrical insulator or an electrical conductor. They are incredibly high-speed switches -- that's why we make computers out of them. Let's just build ten thousand transistors, one for each coil switch. The switch for a coil will be triggered by the projectile interrupting a laser beam crossing the previous coil.
Hold on, a minute though. Transistors are semiconductors -- they do not transmit electricity perfectly. They're maybe 90% efficient. About 10% of the power transferred through the switch is going to be turned into heat inside the switch. How much heat can a transistor take before its wrecked? Anyone who has overclocked a Pentium knows what I'm talking about! Transistors get real hot real fast when you try to push a lot of power through them.
How much power?
Power = mass x acceleration x distance / time
By the time we hit the last coil, the 1000kg projectile will be moving at about 9999.5m/s. We need to accelerate it up to 10000m/s, we have 100 microseconds in which to do so, and one metre. The acceleration is 5000m/s2. If we work it out, the total power required by the last stage is fifty billion Watts. The five million Joules cost about a dime; it's getting them where they need to be in 0.0001 seconds that's the hard part.
We're going to turn 10% of that power directly into heat in the switch, so that's five billion Watts of heat to dissipate. Imagine the heat of ten million 500 Watt spotlights concentrated in a small area, and all turned on for 100 microseconds. It'll be hot.
Note that we're assuming that 100% of the force generated by the magnetic field is translated into motive force on the projectile. In reality, only about 25% of the magnetic force actually turns into acceleration. We'd need to up the power by at least a factor of four, so really we've got more like 20 billion Watts of heat to dissipate. But let's ignore that for now.
Let's assume that the transistor is extremely thin and therefore the transistor is equally hot everywhere. An extremely thin transistor is also a good idea because a thin transistor has large surface area. The larger the surface area an object has, the faster you can cool it. Let's wrap our transistor in a huge copper heat sink.
Slabs of copper do not diffuse heat infinitely quickly. The temperature of the surface of the heat sink that is touching the transistor will rise based on many factors -- higher power consumption, smaller surface area and longer application of heat by the transistor all cause a larger temperature rise at the interface between the transistor and the sink. The heat capacity and thermal diffusion of copper are well known, and from these facts we can work out that:
Clearly if the heat sink is not sucking heat out fast enough, the heat sink is going to itself get hot enough to wreck the transistor. Let's suppose that the transistor can take a rise of 100 degrees Celcius before it is destroyed. We have 5 billion Watts of heat, and 100 microseconds to get rid of as much of it as possible. How much area do we need to ensure that the surface of the heat sink rises only 100 degrees?
Solve the above equation for area and you get 300000 square centimeters. That's a square transistor 5.5 metres on a side, about the size of a typical kitchen floor.
Transistor-grade wafer-thin silicon costs about $2 for a square centimeter, so the transistor for the last stage alone will cost us about $600000 dollars. And that's for the stage that only adds 0.01% of the total oomph, for a device that can only launch a one-tonne projectile, and we've neglected inefficiency in the coil. Clearly to build the whole device would cost multiple billions of dollars for the on switch alone. That's an expensive on switch!
Of course, we could solve these problems by inventing new magic materials. If we had cheap superconductors that conducted electricity and heat with 100% efficiency at reasonable temperatures, supported large currents and fast switching, then sure, we could build mass drivers that put objects into orbit at low cost. Tragically, we do not have magic materials.
And of course I haven't even mentioned the difficulties of generating and storing enough power to light Seattle and then discharging it all in two seconds. Generating large quantities of power spread out over lots of time and space is easy. Concentrating that power into a very tiny time and space is hard. Fifty gigawatts for the last stage alone -- we'd need the Mr. Fusion from Back To The Future! (Actually, we'd need around 40 of them, as Mr. Fusion generated the mere 1.21 gigawatts required to power the flux capacitor.) I've also glossed over many serious difficulties in the implementation of the coils; dealing with self-inductance, magnetic eddys and other issues is non-trivial.
Until there are radical new advances in material science and power management we're going to be stuck with strapping big tanks of liquid oxygen onto the sides of projectiles if we want to get them into space.
I stole this argument from this excellent, more technical description of the switching problem:
This site is a good one if you're interested in exotic orbital technologies:
This guy builds
This page has some great explanations of the