Background
I am developing a game / simulation that has spacecraft with advanced albeit at least not physically impossible drives travelling in the solar system. As operation time should be far more valuable than propellant the fastest way is the best way.
The Problem
Assumptions / Constraints
The spacecraft obey the rocket equation. Thrust and exhaust velocity are constant and turning is instant. Orbital mechanics are more or less ignored. That means I will assume travel in a straight line (differences in orbital velocity will be included in the dry mass or ignored). The relative velocities are small enough that special relativity will be ignored.
Description of the problem
How fast will a spacecraft with constant thrust but changing mass arrive at a distance if v0 = vend = 0? How long will burn prograde, coast and burn retrograde? At which point of the journey will it be at time t?
Related Questions
These questions assume constant acceleration which is much easier to calculate:
Constant Acceleration in Space. How much time for a given distance?
How fast will 1g get you there? How can you calculate a course based on constant acceleration burn and deceleration burn? See also: Wikipedia and project rho
This question touches the same subject but has a different scope: Estimating thrust and kg fuel for a generation ship's journey to Alpha Centauri
My approach
My first approach was to burn half the tank (in delta V terms), (maybe coast a bit), flip and burn the rest. Intuitively (and the math backs it up) the "flip" is beyond the halfway point of both time and distance travelled. With the rocket equation one can calculate how much wet mass is remaining after expending 50% of delta V. Assuming a constant thrust and exhaust velocity the remass flow must also be constant. Therefore time to 50% delta V is: $\frac{WetMass_0-WetMass}{RemassFlow}$
The acceleration at any given time is a function of time: a(t) = $\frac{F}{M-mt}$ where F is the thrust, M is the mass at t0 and m is the remass flow. Integrating over t should produce the velocity at t (assuming v0=0): v(t) = $\frac{F(Log(M) - Log(M-mt)}{m}$ Backwards (starting at v1 which should equals $\frac{delta V}{2}$ in this example): vb(t) = $ v_1 -\frac{F(Log(M) - Log(M-mt)}{m}$
Example
Using a D-T Fusion Tokamak with an $V_e$ of 66,800 m/s and a remass flow of 1 kg/s, a dry mass of 250 000 kg and a delta V of 100 000 m/s leads to a wet mass of about 1.11707*10^6 kg. It takes about 6.812667 days to burn through the first 50 000 m/s delta V and everything is burned up in about 10.03556 days. Applying the functions from above so far it seems to check out.
Distance travelled
Now to the hard part. How much distance does this acceleration and deceleration take (do we have enough runway). Integrating the functions from above once again over t should be the correct approach (thanks to mathematica at this point). s(t) = $\frac{Ft*Log(M) - F(-t + \frac{M*Log(M)}{m}+(-\frac{M}{m}+t)Log(M-mt))}{m}$
Backwards: sb(t) = $\frac{mtv_0 - Ft*Log(M) + F(-t+\frac{M*Log(M)}{m}+(-\frac{M}{m}+t)Log(M-mt))}{m}$
Example II
Continuing the example. It takes about 0.0862 au to accelerate and 0.0523 au to "brake".
Easy Cruising
Now there are to options: if the sum of acceleration distance and deceleration distance is shorter than the travel distance the solution is rather straightforward. The spacecraft will cruise at the maximum achieved velocity until the remaining distance = "braking" distance. In the examples an imaginary horizontal (for velocity) or tangential (for distance) would be added at the mid point. Travel time = time to accelerate + cruise time + time to decelerate. Option 2 remains a problem:
Remaining problem: Shortening of the way / the top gear challenge
If the distance to accelerate and to decelerate is longer than the travel distance the spacecraft cannot expend 100% of its delta V. Therefore I no longer know the optimal "flip point". I assume there is a way to analytically solve for an optimum point which I would prefer. At the moment the only solution I consider (not having it implemented yet) is to brute force the problem by decreasing the acceleration time in small steps until a valid solution is found. However I assume that this solution would get computationally expensive as it would have to be done quite often for pathfinding / decision making. (I seem to recall a Top Gear challenge where they had to reach a maximum speed and still stop before the finish line which seems to be somewhat similar to this problem).