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 3 entries in each of the rate and state variable arrays. There are a total of 12 entries in the constant variable array. */ /* * VOI is time in component environment (day). * STATES[0] is Tn in component Tn (cells_per_microlitre). * CONSTANTS[0] is sn in component Tn (flux). * CONSTANTS[1] is dn in component Tn (first_order_rate_constant). * CONSTANTS[2] is kn in component model_parameters (first_order_rate_constant). * CONSTANTS[3] is eta in component model_parameters (cells_per_microlitre). * STATES[1] is C in component C (cells_per_microlitre). * STATES[2] is Te in component Te (cells_per_microlitre). * CONSTANTS[4] is alpha_n in component Te (dimensionless). * CONSTANTS[5] is alpha_e in component Te (first_order_rate_constant). * CONSTANTS[6] is de in component Te (first_order_rate_constant). * CONSTANTS[7] is gamma_e in component Te (microlitre_per_cells_day). * CONSTANTS[8] is Cmax in component C (cells_per_microlitre). * CONSTANTS[9] is rc in component C (first_order_rate_constant). * CONSTANTS[10] is dc in component C (first_order_rate_constant). * CONSTANTS[11] is gamma_c in component C (microlitre_per_cells_day). * RATES[0] is d/dt Tn in component Tn (cells_per_microlitre). * RATES[2] is d/dt Te in component Te (cells_per_microlitre). * RATES[1] is d/dt C in component C (cells_per_microlitre). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 1510.0; CONSTANTS[0] = 0.37; CONSTANTS[1] = 0.23; CONSTANTS[2] = 0.062; CONSTANTS[3] = 720.0; STATES[1] = 10000.0; STATES[2] = 20.0; CONSTANTS[4] = 0.14; CONSTANTS[5] = 0.98; CONSTANTS[6] = 0.30; CONSTANTS[7] = 0.057; CONSTANTS[8] = 230000; CONSTANTS[9] = 0.0057; CONSTANTS[10] = 0.024; CONSTANTS[11] = 0.0034; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[0] = CONSTANTS[0] - ( CONSTANTS[1]*STATES[0]+ CONSTANTS[2]*STATES[0]*(STATES[1]/(STATES[1]+CONSTANTS[3]))); RATES[2] = ( CONSTANTS[4]*CONSTANTS[2]*STATES[0]*(STATES[1]/(STATES[1]+CONSTANTS[3]))+ CONSTANTS[5]*STATES[2]*(STATES[1]/(STATES[1]+CONSTANTS[3]))) - ( CONSTANTS[6]*STATES[2]+ CONSTANTS[7]*STATES[1]*STATES[2]); RATES[1] = CONSTANTS[9]*STATES[1]*log(CONSTANTS[8]/STATES[1]) - ( CONSTANTS[10]*STATES[1]+ CONSTANTS[11]*STATES[1]*STATES[2]); } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { }