Calculating Time taken to reach speed with Time Dilation

  • #1
TheStick
6
1
TL;DR Summary
Basically seeing if the code I wrote correctly calculates how long it would take for a constantly accelerating ship to reach certain speeds, focusing mostly on time dilation and how that would slow it down as opposed to the time we might otherwise think it would take.
So I've learned about time dilation and how getting close to the speed of light can have affects of time dilation. Looking into a bit more I see that when you are really close to the speed of light, say getting to the point of 99.9999999999% the speed of light, then it starts to become that accelerating a single meter would increase time dilation by quite a bit.

using Lorentz's equation - Δt' = Δt / √(1 - v²/c²)

So I was curious about figuring out the amount of time it would take, assuming constant acceleration, I wrote a piece of code (C#), and I was curious if this was correct and if not, what I've done wrong. Just wondering, I was bored ig.

Code:
using System;

public class calc
{

// This is a calculator that will calculate how long it will take to get up
// to a certain speed, taking time dilation into account.

// Hopefully.

private const double c = 299792458; // Speed of light in meters

public static double accuracy = 0.05; // Measured in Meters
public static double speed; // Percentage of c
public static double acceleration = 999; // 1000 meters per second

//This is approximately equal to 1 meter as a percentage of the speed of light.
public static double time;

public static double LorentzFactor;

public static double speedPercentage = speed / c;

//    1 / SQRT( 1 - (u^2)  )  --- Lorentz Factor
// u being the percentage

static void Main(){

    time = 0;
    speed = 0;
    calculate();

}


static void calculate(){
    while( speed < (c - accuracy)){
      
    speedPercentage = speed / c;
      
    LorentzFactor = 1 / (Math.Sqrt( 1 - (speedPercentage*speedPercentage))  );
  
  
    // How many Seconds
    speed += accuracy; // m
    time += (accuracy / acceleration ) * LorentzFactor;
  
    // How many meters per second
    //speed += acceleration / (1 * LorentzFactor);
    //time += 1;
  
    }
  
    time = time / 60;
    time = time / 60;
    time = time / 24;
  
    Console.WriteLine("Accuracy: " + accuracy);
    Console.WriteLine("(m/s) Speed: " + speed);
    Console.WriteLine("");
    Console.WriteLine("Days: " + time);
    Console.WriteLine(" Speed: " + (speed / c));
    Console.WriteLine("Lorentz factor: " + LorentzFactor);
    Console.WriteLine("---");

}

}

` Basically the code take every specific distance traveled (Accuracy) so say for every meter accelerated, it calculates the time taken to to accelerate that meter, and puts the Lorentz Factor into affect. These are some of the results.

Accuracy: 0.05

(m/s) Acceleration: 1000 Days: 5.45031839906392 Speed: 0.999999999930029 Lorentz factor at end: 45955.4795189111

(m/s) Acceleration: 500

Days: 10.9006367981278 Speed: 0.999999999930029 Lorentz factor at end: 45955.4795189111

Accuracy: 0.1 (m/s) Acceleration: 1000

Days: 5.4503051461314 Speed: 0.999999999939864 Lorentz factor at end: 35637.0967410703

Accuracy: 1 (m/s) Acceleration: 1000

Days: 5.45003205655855 Speed: 0.999999996664359 Lorentz factor at end: 8657.2579371794

This is just for anyone whose interested, I'm not sure this feels correct, changing the accuracy changes the Lorentz affect by a lot, but hardly seemed to affect the time taken to accelerate to that speed. I'd been thinking it would start taking a very, very long time to accelerate to that speed, but that doesn't seem to be what its outputting. I really have no idea if this is correct or anything at all, just find the stuff fascinating.
 
Physics news on Phys.org
  • #2
TheStick said:
figuring out the amount of time it would take, assuming constant acceleration
Time according to whom? There is no absolute time in relativity. Do you want to calculate time according to a clock on board the ship? Or according to a clock that remains at rest at the launch point?
 
  • #4
TheStick said:
speed += accuracy;
As Peter says, I don't think it's entirely clear what time you're calculating. Also, the quoted line from your code looks very wrong. The speed increase should be the coordinate acceleration (which probably isn't constant - proper and coordinate accelerations are different in relativity) times your time interval.
 
  • #5
PeterDonis said:
Time according to whom? There is no absolute time in relativity. Do you want to calculate time according to a clock on board the ship? Or according to a clock that remains at rest at the launch point?
Sorry, I'd thought I had specified that but I guess not, I'm meaning from Earth's perspective, so like how much time would have passed on earth by the time they reached that speed.
 
  • #6
Ibix said:
As Peter says, I don't think it's entirely clear what time you're calculating. Also, the quoted line from your code looks very wrong. The speed increase should be the coordinate acceleration (which probably isn't constant - proper and coordinate accelerations are different in relativity) times your time interval.
I don't understand coordinate acceleration very much. But what I was doing here was calculating how much time it would take to 'accelerate every say meter. Or you could change the accuracy, so how much time it would take for every centimeter. As I thought that would more accurately put Time Dilations affect.
 
Last edited:
  • #7
PeterDonis said:
That doesn't calculate what you actually are trying to calculate.

The equations you need can be found in this article on the relativistic rocket equation:

https://math.ucr.edu/home/baez/physics/Relativity/SR/Rocket/rocket.html
So even though I'm only calculating the time it would take to accelerate to certain speeds, I need more than just Acceleration and Time Dilation? I guess one question I'm not sure of, is once you are travelling very fast, would Time Dilation affect say every single meter accelerated. So where it would get to a point where every single Meter you accelerate, would make it take even longer to accelerate to the next meter?
In the link, it has a table for T (years), t (years), d (ly), v/c, γ. But at points in the table T is say 5 years, then The Lorentz Factor is like 86.2. I'd thought it meant that for every five years on earth, the t would be 1. But instead t is 83.7 years. I'd thought it would be something like t = T*y. Which is I suppose is why I'd thought bringing it down to individual meters traveled, and how long that would take with Time Dilation, would be more accurate.
 
  • #8
TheStick said:
I'm only calculating the time it would take to accelerate to certain speeds, I need more than just Acceleration and Time Dilation?
The problem is that the time dliation factor is not constant, because of the acceleration. In the general case, you need to do an integral. In the special case of constant acceleration, you can use the equations on the relativistic rocket page I linked to. But as you will see if you look, those equations aren't as simple as just plugging numbers into the time dilation formula you posted.
 
  • #9
PeterDonis said:
The problem is that the time dliation factor is not constant, because of the acceleration. In the general case, you need to do an integral. In the special case of constant acceleration, you can use the equations on the relativistic rocket page I linked to. But as you will see if you look, those equations aren't as simple as just plugging numbers into the time dilation formula you posted.
By time dilation factor do you mean the Lorentz factor? In which case I never had it be constant. I had it change with every meter accelerated. I'll also likely research more into coordinate acceleration as that seems to be something I don't know much of either. Thank you for your help however.
 
  • #10
TheStick said:
By time dilation factor do you mean the Lorentz factor?
Yes.

TheStick said:
In which case I never had it be constant. I had it change with every meter accelerated.
It's not just the time dilation factor that changes. So does the coordinate acceleration, as @Ibix pointed out. Also, those things are not functions of the distance traveled (at least not in the formula you wrote down), so "with every meter" is not a correct way to try to do the calculation.

In any case, since there are closed form formulas for the scenario you are trying to calculate (on the relativistic rocket page I linked to), there is no need to write a complicated computer program to do the calculation by what amounts to a clunky approximation to an integral. Just use the formulas.
 
  • #11
PeterDonis said:
Yes.


It's not just the time dilation factor that changes. So does the coordinate acceleration, as @Ibix pointed out. Also, those things are not functions of the distance traveled (at least not in the formula you wrote down), so "with every meter" is not a correct way to try to do the calculation.

In any case, since there are closed form formulas for the scenario you are trying to calculate (on the relativistic rocket page I linked to), there is no need to write a complicated computer program to do the calculation by what amounts to a clunky approximation to an integral. Just use the formulas.
Alright, Thanks for your explanations! I'll learn more about coordinate geometry and (attempt) to understand those formulas better. Appreciate your quick help.
 
  • Like
Likes berkeman
  • #12
TheStick said:
Alright, Thanks for your explanations! I'll learn more about coordinate geometry and (attempt) to understand those formulas better. Appreciate your quick help.
For motion in one dimension:

Assume a spacecraft (or particle) has an acceleration of ##a##, measured in a frame of reference in which it is instantaneously at rest. The acceleration (##a'##) measured in a frame of reference in which the spacecraft is moving at speed ##v## is $$a' = \frac a {\gamma^3} = a(1 - \frac {v^2}{c^2})^{3/2}$$Note that as ##v \to c##, we have ##a' \to 0##. This formula implies that a particle can accelerate indefinitely under what it measures as a constant force (and undergo a constant proper acceleration) and yet never reach the speed of light as measured in any inertial frame. One example of this is a charged particle in a particle accelerator. This may be subject to a constant force and a constant proper acceleration and yet, in the reference frame of the laboratory, never attain the speed of light.

It also highlights that the laws of physics for a spacecraft or particle travelling at high speed relative to the Earth are unchanged. Its engines, for example, may continue to work in the same way, regardless of the relative speed of the Earth. This is implied by the first postulate of SR.
 
  • Like
Likes pervect
  • #13
TheStick said:
I don't understand coordinate acceleration very much. But what I was doing here was calculating how much time it would take to 'accelerate every say meter. Or you could change the accuracy, so how much time it would take for every centimeter. As I thought that would more accurately put Time Dilations affect.
Your proper acceleration is what you feel. Coordinate acceleration is the acceleration anybody else measures you to have using their own frame of reference. This is a distinction without a difference in Newtonian physics, but in relativity they are different and the difference becomes increasingly important as the speed difference between you and the other guy grows.

I think what you are trying to do is say that the astronaut accelerates with what feels to him like a constant acceleration, ##a##. He calculates the time interval ##\delta t## that it takes him to travel some small distance ##\delta x## (the value you've called 'accuracy') from rest at this acceleration. Then you begin stepping the shipboard time forward in steps of ##\delta t##, updating the velocity and the time that mission control measure.

If that's correct, the problems seem to be that you haven't calculated ##\delta t## correctly (look up the SUVAT equations) and you haven't transformed the velocity change (look up the relativistic velocity addition formula). If you do that correctly, your code would be basically doing numerical integration using Euler's method, and it shouldn't be too far off the exact answer Peter linked.
 
  • Like
Likes PeroK
  • #14
I'm not exactly sure what you're asking, but if you're seeing a paradox, it would probably be because you're assuming a constant rate of acceleration. If you assume a constant rate of acceleration, you'll reach c in... I forget, either two months or a year.

But that can't happen. As time slows down, it takes increasingly more energy to go an additional increment of speed.
 
  • #15
Ibix said:
If you do that correctly, your code would be basically doing numerical integration using Euler's method, and it shouldn't be too far off the exact answer Peter linked.
Although accumulated floating point error should be considered as well.
 
  • Like
Likes Ibix
  • #16
Miss-Understands- said:
I'm not exactly sure what you're asking, but if you're seeing a paradox, it would probably be because you're assuming a constant rate of acceleration. If you assume a constant rate of acceleration, you'll reach c in...
Not if its proper acceleration. You can accelerate with constant proper acceleration indefinitely without reaching ##c##. See post #12
Miss-Understands- said:
I forget, either two months or a year.
The time that you get close to ##c## depends on the acceleration. For a proper acceleration of ##g## you get close to ##c## in about a year.
Miss-Understands- said:
But that can't happen. As time slows down, it takes increasingly more energy to go an additional increment of speed.
You are living up to your username here. You are also misunderstanding the difference between proper acceleration and coordinate acceleration. Also, time does not really slow down. That's an imprecise way to describe symmetric velocity-based time dilation.
 
Last edited:
  • Like
Likes cianfa72
  • #17
Miss-Understands- said:
I'm not exactly sure what you're asking, but if you're seeing a paradox, it would probably be because you're assuming a constant rate of acceleration.
Careful. Constant proper acceleration is fine. Constant coordinate acceleration eventually leads to exceeding ##c##, yes. You need to be clear on that distinction, especially as the concept appears to be new to the OP.
Miss-Understands- said:
If you assume a constant rate of acceleration, you'll reach c in... I forget, either two months or a year.
That would depend on the coordinate acceleration value you pick - either about 2.5g or 1g gives your numbers. Neither time is a general truth.
Miss-Understands- said:
But that can't happen.
Again, careful. You can describe constant coordinate acceleration paths easily enough (although the OP's approach can't do it). No object can follow such a path, but you can write down the maths describing it.
Miss-Understands- said:
As time slows down, it takes increasingly more energy to go an additional increment of speed.
I'm afraid this is a terrible way to describe what's going on. "Time slows down" isn't really true, certainly not as a statement unqualified by who is measuring what. The increased energy bit is frame dependent, and also applies to Newtonian physics. It's the different dependence of the energy on the speed that's important, and that it diverges as the speed approaches ##c##. And, again, you need to be clear about which frame is measuring what, since that appears to be part of the OP's confusion.
 
Last edited:
  • Like
Likes PeroK
  • #18
Ibix said:
Your proper acceleration is what you feel. Coordinate acceleration is the acceleration anybody else measures you to have using their own frame of reference. This is a distinction without a difference in Newtonian physics, but in relativity they are different and the difference becomes increasingly important as the speed difference between you and the other guy grow.
Sorry, even in Newtonian physics there is a difference between "absolute acceleration" (i.e. w.r.t. Newton "absolute space") and acceleration w.r.t. a possibly non-inertial reference frame.
 
  • #19
Correct, but the OP is struggling with inertial frames, so I decided not to complicate things any more than necessary.
 
  • Like
Likes cianfa72

Similar threads

Replies
14
Views
651
Replies
18
Views
1K
Replies
55
Views
2K
Replies
2
Views
1K
Replies
10
Views
4K
Replies
24
Views
2K
Replies
65
Views
7K
Back
Top