Friday, November 7, 2014

Relativistic Rocket Calculator

I have written a calculator for relativistic acceleration to make it easier to understand how relativity affects acceleration problems.

Accelerating Rockets

Most people get exposed to equations like v = at and d½at² which let you compute velocity and distance for a rocket that accelerates at a fixed acceleration a for a time t. With a little algebra, you can play with those equations and compute other things, such as time given distance or velocity.

Special Relativity

Most people also know that strange things happen when objects approach the speed of light: time slows down, lengths contract, and mass increases. The Lorentz equations that describe this are less-well known, but still quite accessible to anyone with an understanding of high-school algebra.

Relativistic Acceleration

Things get complicated when you combine the two. Now instead of time, you have ship-time and earth-time, and as the ship goes faster, its time slows down, which reduces the acceleration, which affects the velocity . . .and you have this circular mess.

If you understand how to add relativistic velocities, then with a little work you can show that the velocity v = c tanh at/c, which fixes the circular definition, and you can then use calculus to compute the other numbers. Or you can use someone else's results.

But if you just want to explore different possibilities, you can use this calculator page.

Using the Calculator

The relativistic acceleration calculator assumes that the ship accelerates at a fixed rate up to some peak cruising velocity and that it later decelerates at that same rate until it reaches the destination. That is, the ship is under power for the first and last parts of the trip and it cruises at constant velocity in the middle.

The calculator needs to know three things:
  1. The acceleration. Default is 1g
  2. The powered phase. Either how much time it takes (Earth or ship time) or how much distance it covers.
  3. The cruise phase. Likewise, you need to specify either how long it lasts (default is zero) or how much distance is covers.
Answer any combination of these and the calculator will fill in all the others for you.

Example 1

A starship goes from Earth to Alpha Centauri, 4.366 light-years away. It accelerates at 1g until it's half-way there, then it decelerates a 1g until it arrives. How long does it take on Earth? How long does it take the crew? What's the max velocity?

To figure this out, open the calculator. Acceleration is already set to 1g, so leave that alone. Set "How far does it travel under power" to 4.366 light-years. Leave cruise time at zero. 

The two "how long is the whole trip" numbers are 6 earth-years and 3.6 ship-years, and the max velocity is 95% the speed of light.

Example 2

A starship to Tau Ceti, 11.905 light-years away, spends most of the voyage coasting at 90% the speed of light. At 1 g, how long does it have to accelerate at the start and decelerate at the end? How long is the whole trip? How far is it from Tau Ceti when it starts to decelerate? 

Again, leave acceleration at 1g. In the Powered Phase, Set "what velocity does it reach" to 0.9 c. In the Cruise Phase set "what is the total distance traveled" to 11.905 light-years. 

Look at "how long does it accelerate?" in the Powered section. It's 3 years Earth-time and 1.8 years ship time.  Then look at "How long is the whole trip?" in the Cruise section. It's 14.4 earth-years and 7.4 ship-years. Finally, "how far does it travel under boost alone" tells you that it will be 1.25 light-years from Tau Ceti when it starts to decelerate.

Relativity: Adding Velocities

When people first learn that nothing can exceed the speed of light, they often ask what would happen if two ships which were each going 75% of the speed of light happened to pass each other, head on. Wouldn't the people on each ship think the other ship was going 150% the speed of light?

Equivalently, some ask what if I see a ship moving 75% the speed of light with respect to me, and that ship fires a projectile forward at 75% the speed of light with respect to itself. Won't the projectile be moving at 150% the speed of light with respect to me?
A rocket launches another rocket (John D. Norton, U. Pittsburgh)

The answer is that velocities don't add in relativity. Instead, a concept called rapidity adds. The rapidity is the hyperbolic tangent of the velocity as a fraction of the speed of light. (Wikipedia has a good explanation.)

This calculator lets you put in velocities for the two ships and it computes the sum of their velocities. For example, in the case of two ships going 75% the speed of light, it shows that they'll observe each other moving 96% the speed of light.

Saturday, November 1, 2014

Space Calculations

Anyone writing hard science fiction occasionally needs to do astronomical calculations. How long will it take a rocket to get from A to B? How big will this planet's star look from the surface? How long will the year be? How long will eclipses last?

These questions are both easy and hard. Easy, because they only require a few bits of information to state, but hard because they need a fair amount of math to solve. Plenty of web pages give the answers, but most of them assume a level of mathematical sophistication that most folks just don't have.

I propose to use JavaScript create a number of blog pages to make it easy to get answers to questions of this sort. As such, I don't expect to update it quite as often as my other blog, which is about my experiences reading in foreign languages.