Grid City and Line City

The Saudi government is planning on building a city in a straight line across the desert, called Neom. I have previously criticized it here. In a conversation here, a simple model for a one-dimensional city and a two-dimensional city was requested, so we can see how travel times compare. I have attempted to build these here.


Prerequisites: None.

Originally Written: August 2022.

Confidence Level: I very much an amateur here. Most of what I know about transit planning comes from Alon Levy’s blog. I am trying to make these estimates realistic. My guess is that people who know more than me about transit will find my conclusions obvious.



Suppose you are trying to build a new city of 100 blocks. Each block is 1 mile square, has the same density, and can provide enough demand for a rapid transit station. We would like to arrange the blocks in the simplest possible way, and design a rapid transit system for them.

I don’t think that either of these is actually a good way to build a city. Real cities have curves. Cities should be designed for human flourishing, not to make the transportation system as efficient as possible. Blocks should not be uniform: different people want different things, and the city should reflect that. Transportation networks that began as routes that people most wanted to travel along are never grids. Most of the benefits of grids and straight lines are for the planner, rather than for the residents. The network should reflect the physical and human geography of the city, even if it doesn’t look as pretty on a map. This exercise should not be taken as an actual city plan. It is simply to figure out the transportation benefits of building in two dimensions instead of one.

A city with 100 rapid transit stations is a major city. Cities whose Metros have about 100 stations include Munich, Vienna, Stockholm, Oslo, Osaka, Hong Kong, Kunming, and Nanchang.

We will try out two different arrangements for the city: Grid City and Line City. Grid City is a 10 by 10 grid. Line City is a 100 by 1 line. How does the transit system work for both of them?


Grid City

Let’s start with a map of grid city. Each block is outlined in black. Stations and transit routes are in red. Each station is in the center of the block, and there is a complete grid of transit lines.

Fig. 1: A map of Grid City.

There are 20 transit lines: 10 going north-south and 10 going east-west. Each transit line is 9 miles long.

We’re going to build double track subways along each of these routes. The total length of the right of way is 180 miles, and we will need 360 miles of track.

The speed of the trains is going to be 60 mph, or $v = $ 1 mile per minute. This is similar to the top speed of the New York subway, 55 mph.

Each time the train makes a stop, it takes some time for deceleration, boarding, and acceleration. Subways typically use EMUs (electrical multiple units – not the bird), which have electric motors incorporated in each of the cars, so the train can accelerate quickly. Subways typically have lots of doors, which makes boarding fast. Alon Levy uses 45 seconds for the stop delay on the New York subway here. I will round that up to a stop delay of $t = $ 1 minute.

Adding the speed and stop delay together, we get that train takes 2 minutes to travel between stations, for an average speed of 30 mph. The New York subway has stops a bit closer together than this, and has an average speed of 17.4 mph.

I will assume that the train comes every $f = $ 5 minutes.[1]The frequency of the train is actually 1 / 5 minutes. Calling 5 minutes the ‘frequency’ is more common for transit, so I will use this terminology, even though it’s actually a … Continue reading The highest frequency you can get on a subway is one train every 2-3 minutes, using modern signalling systems. This is usually only done in the largest subway systems, like New York or Paris, so I’ve chosen something a bit lower than this.

The trains travel at an average speed of 0.5 mi/min, and have to travel 18 miles travel the complete line and back again. It takes 36 min for a train to complete a loop. To get a train every 5 minutes, we need to have 8 trains on each line.[2]This actually gives us a train every 4.5 min. The difference is because you need an integer number of trains on the loop. For our 20 lines, we need a total of 160 trains.

How long does it take to travel between any pair of stops?

The travel time is a combination of three things: the time in motion at the train’s top speed, the stop delays, and the time it takes to wait for a train.

The time in motion is easy to calculate: $\frac{\Delta x}{v}$.

Each time the train stops, you have to add in the stop delay. At the first stop, you have to wait for boarding and acceleration, while at the last stop, you have to wait for deceleration. The combination of the these two means that you don’t have to adjust by one for the starting or ending stops. Since we have one stop per mile, we can calculate this time as $\Delta x \times t$.

When you first arrive at a station, either because you’re starting your journey or because you’re transferring, you have to wait for the next train. On average, you will have to wait half the train frequency: $\frac{f}{2}$. You can reduce waiting times at transfers by coordinating when the trains arrive at the stations. The benefits of timed transfers become more important as trains or buses come less frequently. Since these trains are pretty frequent, and for simplicity, I won’t include timed transfers in my model.

All three of these times are needed for each direction you travel in. You need to include both $\Delta x$ and $\Delta y$. If you are only going in one direction, then don’t need to add any time for the other direction of travel. This is already included in the expressions for the travel time at top speed and the stop delay, but not for waiting for the train. To deal with this, I include an extra factor called $w_x$ or $w_y$ in front of these terms. Each $w$ is one if you have to wait for a train in that direction and zero if you do not.

Putting this together gives:

$\Delta \tau = \frac{\Delta x}{v} + \frac{\Delta x}{1 \mbox{mi}} \, t + w_x \frac{f}{2} + \frac{\Delta y}{v} + \frac{\Delta y}{1 \mbox{mi}} \, t + w_y \frac{f}{2}$.

The farthest you can go is from one corner to the opposite corner. Both $\Delta x = 9$ and $\Delta y = 9$. Plugging in the rest of the numbers gives a longest possible trip of 41 minutes: 18 minutes of travel, 18 minutes for stops, and 5 minutes waiting for the train.

It would also be nice to know the average travel time. We assume that the city has the same density everywhere, and there are an equal number of trips from every starting location to every ending location. To calculate the average travel time, calculate the travel time times for each pair of stops, and divide by the total number of possible trips ($10^4$). I wrote some code to do this, which you can find at the bottom of this post. The average trip takes 18 minutes.


Line City

Line City has all of its blocks arranged in a 100 mile long line. There is a local transit service stopping at every block, which uses the same trains as Grid City. There is also an express transit service, stopping at blocks number 5, 15, 25, … , 85, 95. Let’s start with a (partial) map of Line City. Each block is outlined in black. Local stations and transit routes are in red. Express stations and transit routes are in blue. All of the tracks are arranged along a single line, which is 99 miles long.

Fig 2: A partial map of Line City. The aspect ratio is somewhat off: the blocks should be square.

The local transit service is the same as for grid city. There is one line, which is 99 miles long, and double tracked, so it requires 198 miles of rail. It has speed $v = $ 1 mi/min, stop delay $t = $ 1 min, and frequency $f = $ 5 min. Traveling 198 miles at an average speed of 0.5 mi/min means that each train takes 396 min, or 6:36 hours to complete a loop. To achieve a 5 min frequency, you need 80 local trains.

The express service is high speed rail. Its total length is 90 miles, so to double track it, we need 180 miles of high speed track. This is along the right of way for the local track.

While the local service is roughly modeled off of the New York subway, the express service is roughly modeled off of high speed trains between Shanghai and Nanjing, which is 187 miles long with 21 stations.

I will choose the speed of the express trains to be 180 mph, or $V = $ 3 mi/min. This is a bit below the operating speed of trains between Shanghai and Nanjing: 300-350 km/hr (186-217 mph). The stop delay for this train is 2-10 min. I will take $T = $ 3 min. The average speed is 95 mph, or 1.6 mi/min. The frequency of the line will be the same as the local trains, $F = $ 5 min, which is also the maximum frequency of trains between Shanghai and Nanjing. Achieving this frequency on this line requires 23 express trains.

How long does it take to travel between any two stops?

There are two possible routes you could take: You could take the local trains the entire way, or you could ride the express trains. Which route is better depends on where you start and end points.

If you take the local train the entire way, the trip is similar to the trains in Grid City, if you only have to travel in one direction. The total time is the sum of the time in motion, the stop delays, and the initial time to wait for the train:

$\Delta \tau_L = \frac{\Delta x}{v} + \Delta x \, t + w \frac{f}{2}$.

If you take the express train, you ride up to three trains over the course of your trip. You ride the local train to the nearest express station, then ride the express train between express stations, then ride the local train to your destination. The initial and final trips are given by the expression above: $\Delta \tau_{L,i}$ and $\Delta \tau_{L,f}$. The express trip is similar, but you have a different speed, stop delay, and frequency, and the stop delay only applies every 10 miles instead of every mile. You should only wait for an express train if you need to, so also include a $W$ factor that is zero or one, applied to the train’s frequency.

$\Delta \tau_E = \Delta \tau_{L,i} + \Delta \tau_{L,f} + \frac{\Delta x}{V} + \frac{\Delta x}{10 \mbox{mi}} \, T + W \frac{F}{2}$.

The actual travel time between two stops is whichever route is faster. For shorter distances, the local train will be faster, while for longer distances, transferring to the express train will be faster.

$\Delta \tau = \min(\Delta \tau_L, \Delta \tau_E)$.

The longest trip is between the two endpoints, and takes 89 minutes, or 1:29 hours. The calculation for the average trip was performed by the code below and it takes 36 minutes.

Both the longest trip and the average trip are much longer in Line City than in Grid City.


Can we make Line City better?

Speeding up the express trains does not work. Maglev trains are faster than conventional high speed rail. There aren’t as many maglev trains in operation. There is one in Shanghai, between the airport and downtown.

The two stations are 19 miles apart. On most trips, the maximum speed is 268 mph, but the train can travel at up to 311 mph. The train takes 7:20 minutes to complete the journey. It spends 4 minutes accelerating, travels at maximum speed for only a short distance, and then slows down as it approaches the station.

Fig. 3: The speed of the Shanghai maglev train as it travels from downtown to the airport.

Our express train has stops only 10 miles apart. The maglev train won’t have enough time to accelerate to its top speeds in that short of a distance. The stop delay has become more significant than the time in motion.

What we can do instead is add a maglev train in addition to the local and express trains. The maglev train will only stop at stations 25 and 75, so it has plenty of distance to travel at its top speeds. If it’s double tracked, this would mean 100 miles of maglev track along the central 50 miles of the right of way. If we have a small enough number of trains, we might be able to use passing zones instead of double tracking the entire route.

I will take the speed of the maglev train to be 300 mph, or $\mathcal{V} = $ 5 mi/min. I will take the stop delay to be $\mathcal{T} = $ 5 min. Assuming a uniform acceleration, the train loses 2 minutes while accelerating, a slightly smaller time decelerating, and we need to include some time for boarding. The total time for a trip from stop 25 to stop 75 is 15 min: 10 minutes in motion and 5 minutes of stop delay.

The frequency for the other routes was 5 min. I don’t think that this will work for the maglev train. You need larger intervals so faster trains have time to brake in case the train ahead of them does something weird. I don’t think that your frequency can be as fast, or faster than your stop delay. For the maglev train, I will instead take $\mathcal{F} = $ 10 min.

The average speed, including the stop delay, is 3.33 mi/min. The total trip out and back is 100 miles. To achieve a 10 min frequency, we need 3 maglev trains.

Figuring out the travel times using the maglev train is a bit more complicated. You can ride to the nearest maglev station either using local or express trains, then take the maglev across the city, then ride to your destination using either local or express trains. If you want to see how this is implemented, see the code below.

The longest trip is now 83 min and the average trip is 34 minutes. Adding the maglev reduces the length of the longest trip by 6 minutes and the average trip by 2 minutes. This is an improvement, but not that impressive.

We can plot the travel time as a function of initial and final location. For short distances, the local train is dominant. For longer distances, you can start seeing the effect of the express stations: routes which start or end at or near an express station take shorter times. At even longer distances, you can see the maglev stations at 25 and 75. They also serve to keep the express station pattern from continuing to increase as get closer to the edges.

Fig. 4: A chart of the travel time between any pair of stations in Line City. The horizontal axis is the origin and the vertical axis is the destination. The color shows how long it takes. Darker blues take less time, while lighter yellows take more time.

We could assume that some new kind of train is developed which is twice as fast as a maglev train. Since this is something new, I’ll pretend that the acceleration and deceleration times don’t change either – although in practice, we rapidly reach the accelerations humans will tolerate comfortably. This train reduces the longest trip to 73 minutes, saving an additional 10 minutes, but only cuts about 1 minute off of the average trip. Speeding up the fastest train is helpful for the trips that use it, but doesn’t impact the average very much because most trips don’t use it.

You could also improve the transit time by making the blocks different from each other. Travel is easier to or from the express and especially the maglev stations. These blocks should have higher density development, so they have more trips, which improves the average. Applying this only to Line City isn’t fair. You could also give Grid City a shorter average travel time if you allow some of its blocks to have more development. In this case, the optimal transit network would probably not be a grid. To keep this project limited in its scope, I will not look at how things change with nonuniform development.


Comparisons

Let’s put together a table for the 3 scenarios we’ve looked at: Grid City, Line City without maglev, and Line City with maglev:

Grid CityLine CityLine City + Maglev
Right of Way180 mi99 mi99 mi
Local Track360 mi198 mi198 mi
Express Track180 mi180 mi
Maglev Track50-100 mi
Local Trains1608080
Express Trains2323
Maglev Trains3
Longest Trip41 min89 min83 min
Average Trip18 min36 min34 min

It is a lot easier to travel around Grid City than it is to travel around Line City. Adding even faster trains doesn’t improve Line City very much.

Line City faces a serious challenge. In order for a train to be useful to lots of people, it has to stop frequently. But frequent stops take time and reduce the maximum speed you can reach between stations. If you want to travel fast and far, you can only stop occasionally. Grid City avoids this because no train has to travel a far distance.

Line City also has problems with transfers. In Grid City, someone has to wait for at most 2 trains. In Line City, some routes require waiting for 5 trains: local, then express, then maglev, then express, then local. This extra time waiting adds up: 15 minutes of the longest trip is simply waiting. The transit agency can try to reduce the time waiting by using timed transfers, but transferring is always a cost. Grid City could also use timed transfers to reduce the waiting time.

You could also improve the average travel time by relaxing the assumption that the city is completely uniform. Line City would want more intensive development at express stations than at local stations, and the very densest development at the maglev stations. This would make the fastest forms of transit more convenient for a larger fraction of the people. We could also improve Grid City if some areas are more intensely developed than others. You might not want to use a grid anymore, though. If there is a single area of densest development, makes more sense to use a radial network instead of a grid. The development patterns that are possible in two dimensions are a lot more varied than in one dimension.

If you wanted to do a compromise between Line and Grid City, you could split Line City into three pieces and big a triangle out of them. I haven’t done this calculation, but I expect that it be better than Line City, although not as fast to get around as Grid City. The triangle would also make a striking shape in the desert, when viewed from space, in case that’s one of your major goals.


Neom

This isn’t that hard of a model to set up. Surely someone working on Neom, the Line City that’s planned to be built in Saudi Arabia, has thought of it. What do they have to say about this problem?

Neom claims that it will have end-to-end transit times of 20 minutes. On the surface, this isn’t that ridiculous. If we placed the maglev stations at blocks 1 and 100, instead of 25 and 75, then the travel time between these two stations would be 25 minutes. Increasing the maximum speed some could get it down to 20 minutes. Neom plans on using some form of hyperloop which is supposed to be faster.

The problem is that this fast train doesn’t have any intermediary stops. Every stop you add increases the travel time by 5 minutes. Getting an end-to-end travel time of 25 minutes is easier than getting an anywhere-to-anywhere travel time of at most 25 minutes.

If you want this to work, you would have to have people getting on and off the train without it stopping. Which seems to be what Neom is planning to do.[3]Their website is vague, but this is what I’ve heard people talking about what they’re planning. People get in separate pods at a station, which accelerate to full speed independently, then attach themselves to the train. Your pod separates from the train when you get close to your station, so it can decelerate independently as well.

I don’t know of any transit system that does anything like this, and certainly not at this speed. It’s not as simple as having pods join the train from the back and leaving from the front. Because pods are traveling different distances, some of them will have to join or leave from the middle of the train, and then the train will have to reattach itself. I am not convinced that this can be made reliably safe at 300 mph.

Using pods also reduces one of the other benefits of using trains for rapid transit. People are much closer together on a train than they would be if they were in separate vehicles, so a train can carry a lot more people along a narrower right of way. Since each pod travels directly from an origin to a destination, it will only have a few people in it. Each “train” will have to consist of a lot of pods. The result will be something closer to the density of cars driving down a road, with one or a few people in each vehicle, than to the density of people on a subway.

I don’t think that Neom’s plans are realistic. It is still interesting to look at them. If you want to build an efficient transit system for a large, linear city like this, having fast trains is not enough. You also need fast trains that don’t stop.

Building the city in two dimensions puts everything closer together. You can get similar travel times with much slower trains because you don’t have to go nearly as far. Two dimensional cities are still better for transportation than one dimensional cities.



Appendix A: Code for Grid City

All code should run in GNU Octave (free) or Matlab (not free).

clear; close all; clc;

% Calculates the average trip length for a city arranged entirely in a grid.
% The density of the city is perfectly uniform.

% The city is 10 mi long and 10 mi wide and has a stop every mile. 
% The stops are numbered 1 to 10 in both directions.

% Transfers will be necessary to take you between lines.

v = 1; % Speed, in mi/min.
t = 1; % Stop delay, in min.
f = 5; % Frequency, or time between trains, in min.
l = 9; % Length of each line, in mi. There are 20 total lines.

va = 1/( (1/v)+t); % Average speed, including stops.

% Calculate the number of each type of train needed.
% Note that a train has to travel twice the length of the line to complete a loop.

lt = 2*l/va; % Time for a train to complete a loop.
n = 20*ceil(lt/f); % Number of trains needed.
disp(strcat('We need ',num2str(n),' trains.') )

% Create every pair of stops and every X and Y coordinate
% and measure the time it takes to travel between them.

Times = zeros(10,10,10,10); % Array to put in the time to travel between stops.

for X1 = 1:10 % Cycle through the positions of the starting point.
  for Y1 = 1:10
    for X2 = 1:10 % Cycle through the positions of the ending point.
      for Y2 = 1:10
        
        xx = abs(X2-X1); % X distance between stops.
        yy = abs(Y2-Y1); % Y distance between stops.
        
        wx = logical(xx); wy = logical(yy); 
          % You don't have to wait for a train if you aren't going in that direction.
        
        Time = xx/v + xx*t + wx*f/2 + ...
          yy/v + yy*t + wy*f/2;
          % A combination of the travel time, the stop time, 
          % and the waiting time for a train, in both directions.
          
          % There's no stop time if you are zero or one stop away.
          
          % Note that this is probably too slightly too much waiting time
          % because you can pick which direction to go first.
          
        Times(X1,Y1,X2,Y2) = Time; % Put it in the array.
        
      end
    end
  end
end

% Calculate the time for the longest trip and the average trip.
MaxTime = max(max(max(max(Times))));
disp(strcat('The longest trip takes ',num2str(MaxTime),' min.'))
AvgTime = sum(sum(sum(sum(Times))))/10^4;
disp(strcat('The average trip takes ',num2str(AvgTime),' min.'))

Appendix B: Code for Line City

All code should run in GNU Octave (free) or Matlab (not free).

I’ve moved the time calculations to multiple functions, so I can call them inside each other.

If you want to see want happens without the maglev, and you don’t want to change anything other than the preamble, you make the speed of the maglev really slow (set $VV = 0.1$), so taking the maglev is never the fastest method of travel between points.

clear; close all; clc;

% Calculates the average trip length for a city 
% arranged entirely along a line, like Neom.

% The density of the city is perfectly uniform.

% The city is 100 mi long and has a stop every mile. 
% The stops are numbered 1 to 100.

% There is both a local service, stopping at every stop,
% an express service, stopping at every stop ending in 5,
% and a maglev service, stopping at stops 25 and 75 only.

v = 1; % Speed of the local line, in mi/min.
V = 3; % Speed of the express line, in mi/min.
VV = 5; % Speed of the maglev line, in mi/min.

t = 1; % Stop delay on the local line, in min.
T = 3; % Stop delay on the express line, in min.
TT = 5; % Stop delay on the maglev line, in min.

f = 5; % Frequency, or time between trains, for local, in min.
F = 5; % Frequency for express, in min.
FF = 10; % Frequency for maglev, in min.
% On average, you wait half of this time. 

l = 99; % Length of the local line, in mi.
L = 90; % Length of the express line, in mi.
LL  = 50; % Length of the maglev line, in mi.

va = 1/( (1/v)+t); % Average speed for local, including stops.
VA = 10/( (10/V)+T); % Average speed for express, including stops.
VVAA = 50/( (50/VV)+TT); % Average speed for maglev, including stops.

% Calculate the number of each type of train needed.
% Note that a train has to travel twice the length of the line to complete a loop.

lt = 2*l/va; % Time for a local train to complete a loop.
n = ceil(lt/f); % Number of local trains needed.
disp(strcat('We need ',num2str(n),' local trains.'))

LT = 2*L/VA; % Time for an express train to complete a loop.
N = ceil(LT/F); % Number of express trains needed. 
disp(strcat('We need ',num2str(N),' express trains.'))

LLTT = 2*LL/VVAA; % Time for a maglev train to complete a loop.
NN = ceil(LLTT/FF); % Number of maglev trains needed. 
disp(strcat('We need ',num2str(NN),' maglev trains.'))


% Create every pair of stops and measure the time it takes 
% to travel between them on the local line, by transferring
% to the express line, and by (potentially) double transferring 
% to the maglev line. The travel time is the smallest one.

% I've moved everything to new functions so I can use them recursively.

Times = zeros(100,100); % Array to put in the time to travel between stops.

for X1 = 1:100; % First stop number.
  for X2 = 1:100; % Second stop number.
        
    % Local only.
    TimeL = LocalTime(X1,X2,v,t,f);
    
    % Transfer to express.
    TimeE = ExpressTime(X1,X2,v,t,f,V,T,F);
    
    % Transfer to maglev.
    TimeM = MaglevTime(X1,X2,v,t,f,V,T,F,VV,TT,FF);
            
    % The time is the minimum of local, express, & Maglev times.
    Times(X1,X2) = min([TimeL,TimeE,TimeM]);
        
  end
end

% Calculate the time for the longest trip and the average trip.
MaxTime = max(max(Times));
disp(strcat('The longest trip takes ',num2str(MaxTime),' min.'))
AvgTime = sum(sum(Times))/10^4;
disp(strcat('The average trip takes ',num2str(AvgTime),' min.'))
function T = LocalTime(X1,X2,v,t,f)
  % Calculates the time it takes to travel a between points X1 and X2 
  % on local trains. The speed of the local train is v, the stop delay is t,
  % and the frequency is f.
  
  xx = abs(X2-X1); % The distance between the stops.
  
  w = logical(xx); % Don't include waiting time if you don't get on a train.
  
  T = xx/v + xx*t + w*f/2;
    % A combination of the travel time, the stop times, and
    % the initial waiting time.
    
    % There's no stop time if you are zero or one stop away.
  
endfunction
function T = ExpressTime(X1,X2,v,t,f,V,T,F)
  % Calculates the time it takes to travel a between points X1 and X2 
  % by transferring to the express train. The speed, stop delay, and frequency
  % for local trains are v, t, and f, respectively, and for the express
  % trains are V, T, and F, respectively.
  
    eX1 = 10*round( (X1-5)/10)+5; % Closest express stop to X1.
    eX2 = 10*round( (X2-5)/10)+5; % Closest express stop to X2.

    TL1 = LocalTime(X1,eX1,v,t,f); 
      % Time to take the local train to the nearest express stop for X1.
    TL2 = LocalTime(X2,eX2,v,t,f); 
      % Time to take the local train to the nearest express stop for X2.
      
    eX = abs(eX2-eX1); % Distance between express stops.
    W = logical(eX); % Don't wait for an express train if no need.
        
    TE = eX/V + (eX/10)*T + W*F/2;
      % The travel time, stop times, and initial waiting time.
      
    T = TL1 + TE + TL2;
      % You ride the local train first, then the express, 
      % then the local train again. The total time is the sum of the three.
      
      % If you don't get on an express train, this still assumes that
      % you wait for local trains twice. I guess you ride to the nearest
      % express stop, get off and look around a bit, then get back on.
      % This doesn't affect the result because, in this case,
      % the local train will be faster.
  
endfunction
function T = MaglevTime(X1,X2,v,t,f,V,T,F,VV,TT,FF)
  % Calculates the time it takes to travel a between points X1 and X2 
  % by transferring to the maglev train. The speed, stop delay, and frequency
  % for local trains are v, t, and f, respectively; for the express
  % trains are V, T, and F, respectively; and for the maglev train are
  % VV, TT, and FF, respectively.
  
    mX1 = 50*round( (X1-25)/50)+25; % Closest maglev stop to X1.
    mX2 = 50*round( (X2-25)/50)+25; % Closest maglev stop to X2.
    
    TL1 = LocalTime(X1,mX1,v,t,f); 
      % Time to take the local train to the nearest maglev stop for X1.
    TL2 = LocalTime(X2,mX2,v,t,f); 
      % Time to take the local train to the nearest maglev stop for X2.
    TE1 = ExpressTime(X1,mX1,v,t,f,V,T,F);
      % Time to get to the nearest maglev stop 
      % by transfering to express trains for X1.
    TE2 = ExpressTime(X2,mX2,v,t,f,V,T,F);
      % Time to get to the nearest maglev stop 
      % by transfering to express trains for X2.
      
    % I will use the faster of the two methods to get to each maglev stop.
    
    mX = abs(mX2-mX1); % Distance between the maglev stops. 
      % Will be either 0 or 50.
    WW = logical(mX); % Don't wait for an express train if no need.
    
    TM = mX/VV + WW*TT + WW*FF/2;
      % The travel time, stop time (singular), and initial waiting time.

    T = min([TL1,TE1]) + TM + min([TL2,TE2]);
      % You get to the maglev station by either method, then ride the maglev
      % train, the get to your destination by either method.
  
  endfunction

References

References
1 The frequency of the train is actually 1 / 5 minutes. Calling 5 minutes the ‘frequency’ is more common for transit, so I will use this terminology, even though it’s actually a period.
2 This actually gives us a train every 4.5 min. The difference is because you need an integer number of trains on the loop.
3 Their website is vague, but this is what I’ve heard people talking about what they’re planning.

Thoughts?