- #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.
` 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.
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.