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 15 entries in the constant variable array. */ /* * VOI is time in component environment (hour). * STATES[0] is c11 in component c11 (per_millilitre). * CONSTANTS[0] is p1 in component model_parameters (per_hour). * CONSTANTS[1] is p2 in component model_parameters (per_hour). * CONSTANTS[2] is p5 in component model_parameters (per_hour). * CONSTANTS[3] is p6 in component model_parameters (per_hour). * STATES[1] is c12 in component c12 (per_millilitre). * STATES[2] is c21 in component c21 (per_millilitre). * CONSTANTS[4] is p4 in component model_parameters (per_hour). * CONSTANTS[5] is p11 in component model_parameters (per_hour). * CONSTANTS[6] is p12 in component model_parameters (per_hour). * STATES[3] is c22 in component c22 (per_millilitre). * STATES[4] is c31 in component c31 (per_millilitre). * CONSTANTS[7] is p3 in component model_parameters (per_hour). * CONSTANTS[8] is p7 in component model_parameters (per_hour). * CONSTANTS[9] is p8 in component model_parameters (per_hour). * STATES[5] is c32 in component c32 (per_millilitre). * STATES[6] is c41 in component c41 (per_millilitre). * CONSTANTS[10] is p9 in component model_parameters (per_hour). * CONSTANTS[11] is p10 in component model_parameters (per_hour). * STATES[7] is c42 in component c42 (per_millilitre). * STATES[8] is c51 in component c51 (per_millilitre). * CONSTANTS[12] is p13 in component model_parameters (per_hour). * CONSTANTS[13] is p14 in component model_parameters (per_hour). * CONSTANTS[14] is p15 in component model_parameters (per_hour). * STATES[9] is c52 in component c52 (per_millilitre). * RATES[0] is d/dt c11 in component c11 (per_millilitre). * RATES[2] is d/dt c21 in component c21 (per_millilitre). * RATES[4] is d/dt c31 in component c31 (per_millilitre). * RATES[6] is d/dt c41 in component c41 (per_millilitre). * RATES[8] is d/dt c51 in component c51 (per_millilitre). * RATES[1] is d/dt c12 in component c12 (per_millilitre). * RATES[3] is d/dt c22 in component c22 (per_millilitre). * RATES[5] is d/dt c32 in component c32 (per_millilitre). * RATES[7] is d/dt c42 in component c42 (per_millilitre). * RATES[9] is d/dt c52 in component c52 (per_millilitre). */ void initConsts(double* CONSTANTS, double* RATES, double *STATES) { STATES[0] = 9000; CONSTANTS[0] = 0.097884; CONSTANTS[1] = 0.085470; CONSTANTS[2] = 5.119458; CONSTANTS[3] = 7.986374; STATES[1] = 10000; STATES[2] = 0; CONSTANTS[4] = 0.050607; CONSTANTS[5] = 2.527205; CONSTANTS[6] = 3.018396; STATES[3] = 0; STATES[4] = 0; CONSTANTS[7] = 0.006932; CONSTANTS[8] = 1.224656; CONSTANTS[9] = 1.488771; STATES[5] = 0; STATES[6] = 0; CONSTANTS[10] = 0.188594; CONSTANTS[11] = 0.162463; STATES[7] = 0; STATES[8] = 0; CONSTANTS[12] = 0.097796; CONSTANTS[13] = 0.359250; CONSTANTS[14] = 0.000002; STATES[9] = 0; } void computeRates(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { RATES[0] = (( - CONSTANTS[0]*STATES[0] - CONSTANTS[1]*STATES[0]) - CONSTANTS[2]*STATES[0])+ CONSTANTS[3]*STATES[1]; RATES[2] = (( CONSTANTS[0]*STATES[0] - CONSTANTS[4]*STATES[2]) - CONSTANTS[5]*STATES[2])+ CONSTANTS[6]*STATES[3]; RATES[4] = (( CONSTANTS[1]*STATES[0] - CONSTANTS[7]*STATES[4]) - CONSTANTS[8]*STATES[4])+ CONSTANTS[9]*STATES[5]; RATES[6] = (( CONSTANTS[7]*STATES[4]+ CONSTANTS[4]*STATES[2]) - CONSTANTS[10]*STATES[6])+ CONSTANTS[11]*STATES[7]; RATES[8] = ( CONSTANTS[12]*STATES[0] - CONSTANTS[13]*STATES[8])+ CONSTANTS[14]*STATES[9]; RATES[1] = CONSTANTS[2]*STATES[0] - CONSTANTS[3]*STATES[1]; RATES[3] = CONSTANTS[5]*STATES[2] - CONSTANTS[6]*STATES[3]; RATES[5] = CONSTANTS[8]*STATES[4] - CONSTANTS[9]*STATES[5]; RATES[7] = CONSTANTS[10]*STATES[6] - CONSTANTS[11]*STATES[7]; RATES[9] = CONSTANTS[13]*STATES[8] - CONSTANTS[14]*STATES[9]; } void computeVariables(double VOI, double* CONSTANTS, double* RATES, double* STATES, double* ALGEBRAIC) { }