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.
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 SAPC_{t}, and none are in the SAPC_{i}NS form. Thus, k3 is maximal, and k2 = 0. At the other extreme, when L=1.0 (all engaged), all APC are in the SAPC_{i}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.

Variable  Equation  

Is'  =  Is + ((N)*SI) + (Es_{1}*k4)  (Is*K_{2}s)  (Is*K3)  (Is*k5) + ((M)*SI); 

Es'  =  Es_{1} + (Is*K_{2}s)  (Es_{1}*k4); 

Inse'  =  Inse + ((N)*(1SI)*L) + (Ense_{1}*k4)  (Inse*K_{2}ns)  (Inse*k5) + (M*(1SI)*L); 

Ense'  =  Ense_{1} + (Inse*K_{2}ns)  (Ense_{1}*k4); 

Insu'  =  Insu_{1} + ((N)*(1SI)*(1L))  (Insu_{1}*k5) + (M*(1SI)*(1L)); 
where: (most are internal variables, with the exception of T and N)  

M  =  Cells Added to the system to initially grow it. Equals 0 once the system reaches Total size (T). 

T'  =  (T + M) = (Is' + Es' + Inse' + Ense' + Insu') 

K_{2}s  =  MIN(APC/p * R * SI, APC/p*R*m_dL)/MAX(Is, 1); // #sAPCns / Is 
2)  K_{2}ns  =  MIN(APC/p * R * SI, APC/p*R*m_dL)/MAX(Inse, 1); // #sAPCns / Inse 

K3  =  (APC/p * R * SI  MIN(APC/p * R * SI, APC/p*R*m_dL))/MAX(Is,1); // #sAPC / Is 

Es_{1}  =  Es + Effector cells that are now dividing that went through the Is to Es before. 

Ense_{1}  =  Ense + Effector cells that are now dividing that went though the Inse to Ense before. 

Insu_{1}  =  Insu  Es_{1}  Ense_{1} 

N  =  P + (Is*k5) + U + (Inse*k5) + (Insu_{1}*k5) = cells that die = cells that are reborn = k1*G 
Executed when Foreign AG is initially introduced, to convert the % of unengaged cells to the engaged type:  

Inse'  =  Insu'*L'; 

Insu'  =  Insu'  Inse'; 
Effector / peptide calculations:  

Es'/p  =  Es'/(R*SI); 

Ens'/p  =  Ense'/(R*(1SI)*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 nonself 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.
Last Modified: November 10, 2002