MATLAB: How to calculate distance and time

MATLABtime distance speed

I have sets of data for schedule based airline flights. at t1, t2, t3…., I have corresponding velocities, v1, v2,v3… etc. I have another set of different speeds, such as s1, s2, s3 …. My main objective is to find the time l1, where the aircraft travels the distance of the first set of data with the speeds of s1, s2, s3…. (Note: These speeds correspond to t1, t2, t3 as well.)
Anyone have any idea to do this? Any idea will be appreciated. Thanks.

Best Answer

You do not have a distance for the first set of data.
If you know any two of duration, speed, and distance, then you can find the third. But you do not have duration, you have desired times of take-off. You do have speeds: you have two sets of speeds that we do not know how to distinguish, the v-series and the s-series. You do not have distances.
Airline scheduling usually involves nodes (cities) and edges (direct flight connections with known ground distances) and collections of aircraft with individual known maximum cruising air velocities. In the simple case, winds are ignored completely. In a slightly more advanced case, the edges are no longer considered bidirectional and instead different unidirectional "distances" are assigned in the two directions. In a more advanced case, winds act as non-linear friction. In a step up after that, winds are modeled as being different in different geographic regions, modeled by introducing a whole series of connected intermediate nodes and running a shortest-path algorithm to determine the best route to get between distinguished nodes (the cities); this also allows one to model there being different speeds for take-off and for landing and for cruising. And then you get into market capacity demands, and per-aircraft capacity limitations. And calculating fuel requirements based upon weight where the weight lowers as the flight progresses. And connecting flights (which are important because individual travelers have different destinations but it is not economical to fly directly between all possible destinations.)
With just start times and velocities, you do not have any kind of scheduling task: you just have a bunch of straight line plots about "how far will they have traveled if they kept flying indefinitely?" Not traveled for any particular purpose, or from any particular location, just a whole bunch of (speed * current duration) plots with different t offsets. Like
%arbitrarily assume mapping up to 10 hours and 50 subdivisions for mapping
delta_t = linspace(0, 10, 50); %row vector!
start_times = t; %the given values

velocities = v; %the given values
end_times = [ones(length(start_times),1), start_times(:)] * [delta_t; ones(1,length(delta_t))] %matrix multiply intended

how_far_traveled = velocities(:) * delta_t; %matrix multiply intended
plot(end_times', how_far_traveled');