Generated Code
The following is c code generated by the CellML API from this CellML file. (Back to language selection)
The raw code is available.
/* There are a total of 0 entries in the algebraic variable array. There are a total of 10 entries in each of the rate and state variable arrays. There are a total of 28 entries in the constant variable array. */ /* * VOI is time in component environment (day). * STATES[0] is T in component uninfected_CD4 (cells_per_mm3). * CONSTANTS[0] is s in component uninfected_CD4 (cells_per_mm3_day). * CONSTANTS[1] is lambda in component uninfected_CD4 (per_day). * STATES[1] is T1_star in component productively_infected_CD4 (cells_per_mm3). * STATES[2] is T2_star in component productively_infected_CD4 (cells_per_mm3). * CONSTANTS[2] is Tmax in component uninfected_CD4 (cells_per_mm3). * CONSTANTS[3] is mu in component uninfected_CD4 (per_day). * CONSTANTS[4] is k1 in component productively_infected_CD4 (ml_per_virons_day). * CONSTANTS[5] is r1 in component drug_parameters (dimensionless). * STATES[3] is V1_I in component virus_strain1 (virons_per_ml). * CONSTANTS[6] is k2 in component productively_infected_CD4 (ml_per_virons_day). * CONSTANTS[7] is r2 in component drug_parameters (dimensionless). * STATES[4] is V2_I in component virus_strain2 (virons_per_ml). * STATES[5] is M in component uninfected_long_lived_cells (cells_per_mm3). * CONSTANTS[8] is lambda_M in component uninfected_long_lived_cells (cells_per_mm3_day). * CONSTANTS[9] is mu_M in component uninfected_long_lived_cells (per_day). * CONSTANTS[10] is k1_M in component productively_infected_long_lived_cells (ml_per_virons_day). * CONSTANTS[11] is k2_M in component productively_infected_long_lived_cells (ml_per_virons_day). * CONSTANTS[12] is m11 in component productively_infected_CD4 (dimensionless). * CONSTANTS[13] is m21 in component productively_infected_CD4 (dimensionless). * CONSTANTS[14] is delta1 in component productively_infected_CD4 (per_day). * CONSTANTS[15] is m22 in component productively_infected_CD4 (dimensionless). * CONSTANTS[16] is m12 in component productively_infected_CD4 (dimensionless). * CONSTANTS[17] is delta2 in component productively_infected_CD4 (per_day). * STATES[6] is M1_star in component productively_infected_long_lived_cells (cells_per_mm3). * CONSTANTS[18] is delta1_M in component productively_infected_long_lived_cells (per_day). * STATES[7] is M2_star in component productively_infected_long_lived_cells (cells_per_mm3). * CONSTANTS[19] is delta2_M in component productively_infected_long_lived_cells (per_day). * CONSTANTS[20] is p1 in component drug_parameters (dimensionless). * CONSTANTS[21] is N1 in component virus_strain1 (virons_per_cell). * CONSTANTS[22] is N1_M in component virus_strain1 (virons_per_cell). * STATES[8] is V1 in component virus_strain1 (virons_per_ml). * CONSTANTS[23] is c1 in component virus_strain1 (per_day). * CONSTANTS[24] is p2 in component drug_parameters (dimensionless). * CONSTANTS[25] is N2 in component virus_strain2 (virons_per_cell). * CONSTANTS[26] is N2_M in component virus_strain2 (virons_per_cell). * CONSTANTS[27] is c2 in component virus_strain2 (per_day). * STATES[9] is V2 in component virus_strain2 (virons_per_ml). * RATES[0] is d/dt T in component uninfected_CD4 (cells_per_mm3). * RATES[5] is d/dt M in component uninfected_long_lived_cells (cells_per_mm3). * RATES[1] is d/dt T1_star in component productively_infected_CD4 (cells_per_mm3). * RATES[2] is d/dt T2_star in component productively_infected_CD4 (cells_per_mm3). * RATES[6] is d/dt M1_star in component productively_infected_long_lived_cells (cells_per_mm3). * RATES[7] is d/dt M2_star in component productively_infected_long_lived_cells (cells_per_mm3). * RATES[3] is d/dt V1_I in component virus_strain1 (virons_per_ml). * RATES[8] is d/dt V1 in component virus_strain1 (virons_per_ml). * RATES[4] is d/dt V2_I in component virus_strain2 (virons_per_ml). * RATES[9] is d/dt V2 in component virus_strain2 (virons_per_ml). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 178.81; CONSTANTS[0] = 0; CONSTANTS[1] = 0.01; STATES[1] = 1.19; STATES[2] = 0.004; CONSTANTS[2] = 450; CONSTANTS[3] = 0.0014; CONSTANTS[4] = 3.43E-8; CONSTANTS[5] = 0.9; STATES[3] = 133500; CONSTANTS[6] = 3.43E-8; CONSTANTS[7] = 0.25; STATES[4] = 450; STATES[5] = 49.2; CONSTANTS[8] = 2.0; CONSTANTS[9] = 0.04; CONSTANTS[10] = 4.67E-9; CONSTANTS[11] = 4.67E-9; CONSTANTS[12] = 1; CONSTANTS[13] = 3.4E-5; CONSTANTS[14] = 0.69; CONSTANTS[15] = 1; CONSTANTS[16] = 3.4E-5; CONSTANTS[17] = 0.69; STATES[6] = 0.49; CONSTANTS[18] = 0.062; STATES[7] = 1.7E-3; CONSTANTS[19] = 0.062; CONSTANTS[20] = 0.99; CONSTANTS[21] = 480.1; CONSTANTS[22] = 534.4; STATES[8] = 133500; CONSTANTS[23] = 3.07; CONSTANTS[24] = 0.25; CONSTANTS[25] = 475.3; CONSTANTS[26] = 529.0; CONSTANTS[27] = 3.07; STATES[9] = 450; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[0] = (((CONSTANTS[0]+ CONSTANTS[1]*STATES[0]*(1.00000 - (STATES[0]+STATES[1]+STATES[2])/CONSTANTS[2])) - CONSTANTS[3]*STATES[0]) - CONSTANTS[4]*(1.00000 - CONSTANTS[5])*STATES[0]*STATES[3]) - CONSTANTS[6]*(1.00000 - CONSTANTS[7])*STATES[0]*STATES[4]; RATES[5] = ((CONSTANTS[8] - CONSTANTS[9]*STATES[5]) - CONSTANTS[10]*(1.00000 - CONSTANTS[5])*STATES[5]*STATES[3]) - CONSTANTS[11]*(1.00000 - CONSTANTS[7])*STATES[5]*STATES[4]; RATES[1] = ( CONSTANTS[12]*CONSTANTS[4]*(1.00000 - CONSTANTS[5])*STATES[0]*STATES[3]+ CONSTANTS[13]*CONSTANTS[6]*(1.00000 - CONSTANTS[7])*STATES[0]*STATES[4]) - CONSTANTS[14]*STATES[1]; RATES[2] = ( CONSTANTS[15]*CONSTANTS[6]*(1.00000 - CONSTANTS[7])*STATES[0]*STATES[4]+ CONSTANTS[16]*CONSTANTS[4]*(1.00000 - CONSTANTS[5])*STATES[0]*STATES[3]) - CONSTANTS[17]*STATES[2]; RATES[6] = ( CONSTANTS[12]*CONSTANTS[10]*(1.00000 - CONSTANTS[5])*STATES[5]*STATES[3]+ CONSTANTS[13]*CONSTANTS[11]*(1.00000 - CONSTANTS[7])*STATES[5]*STATES[4]) - CONSTANTS[18]*STATES[6]; RATES[7] = ( CONSTANTS[15]*CONSTANTS[11]*(1.00000 - CONSTANTS[7])*STATES[5]*STATES[4]+ CONSTANTS[16]*CONSTANTS[10]*(1.00000 - CONSTANTS[5])*STATES[5]*STATES[3]) - CONSTANTS[19]*STATES[7]; RATES[3] = ( (1.00000 - CONSTANTS[20])*CONSTANTS[21]*CONSTANTS[14]*STATES[1]+ (1.00000 - CONSTANTS[20])*CONSTANTS[22]*CONSTANTS[18]*STATES[6]) - CONSTANTS[23]*STATES[3]; RATES[8] = ( CONSTANTS[21]*CONSTANTS[14]*STATES[1]+ CONSTANTS[22]*CONSTANTS[18]*STATES[6]) - CONSTANTS[23]*STATES[8]; RATES[4] = ( (1.00000 - CONSTANTS[24])*CONSTANTS[25]*CONSTANTS[17]*STATES[2]+ (1.00000 - CONSTANTS[24])*CONSTANTS[26]*CONSTANTS[19]*STATES[7]) - CONSTANTS[27]*STATES[4]; RATES[9] = ( CONSTANTS[25]*CONSTANTS[17]*STATES[2]+ CONSTANTS[26]*CONSTANTS[19]*STATES[7]) - CONSTANTS[27]*STATES[9]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { }