Original Post
Hi, I'm making a space game. In it, you can accelarate your ship. But if you're near lightspeed, I bring lorentz factors into account. This lorentz factor (well, the inverse, doesn't really matter) is calculated with the following formula: The space game also has the feature that you can make the time go faster. You can choose between 1x, 10x, 100x, ..., up to 100000000x. The problem is now, if the time is going at a rate of 100000000x: then it would be insane to do physical calculations for every real second in those 1000000's of seconds in the interval. It would be way too inefficient to do that much calculations. BUT, at the huge intervals that the calculation has to happen then, is a problem!! The accelaration is calculated using the lorentz factor you have for the current speed. If you're at low speed, this lorentz factor is low. But then it makes you accelarate that fast for e.g. 1000000 seconds, without updating the lorentz factor in that (since like explained I don't work with millions of small intervals, I want to do the calculations in one go). So the result is that you reach lightspeed (much higher even), while in reality it shouldn't reach lightspeed, it should be near it because the lorentz factor should have slowed down the accelaration effect. So I've been trying to come up with a formula for the following: *) given -Your current speed in an absolute reference frame -The lorentz factor can be calculated using the formula given above -The start time (absolute time for external observer) -The end time (absolute time for external observer) -The power of your engine, and the fact that it constantly gives that constant power from start until end time *) asked -Your speed in said absolute reference frame after your engine has given a force with its constant power from start until end time, with the lorentz factors taken into account Does anyone know a way to come up with a formula for this? I've been thinking about something like this: calculate how much energy it's worth to give the constant power during the time interval. Then calculate how much that kinetic energy (with lorentz factors taken into account) adds up to your current speed. But I'm also stuck there at the part where kinetic energy and lorentz factors have to be combined. Anyone got experience with this? Please help :)
double lorentzinv(double speed)
{
return std::sqrt(lorentzinvsq(speed * speed));
}
double lorentzinvsq(double speedsq)
{
if(speedsq >= LIGHTSPEED * LIGHTSPEED) return 0.0;
double result = (1.0 - (speedsq / (LIGHTSPEED * LIGHTSPEED))); //<-- the sqrt of this is the formula
if(result <= 0.0) result = 0.0;
return result;
}