The model computes the probabilities P( i), i = 1 to 41, where P(i) is the probability that there are i - 1 motors in the system for repair. We have chosen to stop at 41 because the probability that the system would have more than 40 machines waiting for repair is effectively 0.

In order to solve for the 41 unknown P( i), we will need 41 equations. One of these equations comes from the fact that the probabilities must all sum to 1:

! Probabilities must sum to 1;

  @SUM( STATE: P) = 1;

The remaining 40 equations are derived from the steady state assumptions that the rate of movement into any state must equal the rate out. We partition these balance equations into two types. In the first case, there are the states where the number of motors in the system are less than or equal to the number of servers. The balance equations in this case are:

@FOR( STATE( N)| N #LE# S:

P( N) * (( N - 1)* MU + LMDA) =

 P( N + 1) * MU * N +

  LMDA * @SUM( BSIZE( I)| I #LT# N: A( I)

   * P( N - I))

);

For each state where the number of motors in the system is less than or equal to the number of servers we set the rate of flow out of the state:

P( N) * (( N - 1)* MU + LMDA)

equal to the rate of flow into the state:

P( N + 1) * MU * N +

LMDA * @SUM( BSIZE( I)| I #LT# N: A( I)

 * P( N - I))

The rate of flow out is the rate of flow to states with more motors, LMDA, plus the rate of flow to lesser states, (N - 1) * MU, multiplied by the probability of being in the state, P( N). The rate of flow in is the rate of flow in from higher states, P( N + 1) * MU * N, plus the expected rate of flow in from lower states, LMDA * @SUM( BSIZE( I)| I #LT# N: A( I) * P( N - I)).

We generate equivalent balance equations for the higher states where the number of motors exceeds the number of servers with the following:

@FOR( STATE( N)| N #GT# S #AND# N #LT# LAST:

P( N) * ( S * MU + LMDA) =

 P( N + 1) * MU * S +

  LMDA * @SUM( BSIZE( I)| I #LT# N: A( I) *

   P( N - I))

);