As in http://www.cig.salk.edu/ThGenesis/TGenStepMath.html, the flowchart shows how the populations of Th cells types, and APCs effect each other. In this model there are 5 Th cell states. In order to maintain a consistent size of the system, the thymus G produces an equal number of cells as those that go to Cell Death.

The Equations:

So how does this flowchart become a system of equations? The chart shows us a path of population changes or the net change in population.

Example: The change in the Initial self population (Is) is equal to the number of new Initial cells from the thymus [ = + k1 * G * SI ], plus cells converting from Es to Is at a rate k4 [ = + Es * k4 ] , minus Is to Es at a rate k2 [ = - Is * k2 ], minus Is to Cell Death at a rate k3 [ = - Is * k3], minus the number of initial cells that die [ = - Is * k5 ].

In an equation this statement looks like this:

Is' = (k1*G* SI) + (Es*k4) - (Is*k2) - (Is*k3) - (Is*k5);

NOTE: k2 and k3 are not inputs in this simulation. In the presence of only self, and absence of nonself, all APCs are of the form S-APCt, and none are in the S-APCi-NS form. Thus, k3 is maximal, and k2 = 0. At the other extreme, when L=1.0 (all engaged), all APC are in the S-APCi-NS form, k3 = 0, and k2 is maximal for both the self and nonself converstion of Initial cells to Effector cells (Is -> Es and Inse -> Ense).

Now we have a system of equations to calculate the populations in each group. It is convenient to think X' as (current time step) variables that we calculate knowing X data (time step -1). The actual program executes the equations in the execution order (ExecOrder) as listed in the table. However the most meaningful are the bulk cell conversion equations, which are listed as ExecOrder #6.
 
 
ExecOrder
Variable   Equation
6)
Is' Is + ((N)*SI) + (Es1*k4) - (Is*K2s) - (Is*K3) - (Is*k5) + ((M)*SI);
6)
Es' = Es1 + (Is*K2s) - (Es1*k4);
6)
Inse'  = Inse + ((N)*(1-SI)*L) + (Ense1*k4) - (Inse*K2ns) - (Inse*k5) + (M*(1-SI)*L);
6)
Ense' = Ense1 + (Inse*K2ns) - (Ense1*k4);
6)
Insu' = Insu1 + ((N)*(1-SI)*(1-L)) - (Insu1*k5) + (M*(1-SI)*(1-L));
where: (most are internal variables, with the exception of T and N)
1)
M = Cells Added to the system to initially grow it. Equals 0 once the system reaches Total size (T).
1)
T' = (T + M) = (Is' + Es' + Inse' + Ense' + Insu')
2)
K2s =  MIN(APC/p * R * SI, APC/p*R*m_dL)/MAX(Is, 1);  // #sAPCns / Is 
2) K2ns  MIN(APC/p * R * SI, APC/p*R*m_dL)/MAX(Inse, 1); // #sAPCns / Inse
2)
K3 =  (APC/p * R * SI - MIN(APC/p * R * SI, APC/p*R*m_dL))/MAX(Is,1);    // #sAPC / Is
3)
Es1 = Es + Effector cells that are now dividing that went through the Is to Es before.
3)
Ense1 = Ense + Effector cells that are now dividing that went though the Inse to Ense before.
4)
Insu1 = Insu - Es1 - Ense1
5)
= P + (Is*k5) + U + (Inse*k5) + (Insu1*k5) = cells that die = cells that are re-born = k1*G
Executed when Foreign AG is initially introduced, to convert the % of unengaged cells to the engaged type:
7)
Inse' = Insu'*L';
8)
Insu' = Insu' - Inse';
Effector / peptide calculations:
10)
Es'/p = Es'/(R*SI);
10)
Ens'/p = Ense'/(R*(1-SI)*L');

Further model notes:

Instant conversion of Insu to and Inse cells:
Equations in the execution order of 7 & 8 in the table above result in instant appearance of a large number of Inse cells. This conversion is equal to the nonself antigenic load times the unengaged cells. This is performed because of the actuality that Insu cells are not physically different than Inse cells. Their only difference is that Inse cells would react with the newly introduced foreign antigen. Thus these unengaged cells, would now engage, and thus are renamed accordingly. This also helps in keeping the math straight, as non-self engaged becomes symmetrical to self.

Steady State:
Steady state values can be observed by allowing the system to continue until the numbers within each cell groups converge on a number and stays there regardless of additional time steps. It is important to note that the system is generally allowed sufficient time after the initial system growth stage to become steady state before the introduction of the foreign antigen. After addition of the antigen, the system again will adjust itself to find a new steady state.

The Application

This is how the simulator works.
  1. Get the k and system values from the user.
  2. Starts with all cell populations = 0.
  3. Iterate through the Equations for SEED number of steps, while L=0

  4. and gradually grow the system via an internal stem cells variable M = (input Total) / (input SEED steps),
  5. Iterate through the Equations for (BEFORE - SEED) number of steps while L=0.
  6. Iterate through the Equations for AFTER steps, with L= the input value for load.
  7. The simulator runs to completion. The resulting data can be visualized through the online graphing, or using the raw data output.

Last Modified: November 10, 2002