# Total time spent travelling, given distance and speed functions

I have the following situtation:

An object is traveling a certain (known) distance in a straight line. The object starts at rest, accelerates to its preset maximum speed then spends some time cruising at that speed, and finally decelerates to a halt.

The object does not follow Newton's second law of motion, but rather obeys the following equations:

While cruising, it's moving normally, so d = v*t and while accelerating: d = e^(k*t) and v = k * e^(k*t), where e is the natural log base, t is time, k is a constant, d is distance traveled, and v is speed. When decelerating, the distance and speed equations are the same, but with a negative time component and are offset by the time and distance spent accelerating and cruising. The value of k for deceleration is also different from the value for acceleration (it's the acceleration k divided by 3, or just 2 if k/3 is greater than 2, if that's important).

I am trying to calculate the total travel time given the distance to travel, the maximum speed, and the acceleration and deceleration constants. The calculation is simple in the case when the distance is great enough that the object reaches its maximum speed - I can calculate t for how long it will take it to reach max speed and then back to 0 from the speed formula; then I get the distance traveled while accelerating and decelerating from the distance equation, with the remaining distance traveled at cruising speed.

I am having difficulties figuring out when the object will begin decelerating if the distance is smaller than the distance required to accelerate to max speed and decelerate back to zero.

So, how would one go about intersecting the speed graphs for acceleration and deceleration to figure out the highest speed it will achieve over such a run? (I think I can figure out the total time from there)

• While accelerating, $d = e^{kt}$. So are you saying that the object started its travel at $d=1$ when $t=0$? Also, since $v=ke^{kt}$, are you saying the object was not accelerating from rest but had a sudden jump in speed? – peterwhy Nov 10 '14 at 14:06
• Good point, I hadn't noticed that. The equations are true, however this mostly doesn't matter due to the size of the numbers involved. d is in m/s, but for most cases it will be several tens of AU, the max speed will be several AU/s and k will be the speed in AU (without the units). So the case of d=1 at t=0 is not significant. I didn't mention specific data cases to avoid someone bringing in relativity because the model I described is Eve Online's warp speed model, so it's hardly realistic. – mtsvetkov Nov 10 '14 at 15:07

Naturally, formalizing the question in a post helped me solve it. Here's what I came up with for posterity's sake:

ta = ln(Vm/ka) / ka
td = ln(Vm/kd) / kd

Vm = ((1/ka)+(1/kd)) * d


Where Vm is highest attained speed, ta, td, ka and kd are the time and k constants for acceleration and deceleration, and d is the distance to travel.

PS. If someone were kind enough to edit this stuff to use the fancy notation that would be great.